| 1 |
%% |
| 2 |
%% Package: spectralsequences v1.3.3 2023-01-28 |
| 3 |
%% Author: Hood Chatham |
| 4 |
%% Email: [email protected] |
| 5 |
%% Date: 2023-01-28 |
| 6 |
%% License: Latex Project Public License |
| 7 |
%% |
| 8 |
%% File: spectralsequencesmanualpreamble.tex |
| 9 |
%% |
| 10 |
%% Manual preamble |
| 11 |
%% |
| 12 |
|
| 13 |
% TODO: someday I should comment this -- it's a bit of a mess |
| 14 |
|
| 15 |
\documentclass{ltxdoc} |
| 16 |
\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry} |
| 17 |
\usepackage[tooltips]{spectralsequences} |
| 18 |
\usetikzlibrary{shapes.geometric} |
| 19 |
\usepackage{amssymb} |
| 20 |
\usepackage{afterpage} |
| 21 |
\usepackage[notmath]{sansmathfonts} |
| 22 |
\usepackage{verbatim} |
| 23 |
\usepackage{needspace} |
| 24 |
\usepackage[documentation]{tcolorbox} |
| 25 |
\usepackage[T1]{fontenc} |
| 26 |
\usepackage{hyperref} |
| 27 |
|
| 28 |
\hypersetup{% |
| 29 |
colorlinks=true, |
| 30 |
linkcolor=blue, |
| 31 |
filecolor=blue, |
| 32 |
urlcolor=thered, |
| 33 |
citecolor=blue, |
| 34 |
pdfborder=0 0 0, |
| 35 |
} |
| 36 |
\usepackage{hyperxmp} |
| 37 |
\makeatletter |
| 38 |
\def\displaycommand#1{\displaycommand@#1\@nil} |
| 39 |
\def\displaycommand@#1#2\@nil{\texttt{\string#1}#2} |
| 40 |
|
| 41 |
% From Christian Feuersänger https://tex.stackexchange.com/a/73103 |
| 42 |
\makeatletter % !!!! |
| 43 |
\input{pgfmanual.code} % This must be exectuted when catcode of @ is letter |
| 44 |
\makeatother % !!!! |
| 45 |
|
| 46 |
\usepackage{calc} % |
| 47 |
\include{pgfmanual-en-macros} % This must be executed when catcode of @ is other |
| 48 |
|
| 49 |
\makeatletter |
| 50 |
|
| 51 |
\parskip=10pt |
| 52 |
\parindent=0pt |
| 53 |
\MakeShortVerb{\|} |
| 54 |
|
| 55 |
\def\sectionstring{\textbackslash\@xp\@gobble\string} |
| 56 |
|
| 57 |
\def\@gobbletocln#1:{} |
| 58 |
\def\eatclnifpresent#1{% |
| 59 |
\eatclnifpresent@#1:\nil |
| 60 |
} |
| 61 |
\def\eatclnifpresent@#1:#2\nil{% |
| 62 |
\ifx$#2$% |
| 63 |
#1% |
| 64 |
\else |
| 65 |
\removecln#2\nil |
| 66 |
\fi |
| 67 |
} |
| 68 |
\def\removecln#1:\nil{#1} |
| 69 |
|
| 70 |
\def\removenil#1\nil{#1} |
| 71 |
|
| 72 |
\def\pgfmanual@pretty@singlequote{'} |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
\def\pulloffstartspaces{\@xp\pulloffstartspaces@\thekey\@nil} |
| 77 |
\def\pulloffstartspaces@#1{% |
| 78 |
\def\test{#1}% |
| 79 |
\ifx\test\pgfmanual@pretty@activespace |
| 80 |
\@xp\def\@xp\leadingtoks\@xp{\leadingtoks\pgfmanual@pretty@space}% |
| 81 |
\@xp\pulloffstartspaces@ |
| 82 |
\else |
| 83 |
\ifx#1\@nil |
| 84 |
\def\thekey{}% |
| 85 |
\else |
| 86 |
\@xp\@xp\@xp\pulloffstartspaces@@\@xp\@xp\@xp#1% |
| 87 |
\fi |
| 88 |
\fi |
| 89 |
} |
| 90 |
\def\pulloffstartspaces@@#1\@nil{\def\thekey{#1}} |
| 91 |
|
| 92 |
\def\pulloffstartbrace{\@xp\pullofflbrace\thekey\nil\@nil} |
| 93 |
\def\pullofflbrace#1#2\@nil{% |
| 94 |
\ifx\test\pgfmanual@pretty@lbrace |
| 95 |
\@xp\def\@xp\leadingtoks\@xp{\leadingtoks\pgfmanual@pretty@lbrace}% |
| 96 |
\@xp\def\@xp\thekey\@xp{\removenil#2}% |
| 97 |
\else |
| 98 |
\@xp\def\@xp\thekey\@xp{\removenil#1#2}% |
| 99 |
\fi |
| 100 |
} |
| 101 |
|
| 102 |
|
| 103 |
\def\pulloffsinglequote{\@xp\pulloffsinglequote@\thekey\nil\@nil} |
| 104 |
\def\pulloffsinglequote@#1#2\@nil{% |
| 105 |
\def\test{#1}% |
| 106 |
\ifx\test\pgfmanual@pretty@singlequote |
| 107 |
\@xp\def\@xp\leadingtoks\@xp{\leadingtoks\pgfmanual@pretty@singlequote}% |
| 108 |
\@xp\def\@xp\thekey\@xp{\removenil#2}% |
| 109 |
\else |
| 110 |
\def\possiblesinglequote{}% |
| 111 |
\@xp\def\@xp\thekey\@xp{\removenil#1#2}% |
| 112 |
\fi |
| 113 |
} |
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
% deletes everything except trailing spaces. For making link underline not include trailing spaces (have to reinsert spaces) |
| 119 |
\def\onlytrailingspaces#1{% |
| 120 |
\pgfkeys@spdef\temp{#1}% |
| 121 |
\@xp\def\@xp\temp\@xp##\@xp1\temp{}% |
| 122 |
\temp#1% |
| 123 |
} |
| 124 |
|
| 125 |
% remove trailing spaces, for making link underline not include trailing spaces |
| 126 |
\def\removetrailingspaces{\@xp\removetrailingspaces@\@xp{\thekey}} |
| 127 |
\def\removetrailingspaces@#1{% |
| 128 |
\removetrailingspace{#1}% |
| 129 |
\ifx\possibletrailingspace\empty\else |
| 130 |
\edef\trailingtoks{\unexpanded\@xp{\possibletrailingspace}\unexpanded\@xp{\trailingtoks}}% |
| 131 |
\@xp\removetrailingspaces@\@xp{\thekey}% |
| 132 |
\fi |
| 133 |
} |
| 134 |
|
| 135 |
\bgroup |
| 136 |
\catcode`\Q=3\lccode`\)=`\}\lccode`\~=`\ \lowercase{ |
| 137 |
\gdef\removetrailingspace#1{\removetrailingspace@#1QQ~Q} |
| 138 |
\gdef\removetrailingspace@#1~Q{\removetrailingspace@@#1} |
| 139 |
\gdef\removetrailingspace@@#1Q#2Q{\def\thekey{#1}\def\possibletrailingspace{#2}} |
| 140 |
|
| 141 |
% Remove trailing brace -- so close brace can be colored / styled differently |
| 142 |
\gdef\removetrailingbrace{\@xp\removetrailingbrace@\thekey QQ)Q} |
| 143 |
\gdef\removetrailingbrace@#1)Q{\removetrailingbrace@@#1} |
| 144 |
\gdef\removetrailingbrace@@#1Q#2Q{\def\thekey{#1}\edef\trailingtoks{\unexpanded{#2}\unexpanded\@xp{\trailingtoks}}} |
| 145 |
} |
| 146 |
|
| 147 |
\catcode`\^^M=\active |
| 148 |
% remove trailing new line -- so we can properly test whether the last nonwhitespace character is a brace |
| 149 |
\gdef\removetrailingnewline{\@xp\removetrailingnewline@\thekey \nil\nil^^M\nil}% |
| 150 |
\gdef\removetrailingnewline@#1^^M\nil{\removetrailingnewline@@#1}% |
| 151 |
\gdef\removetrailingnewline@@#1\nil#2\nil{\def\thekey{#1}\edef\trailingtoks{\unexpanded{#2}\unexpanded\@xp{\trailingtoks}}}% |
| 152 |
\egroup |
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
% Redefine decompose not to do all that fancy crap -- just print as is. Maybe we should get rid of surrounding spaces here and where we do the ref? |
| 157 |
\def\decompose#1/\nil{% |
| 158 |
\index{#1@\protect\texttt{#1} key}% |
| 159 |
\index{\mypath#1@\protect\texttt{#1}}% |
| 160 |
\pgfmanualpdflabel{#1}{}% |
| 161 |
} |
| 162 |
\let\olddeclare\declare |
| 163 |
\ExplSyntaxOn |
| 164 |
% Get rid of colon so that we can have context based linking -- "page" links to global page, "class:page" prints page and links to the page key in the class section, etc. |
| 165 |
\def\declare#1{% |
| 166 |
\exp_args:Nf\olddeclare{% |
| 167 |
\eatclnifpresent{#1}% |
| 168 |
}% |
| 169 |
} |
| 170 |
\ExplSyntaxOff |
| 171 |
|
| 172 |
%\patchcmd\pgfmanualpdfref{#2}{#2} % If I want it to behave differently for things that aren't links |
| 173 |
\patchcmd\pgfmanualpdfref{\expandafter\pgfmanualpdfref@\expandafter{\pgfmanualpdflabel@@}{#2}} % Fix it so that being a link doesn't change the color |
| 174 |
{\colorlet{temp}{.}\expandafter\pgfmanualpdfref@\expandafter{\pgfmanualpdflabel@@}{\textcolor{temp}{#2}}}{}{}% |
| 175 |
|
| 176 |
\newenvironment{manualentry}[1]{% |
| 177 |
\begin{pgfmanualentry}% |
| 178 |
\pgfmanualentryheadline{#1}% |
| 179 |
\pgfmanualbody |
| 180 |
}{% |
| 181 |
\end{pgfmanualentry}% |
| 182 |
} |
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
\def\removespace#1\space\nil{#1} |
| 187 |
\newenvironment{stylekeylist}[2][]{% |
| 188 |
\begin{pgfmanualentry} |
| 189 |
\def\extrakeytext{}% |
| 190 |
\foreach \xx in {#2} {% |
| 191 |
\expandafter\extractkey\xx\space= \marg{keys}\@nil% |
| 192 |
\declareasstyle{\@xp\removespace\mykey\nil}% tells latex not to italicize body |
| 193 |
% The link created in \extractkey is named "key name " with a space at the end. |
| 194 |
% So it won't work. We need to make our own link without the space in it. |
| 195 |
\sseq@eval{\@nx\pgfmanualpdflabel{\@xp\removespace\mykey\nil}{}}% |
| 196 |
}% |
| 197 |
\pgfmanualbody |
| 198 |
}{% |
| 199 |
\end{pgfmanualentry} |
| 200 |
}% |
| 201 |
|
| 202 |
% Custom handler for value of key -- instead of italicizing, do what? |
| 203 |
\def\ifcustomhandler#1{% |
| 204 |
\@xp\pgfkeys@spdef\@xp\test\@xp{#1}% |
| 205 |
\expandafter\ifx\csname\test @ custom handler\endcsname\relax\@xp\@secondoftwo\else\@xp\@firstoftwo\fi |
| 206 |
} |
| 207 |
\def\customhandler#1{% |
| 208 |
\@xp\pgfkeys@spdef\@xp\test\@xp{#1}% |
| 209 |
\csname\test @ custom handler\endcsname{#1}% |
| 210 |
} |
| 211 |
|
| 212 |
\def\declarecustomhandler#1#2{% |
| 213 |
\immediate\write\@auxout{\@nx\expandafter\gdef\@nx\csname#1@ custom handler\endcsname{\@nx#2}}% |
| 214 |
\@xp\gdef\csname#1@ custom handler\endcsname{#2}% |
| 215 |
} |
| 216 |
|
| 217 |
\def\declareasstyle#1{\declarecustomhandler{#1}\stylehandler} |
| 218 |
\def\stylehandler#1#2{% |
| 219 |
\bgroup |
| 220 |
\let\pgfmanualwordstartup\relax |
| 221 |
\def\thekey{#2}% |
| 222 |
\let\leadingtoks\empty |
| 223 |
\pulloffstartspaces\pulloffstartbrace |
| 224 |
\textcolor{keycolor}{\leadingtoks}% |
| 225 |
\@xp\pgfmanualprettyprintpgfkeys\@xp{\thekey}% |
| 226 |
\egroup |
| 227 |
} |
| 228 |
\def\codehandler#1#2{% |
| 229 |
\bgroup |
| 230 |
\def\thekey{#2}% |
| 231 |
\let\leadingtoks\empty |
| 232 |
\let\trailingtoks\empty |
| 233 |
\pulloffstartspaces\pulloffstartbrace |
| 234 |
\removetrailingspaces\removetrailingnewline |
| 235 |
\removetrailingspaces\removetrailingbrace |
| 236 |
\textcolor{keycolor}{\leadingtoks}% |
| 237 |
\@xp\pgfmanualprettyprintcode\@xp{\thekey}% |
| 238 |
\textcolor{keycolor}{\trailingtoks}% |
| 239 |
\egroup |
| 240 |
} |
| 241 |
|
| 242 |
\declarecustomhandler{font}{\codehandler} |
| 243 |
\declarecustomhandler{page constraint}{\codehandler} |
| 244 |
\declarecustomhandler{page constraint}{\codehandler} |
| 245 |
|
| 246 |
|
| 247 |
\let\pgfmanualpdflabel@opt@old\pgfmanualpdflabel@opt |
| 248 |
\def\pgfmanualpdflabel@opt[#1]#2#3{% |
| 249 |
\pgfkeys@spdef\temp{#2}% |
| 250 |
\sseq@eval{\unexpanded{\pgfmanualpdflabel@opt@old[#1]}\unexpanded\@xp{\@xp{\temp}{#3}}}% |
| 251 |
} |
| 252 |
|
| 253 |
\patchcmd\extractkey{\hfill(\extrakeytext no value)}{}{}{\error} |
| 254 |
\patchcmd\extractkey{\def\mykey}{\gdef\mykey}{}{\error} |
| 255 |
\patchcmd\extractkeyequal{\hfill(\extrakeytext no default)}{}{}{\error} |
| 256 |
\patchcmd\extractkeyequal{\def\mykey}{\gdef\mykey}{}{\error} |
| 257 |
\patchcmd\extractinitial{no default, }{}{}{\error} |
| 258 |
\patchcmd\extractinitial{\def\mykey}{\gdef\mykey}{}{\error} |
| 259 |
\patchcmd\extractdefault{\def\mykey}{\gdef\mykey}{}{\error} |
| 260 |
\patchcmd\extractdefault{#2}{{\hskip2pt}#2}{}{\error} |
| 261 |
\patchcmd\extractequalinitial{\def\mykey}{\gdef\mykey}{}{\error} |
| 262 |
\let\extractkey@\extractkey |
| 263 |
\apptocmd\extractkey@{\egroup}{}{\error} |
| 264 |
\def\extractkey{\bgroup\@ifnextchar*{\def\decompose####1\nil{}\relax\extractkey@\@gobble}{\extractkey@}} |
| 265 |
|
| 266 |
\def\pgfmanual@pretty@quote{"} |
| 267 |
\let\pgfmanual@pretty@pgfkeys@loop@\pgfmanual@pretty@pgfkeys@loop |
| 268 |
\def\pgfmanual@pretty@pgfkeys@loop#1{% |
| 269 |
\def\pgfmanual@loc@TMPa{#1}% |
| 270 |
\def\pgfmanual@pretty@pgfkeys@loop@NEXT{\pgfmanual@pretty@pgfkeys@loop@{#1}}% |
| 271 |
\ifx\pgfmanual@loc@TMPa\pgfmanual@pretty@quote% |
| 272 |
\let\pgfmanual@pretty@pgfkeys@loop@NEXT\pgfmanual@pretty@collectquote |
| 273 |
\fi |
| 274 |
\pgfmanual@pretty@pgfkeys@loop@NEXT |
| 275 |
} |
| 276 |
\def\pgfmanual@pretty@collectquote{% |
| 277 |
\let\pgfmanualprettyprinterhandlecollectedargs=\pgfmanual@pretty@collectargs@finish@collectquote |
| 278 |
\let\pgfmanualprettyprinterhandlecollectedargsVtwo\pgfmanualprettyprinterhandlecollectedargsVtwo@default |
| 279 |
\pgfmanualprettyprintercollectupto"% |
| 280 |
{\pgfmanual@pretty@collectquote@b}% |
| 281 |
} |
| 282 |
\def\pgfmanual@pretty@collectquote@b{% |
| 283 |
\let\pgfmanualprettyprinterhandlecollectedargs=\pgfmanual@pretty@collectargs@finish@collectquote@b |
| 284 |
\pgfmanualprettyprintercollectupto,{% |
| 285 |
\@xp\afterpgfmanual@pretty@collectquote\temp |
| 286 |
}% |
| 287 |
} |
| 288 |
|
| 289 |
\def\afterpgfmanual@pretty@collectquotenocomma,{\pgfmanual@pretty@pgfkeys@loop} |
| 290 |
\def\afterpgfmanual@pretty@collectquote{\pgfmanual@pretty@pgfkeys@loop} |
| 291 |
\def\pgfmanual@pretty@collectargs@finish@collectquote#1{\textcolor{keycolor}{\pgfmanualpdfref{""quotes}{"#1"}}} |
| 292 |
\def\pgfmanual@pretty@collectargs@finish@collectquote@b#1{% |
| 293 |
\def\thekey{#1}% |
| 294 |
\edef\temp{\ifpgfmanualprettyprinterfoundterminator,\fi}% |
| 295 |
\pgfkeys{/codeexample/prettyprint/key name/.code={\textcolor{keycolor}{##1}}}% |
| 296 |
\def\leadingtoks{}\def\trailingtoks{}% |
| 297 |
\pulloffstartspaces\pulloffsinglequote\pulloffstartspaces\pulloffstartbrace |
| 298 |
\removetrailingspaces\removetrailingbrace |
| 299 |
\textcolor{keycolor}{{}\leadingtoks}% {} here to prevent \textcolor from eating initial space |
| 300 |
\@xp\pgfmanual@pretty@pgfkeys@loop\thekey\pgfmanual@EOI |
| 301 |
\textcolor{keycolor}{{}\trailingtoks}% |
| 302 |
} |
| 303 |
|
| 304 |
% Don't allow braces in key names |
| 305 |
\patchcmd\pgfmanual@pretty@pgfkeys@collectkey{% |
| 306 |
\def\pgfmanual@pretty@pgfkeys@collectkey@next{% |
| 307 |
\pgfmanualprettyprintercollectargcount{1}{\pgfmanual@pretty@pgfkeys@collectkey}% |
| 308 |
#1% |
| 309 |
}% |
| 310 |
}{% |
| 311 |
\expandafter\pgfmanual@pretty@pgfkeys@processkey\expandafter{\the\toks0 }% |
| 312 |
#1% |
| 313 |
\def\pgfmanual@pretty@pgfkeys@collectkey@next{\pgfmanual@pretty@pgfkeys@loop}% |
| 314 |
}{}{\error} |
| 315 |
|
| 316 |
% Redefine point collection to correctly balance the parens |
| 317 |
% Has unfortunate side effect that it now throws an error if parens don't balance. |
| 318 |
\let\pgfmanual@pretty@collectpoint@old\pgfmanual@pretty@collectpoint |
| 319 |
%\def\pgfmanual@pretty@collectpoint{\pgfmanual@pretty@collectpoint@(} %) |
| 320 |
%\DeclareDocumentCommand\pgfmanual@pretty@collectpoint@{r()}{% |
| 321 |
% \pgfmanualprettyprinterfoundterminatortrue |
| 322 |
% \pgfmanual@pretty@collectargs@finish@collectpoint{#1}% |
| 323 |
% \afterpgfmanual@pretty@collectpoint |
| 324 |
%} |
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
\pgfqkeys{/codeexample/prettyprint}{ |
| 329 |
cs arguments/meta/.initial=1, % Make \meta work correctly in codeexample |
| 330 |
cs/meta/.code={\textcolor{black}{\meta{\@gobble#1}}}, |
| 331 |
% |
| 332 |
cs arguments/opt/.initial=1, |
| 333 |
cs/opt/.code={\opt{\@gobble#1}}, |
| 334 |
% |
| 335 |
cs arguments/oarg/.initial=1, |
| 336 |
cs/oarg/.code={\oarg{\@gobble#1}}, |
| 337 |
% |
| 338 |
cs arguments/marg/.initial=1, |
| 339 |
cs/marg/.code={\marg{\@gobble#1}}, |
| 340 |
cs arguments/metatt/.initial=1, |
| 341 |
cs/metatt/.code={\meta{\texttt{\textup{\@gobble#1}}}}, |
| 342 |
% |
| 343 |
cs arguments/pars/.initial=1, |
| 344 |
cs/pars/.code={\@xp\pars\@xp{\@xp\pgfmanualprettyprintpgfkeys\@xp{\@gobble#1}}}, |
| 345 |
cs arguments/pararg/.initial=1, |
| 346 |
cs/pararg/.code={\pararg{\@gobble#1}}, |
| 347 |
cs arguments/parargtwo/.initial=2, |
| 348 |
cs/parargtwo/.code 2 args={\parargtwo{\@gobble#1}{\@gobble#2}}, |
| 349 |
% |
| 350 |
cs arguments/cscolor/.initial=1, |
| 351 |
cs/cscolor/.code={\textcolor{cscolor}{\@gobble#1}}, |
| 352 |
cs arguments/pointcolor/.initial=1, |
| 353 |
cs/pointcolor/.code={\textcolor{pointcolor}{\@gobble#1}}, |
| 354 |
%point/.code={\def\temp{#1}\show\temp}, |
| 355 |
% |
| 356 |
cs arguments/sseqset/.initial=1, |
| 357 |
cs/sseqset/.code 2 args={\textcolor{cscolor}{\string\sseqset}\{\pgfmanualprettyprintpgfkeys{#2}\}}, |
| 358 |
% |
| 359 |
cs arguments/DeclareDocumentCommand/.initial=2, |
| 360 |
cs/DeclareDocumentCommand/.code={\handlexparsestylecmd#1}, |
| 361 |
cs arguments/NewSseqCommand/.initial=2, |
| 362 |
cs/NewSseqCommand/.code={\handlexparsestylecmd#1}, |
| 363 |
% |
| 364 |
/pdflinks/internal link prefix=pgf, |
| 365 |
key value with style detection/.code 2 args={\pgfkeysalso{/codeexample/prettyprint/key value display only={#2}}}, % get rid of bothersome special style handling |
| 366 |
% handle spaces and colons |
| 367 |
key name/.code={% |
| 368 |
\pgfkeys@spdef\temp{#1}% |
| 369 |
\let\pgfmanual@pretty@pgfkeys@collectkey@keyname\temp |
| 370 |
\textcolor{keycolor}{% |
| 371 |
\pgfmanualpdfref{\temp}{% |
| 372 |
\noligs{\@xp\eatclnifpresent\@xp{\temp}}% |
| 373 |
}% |
| 374 |
}% |
| 375 |
\onlytrailingspaces{#1}% |
| 376 |
}, |
| 377 |
key value display only/.code={% |
| 378 |
\sseq@eval{\@nx\pgfutil@in@{/.style}{\pgfmanual@pretty@pgfkeys@collectkey@keyname}}% |
| 379 |
\ifpgfutil@in@\else |
| 380 |
\sseq@eval{\@nx\pgfutil@in@{/.sseq style}{\pgfmanual@pretty@pgfkeys@collectkey@keyname}}% |
| 381 |
\fi |
| 382 |
\ifpgfutil@in@ |
| 383 |
\def\thekey{#1}% |
| 384 |
\def\trailingtoks{}% |
| 385 |
\removetrailingspaces\removetrailingbrace |
| 386 |
\@xp\stylehandler\@xp{\@xp}\@xp{\thekey}% |
| 387 |
\textcolor{keycolor}{% |
| 388 |
\trailingtoks |
| 389 |
}% |
| 390 |
\else |
| 391 |
\ifcustomhandler{\pgfmanual@pretty@pgfkeys@collectkey@keyname}{% |
| 392 |
\def\thekey{#1}% |
| 393 |
\def\trailingtoks{}% |
| 394 |
\removetrailingspaces\removetrailingbrace |
| 395 |
\@xp\customhandler\@xp{\@xp\pgfmanual@pretty@pgfkeys@collectkey@keyname\@xp}\@xp{\thekey}% |
| 396 |
\textcolor{keycolor}{% |
| 397 |
\trailingtoks |
| 398 |
}% |
| 399 |
}{% |
| 400 |
\textcolor{keycolor}{{\itshape{\let\pgfmanualwordstartup\relax\pgfmanualprettyprintpgfkeys{#1}}}}% |
| 401 |
}% |
| 402 |
\fi |
| 403 |
}, |
| 404 |
point/.code={%\pgfutil@in@){#1}\ifpgfutil@in@\def\temp{#1}\prettyprintprocesspoint{#1}\else \textcolor{pointcolor}{\noligs{#1}}\fi |
| 405 |
\textcolor{pointcolor}{\noligs{#1}}}, |
| 406 |
%/cs/.code={\pgfmanualpdfref{#1}{\textcolor{blue}{#1}}}, |
| 407 |
% /cs with args/.code 2 args={\pgfmanualpdfref{#1}{\textcolor{blue}{#1}}\{\pgfmanualprettyprintcode{#2}\pgfmanualclosebrace}, |
| 408 |
%/colored |
| 409 |
} |
| 410 |
|
| 411 |
\def\handlexparsestylecmd#1#2#3{\pgfkeysvalueof{/codeexample/prettyprint/cs/.@cmd}#1\pgfeov\textcolor{cscolor}{#2}\typesetargspec{#3}} |
| 412 |
\def\typesetargspec#1{\{\textcolor{purple}{#1}\}} |
| 413 |
|
| 414 |
\let\oldtextcolor\textcolor |
| 415 |
\def\textcolorpoint#1{\oldtextcolor{pointcolor}} |
| 416 |
|
| 417 |
|
| 418 |
% Normally the verbatim processes stuff using |
| 419 |
\let\pgfmanual@verb@collect@code\pgfmanual@verb@collect |
| 420 |
\patchcmd\pgfmanual@verb@collect@code{\pgfmanualprettyprintpgfkeys}{\pgfmanualprettyprintcode}{}{\error} |
| 421 |
\let\pgfmanual@verb@code\pgfmanual@verb |
| 422 |
\patchcmd\pgfmanual@verb@code{\begingroup}{\begingroup\let\pgfmanual@verb@collect\pgfmanual@verb@collect@code}{}{\error} |
| 423 |
\def\codeverb|{\pgfmanual@verb@code} |
| 424 |
|
| 425 |
% balance the braces |
| 426 |
\NewDocumentCommand\prettyprintprocesspoint { m } {% |
| 427 |
\textcolor{pointcolor}{% |
| 428 |
\bgroup |
| 429 |
\let\pgfmanual@pretty@collectpoint\pgfmanual@pretty@collectpoint@old |
| 430 |
\let\textcolor\textcolorpoint |
| 431 |
\noligs{(\pgfmanualprettyprintcode{#1})}% |
| 432 |
\egroup |
| 433 |
}% |
| 434 |
} |
| 435 |
%\pgfqkeys{/codeexample}{every codeexample/.style={width=6cm}} |
| 436 |
|
| 437 |
% This macro in pgfmanual-en-macros.tex seems not to work because the call to \openin is wrong... |
| 438 |
\def\do@codeexamplefromfile{% |
| 439 |
\immediate\openin\examplesource examples/spectralsequencesmanual-\codeexamplesource.tex\relax % I only changed this line |
| 440 |
\def\examplelines{}% |
| 441 |
\readexamplelines |
| 442 |
\closein\examplesource |
| 443 |
\expandafter\endofcodeexample\expandafter{\examplelines}% |
| 444 |
} |
| 445 |
|
| 446 |
% For some reason it's started duplicating the last line of the file, |
| 447 |
% so I added an illogical extra \ifeof and that seems to fix the problem. |
| 448 |
\def\readexamplelines{ |
| 449 |
\ifeof\examplesource% |
| 450 |
\else |
| 451 |
\immediate\read\examplesource to \exampleline |
| 452 |
\ifeof\examplesource\else %% Added |
| 453 |
\edef\examplelines{\unexpanded\@xp{\examplelines}\unexpanded\@xp{\exampleline}}% |
| 454 |
\fi %% Added |
| 455 |
\expandafter\readexamplelines% |
| 456 |
\fi |
| 457 |
} |
| 458 |
|
| 459 |
|
| 460 |
\pgfqkeys{/sseqpages}{ |
| 461 |
class/class:name/.forward to=/sseqpages/class/name, |
| 462 |
class/class:page/.forward to=/sseqpages/class/page, |
| 463 |
struct line/structline:page/.forward to=/sseqpages/struct line/page, |
| 464 |
fit/cc:differential style/.forward to=/sseqpages/fit/differential style, |
| 465 |
tikz primitives/cc:differential style/.forward to=/sseqpages/tikz primitives/differential style |
| 466 |
} |
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
\hypersetup{ |
| 471 |
pdftitle={The Spectral Sequences Package}, |
| 472 |
pdfauthor={Hood Chatham}, |
| 473 |
pdfsubject={A spectral sequence drawing package build on tikz}, |
| 474 |
pdfkeywords={spectral sequences,algebraic topology,homotopy theory,math,tikz,sseq}, |
| 475 |
pdflicenseurl={http://www.latex-project.org/lppl/} |
| 476 |
} |
| 477 |
|
| 478 |
\def\pars#1{|(|#1|)|} |
| 479 |
\def\pararg#1{\pars{\meta{#1}}} |
| 480 |
\def\parargtwo#1#2{|(\meta{#1},\meta{#2})|} |
| 481 |
\def\parargthree#1#2#3{|(\meta{#1},\meta{#2},\meta{#3})|} |
| 482 |
\def\parargthreeopt#1#2#3{|(\meta{#1},\meta{#2}|\opt{|,\meta{#3}|}|)|} |
| 483 |
\def\parargthreevar#1#2#3{|(\meta{#1},\meta{#2}#3)|} |
| 484 |
|
| 485 |
\def\cmdarg{\texttt{\textbackslash}\meta} |
| 486 |
\def\ooptions{\oarg{options}} |
| 487 |
\def\moptions{|[|\meta{options}|]|} |
| 488 |
\def\sourcecoord{\meta{source coordinate}} |
| 489 |
\def\targetcoord{\meta{target coordinate}} |
| 490 |
\def\sourcen{\meta{source n}} |
| 491 |
\def\targetn{\meta{target n}} |
| 492 |
\def\sourcename{\meta{source name}} |
| 493 |
|
| 494 |
\def\today{\the\year/\the\month/\the\day} |
| 495 |
\def\pgfmanualurl{http://math.mit.edu/~hood/pgfmanual_v3.0.1a.pdf} |
| 496 |
\def\xparseurl{http://mirror.ctan.org/macros/latex2e/contrib/l3packages/xparse.pdf} |
| 497 |
\def\colormanualurl{http://mirror.ctan.org/macros/latex/required/graphics/color.pdf} |
| 498 |
|
| 499 |
\def\pkg#1{\textsf{\textmd{#1}}} |
| 500 |
\def\sseqpages{\textsc{\pkg{spectralsequences}}} |
| 501 |
\let\spectralsequences\sseqpages |
| 502 |
\def\sseqpkg{\pkg{sseq}} |
| 503 |
\let\tikzpkg\tikzname |
| 504 |
\def\pgfpkg{\pkg{\textmd{PGF}}} |
| 505 |
\def\tikzcdpkg{\pkg{tikzcd}} |
| 506 |
\def\pgfplotspkg{\textsc{\pkg{pgfplots}}} |
| 507 |
\def\xparsepkg{\pkg{xparse}} |
| 508 |
\def\colorpkg{\pkg{color}} |
| 509 |
\def\texlive{\TeX\ Live} |
| 510 |
\def\miktex{MiK\TeX} |
| 511 |
\def\pdflatex{\textsc{PDF}\LaTeX} |
| 512 |
\def\lualatex{Lua\LaTeX} |
| 513 |
\let\pdfLaTeX\pdflatex |
| 514 |
\let\LuaLaTeX\lualatex |
| 515 |
|
| 516 |
|
| 517 |
\def\env#1{\texttt{\{#1\}}} |
| 518 |
\def\sseqpageenv{\pgfmanualpdfref{sseqpage}{\env{sseqpage}}} |
| 519 |
\def\sseqdataenv{\pgfmanualpdfref{sseqdata}{\env{sseqdata}}} |
| 520 |
\def\tikzpictureenv{\env{tikzpicture}} |
| 521 |
\def\scopeenv{\env{scope}} |
| 522 |
\def\tikzcdenv{\env{tikzcd}} |
| 523 |
\def\eTeX{\leavevmode\hbox{$\varepsilon$}-\TeX} |
| 524 |
|
| 525 |
|
| 526 |
\def\example#1{\path{example_#1.tex}} |
| 527 |
|
| 528 |
|
| 529 |
% xparse modifications: |
| 530 |
\ExplSyntaxOn |
| 531 |
\cs_set_eq:NN \__xparse_grab_U:w \sseq__xparse_grab_U:w |
| 532 |
\cs_set_eq:NN \__xparse_add_type_U:w \sseq__xparse_add_type_U:w |
| 533 |
\ExplSyntaxOff |
| 534 |
|
| 535 |
\def\@maketitle{% |
| 536 |
\null\vskip 2em |
| 537 |
\begin{center}\let\footnote\thanks\sffamily |
| 538 |
{\huge \@title\par}\vskip 1.5em |
| 539 |
{\large \parbox{.33\textwidth}{\centering\@author}% |
| 540 |
\parbox{.33\textwidth}{\centering\@date}}% |
| 541 |
\vskip2.5em\rule{\textwidth}{.4pt}% |
| 542 |
\end{center}\par\vskip1.5em} |
| 543 |
\def\abstractname{} |
| 544 |
\def\mailtoHC{\href % some PDF viewers don't like spaces: |
| 545 |
{mailto:<[email protected]>\%20Hood\%20Chatham?subject=[spectralsequences\%20package]} |
| 546 |
{\texttt{[email protected]}}} |