diff options
57 files changed, 4414 insertions, 2155 deletions
diff --git a/Master/texmf-dist/doc/latex/spectralsequences/README b/Master/texmf-dist/doc/latex/spectralsequences/README deleted file mode 100644 index f581a8129a1..00000000000 --- a/Master/texmf-dist/doc/latex/spectralsequences/README +++ /dev/null @@ -1,8 +0,0 @@ -Package: spectralsequences version 1.0 -Author: Hood Chatham -Email: hood@mit.edu -Date: 2017-06-18 -License: All files have the Latex Project Public License. -Description: Print spectral sequence diagrams using pgf/tikz. - -See the file manual/spectralsequencesmanual.pdf for a manual. Email me at hood@mit.edu to submit bug reports, request new features, etc. The current development copy is hosted at https://github.com/hoodmane/spectralsequences.
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/spectralsequences/README.md b/Master/texmf-dist/doc/latex/spectralsequences/README.md new file mode 100644 index 00000000000..5047519cce5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/README.md @@ -0,0 +1,49 @@ + +spectralsequences v1.1.0 +======================== +Author: Hood Chatham +Email: hood@mit.edu +Date: 2017-08-02 +License: All files have the Latex Project Public License. +Description: Print spectral sequence diagrams using pgf/tikz. + + +See the file manual/spectralsequencesmanual.pdf for a manual. See the examples directory for a large number of example files. +Email me at hood@mit.edu to submit bug reports, request new features, etc. The current development copy is hosted at https://github.com/hoodmane/spectralsequences. + +Changelog: +========== + +## [Unreleased] + +### Added: +- \sseqparseint +- \parsecoordinate and \parsedifferential +- \IfInBoundsTF, \IfOutOfBoundsTF +- New loop constructs \Do, \DoUntilOutOfBounds, \DoUntilOutOfBoundsThenNMore +- \kill which kills a class without having to put a differential +- \lastclass as default arguments for \replaceclass, \classoptions, \d/\doptions, \structline/\structlineoptions +- Pin key for labels +- Families +- Insert key for new classes allows control over relative class placement without reordering commands +- Draw differentials from a range of pages. +- Frame axis type, tick marks. + +### Changed: +- Ticks are now placed at values congruent to tick offset mod tick step, tick offset defaults to 0 +- What was called "x axis style" is now called "x axis type". + +### Fixed: +- The \tagclass command works now. +- Scopes now nest properly. +- Fixed a big performance issue with nested scopes and shifts. +- Adobe reader grid color is now correct (or more correct) +- Fixed the grid drawing so that grids are handled correctly when the range includes negative numbers +- The package now works with xparse after 2017/02/08 when changes were made that broke my original code +- Fixed a bug where if you used a structline in two sseqpage environments with the same name, it would give an error. +- Now if you say \structline(0,0)(0,1) \structlineoptions(0,1)(0,0) it will work correctly. +- Big ranges like 0 - 600 now work, provided that you provide an appropriate scale +- Big range like 600 - 700 no longer will cause an overflow +- Labels now are rectangle nodes so they don't shift down if they are very wide +- Fixed a bug with ranges and the sseqpage environment where classes lying outside the printed range would enlarge the range even if an explicit range was specified. +- The chess grid works correctly now diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_2.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_2.pdf Binary files differnew file mode 100644 index 00000000000..46bede4dcbf --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_2.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_2.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_2.tex new file mode 100644 index 00000000000..1bd2cf23287 --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_2.tex @@ -0,0 +1,175 @@ +%% +%% Description: Adams Novikov Spectral Sequence for $S_2$ + +\documentclass{spectralsequence-example} + +% figure out how to get width("\noexpand\small 16") working +\sseqset{ppower/.sseq style={ + rectangle,"#1" {inside, font=\tiny}, + minimum height=width("16"), + minimum width=width("16") +}} + +\sseqnewfamily{imJ} +\begin{document} + +\NewSseqCommand\etaclass{O{}d()}{ + \IfNoValueF{#2}{\pushstack(#2)} + \class[#1](\lastx+1,\lasty+1) + \structline(\lastclass1)(\lastclass) +} + +\NewSseqCommand\divetaclass{O{}d()}{ + \IfNoValueF{#2}{\pushstack(#2)} + \class[#1](\lastx-1,\lasty-1) + \structline(\lastclass1)(\lastclass) +} + +\NewSseqCommand\nuclass{O{}d()}{ + \IfNoValueF{#2}{\pushstack(#2)} + \class[#1](\lastx+3,\lasty+1) + \structline(\lastclass1)(\lastclass) +} + +\NewSseqCommand\nustruct{d()}{ + \IfNoValueF{#1}{\pushstack(#1)} + \structline(\lastx-3,\lasty-1,-1)(\lastclass) +} + +\begin{sseqdata}[ + name=ANSS-S_2, Adams grading, + class labels={below}, + %label distance=-1pt, + below label distance=0pt, + classes={tooltip={(\xcoord,\ycoord)}}, + class pattern = linear, + class placement transform={rotate=90,scale=2}, + differentials=blue, + x range={0}{40}, + y range={0}{10}, + xscale=0.7, + yscale=1.7, + grid=go, + right clip padding=2em +] +\begin{scope}[imJ] +\class[rectangle,fill,inner sep=3pt](0,0) +\DoUntilOutOfBoundsThenNMore{3}{\etaclass} +\classoptions["\alpha_1" above left](1,1) + +\class["\alpha_{2/2}",circlen=2](3,1) +\nustruct +\structline[dashed](3,1)(3,3) + + +\class["\alpha_3"](5,1) +\d3(\lastclass) +\DoUntilOutOfBounds{\etaclass\d3(\lastclass)} + +\class["\alpha_{4/4}",ppower=16](7,1) +\DoUntilOutOfBoundsThenNMore{3}{\etaclass} + +\class["\alpha_{5}"](9,1) +\DoUntilOutOfBoundsThenNMore{3}{\etaclass} + +\class["\alpha_{6/3}", circlen=3](11,1) +\d3(\lastclass) +\DoUntilOutOfBounds{\etaclass\d3(\lastclass)} +\replaceclass["\alpha_{6/2}", circlen=2](11,1) +\structline[dashed](11,1)(11,3) + +\class["\alpha_7"](13,1) +\d3(\lastclass) +\DoUntilOutOfBounds{\etaclass\d3(\lastclass)} + + +\class["\alpha_{8/5}",ppower=32](15,1) +\DoUntilOutOfBoundsThenNMore{3}{\etaclass} + +\class["\alpha_9"](17,1) +\DoUntilOutOfBoundsThenNMore{3}{\etaclass} + +\class["\alpha_{10/3}",circlen=3](19,1) +\d3(\lastclass) +\DoUntilOutOfBounds{\etaclass\d3(\lastclass)} +\replaceclass["\alpha_{10/2}",circlen=2](19,1) +\structline[dashed](19,1)(19,3) + +\class["\alpha_{11}"](21,1) +\d3(\lastclass) +\DoUntilOutOfBounds{\etaclass\d3(\lastclass)} +\end{scope} + +\class["\beta_{2/2}"](6,2) +\nustruct +\class["\beta_{2}" below](8,2) +\etaclass\structline(\lastclass)(6,2,2) % This is a *nu + +\class["\beta_3" left,insert = 1](14,2) +\etaclass[insert=1](14,2,-1) +\divetaclass["\beta_{4/4}" left, insert = 2] +\nuclass(14,2,2)\nuclass[circlen=2]\nuclass[circlen=3]\nuclass["P\beta_{2/2}" above left] +\nuclass\divetaclass["P\beta_2"] + + +\class["\beta_{4/3}",insert=1](16,2) +\etaclass[insert=1]\etaclass[insert=1] +\class["\beta_{4/2,2}",circlen=2](18,2) +\structline[dashed,](18,2,-1)(18,4,-1) + +\class["\eta_2"](19,3) +\etaclass + +\class["\beta_{4}"below](20,2) +\structline[dashed,bend left=20](20,2,-1)(20,4,2) +%\structlineoptions[](20,2,-1)(20,4,2)%page=0--3 +\etaclass\etaclass\structline(\lastclass)(\lastx+1,\lasty+1,-1) + +\nuclass["\alpha_{4/4}^3" {above left=-1pt}](18,2,-1) + + + +\class["\eta_{3/2}"](23,3) +\etaclass\etaclass + +\class["\beta_5" below](26,2) +\d3(\lastclass,-1) + +\class["\beta_{8/8}" ](30,2) +\etaclass +\class["\beta_{6/2}" left](30,2) +\d5(\lastclass) + +\class["\gamma_3" left](31,3) +\nuclass +\class["\eta_{5/3}"](33,4) + +\class["\beta_{8/7}"](32,2) +\etaclass\etaclass\etaclass\etaclass\etaclass\etaclass +\class["\beta_{6}"left](32,2)\etaclass + +\class["x_{32}"](32,4)\etaclass\etaclass["P\beta_{4/4}" right] +\class["x_{36}"](36,4) +\nuclass(32,4,-1)\nuclass + +\class["P\beta_3" above left](34,6)\etaclass\nuclass(34,6,-1) + +\class["\beta_{8/6,2}",circlen=2](34,2) +\etaclass\nuclass(\lastclass1) + +\class["\gamma_{4/2,2}" right](37,3) +\class["\beta_{8/4,2}",circlen=2](38,2) +\class["\beta_{7}" right](38,2) +\class["d_{4/4}\beta_{8/7}" right](39,3) +\class["x''_{39}" right](39,3) +\class["\gamma_{4,2}" right](39,3) +\class["x_{39}'"](39,5) +\class["P\eta_2"](39,7) +\end{sseqdata} + +\printpage[name=ANSS-S_2] + +\printpage[name=ANSS-S_2,page=5] + +\printpage[name=ANSS-S_2, no imJ] +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_3.pdf Binary files differindex 00050e20386..2821d2ab8bf 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.pdf +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_3.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_3.tex index b3d801acf6b..0dc8e67a959 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.tex +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_3.tex @@ -1,20 +1,15 @@ %% -%% Package: spectralsequences.sty version 1.0 -%% Author: Hood Chatham -%% Email: hood@mit.edu -%% Date: 2017-06-18 -%% License: Latex Project Public License +%% Description: Adams Novikov Spectral Sequence for $S_3$ %% %% File: example_anss3.tex %% %% Draws the Adams Novikov spectral sequence at the prime 3 through the 45 stem. %% In this range, all we see is the Toda differential d_{2p-1}(\beta_{p/p}) = \alpha\beta^p -%% Thanks to Eric Peterson for contributing this diagram. +%% Thanks to Eric Peterson for contributing this diagram. Presumably he copied it from page 13 of the green book. +%% Compare this to page 5 of example_ass3 %% -\documentclass{article} -\usepackage{spectralsequences} -\usepackage[landscape]{geometry} +\documentclass{spectralsequence-example} \begin{document} % tower definitions \NewSseqCommand\alphaclass{d()}{ @@ -29,16 +24,19 @@ \structline(\lastclass)(\lastclass1) } +\centering \begin{sseqpage}[ Adams grading, - classes = { tooltip = {(\xcoord,\ycoord)} }, - class labels = above left, + classes = { tooltip = {(\xcoord,\ycoord)}, inner sep=1.2pt }, + class labels = below, label distance=3pt, differentials={-{>[width=4]}, target anchor=-60}, - y range={0}{10}, + y range={0}{11}, x range={0}{45}, x tick step=5, - xscale=0.375 + xscale=0.7, + yscale=1.2, + y axis gap=2em ] \class[rectangle,fill,inner sep=3pt](0,0) @@ -55,10 +53,10 @@ \class["\alpha_{11}"](43,1) \class["\beta_1"](10,2) \structline(3,1)(10,2) -\class["\beta_2"](26,2) -\class["\beta_{3/3}" {xshift = -2pt, yshift=-2pt}](34,2) -\class["\beta_{3/2}"](38,2) -\class["\beta_3"](42,2) +\class["\beta_2" left](26,2) +\class["\beta_{3/3}" left](34,2) +\class["\beta_{3/2}" {left}](38,2) +\class["\beta_3" left](42,2) % tower off of beta_1 \alphaclass(10,2)\betaclass @@ -83,6 +81,12 @@ % d5s \d5(34,2) \d5(44,4) + +%% Doug's contributions +\classoptions["{\left<\alpha_1,\alpha_1,\beta_1^3\right>}" {below right=0em}](37,3) +\structline[dashed](37,3)(40,8) + + \end{sseqpage} \end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_2.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_2.pdf Binary files differnew file mode 100644 index 00000000000..79621a0e2e6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_2.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_2.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_2.tex new file mode 100644 index 00000000000..67be3dd6b57 --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_2.tex @@ -0,0 +1,399 @@ +%% +%% Description: Adams Novikov Spectral Sequence for $S_2$ +%% +%% +%% Draws the Adams Spectral Sequence at the prime 2 through the 45 stem. +%% See pages 146 - 147 of Green book +%% https://mathoverflow.net/questions/102316/differentials-in-the-adams-spectral-sequence-for-spheres-at-the-prime-p-2 +%% https://en.wikipedia.org/wiki/Homotopy_groups_of_spheres#Table_of_stable_homotopy_groups +%% + + +\documentclass{spectralsequence-example} + + +\begin{document} +\sseqset{imJ/.sseq style={purple}} + + +\NewSseqCommand\twoclass{O{}d()}{ + \IfNoValueF{#2}{\pushstack(#2)} + \class[#1](\lastx,\lasty+1) + \structline(\lastclass1)(\lastclass) +} + +\NewSseqCommand\divtwoclass{O{}d()}{ + \IfNoValueF{#2}{\pushstack(#2)} + \class[#1](\lastx,\lasty-1) + \structline(\lastclass1)(\lastclass) +} + + +\NewSseqCommand\etaclass{O{}d()}{ + \IfNoValueF{#2}{\pushstack(#2)} + \class[#1](\lastx+1,\lasty+1) + \structline(\lastclass1)(\lastclass) +} +\NewSseqCommand\divetaclass{O{}d()}{ + \IfNoValueF{#2}{\pushstack(#2)} + \class[#1](\lastx-1,\lasty-1) + \structline(\lastclass1)(\lastclass) +} +\NewSseqCommand\etastruct{d()}{ + \IfNoValueF{#1}{\pushstack(#1)} + \structline(\lastx-1,\lasty-1,-1)(\lastclass) +} + + +\NewSseqCommand\nuclass{O{}d()}{ + \IfNoValueF{#2}{\pushstack(#2)} + \class[#1](\lastx+3,\lasty+1) + \structline(\lastclass1)(\lastclass) +} + +\NewSseqCommand\nustruct{d()}{ + \IfNoValueF{#1}{\pushstack(#1)} + \structline(\lastx-3,\lasty-1,-1)(\lastclass) +} + +\NewSseqCommand\hznudiamond{d()}{ + \IfNoValueF{#1}{\pushstack(#1)} + \savestack + \class(\lastx,\lasty+1) + \structline(\lastclass1)(\lastclass) + \nustruct + \restorestack +} + +\NewSseqCommand\etanudiamond{d()}{ + \IfNoValueF{#1}{\pushstack(#1)} + \savestack + \class(\lastx+1,\lasty+1) + \structline(\lastclass1)(\lastclass) + \nustruct + \restorestack +} + +\NewSseqCommand \czero {O{} r() }{ + \savestack + \class[#1](#2) + \etaclass + \restorestack +} + +\NewSseqCommand\tower {O{}d()mO{}} { + \begin{scope}[#4] + \IfNoValueF{#2}{\class[#1](#2)} + \savestack + \Do{#3-1}{ + \class(\lastx, \lasty+1) + \structline(\lastclass)(\lastclass1) + } + \restorestack + \end{scope} +} + + +\NewSseqCommand \towergroup {o r() m O{}} { + \tower(#2){#3}[#4] + \IfNoValueF{#1}{\classoptions[#1](#2)} + \etaclass\etaclass\etaclass + \nustruct\divtwoclass\nustruct\divtwoclass + \nustruct\nuclass +} + + +\protected\def\Psqvphant{\vphantom{P^2}} +\NewSseqGroup \Phone { mm } { + \class["#1h_1#2"](0,0) + \etaclass\etaclass + \divtwoclass\divtwoclass["\Psqvphant#1h_2#2" {below=-4pt}] +} + +\NewSseqGroup \Phonegroup {G{}}{ + \sseqset{class label handler = { \sseqnormalizemonomial{##1} }} + \czero["#1c_0" above](-1,-2) + \Phone[imJ]{P#1}{} + \nuclass[imJ]\divtwoclass[imJ]\divtwoclass["#1d_0" left,name=d0] + \etaclass\etaclass\etaclass + \nustruct\divtwoclass\nustruct\divtwoclass\nustruct\divtwoclass["#1e_0" left,name=e0] + \nuclass\hznudiamond + \divtwoclass + \classoptions["#1g" {below=0.3em},page=0-3](\lastclass) + %\etanudiamond + + % Have to go back and draw path e0 to g + \savestack + \d2(e0,-1) + \etaclass(e0)\d2(\lastclass,-1) + \divtwoclass[name=f0]\d2(\lastclass,-1) + \nuclass[name=nuf0] + \etastruct % Now we're back at g + \restorestack + \nuclass[name=nug]\hznudiamond\nuclass[name=nu2g] +} + + +\NewSseqGroup \Phonegroupb {G{}}{ + \Phonegroup{P#1} + + \divtwoclass["\Psqvphant#1j" {below left=-1pt,yshift=2pt}](f0) \d2(\lastclass,-1) + \divtwoclass(nuf0) \d2(\lastclass,-1) + \nustruct\divtwoclass["\Psqvphant#1k" {below=-1pt}] \d2(\lastclass,-1) + \nuclass\d2(\lastclass,-1) + \hznudiamond + \divtwoclass["\Psqvphant#1l" {below left=-1pt,yshift=2pt}]\d2(\lastclass,-1) + \nuclass\d2(\lastclass,-1)\hznudiamond + \divtwoclass["\Psqvphant#1m" {below left=-3pt},name=m] + + \divtwoclass(nug)\structline(\lastclass)(\lastx+1,\lasty+1) + \divtwoclass(nu2g)\nustruct + \divtwoclass\structline(\lastclass)(\lastx+1,\lasty+1) + \d2(m,-1) +} + + + +\begin{sseqdata}[ + name = ASS-S_2, + Adams grading, + classes=fill, + class labels={above left=0.2em,black}, + x range={0}{46}, + y range={0}{23}, + % xscale=0.7, + % yscale=0.8, + differentials = blue, + classes = { tooltip = { (\xcoord,\ycoord) } }, + grid = go, + run off = - +] +\towergroup(0,0){\ymax-\ymin+2} +\classoptions["h_2" below](3,1) +\nuclass +\divetaclass\divetaclass["h_3" below] +\tower{4} + + +\Phonegroup(9,5) +\classoptions["f_0"](f0) + +\Phonegroupb(17,9) +\pushstack(d0) +\tower["i" {below left,yshift=2pt}](23,7){6}[imJ] +\structline(\lastclass)(\lastx+3,\lasty+1,-1) +\structline(\lastx,\lasty+1)(\lastx+3,\lasty+2,-1) +\d2(23,7) +\d2(23,8) + +\Phonegroupb(25,13){P} +\Phonegroupb(33,17){P^2} +\tower["P^2i" {below left,yshift=2pt}](39,15){6}[imJ] +\structline(\lastclass)(\lastx+3,\lasty+1,-1) +\structline(\lastx,\lasty+1)(\lastx+3,\lasty+2,-1) +\d2(39,15) +\d2(39,16) +\d4(39,12) +\d4(40,13,,1) + +\Phonegroup(41,21){P^4} +\tower["P^2i" {below left,yshift=2pt}](47,19){6}[imJ] +\d2(47,19) +\d2(47,20) + +\towergroup["h_4" below](15,1){8}[imJ] +\classoptions["h_3^3" below](\lastclass) + +\tower["h_3^2" left](14,2){2} +\d2(15,1) % d2(h_4) = h_0h_3^2 +\d3(15,2)\d3(15,3) % d2(h_0h_4) = h_0d_0 + +\class["c_1"](19,3)\nuclass +\czero["h_4c_0"](23,4) + + + +\towergroup["h_5" below](31,1){16}[imJ] +\nuclass +\divetaclass\divetaclass["h_3h_5" {below=-2pt}] +\tower{4} + +\class["n"{above=-0.5pt}](31,5) +\nuclass\nuclass +\divetaclass["t"] +\nuclass["c_1g"] + +\class["q" {below right=-0.7pt}](32,6) +\etaclass + +\class["p"](33,4) +\twoclass\divetaclass["d_1"] +\nuclass\nuclass +\divetaclass["x" below]\tower{6} + +\d[bend left=15]4(38,3,,2) +\d[bend left=30]4(38,2) + + +\tower["h_4^2" below](30,2){4} +\etaclass +\tower["r" left](30,6){6} +\d3(\lastclass) + +\d2(31,1)\d2(31,2)\d2(31,3) +\d3(31,4)\d3(31,5)\d3(31,6)\d3(31,7)\d3(31,8,-1) +\d4(31,8,1)\d4(32,9,,1) +\d4(31,9,-1,-1)\d4(31,10,-1,-1) + +\d3(34,2) + + +\class(38,6)\d2(\lastclass,-1) +\twoclass\d2(\lastclass,-1) +\twoclass\nustruct\d2(\lastclass,-1) +\twoclass\nustruct\d4(\lastclass,-1) +\divetaclass["e_0g"]\d4(\lastclass,-1) + +\czero[pin distance=3em,pin=below right:h_5c_0"](39,4) + +\class["e_1" {below=-1pt}](38,4) +\d3(\lastclass,1) +\etaclass\etaclass\divtwoclass\divtwoclass["f_1" below] +\etaclass +\divtwoclass\d2(\lastclass) +\divtwoclass\d2(\lastclass,-1) + + +\Phone(40,6){P}{h_5} + +\class["u"](39,9)\etaclass\etaclass\divtwoclass + +\class["g^2"](40,8) +\class["v"](42,9) +\d2(\lastclass) + +\tower["P^2r" {below=-4pt}](46,14){6} +\d3(\lastclass) + +\class["Pe_0g" right](45,12) +\d4(\lastclass) + +\class["w"](45,9) + +\class["d_0r" right](44,10) +\d3(\lastclass) + + +\class["h_4^3" below](45,3)\twoclass + +\tower["h_5d_0" {below right=-2pt}](45,5){3} +\etaclass\etaclass +\nuclass(45,5)\hznudiamond +\nustruct(45,7) + +\tower["g_2" below](44,4){3} +\etaclass + +\class["N"](46,8) +\class["gj"](46,11) + +\tower(47,13){12} +\foreach \y in {13,...,18} { \d2(47,\y)} +\end{sseqdata} +\centering + +\begin{sseqpage}[ + page=7, + name=ASS-S_2, Adams grading, + class labels={below}, + %label distance=-1pt, + below label distance=0pt, + differentials=blue, + x range={0}{40}, + y range={0}{10}, + xscale=0.7, + yscale=1.7, + grid=go, + right clip padding=2em +] +\structline[dashed,bend right=20](15,4)(16,7,1) +\structline[dashed,bend right=20](23,9,2)(24,11) +\structline[dashed,bend right=20](31,11)(32,15) +\structline[dashed,bend right=20](39,17,2)(40,19) + +\structline[dashed](14,2)(15,5,1) +\structline[dashed](21,5)(22,8) +\structline[dashed,bend right=20](20,6)(23,9,1) +\structline[dashed](23,6)(23,9,1) +\structline[dashed,bend right=20](30,2)(33,4) +\structline[dashed,bend left=20](32,6)(35,9) + +\structline[dashed](38,4)(39,7) + +\structline[dashed](40,8)(40,10) +\structline[dashed](40,8)(41,10) +\structline[dashed,bend left=40](39,9)(42,12) +\structline[dashed](41,10)(42,12) + +\classoptions["h_0^2i" right=1pt](23,9) +\classoptions["h_0^{10}h_5" left](31,11) +\classoptions["h_1h_5" below](32,2) +\classoptions["h_0h_2h_5" below](34,3) +\classoptions["h_2^2h_5" below](37,3) +\classoptions["h_0^2h_3h_5" {left=-0.1em}](38,4,1) +\classoptions["h_1h_3h_5" {below=-.4em}](39,3,1) + +\classoptions["Ph_3" left](15,5,1) +\classoptions["P^2h_3" left](23,9,1) +%\classoptions["P^3h_3" left](31,13,1) +%\classoptions["P^4h_3" left](39,17,1) +\end{sseqpage} +%\end{document} + +\newgeometry{margin = 0.1cm} +\printpage[name=ASS-S_2,page=2,xscale=0.7,yscale=0.8,keep changes] + +%\printpage[name=ASS-S_2,page=2] + +\printpage[name=ASS-S_2,page=3] + +\printpage[name=ASS-S_2,page=4] + +\begin{sseqpage}[name=ASS-S_2,page=5] +\structline[dashed,bend right=20](15,4)(16,7,1) +\structline[dashed,bend right=20](23,9,2)(24,11) +\structline[dashed,bend right=20](31,11)(32,15) +\structline[dashed,bend right=20](39,17,2)(40,19) + +\structline[dashed](14,2)(15,5,1) +\structline[dashed](21,5)(22,8) +\structline[dashed,bend right=20](20,6)(23,9,1) +\structline[dashed](23,6)(23,9,1) +\structline[dashed,bend right=20](30,2)(33,4) +\structline[dashed,bend left=20](32,6)(35,9) + +\structline[dashed](38,4)(39,7) + +\structline[dashed](40,8)(40,10) +\structline[dashed](40,8)(41,10) +\structline[dashed,bend left=40](39,9)(42,12) +\structline[dashed](41,10)(42,12) + +\classoptions["g" {below=0.3em}](20,4) +\classoptions["{d_0^2=Pg=c_0g}" {xshift=5pt, below=-2.15em}](28,8) + + +\classoptions["h_0^2i" right=1pt](23,9) +\classoptions["h_0^{10}h_5" left](31,11) +\classoptions["h_1h_5" below](32,2) +\classoptions["h_0h_2h_5" below](34,3) +\classoptions["h_2^2h_5" below](37,3) +\classoptions["h_0^2h_3h_5" {left=-0.1em}](38,4,1) +\classoptions["h_1h_3h_5" {below=-.4em}](39,3,1) + +\classoptions["Ph_3" left](15,5,1) +\classoptions["P^2h_3" left](23,9,1) +%\classoptions["P^3h_3" left](31,13,1) +%\classoptions["P^4h_3" left](39,17,1) +\end{sseqpage} +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_3.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_3.pdf Binary files differnew file mode 100644 index 00000000000..01bdc0c0121 --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_3.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_3.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_3.tex new file mode 100644 index 00000000000..aeab68e5212 --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_3.tex @@ -0,0 +1,158 @@ +%% +%% Description: The Adams Novikov Spectral Sequence for $S_3$, styled to superimpose on ANSS-S_3 +%% +%% The Adams spectral sequence at the prime 3 through the 45 stem. +%% Compare page 5 to example_ass3 +%% Copied from page 11 of the green book. +%% + +\documentclass{spectralsequence-example} + +\begin{document} + +\NewSseqCommand\tower {d()m} { + \IfNoValueF{#1}{\class(#1)} + \savestack + \Do { #2 } { + \class(\lastx, \lasty+1) + \structline(\lastclass1)(\lastclass) + } + \restorestack +} + +\NewSseqCommand\hclass {d()}{ + \IfNoValueF{#1}{\pushstack(#1)} + \class(\lastx+3,\lasty+1) + \structline(\lastclass1)(\lastclass) +} + +\NewSseqCommand\bclass {d()}{ + \IfNoValueF{#1}{\pushstack(#1)} + \class(\lastx+7,\lasty+1) + \structline(\lastclass1)(\lastclass) +} + +\NewSseqCommand\hbachair {d()}{ + \IfNoValueF{#1}{\pushstack(#1)} + \nameclass{tempclass}(\lastclass) + \bclass(\lastx,\lasty+1) + \hclass + \hclass(tempclass) + \bclass + \structline(\lastclass3)(\lastclass) +} + +\NewSseqCommand\bahclaw { r() } { + \class(#1) + \bclass + \class(\lastx,\lasty+1) + \structline(\lastclass1)(\lastclass) + \class(\lastx-3,\lasty-1) + \structline(\lastclass1)(\lastclass) + \pushstack(\lastclass2) +} +\begin{sseqdata}[ + name=ass3, + Adams grading, + classes={fill, inner sep=1.2pt, tooltip={(\xcoord,\ycoord)}}, + class labels={below,black}, + differentials=blue, + grid = go, + x tick step = 5, + x range={0}{45}, + y range={0}{11}, + xscale=0.7, + yscale=1.2, + y axis gap=2em +] +\tower(0,0){\ymax+1} +\classoptions["a_0" {left=0pt}](0,1) +\hbachair +\classoptions["h_0"](3,1) +\classoptions["b_0"](\lastclass) +\classoptions[purple,page=3](7,2) +\DoUntilOutOfBounds{\hbachair} + +\begin{scope}[sseq=purple] +\class["h_1"](11,1) +\tower{2} +\d2(\lastclass) +\DoUntilOutOfBounds{ + \bclass\d2(\lastclass) + \hclass\d2(\lastclass) +} +\end{scope} + +\begin{scope}[orange] +\class["k_0"](26,2) +\DoUntilOutOfBounds{ + \hclass\bclass +} +\end{scope} + + +\begin{scope}[sseq=purple] +\bahclaw(15,4) +\DoUntilOutOfBounds{\hbachair} +\bahclaw(27,7) +\DoUntilOutOfBounds{\hbachair} +\bahclaw(39,10) +\DoUntilOutOfBounds{\hbachair} +\bahclaw(38,7) +\d2(\lastclass1)\d2(\lastclass2)\d2(\lastclass3)\d2(\lastclass4) +\DoUntilOutOfBounds{ + \hbachair + \d2(\lastclass)\d2(\lastclass1) + \d2(\lastclass3)\d2(\lastclass4) +} +\end{scope} + + + + +\begin{scope}[sseq=purple] +\class[](23,3) % label me +\tower{3} +\d2(\lastclass)\d2(\lastx,\lasty+1) +\DoUntilOutOfBounds{ + \hbachair + \d2(\lastclass)\d2(\lastclass1) + \d2(\lastclass3)\d2(\lastclass4) +} +\end{scope} + + +\class["h_2"](35,1) +\tower{8} +\DoUntilOutOfBounds{\hbachair} + +\begin{scope}[sseq=orange] +\class["b_{11}"](34,2) +\tower{4} +\DoUntilOutOfBounds{ + \hclass\bclass +} +\d5(34,2) +\d5(44,4) +\end{scope} +\foreach \y in {1,...,4}{ + \d2(35,\y) +} +\d3(35,5)\d3(35,6) +\foreach \y in {7,...,9}{ + \classoptions[purple,page=4](35,\y,-1) +} + + + + +\end{sseqdata} +\centering +\printpage[name=ass3,page=1] +\newpage +\printpage[name=ass3,page=2] +\newpage +\printpage[name=ass3,page=3] +\newpage +\printpage[name=ass3,page=5] +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-tmf_2.pdf Binary files differindex 0939e810f49..35291705371 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.pdf +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-tmf_2.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-tmf_2.tex index a16a581d681..d9719ac38ca 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.tex +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-tmf_2.tex @@ -1,9 +1,5 @@ %% -%% Package: sseqpages.sty version 1.0 -%% Author: Hood Chatham -%% Email: hood@mit.edu -%% Date: 2017-06-18 -%% License: Latex Project Public License +%% Description: The Adams spectral sequence for $\tmf_2$ %% %% File: example_tmfass.tex %% @@ -29,17 +25,15 @@ % % deleting off page edge handling cuts off 1.4s (1s?) so I haven't found any of the big time holes yet. WHY IS THIS SO SLOW?? -\documentclass{article} -\usepackage[landscape,margin=0cm,top=2cm]{geometry} -\usepackage{spectralsequences} +\documentclass{spectralsequence-example} \begin{document} \NewSseqGroup\tower {} {% 25 \class(0,0) - \foreach \y in {1,...,22}{ - \class(0,\y) - \structline(0,\y-1,-1) (0,\y,-1) + \DoUntilOutOfBoundsThenNMore{2}{ + \class(\lastx,\lasty+1) + \structline(\lastclass1) (\lastclass) } } @@ -164,6 +158,7 @@ x tick step=2, Adams grading, classes={fill,inner sep=0.3ex,tooltip={(\xcoord,\ycoord)}}, + class placement transform={scale=1.5}, differentials={->,blue}, struct lines=red, %no struct lines, no differentials, yscale=0.6, xscale=0.5, @@ -245,8 +240,6 @@ \printpage[name=tmfass,page=0] -%\end{document} - \printpage[name=tmfass,page=2] @@ -289,4 +282,3 @@ \end{sseqpage} \end{document} - diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-EO2_3.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-EO2_3.pdf Binary files differnew file mode 100644 index 00000000000..ce90f2c83f1 --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-EO2_3.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-EO2_3.tex index c4a5f3650e2..b90f129512f 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.tex +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-EO2_3.tex @@ -1,11 +1,5 @@ %% -%% Package: spectralsequences.sty version 1.0 -%% Author: Hood Chatham -%% Email: hood@mit.edu -%% Date: 2017-06-18 -%% License: Latex Project Public License -%% -%% File: example_EO2_3.tex +%% Description: The homotopy fixed point spectral sequence for a maximal finite subgroup of $\mathbb{G}_{p-1}$ acting on $E_{p-1}$ with $p=3$ %% %% This is the homotopy fixed point spectral sequence for EO_2 at the prime 3. The maximal finite subgroup of the Morava stabilizer for E_{p-1} is %% of size 2p(p-1)^2 = 24, and so there is a norm element v in degree 24. There's also a bunch of trace classes on the zero line, but the trace map @@ -18,15 +12,14 @@ %% HFPSS for KO = KU^{hC_2} (see example_KUHFPSS). %% -\documentclass{article} -\usepackage{spectralsequences} -\usepackage[landscape,margin=0cm,top=2cm]{geometry} +\documentclass{spectralsequence-example} \begin{document} \begin{sseqdata}[name=EO(2),Adams grading, y range={0}{14},x range={0}{160}, xscale=0.15, x tick step=5, - classes={fill, tooltip={(\xcoord,\ycoord)}} + classes={fill, tooltip={(\xcoord,\ycoord)}}, + title=Page \page ] \foreach \v in {0,...,8}{ \foreach \b in {0,...,11}{ @@ -55,20 +48,28 @@ } } \end{sseqdata} -\printpage[name=EO(2),page=0] +\printpage[name=EO(2),page=0,title={\phantom{Page 5}}] \newpage \printpage[name=EO(2),page=5] \newpage \printpage[name=EO(2),page=9] \newpage -\begin{sseqpage}[name=EO(2),page=10] +\begin{sseqpage}[name=EO(2),page=10,title={Page $\infty$}] \classoptions["a" left](3,1) \classoptions["b" right](10,2) \classoptions["ab" left](13,3) \classoptions["b^2" right](20,4) \classoptions["b^3" right](30,6) \classoptions["b^4" right](40,8) - \classoptions["v^3" right](72,0) + +% Doug's additions: +\classoptions["{\left<a,a,b^2\right>}" below](27,1) +\structline[dashed](27,1)(30,6) +\structline[dashed](37,3)(40,8) + +\structline[dashed](99,1)(102,6) +\structline[dashed](109,3)(112,8) + \end{sseqpage} \end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-KO.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-KO.pdf Binary files differnew file mode 100644 index 00000000000..6980ccb0067 --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-KO.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-KO.tex index 7207b38a986..7409a2a77de 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.tex +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-KO.tex @@ -1,9 +1,5 @@ %% -%% Package: spectralsequences.sty version 1.0 -%% Author: Hood Chatham -%% Email: hood@mit.edu -%% Date: 2017-06-18 -%% License: Latex Project Public License +%% Description: The homotopy fixed point spectral sequence for $C_2$ acting on $KU$ by complex conjugation, compare the odd-primary case HFPSS-EO2_3 %% %% File: example_KUHFPSS.tex %% @@ -14,13 +10,11 @@ %% shows that \alpha v = \alpha_3, so dividing the differential by \alpha gives d3(v) = \alpha_1^3. Now there's no Kudo differential %% because the prime is 2, and the spectral sequence immediately collapses. %% -%% Second, a demonstration of the falsehood of ku^{hC_2} = ko -- ku^{hC_2} has an extra generator as a ring, which is in degree -4. +%% Second, a demonstration of the falsehood of ku^{hC_2} = ko -- ku^{hC_2} has an extra generator as a ring, which is in degree -4. %% In particular, it's not even connective. %% -\documentclass{article} -\usepackage[landscape,margin=2cm]{geometry} -\usepackage{spectralsequences} +\documentclass{spectralsequence-example} \begin{document} \sseqset{ Z2class/.sseq style={circle,inner sep=0.3ex,fill=black}, @@ -31,26 +25,28 @@ name=KRHFPSS, x range={-12}{14}, y range={0}{10}, - y axis style=center, + y axis type=center, y axis gap=0.425cm, tick step=4, classes=Z2class, differentials=->, degree={-1}{#1-1}, - scale=0.85, + scale=1.45, right clip padding=0.1cm, top clip padding=0.05cm, x axis extend start=0cm, x axis extend end=0.33cm, y axis extend end=0.3cm, + grid=go ] -\draw[background,xshift=-0.5cm,yshift=-0.51cm,step=1cm,gray,very thin] (\xmin+0.01,\ymin+0.01) grid (\xmax+0.9,\ymax+0.9); +% This is just to make sure the bounding box doesn't move around +\path[background] (\xmin-1,\ymin-1) rectangle (\xmax+1,\ymax+1); -\pgfmathsetmacro\xitstart{int(int(\xmin/8)*8-16)} -\pgfmathsetmacro\xitgap{int(\xitstart+4)} -\pgfmathsetmacro\xitend{int(\xmax+2)} -\pgfmathsetmacro\xmaxpp{int(\xmax+2)} +\sseqparseint\xitstart{\xmin/8*8-16} % division is integer division (I think with rounding towards 0...) so /8*8 rounds up to the nearest multiple of 8? +\sseqparseint\xitgap{\xitstart+4} +\sseqparseint\xitend{\xmax+2} +\sseqparseint\xmaxpp{\xmax+2} \foreach \x in {\xitstart,\xitgap,...,\xitend} { \class[Zclass](\x,0) @@ -60,8 +56,8 @@ } } -\pgfmathsetmacro\xitstart{int(\xitgap)} -\pgfmathsetmacro\xitgap{int(\xitstart+8)} +\sseqparseint\xitstart{\xitgap} +\sseqparseint\xitgap{\xitstart+8} \foreach \x in {\xitstart,\xitgap,...,\xitend} { \foreach\z in {0,...,\xmax}{ @@ -78,7 +74,7 @@ \newpage \begin{sseqpage}[name=KRHFPSS,page=0,keep changes] \pgfmathsetmacro\antidiag{min(-\xmin,\ymax+0.8)} -\clip[background,xshift=0.28cm,yshift=-0.4cm](-\antidiag,\antidiag)--(-1,1)--(-0.4,0)--(\xmax+2,0)--(\xmax+2,\antidiag)--cycle; +\clip[background,xshift=0.2cm,yshift=-0.33cm](-\antidiag,\antidiag)--(-1,1)--(-0.4,0)--(\xmax + 0.28,0)--(\xmax+0.28,\antidiag)--cycle; \foreach \z in {2,6}{ \doptions[draw=none]4(-\z-1,\z-1) \structlineoptions[draw=none](-\z-1,\z-1)(-\z,\z) diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/J_RPinfty.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/J_RPinfty.pdf Binary files differnew file mode 100644 index 00000000000..aaf1e1ed7b4 --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/J_RPinfty.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/J_RPinfty.tex index a2a5245f43d..eee6ffea63f 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.tex +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/J_RPinfty.tex @@ -1,8 +1,8 @@ %% -%% Package: spectralsequences.sty version 1.0 +%% Package: spectralsequences v1.1.0 %% Author: Hood Chatham %% Email: hood@mit.edu -%% Date: 2017-06-18 +%% Date: 2017-08-02 %% License: Latex Project Public License %% %% File: example_endofVFoS.tex @@ -12,10 +12,8 @@ %% Looking back, I seem to have inferred a bunch of stuff that wasn't actually written down on the page, but I'm not sure how so there's a chance some of it is wrong. %% -\documentclass{article} -\usepackage[landscape,margin=0cm,top=2cm]{geometry} +\documentclass{spectralsequence-example} \usepackage{amssymb} -\usepackage{spectralsequences} \NewSseqCommand\row { m } {\foreach \x in {1,...,35}{\class(\x,#1)}} \NewSseqCommand\twoptrow { m } {\foreach \x in {1,...,35}{\class(\x,#1)\class(\x,#1)}} @@ -123,7 +121,6 @@ \printpage[name=mysseq, page=2] \newpage \printpage[name=mysseq, page=3] - \newpage \printpage[name=mysseq, page=4] \newpage diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-bo-A1.pdf Binary files differindex 9367b1ce253..fa0a98f5b0f 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.pdf +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-bo-A1.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-bo-A1.tex index 7d1ab32c7f2..f8e97bac890 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.tex +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-bo-A1.tex @@ -1,21 +1,15 @@ %% -%% Package: spectralsequences.sty version 1.0 -%% Author: Hood Chatham -%% Email: hood@mit.edu -%% Date: 2017-06-18 -%% License: Latex Project Public License +%% Description: The May spectral sequence for $Ext(\HF_{2*}bo)$ %% -%% File: example_bo_May_SS.tex -%% -%% Draws the May spectral sequence computing Ext_{A(1)} ( F_2, F_2 ), which by a change of rings and a simple argument that the ASS has to collapse, +%% This is the May spectral sequence computing Ext_{A(1)} ( F_2, F_2 ), which by a change of rings and a simple argument that the ASS has to collapse, %% is telling us pi_* bo. See the Green Book for reference. %% The main purpose of this example from my perspective is to illustrate the utility of class "tags". %% -\documentclass{article} -\usepackage{spectralsequences} -\NewSseqGroup\tower {} { +\documentclass{spectralsequence-example} + +\NewSseqCommand\tower {} { \class(0,0) \foreach\i in {1,...,11}{ \class(0,\i) @@ -23,7 +17,7 @@ } } \NewSseqGroup\hvee {} { - \tower(0,0) + \tower \foreach\i in {1,...,11}{ \class(\i,\i) \structline(\i-1,\i-1,-1)(\i,\i,-1) diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-tmf-A2.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-tmf-A2.pdf Binary files differnew file mode 100644 index 00000000000..c1643f7bc19 --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-tmf-A2.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-tmf-A2.tex index c4041a6eb5e..ab8b3e5a910 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.tex +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-tmf-A2.tex @@ -1,20 +1,11 @@ %% -%% Package: sseqpages.sty version 1.0 -%% Author: Hood Chatham -%% Email: hood@mit.edu -%% Date: 2017-06-18 -%% License: Latex Project Public License -%% -%% File: example_tmfmayss.tex +%% Description: The May spectral sequence for $Ext(\HF_{2*}\tmf)$ %% %% I got this from Mike Hill's note: https://pdfs.semanticscholar.org/ddbb/8d584e4e81a71400088117b16cd241238c6c.pdf %% - -\documentclass{article} -\usepackage[landscape,left=1cm]{geometry} -\usepackage{spectralsequences} +\documentclass{spectralsequence-example} \begin{document} \sseqset{htwostructstyle/.sseq style = {gray,very thin, run off=-}} %\pgfkeys{/sseqpages/struct line/htwostructstyle/.show code} @@ -50,9 +41,8 @@ \pushstack(#2) } \savestack - \edef\towermax{\the\numexpr9-\lasty0} \begin{scope}[#1] - \foreach\i in {1,...,\towermax}{ + \DoUntilOutOfBounds{ \class(\lastx,\lasty+1) \structline(\lastclass1)(\lastclass) } @@ -63,8 +53,7 @@ \NewSseqCommand\honetower {O{}} { \savestack \begin{scope}[#1] - \edef\towermax{\the\numexpr9-\lasty0} - \foreach\i in {1,...,\towermax}{ + \DoUntilOutOfBounds{ \class(\lastx+1,\lasty+1) \structline(\lastclass1)(\lastclass) } @@ -84,13 +73,12 @@ \IfNoValueF{#2}{ \pushstack(#2) } - \edef\towermax{\the\numexpr-\lasty+8} \begin{scope}[#1] \gettag\thetag(\lastclass) \class(\lastx+3,\lasty+1) \structline[htwostructstyle](\lastclass)(\lastclass1) \savestack - \foreach\i in {1,...,\towermax}{ + \DoUntilOutOfBounds{ \class(\lastx,\lasty+1) \structline(\lastclass1)(\lastclass) \structline[htwostructstyle](\lastx-3,\lasty-1,\thetag)(\lastclass) @@ -106,7 +94,9 @@ } } -\begin{sseqdata}[name=tmfmayss,y range={0}{8}, x range={0}{25}, classes=fill, class labels={below=3pt},degree={-1}{1},differentials=blue, +\begin{sseqdata}[name=tmfmayss,y range={0}{8}, x range={0}{25}, degree={-1}{1}, + classes=fill, + class labels={below=3pt},differentials=blue, class pattern=linear, classes={ tooltip = {(\xcoord,\ycoord)} }, xscale=0.8, title = {Page \page}, run off differentials = -> diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KF3n.pdf Binary files differindex 7535a796aa9..e7f5f515d87 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.pdf +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KF3n.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KF3n.tex index dad6f608b58..e75319226c4 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.tex +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KF3n.tex @@ -1,11 +1,5 @@ %% -%% Package: spectralsequences.sty version 1.0 -%% Author: Hood Chatham -%% Email: hood@mit.edu -%% Date: 2017-06-18 -%% License: Latex Project Public License -%% -%% File: example_KF3n.tex +%% Description: The Serre spectral sequence for $\HF_3$ cohomology of $K(\F_3,n-1)\to pt \to K(\F_3,n)$ for $n=2,3,4$, with Bockstein SS's for going up to $\Zbb_3$ coefficients. %% %% This is a computation of the Z_3 cohomology of K(F_3,n). This was part of a way-too-hard problem on Haynes Algebraic Topology II problem set which asked to compute %% the smallest k>0 such that H_{n+k}(K(--,n);Z_p) : Ab --> Ab is not the zero functor and to compute what functor it is. One of the main ideas is to use the Bockstein @@ -21,7 +15,7 @@ \sseqset{ cohomological Serre grading, title={Page \page}, - class placement transform={scale=3, rotate=90}, + class placement transform={scale=1.3, rotate=90}, class pattern=linear, classes={draw=none}, class label handler = {\sseqnormalizemonomial{#1}}, @@ -31,7 +25,6 @@ yscale=1.5, x axis extend end=40pt, y axis extend end = 40pt, x axis gap =50pt, class label handler = {}, } - %class labels=above, } \begin{sseqdata}[name=K(Z/3;2), @@ -42,7 +35,7 @@ ] \foreach \x/\xlabel in { 0/1, 2/\iota_2, 3/\beta\iota_2, 4/\iota_2^2, 5/\iota_2\beta\iota_2, 6/\iota_2^3, - 7/\iota_2^2\beta\iota_2, 7/P^1\beta\iota_2, 8/\iota_2^4, 8/\beta P^1\beta\iota_2 } + 7/\iota_2^2\beta\iota_2, 7/P^1\beta\iota_2, 8/\iota_2^4, 8/\beta P^1\beta\iota_2 } \foreach \y/\ylabel in { 0/1, 1/\alpha, 2/x, 3/\alpha x, 4/x^2, 5/\alpha x^2, 6/x^3} { \class["\ylabel\xlabel"](\x,\y) @@ -166,7 +159,7 @@ \draw[->] (8,0,1) to[bend right=30, "\beta^1"' {pos = 0.46}] (9,0); \class["\Z\{1\}"](0,-1) -\class["\Z/3\{\beta\iota_3\}"](2,-1) +\class["\Z/3\{\beta\iota_2\}"](3,-1) \class["\Z/3\{\beta\iota_2^2\}"](5,-1) \class["\Z/9\{\beta\iota_2^3\}"](7,-1) \class["\Z/3\{\beta P^1\iota_2\}"](8,-1) diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KZ3.pdf Binary files differindex d0da6d62c7e..762ffa938ad 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.pdf +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KZ3.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KZ3.tex index 94cf1fb643d..25c71433787 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.tex +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KZ3.tex @@ -1,9 +1,5 @@ %% -%% Package: spectralsequences.sty version 1.0 -%% Author: Hood Chatham -%% Email: hood@mit.edu -%% Date: 2017-06-18 -%% License: Latex Project Public License +%% Description: The Serre spectral sequence for $\HZ$ cohomology of $\CP^\infty \to pt \to K(\Z,3)$ %% %% File: example_KZ3.tex %% @@ -12,7 +8,7 @@ \documentclass{article} \usepackage[landscape,margin=0.5cm,top=2cm]{geometry} -\usepackage[]{sseqpages} +\usepackage{spectralsequences} \usepackage{amssymb} \def\Z{\mathbb{Z}} % Last time test: 1.1 sec @@ -25,7 +21,6 @@ y range={0}{10}, cohomological Serre grading, differentials={->}, - labels=below, xscale=1.8, y axis gap=0.7cm, math nodes, @@ -35,9 +30,8 @@ x label = {$H^*(K(\Z,3))$}, y label = {$H^*(K(\Z,2))$} ] -%\tracingall + \column0["\Z\{\ifnum\y>0\relax x\ifnum\y>1\relax ^{\y}\fi\else1\fi\}"] -%\error \column3["\Z\{a\ifnum\y>0x\ifnum\y>1 ^{\y}\fi\fi\}"] diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.pdf Binary files differdeleted file mode 100644 index 8b5dc4f6293..00000000000 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KRHFPSS.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KRHFPSS.pdf Binary files differdeleted file mode 100644 index 3aff1b1fe8b..00000000000 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KRHFPSS.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.pdf Binary files differdeleted file mode 100644 index c1d593951c7..00000000000 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.pdf Binary files differdeleted file mode 100644 index d5ab3fb620a..00000000000 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.tex deleted file mode 100644 index fcfca3ae84c..00000000000 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.tex +++ /dev/null @@ -1,359 +0,0 @@ -%% -%% Package: spectralsequences.sty version 1.0 -%% Author: Hood Chatham -%% Email: hood@mit.edu -%% Date: 2017-06-18 -%% License: Latex Project Public License -%% -%% File: example_ass.tex -%% -%% Draws the Adams Spectral Sequence at the prime 2 through the 45 stem. -%% See pages 146 - 147 of Green book -%% https://mathoverflow.net/questions/102316/differentials-in-the-adams-spectral-sequence-for-spheres-at-the-prime-p-2 -%% https://en.wikipedia.org/wiki/Homotopy_groups_of_spheres#Table_of_stable_homotopy_groups -%% - - -\documentclass{article} -\usepackage[landscape,paperheight=14in,margin=0.1in]{geometry} -\usepackage{spectralsequences} - - -\begin{document} -\NewSseqGroup\tower {m} { - \class(0,0) - \foreach \y in {2,...,#1} { - \class(0, \y-1) - \structline(0, \y-2, -1)(0, \y-1, -1) - } -} - -\def\etaclass(#1,#2){ - \class(#1+1,#2+1) - \structline(#1,#2, -1)(#1+1,#2+1, -1) -} -\def\etasqclass(#1,#2){ - \class(#1+1,#2+1) - \class(#1+2,#2+2) - \structline(#1,#2, -1)(#1+1,#2+1, -1) - \structline(#1+1,#2+1, -1)(#1+2,#2+2, -1) -} -\def\etacubclass(#1,#2){ - \class(#1+1,#2+1) - \class(#1+2,#2+2) - \class(#1+3,#2+3) - \structline(#1,#2, -1)(#1+1,#2+1, -1) - \structline(#1+1,#2+1, -1)(#1+2,#2+2, -1) - \structline(#1+2,#2+2, -1)(#1+3,#2+3, -1) -} -\def\divtwoclass[#1](#2,#3){ - \class[#1](#2,#3-1) - \structline(#2,#3-1,-1)(#2,#3 ,-1) -} -\def\divfourclass[#1](#2,#3){ - \class(#2,#3-1) - \structline(#2,#3-1,-1)(#2,#3 ,-1) - \class[#1](#2,#3-2) - \structline(#2,#3-2,-1)(#2,#3-1,-1) -} -\def\diveightclass[#1](#2,#3){ - \class(#2,#3-1) - \structline(#2,#3-1,-1)(#2,#3 ,-1) - \class(#2,#3-2) - \structline(#2,#3-2,-1)(#2,#3-1,-1) - \class[#1](#2,#3-3) - \structline(#2,#3-3,-1)(#2,#3-2,-1) - -} -\def\nuclass(#1,#2){ - \class(#1+3,#2+1) - \structline(#1,#2,-1)(#1+3,#2+1,-1) -} -\def\nustruct(#1,#2){ - \structline(#1,#2,-1)(#1+3,#2+1,-1) -} - -\begin{sseqdata}[ - name = S0ASS, - Adams grading, - classes=fill, - class labels={above left=0.2em}, - x range={0}{45}, - y range={0}{23}, - xscale=0.7, - yscale=0.8, - differentials = red, - right clip padding = 3em, - classes = { tooltip = { (\xcoord,\ycoord) } }, - grid = go -] -\tower(0,0){25} - -% multiples of eta -\etacubclass(0,0) -\classoptions["h_1"](1,1) - -% divisibilities of nu -\divfourclass["h_2" below](3,3) - -\nustruct(0,0) - -\nuclass(3,1) - - - -\tower(7,1){4} -%\classoptions["h_3" left](7,1) -\etasqclass(7,1) -\structline(6,2)(9,3) - -\class["c_0" above](8,3) -\etaclass(8,3) - - - -\class["Ph_1"](9,5) -\etasqclass(9,5) -\divfourclass["Ph_2" below](11,7) - -\tower(14,2){2} -\classoptions["h_3^2" left](14,2) -\tower(14,4){3} -\classoptions["d_0" left](14,4) - -\tower(15,1){8} -\classoptions["h_4" left](15,1) -\d2(15,1) % d2(h_4) = h_0h_3^2 -\d3(15,2)\d3(15,3) % d2(h_0h_4) = h_0d_0 - -\etacubclass(15,1) -\divfourclass[](18,4) -\nustruct(15,1)\nustruct(15,2)\nustruct(15,3) - - -\nuclass(18,2) - -\etacubclass(14,4) -\diveightclass["e_0" left](17,7) -\nustruct(14,6)\nustruct(14,5)\nustruct(14,4) - -\nuclass(17,5) -\divfourclass["g" {below = 0.3em}](20,6) -\etaclass(17,4) -\divtwoclass["f_0" {below right=0em}](18,5) -\etaclass(20,4) -\nustruct(18,4) - -\classoptions["h_3^3" below](21,3) - -\d2(17,4)\d2(18,5)\d2(18,4,-1) % d2(e_0) = h1^2 d0, d2(f_0) = h0^2 e0 -\nustruct(17,4)\nuclass(20,5) -\divtwoclass[](23,6)\nustruct(20,4) -\nuclass(23,5) - -\tower(23,7){6} -\classoptions["i" left](23,7) - -\class["Pc_0" {xshift=3pt}](16,7)\etaclass(16,7) -\class["P^2c_0" {xshift=5pt,yshift=2pt}](24,11)\etaclass(24,11) - -\class["c_1" {above=0em}](19,3) -\nuclass(19,3) - -\class["h_4c_0" below](23,4) -\etaclass(23,4) - - -\class["P^2h_1"](17,9)\etasqclass(17,9) -\divfourclass["P^2h_2" {below=0em}](19,11) -\nuclass(19,9) -\divfourclass["Pd_0" left](22,10) -\etacubclass(22,8) -\diveightclass["Pe_0" below](25,11) -\etaclass(25,8)\divfourclass["j" below](26,9) -\d2(23,7)\d2(23,8) % d2(i)=h_0Pd_0 -\d2(25,8) % d2(Pe_0) = h_1^2 Pd -\d2(26,9)\d2(26,8)\d2(26,7) % d2(j) = h_0 Pe_0 - -\nustruct(22,10)\nustruct(22,9)\nustruct(22,8) - - -\class["P^3h_1"](25,13)\etasqclass(25,13) -\divfourclass["P^3h_2" {below=0em}](27,15) -\nuclass(27,13) -\divfourclass["P^2d_0" {left=0.2em}](30,14) -\etacubclass(30,12) -\diveightclass["P^2e_0" {below=0em}](33,15) -\d2(33,12) % d2(P^2e_0) = h_1^2 P^2d_0 -\nustruct(30,14)\nustruct(30,13)\nustruct(30,12) -\etaclass(33,12) -\divfourclass["Pj" {right}](34,13) -\d2(34,11)\d2(34,12)\d2(34,13) % d2(Pj) = h0 P^2e_0 - - - -\class(28,10)\divfourclass["{Pg=d_0^2}" {below left=-0.5em}](28,10) -\etaclass(28,8)\divfourclass["k" below](29,9) -\d2(29,7)\d2(29,8) % d2(k) = h_0 Pg = h_0 d_0^2 -\class["r" below](30,6) \d3(30,6) % d3(r) = h0^2 k -\tower(30,7){5} -\classoptions["s" below](30,7) - -\tower(30,2){4} -\classoptions["h_4^2" below](30,2) -\etaclass(30,2) - -\tower(31,1){16}\classoptions["h_5" below](31,1) -\d2(31,1)\d2(31,2)\d2(31,3,-1) % d2(h_5) = h_0 h_4^2 -\d3(31,4)\d3(31,5)\d3(31,6)\d3(31,7) \d3(31,8,1) % \d3(h_0^3 h_5) = s -\replaceclass[offset={(0,0)}](31,8) % d_0e_0 + h_0^7h_5 -\structline(31,8)(31,9) -\d4(31,8)\d4(31,9)\d4(31,10) % d4(d_0e_0 + h_0^7h_5) = P^2d_0, d4(h_0^8 h_5) = h_0 P^2d_0 -\etacubclass(31,1) -\divfourclass[](34,4) -\nustruct(31,3)\nustruct(31,2)\nustruct(31,1) -\nuclass(34,2) - -\class["n" above](31,5)\nuclass(31,5) - -\class(31,10) -\divfourclass["d_0e_0" {below right=0em,xshift=-5pt}](31,10) -\etaclass(31,8) -\divfourclass["l" {right=0em}](32,9) -\d3(31,8,-1) % d3(d_0e_0) = h_0^4 s = d3(h_0^7 h_5), see replaceclass above - -\d2(32,7,,-1)\d2(32,8,,-1) % d2(l) = h_0 d_0 e_0 -\d4(32,9,-1) % d4(h_0^2 l) = h_1 P^2d_0 - -\class["q"](32,6)\etaclass(32,6) - -\class["d_1"](32,4)\etaclass(32,4) -\nuclass(32,4)\nuclass(35,5) -\divtwoclass["p" above right](33,5) - -\class["P^3c_0"{xshift=4pt,yshift=2pt}](32,15)\etaclass(32,15) - -\class["P^4h_1"](33,17)\etasqclass(33,17) -\divfourclass["P^4h_2" right](35,19) - -\class(34,10) -\divfourclass["d_0g" left](34,10) -\etaclass(34,8) -\divfourclass["m" right](35,9) -\d2(35,7)\d2(35,8) % d2(m) = h_0 d_0 g - - -\class["t"](36,6)\etaclass(36,6) -\nustruct(34,6) - -\class(36,14) -\divfourclass["P^2g" left](36,14) -\etaclass(36,12) -\divfourclass["Pk" {right=0em}](37,13) -\d2(37,11)\d2(37,12) % d_2(P^1k) = h_0 P^2g - - -\tower(37,5){6}\classoptions["x"](37,5) - -\class["e_0g"](37,8)\etaclass(37,8) -\diveightclass["y" right](38,9) -\d4(37,8,-1) \d4(38,9)% d4(e_0g) = P^2g -\d2(38,6,-1)\d2(38,7,-1)\d2(38,8,-1) % d2(y) = h_0^3x - -\class(38,5) -\diveightclass["h_3h_5" below](38,5) -\etasqclass(38,2) - -\class["e_1" {below=0em,xshift=2pt}](38,4)\etasqclass(38,4) -\divfourclass["f_1" right](40,6) -\d3(38,4) % d_3(e_1) = h_2^2 n = h_1 t, see Bruner "A New Differential in the ASS" - -\tower(39,15){6}\classoptions["P^2i" {right=0em}](39,15) - -\class(38,18)\divfourclass["P^3d_0" {below left=0em}](38,18) -\etacubclass(38,16)\diveightclass["P^3e_0" {below=0em}](41,19) -\nustruct(38,18)\nustruct(38,17)\nustruct(38,16) -\etaclass(41,16)\divfourclass["P^2j" {below=0em}](42,17) -\d2(39,15)\d2(39,16) % d2(P^2i) = h_0 P^3d_0 -\d2(41,16,,1)\d2(42,17,,1) % d2(P^3e_0) = h_1^2 P^3d_0 -\d2(42,15)\d2(42,16) % d2(P^2j) = h_0 P^3e_0 - - - -\class["c_0 h_5" {below=-0.3em}](39,4)\etaclass(39,4) - -\d4(38,2,1,-1) \d4(38,3,1,-1) % d4(h_3h_5) = h_0x - - -\class(39,14) -\divfourclass["Pd_0e_0" {below=-0.2em}](39,14) -\etaclass(39,12) -\divfourclass["Pl" {below=0em}](40,13) -\d2(40,11)\d2(40,12) % d2(Pl) = h_0 P^2g -\d4(39,12)\d4(40,13,,-1) % d4(Pd_0e_0) = P^3d_0 - - - -\class["c_1g"](39,7) -\class["g^2"](40,8) -\class["u"](39,9)\etasqclass(39,9) -\divtwoclass["z"](41,11) -\class(41,5)\divfourclass["c_2"](41,5) -\class["v"](42,9) -\d2(42,9) % d2(v) = h_1^2 u - -\class["d_0^3"](42,12) - -\class["Ph_1h_5" {right=0em}](40,6)\etasqclass(40,6) -\divfourclass["Ph_2h_5" {right=0em}](42,8) - - -\class["P^4c_0"](40,18)\etaclass(40,18) - - -\class["P^5h_1"](41,20)\etasqclass(41,20) -\divfourclass["P^5h_2" right](43,22) - -\class(44,5)\divfourclass["g_2" below](44,5) -\etaclass(44,3) - -\class(44,18)\divfourclass["P^3g" left](44,18) -\etaclass(44,16)\divfourclass["P^2k" below](45,17) -\class["P^2r"](46,14) -\d2(45,15)\d2(45,16) % d2(P^2k) = h_0 P^3g -\d3(46,14)% d3(P^2r) = h0^2 P^2k -\class(45,4)\divtwoclass["h_4^3" below](45,4) - -\class(45,6)\divfourclass["h_5d_0" right](45,6) -\etaclass(45,4) - -\class["w"](45,9) - -\class["Pc_0g" left](45,12) -\d4(45,12) % d4(Pc_0g) = P^3g -\end{sseqdata} - -\printpage[name=S0ASS,page=0] - -\printpage[name=S0ASS,page=2] - -\printpage[name=S0ASS,page=3] - -\printpage[name=S0ASS,page=4] - -\begin{sseqpage}[name=S0ASS,page=5] -\structline[dashed,bend right=20](15,4)(16,7) -\structline[dashed](21,5)(22,8) -\structline[dashed,bend right=20](20,6)(23,9,-1) -\structline[dashed,bend right=20](23,6)(23,9,-1) -%\structline[dashed,bend right=20](32,6)(33,9) -%\structline[dashed,bend right=20](32,6)(33,9) -\classoptions["h_0^2i" left](23,9) -\classoptions["h_0^{10}h_5" left](31,11) -\classoptions["h_1h_5" below](32,2) -\classoptions["h_2h_5" below](34,2) -%\classoptions["h_0^2h_3h_5" {left=-0.1em}](38,4,1) -\classoptions["h_1h_3h_5" {below=-.4em}](39,3,1) -\classoptions["P^4h_3" {below=0em}](39,17) -\end{sseqpage} -\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.pdf Binary files differdeleted file mode 100644 index a2189c047b4..00000000000 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.tex deleted file mode 100644 index 001bdff30ad..00000000000 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.tex +++ /dev/null @@ -1,79 +0,0 @@ -%% -%% Package: spectralsequences.sty version 1.0 -%% Author: Hood Chatham -%% Email: hood@mit.edu -%% Date: 2017-06-18 -%% License: Latex Project Public License -%% -%% File: example_duggarKRAHSS.tex -%% -%% Draws the Atiyah Hirzebruch spectral sequence for KR. -%% To be honest, I can't really remember what this is, but based on the title, I copied it out of Duggar's paper computing KR. -%% - - - -\documentclass{article} -\usepackage[landscape]{geometry} -\usepackage{spectralsequences} -\begin{document} -\sseqset{Zclass/.sseq style={fill=none,draw,inner sep=0.6ex},2Zclass/.style={fill=none,rectangle,draw,inner sep=0.6ex}} -\begin{sseqdata}[ - name=KRAHSS, - Adams grading, - x range={-18}{17}, - y range={-10}{10}, - classes=fill, - no orphan edges, - run off differentials = {->}, - scale=0.5, - axes style=center, - tick step=4, - x tick gap=0.2cm, - y tick gap=0.4cm, - x axis gap=0.25cm, - y axis gap=0.25cm, - x axis extend start=0cm, - y axis extend start=0cm, - x axis extend end=0.25cm, - y axis extend end=0.25cm -] - -\draw[background,xshift=-0.5cm,yshift=-0.5cm,step=1cm,gray,very thin] (\xmin+0.1,\ymin+0.1) grid (\xmax+0.7,\ymax+0.7); -\pgfmathparse{\xmax+2} -\foreach \x in {0,4,...,\pgfmathresult} { - \class[Zclass](\x,0) - \foreach \z in {0,...,\pgfmathresult} { - \class(\x+\z+1,\z+1) - \structline(\x+\z,\z)(\x+\z+1,\z+1) - } -} - -\foreach \x in {4,12}{ - \foreach\z in {0,...,\xmax}{ - \d3(\x+\z,\z) - } - \replaceclass[2Zclass](\x,0) -} - -\foreach\x in {-4,-8,...,-\pgfmathresult}{ - \class[Zclass](\x,0) - \class(\x-2,0) - \foreach \z in {-1,...,-\pgfmathresult}{ - \class(\x+\z-2,\z) - \structline(\x+\z-1,\z+1)(\x+\z-2,\z) - } -} - -\foreach \x in {-6,-14}{ - \foreach\z in {-3,...,-\xmax}{ - \d3(\x+\z,\z) - } -} - -\end{sseqdata} -\printpage[name=KRAHSS,page=0] -\newpage -\printpage[name=KRAHSS,page=5] - -\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.pdf Binary files differdeleted file mode 100644 index f0fcae52c21..00000000000 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.pdf Binary files differdeleted file mode 100644 index d8e47ee1d18..00000000000 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.tex deleted file mode 100644 index fd48445ca0c..00000000000 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.tex +++ /dev/null @@ -1,129 +0,0 @@ -%% -%% Package: spectralsequences.sty version 1.0 -%% Author: Hood Chatham -%% Email: hood@mit.edu -%% Date: 2017-06-18 -%% License: Latex Project Public License -%% -%% File: example_mayss.tex -%% -%% I think this is the May SS for the sphere. May spectral sequences are annoying to draw neatly it turns out -- there's too much stuff in them. -%% It helps a lot if you start at E_2 though, since E_1 is polynomial. They also have the problem with their crappy grading that makes all -%% differentials the same length. I seem to have graded this weirdly, probably because the normal grading looked too bad. -%% - -\documentclass{article} -\usepackage{fullpage} -\usepackage{spectralsequences} - -\begin{document} -\NewSseqGroup\tower {m} { - \class["#1"](0,0) - \foreach\i in {1,...,14}{ - \class(0,\i) - \structline(0,\i-1,-1)(0,\i,-1) - } -} - -\NewSseqGroup\hone {m} { - \foreach\i in {1,...,#1}{ - \class(\i,\i) - \structline(\i-1,\i-1,-1)(\i,\i,-1) - } -} - -\NewSseqCommand\dtower {u(u)} { - \foreach\i in {0,...,10}{ - \d[yshift=\i]#1(#2) - } -} - - -\def\single(#1)#2{\class["#2"](#1)} - -\NewSseqGroup\htwo {m} { - \foreach \n in {0,...,5}{ - \tower(3*\n,\n){\sseqifempty{#1}{}{#1}\sseqpowerempty{h_2}{\n}} - \ifnum\n>0\relax - \structline(3*\n-3,\n-1,-1)(3*\n,\n,-1) - \fi - } -} - -\NewSseqGroup\htwosinglejoin {mm} { - \foreach \n in {0,...,5}{ - \single(3*\n,\n){\sseqifempty{#1}{}{#1}\sseqpowerempty{h_2}{\n}} - \ifnum\n>0\relax - \structline(3*\n-3,\n-1,-1)(3*\n,\n,-1) - \fi - } - \foreach \n in {0,...,#2}{ - \structline(3*\n,\n,-1)(3*\n,\n+1,-1) - } -} - - - -\begin{sseqdata}[name=may, degree={-1}{1-#1},x range={0}{13}, y range={0}{13},class labels=below right,differentials=blue,x axis extend end=23pt,draw] -\tower(7,1){h_3} -\htwo(0,0){} -\classoptions[label position=above left](9,3) -\hone(0,0){3} -\htwo[label position={xshift=3pt,yshift=2pt}](4,4){b_{2,0}} -\dtower2(4,4,-1,-1) % d2(b_{2,0}h_0^n) = h_2h_0^{n+2} -\d2(4,4,-1,1) % d2(b_{2,0})= h_2h0^2 + h1^3 - -%\hone(4,4){3} -\htwo(8,8){b_{2,0}^2} -\hone(8,8){3} -\dtower4(8,8,,1) % d4(b_{2,0}^2) = h3 h0^4 -%\hone(8,8){3} -\hone(7,1){2} - - -\htwosinglejoin(7,4){x_7}{4} -\dtower2(7,4,2,-1) -\hone(7,4){2} -\htwosinglejoin(11,8){x_7b_{2,0}}{4} -\htwosinglejoin(10,4){b_{2,1}}{3} -%\hone(10,4){1} -\d2(10,4,-1,2) % d2(b21)=h2^3+h3h1^2 -\dtower2(10,4,1,1) % d2(b21 h0^n) = h2^3 h0^n - - -\tower(11,5){h_3b_{2,0}} -\tower(12,6){b_{3,0}} -\dtower2(12,6,-1,-1) - -\htwo(12,12){b_{2,0}^3} -\dtower2(12,12,-1,1) % d2(b20^3 h_0^n) = h0^n b20^2 d2(b20) = h0^{n+2} h2 b20^2 -\d2(12,12,-1,2) % d2(b_{2,0}^3)= b20^2 d2(b20) = h_2 h0^2 b20^2 + h1^3 b20^2 -\hone(12,12){3} -\replaceclass(11,11) - -\structline(11,10)(11,11) -\structline(10,10,2)(11,11) - -\replaceclass(3,3) - -\structline(2,2)(3,3) -\structline(3,2)(3,3) - - - - - -\replaceclass(9,3) -\structline(6,2)(9,3) -\structline(8,2)(9,3) - - - -%\dtower2(12,6,2,-1) -\end{sseqdata} -\printpage[name=may] -\newpage -\printpage[name=may, page=4] -\newpage -\printpage[name=may, page=5] -\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.pdf Binary files differdeleted file mode 100644 index db413adf758..00000000000 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.pdf +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/hatcher.pdf Binary files differindex ddf0032ed0d..893474ce3b1 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.pdf +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/hatcher.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/hatcher.tex index a200354d1f1..ff079110c4b 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.tex +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/hatcher.tex @@ -1,19 +1,17 @@ %% -%% Package: spectralsequences.sty version 1.0 +%% Package: spectralsequences v1.1.0 %% Author: Hood Chatham %% Email: hood@mit.edu -%% Date: 2017-06-18 +%% Date: 2017-08-02 %% License: Latex Project Public License %% %% File: example_hatcher.tex %% -%% This comes from Hatcher's spectral sequences book. I think it's a good demonstration of the flexibility of sseqpages. +%% This comes from Hatcher's spectral sequences book. I think it's a good demonstration of the flexibility of sseqpages. %% Thanks to Antonio Ruiz for suggesting it. %% -\documentclass{article} -\usepackage[landscape,margin=1cm,top=2cm]{geometry} -\usepackage{spectralsequences} +\documentclass{spectralsequence-example} \usepackage{amssymb} \def\Z{\mathbb{Z}} @@ -22,18 +20,18 @@ 0/.sseq style={"0",draw=none}, homological Serre grading, classes={draw=none,inner sep=0.2em}, - tick gap=0.7em, + %tick gap=0.7em, } \begin{sseqdata}[ name=hatcherex1, permanent cycles={draw,minimum width={width("$Z_2$")+0.85em}}, yscale=0.6, - axes gap=1.2em, - axes clip padding=0em + axes gap=0.5cm, + tick gap=1em, ] \begin{scope}[background,opacity=0.1] \foreach \n in {1,3,...,9}{ - \fill(-1.1,\n-0.5)--(-1.1,\n+0.5)--(0,\n+0.5)--(\n+0.5,0)--(\n+0.5,-1.6)--(\n-0.5,-1.6)--(\n-0.5,0)--(0,\n-0.5)--cycle; + \fill(-1.3,\n-0.5)--(-1.3,\n+0.5)--(0,\n+0.5)--(\n+0.5,0)--(\n+0.5,-2)--(\n-0.5,-2)--(\n-0.5,0)--(0,\n-0.5)--cycle; } \end{scope} @@ -73,6 +71,8 @@ \end{sseqdata} \printpage[name=hatcherex1,page=0] +\vskip30pt + \begin{sseqdata}[ name=hatcherex2, yscale=0.6, @@ -81,7 +81,7 @@ \begin{scope}[background,opacity=0.1] \foreach \n in {1,3,...,9}{ - \fill(-1.1,\n-0.5)--(-1.1,\n+0.7)--(0,\n+0.7)--(\n+0.5,0)--(\n+0.5,-1.6)--(\n-0.5,-1.6)--(\n-0.5,0)--(0,\n-0.5)--cycle; + \fill(-1.3,\n-0.5)--(-1.3,\n+0.7)--(0,\n+0.7)--(\n+0.5,0)--(\n+0.5,-2)--(\n-0.5,-2)--(\n-0.5,0)--(0,\n-0.5)--cycle; } \end{scope} diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/unstable_ASS_SO.pdf b/Master/texmf-dist/doc/latex/spectralsequences/examples/unstable_ASS_SO.pdf Binary files differnew file mode 100644 index 00000000000..2e6c622eb02 --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/unstable_ASS_SO.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/examples/unstable_ASS_SO.tex b/Master/texmf-dist/doc/latex/spectralsequences/examples/unstable_ASS_SO.tex new file mode 100644 index 00000000000..159549a9c2e --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/examples/unstable_ASS_SO.tex @@ -0,0 +1,78 @@ +%% +%% Package: spectralsequences v1.1.0 +%% Author: Hood Chatham +%% Email: hood@mit.edu +%% Date: 2017-08-02 +%% License: Latex Project Public License +%% +%% File: example_unstable_ASS_SO.tex +%% +%% From Kathryn Lesh: A conjecture on the unstable Adams spectral sequences for SO and U top of page 21. +%% http://hopf.math.purdue.edu//Lesh/uass-so-model.pdf +%% + +\documentclass{spectralsequence-example} + +\begin{document} +\sseqset{ + M3M2/.sseq style = { fill }, + M4M3/.sseq style = { circlen = 2, fill } +} +%\pgfkeys{/sseqpages/class/M4M3/.show code} + +\NewSseqCommand \tower { O{} d() } { + \IfNoValueF{#2}{\class(#2)} + \savestack + \begin{scope}[#1] + \DoUntilOutOfBounds{ + \class(\lastx,\lasty+1) + \structline(\lastclass1)(\lastclass) + } + \end{scope} + \restorestack +} + +\NewSseqCommand \etaclass {} { + \class(\lastx+1,\lasty+1) + \structline(\lastclass1)(\lastclass) +} + +\NewSseqCommand \divtwoclass {} { + \class(\lastx,\lasty-1) + \structline(\lastclass1)(\lastclass) +} + +\begin{sseqdata}[ name = SO_UASS, tick step = 5, x range = {0}{20}, Adams grading, y range={0}{10} ] +\class(1,0) +\tower(3,0) + +\begin{scope}[M3M2] +\tower(7,0) +\etaclass\etaclass + +\tower(11,3) + +\class(14,4) +\divtwoclass\divtwoclass +\etaclass\etaclass\etaclass +\divtwoclass\divtwoclass + +\class(16,5)\etaclass +\end{scope} + +\begin{scope}[M4M3] +\tower(15,0) +\etaclass\etaclass\etaclass +\divtwoclass\divtwoclass +\end{scope} + +\d2(15,0)\d2(15,1)\d2(15,2) +\d2(16,1)\d2(17,2)\d2(18,3) +\d2(18,2)\d2(18,1) +\end{sseqdata} + + +\printpage[ name = SO_UASS, page = 2 ] +\newpage +\printpage[ name = SO_UASS, page = 3 ] +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.pdf b/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.pdf Binary files differnew file mode 100644 index 00000000000..054c2d23478 --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.tex b/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.tex new file mode 100644 index 00000000000..a4911b459c6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.tex @@ -0,0 +1,121 @@ +\input spectralsequencesmanualpreamble + +\def\eatclnifpresent#1{#1} +\def\pgfkeysname{pgfkeys} +\def\file#1{\path{#1.code.tex}} +\begin{document} +\title{A brief overview of the \\ \sseqpages\ code} +\author{Hood Chatham\\\mailtoHC} +\maketitle +\section{Introduction} +The basic idea is comparable to a more elaborate version of \tikzcdpkg. +We plan to draw multiple copies of a spectral sequence, so the commands are not issued inside of a picture environment. +Instead, all information must be stored to draw later. The |\sseq@savedpaths| is responsible for storing the collection of objects of the spectral sequence. + +The user defines ``classes'' (which correspond roughly to generators of the spectral sequence $E_2$ / $E_1$ page). +From the point of view of the programmer, a class is an object with a death page (either infinite or finite) signalling on which page it is the source or target of a differential +and some pile of information on how to draw it. When the user calls the |\class| command, it makes a new class object with an appropriate name and stores the +information to tell \spectralsequences\ how to draw the class later, and sets the page to be infinite. A macro informing spectralsequences about the class +is added to |\sseq@savedpaths| so that it can be drawn later if appropriate. + +The |\d| command is similar -- we set the page of the source and target to be the current page and also the pages of any relevant structlines, store the page of the differential and the data needed to draw it, and add the differential to |\sseq@savedpaths|. + +The |\structline| command saves code to draw a line, and also figures out what page it should die on based on the smaller of the two death pages of the source and target. If the source and target haven't been killed yet, it hooks into them so that |\d| knows to set the page of this structline too. + +Now to draw a page of the spectral sequence, we start up a \tikzpictureenv\ environment, draw some axes, +walk across |\sseq@savedpaths|, and for each class, we check whether the death page of the class is greater than or equal to the current page and if so we draw a corresponding +pgf/tikz node. Similarly, we draw the differentials that lie on exactly the current page, and the subset of the structure lines with death page later than the current one. + +This is the core idea of the package. In addition to these core features are many important reusability features. For instance, we need a way to define reusable user macros that draw collections of classes and we need looping constructs. + +So, having heard this simple description, a reasonable question to ask is: why does it take in excess of 8000 lines of TeX code to accomplish these simple tasks? There are a few reasons. Firstly, the package handles a lot of use cases and has a quite a few different features and there is a large amount of intrinsic complexity to getting these things right. Another huge reason is that \TeX\ is a completely unreasonable coding environment. This is responsible for a good deal of the complexity in \file{sseqparsers}, for example. + +Perhaps the biggest single contributor to code complexity is performance. \tikzname\ is very robust, but it is not fast. \spectralsequences\ draws roughly cubically many classes in large diagrams, and my larger test examples have as many as 5,000 classes. If each class takes an extra millisecond a second to draw, that comes out to an extra five seconds of compilation time. Because of this, unless the performance critical drawing code is super optimized, the package will be way too slow on large diagrams. Most of the added complexity due to performance considerations is contained in \file{sseqdrawing}, but the hard parts of the key value code are all related to performance too. + +The last major source of complexity is the robust error handling code. Most \LaTeX\ packages have crappy error handling and result in inscrutable errors even in relatively reasonable use conditions. There are a two main reasons for this as far as I can tell: \LaTeX\ doesn't have good error handling tools and most people who write \LaTeX\ packages are not primarily programmers and have other priorities than ensuring that their packages have clean failure modes. The files \file{sseqmessages} and \file{sseqforeach} are entirely devoted to error handling, and almost all of the complexity of \file{sseqmacromakers} is tied up in error handling too. + + + +\section{Load Store} +The file \file{sseqloadstore} defines two storage systems. The point of these systems is to ensure that unrelated spectral sequences do not interfere with each other. One system is faster and relatively storage intensive, and it is for macros that contain global information about the spectral sequence. These macros have default values which can be changed using |\sseqset|. The other system is for storing the data about the spectral sequence objects (classes, differentials, structlines, etc). This file is short and simple, but the seemingly innocuous features provided here lead to huge simplifications in much of the rest of the code. + +The first system works by making a list |\sseq@storelist| of the commands that need to be stored. It defines commands |\sseq@storecmds| and |\sseq@getcmds| which iterate over |\sseq@storelist| and copy each command between |\sseq@whatevercommand| and |\sseq@whatevercommand@@@\metatt{sseqname}|. Each command also has a default value stored in |\sseq@whatevercommand@@default|. This default can be changed by the user using |\sseqset| outside of a spectral sequence. There is also a command |\sseq@storelist@setdefaults| which loads the default values of all of the commands in |\sseq@storelist|. At the beginning of a \sseqdataenv\ or \sseqpageenv\ environment, if the spectral sequence is new then |\sseq@storelist@setdefaults| is run, and otherwise |\sseq@getcmds| is run. At the end of the \sseqdataenv\ environment, |\sseq@storecmds| is run. + +The second system basically is just semantic sugar for indexing into a command that has the name of the current spectral sequence inserted into it: the command |\sseq@obj{some name}| just expands to |\csname sseq.\sseq@thename.some name\endcsname|. This allows different spectral sequences to have different name spaces. A large number of commands to manipulate this are provided. All changes to objects are made global, so at the end of a \sseqpageenv\ environment, any changes that have been made must be reverted. The command |\sseq@cleanup@obj| checks if we are in a context where changes will have to be reverted, checks if an old value of the current object has been stored yet, and if neither of these are true, it adds reverting the current object to a ``cleanup'' command to be run at the end of the current environment. + +\section{Messages} +The file \file{sseqmessages} defines the error handling code. It uses the delightful l3msg infrastructure which separates message content from the position the errors are triggered in and makes much more attractive error messages. One deficiency for my purposes in l3msg though is that it doesn't have very many hooks. My package knows a lot about the circumstances under which most errors trigger and wants to tell the user about this. The basic idea for this approach came from \tikzcdpkg. At the beginning of the \tikzcdenv\ environment, the |\errmessage| command is patched to add an annotation explaining what cell in the matrix the error occurred in. This is because \tikzcdenv\ has a two-pass algorithm, and so errors can occur far away from the code that triggered them. + +Anyways, I have a fairly complicated pile of extra information to add into the picture. Firstly, I reconstruct what the user said as closely as possible. This is done inside of \file{sseqmacromakers} and \file{sseqmain}. I also assemble a stack trace that indicates all loops and user macros and all loop variable values. I assemble all this context information and a little more, and then make an annotation message accordingly. All of the many cases here are handled using a pile of horrible spaghetti code. + +The annotation setup code is not expandable, so it cannot happen as the error is written to stderr. We need a setup hook before the error is triggered, we need a hook inside the body of the message, and we need a cleanup hook after the error is done to remove any local changes the setup code made. I make a copy of |\__msg_error_code:nnnnnn| and add these two hooks to the beginning and end. The annotation itself is prepended to |\__sseq_hooked_msg_see_documentation_text:n| which is conveniently located inside of the message text. + +The other interesting thing in this file is my code for handling |\end| mismatches. Because of the need for nested environment definitions, \LaTeX\ only checks that the environment being |\end|ed matches the current environment after running the |\end| code. However, the code for |\end{sseqpage}| tries to draw a picture, and drawing this picture depends on a large amount of state. If the current environment isn't \sseqpageenv, none of this state is actually present and so hundreds of incomprehensible low level errors happen before the check end code is run and \LaTeX\ gives the environment mismatch error. The fix for my package is to run my own checkend code, which is pretty simple. See my \href{https://tex.stackexchange.com/questions/378174/why-does-checkend-occur-after-running-endenvironment}{tex stack exchange question} for more details. + +\section{Loops} +The file \file{sseqforeach} is responsible for defining looping constructs. It's mostly pretty simple. The first half defines |\DoUntilOutOfBounds|, which repeats some block of stack based code until the top of the stack is out of bounds. The most complicated part of this is the descent check -- it periodically checks that the top of the stack has moved towards the boundary of the page to prevent infinite loops. + +The other part of this file patches the |\foreach| command from \tikzname\ in order to make it inform \sseqpages\ what the user said for the foreach loop (as best as I can approximate) and what the loop variables are. This is for error messages -- the ``what the user said'' part will go into the stack trace, and the loop variables will be listed. + + +\section{Macro Makers} +The file \file{sseqmacromakers} defines commands to define commands. It is built on top of \xparsepkg\ but adds a large number of features specific to my package. Unfortunately, it depends on \xparsepkg\ internals and \xparsepkg\ is not yet stable. None of these dependencies are mission critical, but they significantly increase usability. I have attempted to make fallback code that will work even if incompatible \xparsepkg\ changes are made, but this is incomplete. + +Like \tikzname, \spectralsequences\ defines a bunch of commands that only make sense to use inside of certain environments. Thus, we define the command |\class| as |\sseq@class| and at the beginning of the \sseqdataenv\ or \sseqpageenv\ environments, we run a command |\sseq@installmacros| that does a bunch of things like |\let\class\sseq@class|. I want to use \xparsepkg\ to define |\sseq@class|, but the problem I run into is that \xparsepkg\ stores the name of the command being defined and uses that name in certain error messages. These error messages would refer incorrectly to |\sseq@class| instead of |\class|. The fix for this is pretty boring -- it just involves redefining macros back and forward. Anyways, I make a command |\sseq@DeclareDocumentCommandAs| that defines a command using \xparsepkg\ that gives errors as if it were named a specific other command. I use this for defining most of the user-facing macros. + +The rest of the file is responsible for defining |\NewSseqCommand| and |\NewSseqGroup|. These commands are relatively simple in principle -- the point of |\NewSseqCommand| is almost already accomplished by \xparsepkg\ already. Most of the complexity is introduced in order to improve the error messages that \spectralsequences\ produces. In particular, I want to reconstruct as closely as possible what the user said when they ran the command. This way, if an error occurs nested several commands deep, or inside of a loop, the user can still get a decent idea about where the error is coming from. + + +\section{Keys} +There are different options that make sense for the |\class| command versus for the |\d| command, and some options that do make sense for both need distinct handling. However, there are also overlaps. Thus, the key value system is naturally a tree structure. \pgfkeysname\ has support for ``directories'' which proves extremely valuable. Each directory has an unknown option handler, which by default throws an error. I have a command |\sseq@passoptionto| that hands the keys to the parent directory. +% The directory structure is as follows: +%\begin{tikzpicture} +%\node {sseq@keys@unknown} child { +% node { /sseqpages } child { +% node {/sseqpages/class} +% node {/sseqpages/differential} +% } +%\end{tikzpicture} + +\sseqpages\ is a two-pass algorithm. On the first pass, it creates the data structures necessary to encode the spectral sequence, and on the second pass, the spectral sequence is actually drawn. The second basic design feature of the \sseqpages\ key value system is that keys need to be able to do different things on the first and second pass. This is accomplished very simply -- I use two wrapper macros |\sseq@options@firstpass| and |\sseq@options@secondpass| for code that should only happen respectively on the first and second pass. To use them, I basically just define |\sseq@options@firstpass| as a no-op and |\sseq@options@secondpass| to add its argument to a macro to be stored for later use at draw time. However, in some circumstances I need to redefine these two hooks, either to delete their argument or to evaluate there arguments. + +Once we have this basic design, we can implement many of the basic features of \sseqpages. There is a problem, which is that I want to mix \tikzname\ keys with keys that my package defines gracefully. However, \tikzname\ keys execute code that assumes that we are in the middle of drawing something. One early design approach I used was to define my package's unknown option handler to do validation only on \tikzname\ keys on the first pass, and then store the keys and run |\pgfkeys| again to evaluate them at draw time. + +The third major design goal is to allow ``styles'' that change the display of logical collections of classes. That is, the user should be able to say something ``permanent cycles = red'' and change all permanent cycles (as identified by \spectralsequences) to red. Originally I implemented this by storing the keys that the user provided and using |\pgfkeys| at draw time to evaluate them each time I made a class. Here I ran into a problem: |\pgfkeys| is very slow. When I used this design and compiled a 5,000 class spectral sequence, saying \codeverb|classes = {red, red, red}| took over a second longer than not saying it. This was obviously an unsatisfactory state of affairs. The solution to this problem sped up the package tremendously, but at the cost of a large increase in design complexity of the key value system. + +The solution of course is to only run |\pgfkeys| on any given key once and store the result, rather than repeatedly using |\pgfkeys| on the same input. In order to do this, I needed to hook into |\pgfkeys| and change it so that every time that it would normally evaluate code, it should just store it into |\sseq@savedoptioncode|. Conveniently enough, there are only two places where |\pgfkeys| emits code, so this basic idea is easy enough. The problem is that many keys execute recursive calls to |\pgfkeys| that are state-dependent. Normally, the key code is executed instantly, so it can reasonably expect the state it needs to be preserved. However, if I defer the body of a key that makes such a recursive call, pieces of the necessary state are lost before the code is executed and it breaks. Thankfully, all such state-dependent recursive calls are made using the command |\pgfkeysalso|. So the fix is to first walk across the key code and find any instances of |\pgfkeysalso| that occur in it, and run these |\pgfkeysalso|s. Once this recursive expansion has taken place, the resulting code is independent of the state of the key value system's state and is safe to store for later use. + +\section{Main} +The \file{sseqmain} defines the main environments and user commands. The logic is pretty much as described in the overview section, and nothing super notable happens beyond that. There are a lot of details to get right, in particular a lot of the mess in this file is due to the complicated interfacing with \file{sseqkeys}. + + + +\section{Parsers} +The file \file{sseqparsers} is a bit of a grab bag. The code is grouped by structure more than by content, hence the name. Most importantly, it has all of the coordinate parsers that define the coordinate syntax. This file uses some amount of \LaTeX3 programming, though it is a bit of a chimera. There are three main reasons I did not use \LaTeX3 programming more broadly or consistently. The first is inexperience: I simply haven't used \LaTeX3 much. The second is that \LaTeX3 and \tikzname\ do not get along all that well. This is fixable but a pain. The third is that \LaTeX3 has a lot of fancy convenient robust macros, but I generally need sloppy fast macros. If I can write a faster macro that adds a large number of weird preconditions, for the purposes of \spectralsequences\ that is probably better. + +One very good reason to use |\ExplSyntax| in this file is that it gets rid of a lot of space hazards. In this file, I really just make use of the variants of |\exp_args| and |\exp_last_unbraced|. These macros are tremendous innovations that greatly improve expandable macro writing. + +One major annoyance is the need for |\sseq@ifintexpr|. This is a sanitizer for |\numexpr|. I don't understand why the \eTeX\ source doesn't contain an input sanitizer! \TeX\ does not support catch blocks or exceptions, so because we can't ask forgiveness we have to ask for permission. Anyways |\sseq@ifintexpr| was difficult to write and is slow. Together, |\sseq@ifintexpr| and |\numexpr| are still much faster than |\pgfmathparse| though, and the input sanitization only has to occur at the user input stage, so all of the internal uses of |\numexpr| don't pay this cost. Contrast the case for |\sseq@ifpgfmathexpr| which is my sanitizer for |\pgfmathparse|. All it does is redefine |\pgfmath@error| to throw away the error, set a flag, and quit out of |\pgfmathparse|. It was orders of magnitude easier to write. + +There is a parser that does some manipulation on \tikzname\ commands to process the options and the coordinates. The options processing is primarily for speed purposes, and the coordinate parsing I do because I want to make several changes to the way that tikz processes coordinates for the sake of better interoperability with the rest of the \spectralsequences\ feature set (these changes are unfortunately quite involved...). A third thing gained by this is that \sseqpages\ can know that the path looks reasonably close to being syntactically correct at compile time (though I don't run much of the tikz parser, so there's only so much it can tell). + +There are a few tricks in here that I think are relatively interesting. The one that I find the most interesting is as follows: suppose you have an expandable macro that needs error handling. The problem with errors in expandable macros is that the errors themselves are not expandable. My solution is to write the macro so that it either a) satisfies whatever the postcondition of the macro was supposed to be or b) is of the form |\protecterror{\someerror}|. Before the |\edef| occurs, the |\protecterror| is defined to expand to |\noexpand\protecterror\unexpanded{#1}|, so that it hangs around after being |\edef|'d. Suppose we are writing |\edef\theoutput{\somemacro{some input}}|. Then when you want to check for the error, redefine |\protecterror| to globally set some error flag, then say |\setbox0=\hbox{\theoutput}| in a local scope. Because |\hbox| evaluates its argument, this throws an error if |\theoutput| contains an error, and also |\protecterror| sets the error flag. However, |\theoutput| can have other random junk in it, which won't leak into the output. This solution doesn't depend on the error being in the top level of |\theoutput|, it can be in as deeply nested braces as necessary and doesn't require |\scantokens| hacking. It doesn't rely on any particular structure features other than the presence or absence of the error. +Anyways, this is how I manage to have robust error messages with expandable macros. Obviously this isn't applicable to many circumstances, but in my code, my need for expandable macros is always in situations where I have a macro whose evaluation depends on temporary state, but whose result needs to be stored inside of a command (not an |\hbox|) for later handling. + + +\section{Drawing} +The most notable aspect of the \file{sseqdrawing} is that significant chunks of it need to be highly optimized. The command that is used the most times in a normal spectral sequence is the one that prints a class. It is important to be aware of differences between the efficiency of different low level pdf commands. It is worth pointing out that I have fallen into the trap in some places of optimizing code that didn't need optimization. + +In order to maintain all the features of \tikzname\ while being as fast as possible, all drawing code is done in two ways -- one way that is fast and uses low level \pgfpkg, and a second way that is slow and uses \tikzname\. Certain options the user asks for cause the fallback slow code to be run instead of the fast code. It is actually surprising to me how easy it has actually been to maintain this two-method code. It's unusual for the class drawing code to have to resort to the fallback, but if an edge is bent or has a label on it, \sseqpages\ uses \tikzname\ to draw it. Both of these are reasonably standard use cases, but hopefully they will only ever apply to a small percentage of edges in any diagram. + +In order to build the relevant chunks of the fast code, I copied the \tikzname\ main loop and deleted stuff until I got to the minimal subset of code that works for my purposes. +One of the main enemies of speed in this section (other than the \tikzname\ parser and main loop which I avoid by using \pgfpkg) is the |\pgfmathparse| command, which comes up a lot even in \pgfpkg\ code and is quite slow. As much as possible, I try to get away with using the \eTeX\ |\numexpr| and |\dimexpr| commands, both of which are implemented in the \eTeX\ binary and so are very fast. These two commands both have annoying limitations, and it can be difficult to accomplish certain tasks with them. However, it is worth it in interest of speed. In fact, |\numexpr| is actually preferable to |\pgfmathparse| for most of the code outside of the drawing file, because \sseqpages\ deals primarily with integers and basic arithmetic |+-*/()| that |\numexpr| handles, and because |\pgfmathparse| has the unfortunate property of turning all integers into floats. + +The other difficulty that arises here is that \spectralsequences\ needs to be able to handle very large diagrams. In a normal |\tikzpicture|, the distance from |(0,0)| to |(1,0)| is 1cm. If you use |scale=0.5| for instance, and use a coordinate |(3,0)|, then the order that multiplications are performed in is $(3\times 1\textup{cm})\times 0.5$. The issue is that 600cm is an overflow, and this overflow occurs even if you have a very small scaling factor that would make that coordinate fit onto the page (which is probably a bit less than 600cm long). The solution is instead of applying a scaling transformation, I adjust the position of the coordinate (1,0), say to be 0.01cm. Then $600*0.01\textup{cm}= 6\textup{cm}$ leads to no overflow. This leads to various complications in the drawing code. + +There's a second more problematic issue though. Suppose that I want to zoom in on the range from 600 to 700 on a very large spectral sequence. The scale I want to use to fit this to the page will cause an overflow. To fix this I subtract an offset between the minimum and maximum value of x from every single coordinate. This adjusts the range so that it actually goes from say 0 to 100, and then no overflow occurs. + +The issue then is how to make this offset also apply to \tikzname\ primitives. In order to do this I patch into the \tikzname\ coordinate parser and every time it parses a coordinate add in the offsets in the appropriate place. There are a few spots where this goes awry and offsets are added to coordinates that are calculated relative to a another coordinate with the offset already calculated in (the |to| keyword is the main offender here), so there are second order fixes to prevent this. + + +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual-layoutcharts.tex b/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual-layoutcharts.tex new file mode 100644 index 00000000000..ba0a774df29 --- /dev/null +++ b/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual-layoutcharts.tex @@ -0,0 +1,204 @@ +\sseqset{ + distance label/.sseq style = {orange,{<[width = 4pt]}-}, + description/.sseq style = {black, align = center}, + title style={yshift=25pt,font=\Large} +} +\catcode`\| = 12 % | is active to be verbatim, but we need to use it here for our arrowhead specification. +% +\begin{sseqpage}[ grid = chess, + x range = {0}{5}, y range = {0}{5}, math nodes = false, + x axis clip padding = 0.15cm, y axis clip padding = 0.15cm, + right clip padding = 0.2cm, top clip padding = 0.2cm, axes gap = 25pt, + title = {Axis type border layout}, +] +\begin{scope}[background] +\sseq@savedpaths@add{\color{red}\pgfsetpath\sseq@theclippath\pgfusepath{draw}} +\path (\sseq@xmin-3,\sseq@ymin-3) -- (\sseq@xmax+3,\sseq@ymax+3); +\end{scope} + +\begin{scope}[background,|-|,blue] +% axis clip padding +\draw[shift = {(1,-\sseq@xaxisgap)}] (0,0)--(0,\sseq@xclip@axisgap-0); +\draw[distance label,shift = {(1,-\sseq@xaxisgap+\sseq@xclip@axisgap/2)}] (0,0) .. controls (0.5,0) .. (0.5,-1.5) + node[description, below] {x axis\\ clip padding}; +% +\draw[shift = {(-\sseq@yaxisgap,1)}] (0,0)--(\sseq@yclip@axisgap,0); +\draw[distance label,shift = {(-\sseq@yaxisgap+\sseq@yclip@axisgap/2,1)}] (0,0) .. controls (0,0.3) .. (-0.7,0.3) +node[description, left] {y axis\\ clip padding}; + + +% border clip padding +\draw[shift = {(\sseq@xmax cm + \sseq@xaxis@end@extend-0.02cm,\sseq@ymax - 1)}] (-0.02cm,0)--(\sseq@clip@padding@right,0); +\draw[distance label, shift = {(\sseq@xmax cm + \sseq@xaxis@end@extend+\sseq@clip@padding@right/2,\sseq@ymax-1)}] (0,0) .. controls (0,-0.7) ..(0.7,-0.7) + node[description, right] {right clip\\ padding}; +% +\draw[shift = {(\sseq@xmax - 1,\sseq@ymax cm+\sseq@yaxis@end@extend)}] (0,0)--(0,\sseq@clip@padding@top); +\draw[distance label, shift = {(\sseq@xmax -1,\sseq@ymax cm+\sseq@yaxis@end@extend+\sseq@clip@padding@top/2)}] (0,0) .. controls (0.2,0) .. (0.2,0.3) + node[description, above] {top clip\\ padding}; + +% axis tail +\draw[shift = {(\sseq@xmin-\sseq@yaxisgap-0.02cm,\sseq@ymin-\sseq@xaxisgap+0.1cm)}] (0,0) -- (-\sseq@xaxis@tail, 0); +\draw[distance label,shift = {(\sseq@xmin-\sseq@yaxisgap-0.02cm-\sseq@xaxis@tail/2,\sseq@ymin-\sseq@xaxisgap+0.1cm)}] (0,0) .. controls (0,0.5) .. (-1,0.5) + node[description, left]{x axis\\ tail}; +% +\draw[shift = {(\sseq@xmin-\sseq@yaxisgap+0.1cm,\sseq@ymin-\sseq@xaxisgap-0.02cm)}] (0,0) -- (0, -\sseq@yaxis@tail); +\draw[distance label,shift = {(\sseq@xmin-\sseq@yaxisgap+0.1cm,\sseq@ymin-\sseq@xaxisgap-0.02cm-\sseq@yaxis@tail/2)}] (0,0) .. controls (0.5,0) .. (0.5,-1) + node[description, below]{y axis\\ tail}; + +% extend end axis +\draw[shift = {(\sseq@xmax,\sseq@ymin-\sseq@xaxisgap-0.1cm)}] (0,0)--(\sseq@xaxis@end@extend,0); +\draw[distance label,shift = {(\sseq@xmax cm+\sseq@xaxis@end@extend/2,\sseq@ymin-\sseq@xaxisgap-0.1cm)}] (0,0) -- (0,-0.8) + node[description, below] {x axis\\ extend end}; +% +\draw[shift = {(\sseq@xmin cm-\sseq@yaxisgap-0.1cm,\sseq@ymax)}] (0,0)--(0,\sseq@yaxis@end@extend); +\draw[distance label,shift = {(\sseq@xmin cm- \sseq@yaxisgap-0.1cm,\sseq@ymax cm+\sseq@yaxis@end@extend/2)}] (0,0) -- (-0.6,0) + node[description, left] {y axis\\ extend end}; + + +% tick gap +\draw[shift = {(\sseq@xmin+\sseq@xmax/2+0.2,-0.5-\sseq@xaxisgap)}] (0,0)--(0,-\sseq@xlabelgap); +\draw[distance label,shift = {(\sseq@xmin+\sseq@xmax/2+0.2,-\sseq@xlabelgap/2-\sseq@xaxisgap)}] (0,0) .. controls (0.5 ,0) .. (0.5,-0.8) + node[below,black]{x tick gap}; +% +\draw[shift = {(-0.5-\sseq@yaxisgap,\sseq@ymin+\sseq@ymax/2+0.2)}] (0,0)--(-\sseq@ylabelgap,0); +\draw[distance label,shift = {(-\sseq@yaxisgap -\sseq@ylabelgap/2,\sseq@ymin+\sseq@ymax/2+0.2)}] (0,0) .. controls (0, -0.3) .. (-0.5,-0.3) +node[left,black]{y tick gap}; + +% axis gap +\draw[shift = {(\sseq@xmax cm+0.17cm,\sseq@ymin cm-\sseq@xaxisgap+0.02cm)}] (0,0) -- (0, \sseq@xaxisgap); +\draw[distance label,shift = {(\sseq@xmax cm+0.17cm,\sseq@ymin cm-\sseq@xaxisgap/2+0.02cm)}](0,0) .. controls (2,0) .. (2,0.5) +node[above,description]{x axis gap}; +% +\draw[shift = {(\sseq@xmin cm-\sseq@yaxisgap+0.02cm,\sseq@ymax cm+0.17cm)}] (0,0) -- (\sseq@yaxisgap,0); +\draw[distance label,shift = {(\sseq@xmin cm-\sseq@yaxisgap/2+0.02cm,\sseq@ymax cm+0.17cm)}](0,0)--(0,1) %.. controls (0,1) .. (0.5,1); +node[above,description]{y axis gap}; +\end{scope} + +\class(0,0) +\class(5,0) +\class(0,5) +\end{sseqpage} + + +\begin{sseqpage}[ grid = chess, axes type=frame, + title = {Axes type frame layout}, + x range = {0}{5}, y range = {0}{5}, math nodes = false, + x axis clip padding = 0.15cm, y axis clip padding = 0.15cm, + right clip padding = 0.2cm, top clip padding = 1cm, axes gap = 25pt +] +\begin{scope}[background] +\sseq@savedpaths@add{\color{red}\pgfsetpath\sseq@theclippath\pgfusepath{draw}} +\path (\sseq@xmin-3,\sseq@ymin-3) -- (\sseq@xmax+3,\sseq@ymax+3); +\end{scope} + +\begin{scope}[background,|-|,blue] +% axis clip padding +\draw[shift = {(\sseq@xmax+0.5,-\sseq@xaxisgap)}] (0,0)--(0,\sseq@xclip@axisgap); +\draw[shift = {(-\sseq@yaxisgap,\sseq@ymax+0.5)}] (0,0)--(\sseq@yclip@axisgap,0); +\draw[distance label,shift = {(\sseq@xmax+0.5,-\sseq@xaxisgap+\sseq@xclip@axisgap/2)}] (0,0) .. controls (1,0) .. (1,-0.3) +node[description, below] {x axis\\ clip padding}; +\draw[distance label,shift = {(-\sseq@yaxisgap+\sseq@yclip@axisgap/2,\sseq@ymax+0.5)}] (0,0) .. controls (0,0.5) .. (-0.5,0.5) +node[description, left] {y axis\\ clip padding}; + +\draw[shift = {(\sseq@xmax+0.5,\sseq@ymax cm+\sseq@xaxisgap)}] (0,0)--(0,-\sseq@xclip@axisgap); +\draw[distance label,shift = {(\sseq@xmax+0.5,\sseq@ymax cm+\sseq@xaxisgap-\sseq@xclip@axisgap/2)}] (0,0) .. controls (-0.5,0) .. (-0.5,0.2) +node[description, above] {x axis\\ clip padding}; + + +\draw[shift = {(\sseq@xmax cm +\sseq@yaxisgap,\sseq@ymax +0.5)}] (-\sseq@yclip@axisgap,0)--(0,0); +\draw[distance label,shift = {(\sseq@xmax cm +\sseq@yaxisgap-\sseq@yclip@axisgap/2,\sseq@ymax +0.5)}] (0,0) .. controls (0,-0.5) .. (0.2,-0.5) +node[description, right] {y axis\\ clip padding}; + + +% tick gap +\draw[shift = {(\sseq@xmin+\sseq@xmax/2+0.2,-0.5-\sseq@xaxisgap)}] (0,0)--(0,-\sseq@xlabelgap); +\draw[shift = {(-0.5-\sseq@yaxisgap,\sseq@ymin+\sseq@ymax/2+0.2)}] (0,0)--(-\sseq@ylabelgap,0); +\draw[distance label,shift = {(\sseq@xmin+\sseq@xmax/2+0.2,-\sseq@xlabelgap/2-\sseq@xaxisgap)}] (0,0) .. controls (0.5 ,0) .. (0.5,-0.8) + node[below,black]{x tick gap}; +\draw[distance label,shift = {(-\sseq@yaxisgap -\sseq@ylabelgap/2,\sseq@ymin+\sseq@ymax/2+0.2)}] (0,0) .. controls (0, -0.3) .. (-0.5,-0.7) +node[left,black]{y tick gap}; + +% axis gap +\draw[shift = {(\sseq@xmax cm+0.17cm,\sseq@ymin cm-\sseq@xaxisgap+0.02cm)}] (0,0) -- (0, \sseq@xaxisgap); +\draw[shift = {(\sseq@xmin cm-\sseq@yaxisgap+0.02cm,\sseq@ymax cm+0.17cm)}] (0,0) -- (\sseq@yaxisgap,0); +\draw[distance label,shift = {(\sseq@xmax cm+0.17cm,\sseq@ymin cm-\sseq@xaxisgap/2+0.02cm)}](0,0) .. controls (2,0) .. (2,0.5) +node[above,description]{x axis gap}; +\draw[distance label,shift = {(\sseq@xmin cm-\sseq@yaxisgap/2+0.02cm,\sseq@ymax cm+0.17cm)}](0,0)--(0,1) %.. controls (0,1) .. (0.5,1); +node[above,description]{y axis gap}; + +\draw[shift = {(\sseq@xmax cm-0.02cm,\sseq@ymin cm+0.17cm)}] (0,0) -- (\sseq@yaxisgap,0); +\draw[distance label,shift = {(\sseq@xmax cm-0.02cm+\sseq@yaxisgap/2,\sseq@ymin cm+0.17cm)}](0,0) .. controls (0,1) .. (0.8,1) + node[right,description]{y axis gap}; +\draw[shift = {(\sseq@xmin cm+0.17cm,\sseq@ymax cm-0.02cm)}] (0,0) -- (0,\sseq@xaxisgap); +\draw[distance label,shift = {(\sseq@xmin cm+0.17cm,\sseq@ymax cm-0.02cm+\sseq@xaxisgap/2)}](0,0) .. controls (1.3,0) .. (1.3,0.75) + node[above,description]{x axis gap}; +\end{scope} + +\class(0,0) +\class(5,0) +\class(0,5) +\end{sseqpage} + + +\begin{sseqpage}[ grid = chess, axes type=center, + title = {Axes type center layout}, + x range = {-3}{3}, y range = {-3}{3}, math nodes = false, + x axis clip padding = 0.15cm, y axis clip padding = 0.15cm, + right clip padding = 0.2cm, top clip padding = 0.2cm, + left clip padding = 0.2cm, bottom clip padding = 0.2cm %axes gap = 25pt +] +\begin{scope}[background] +\sseq@savedpaths@add{\color{red}\pgfsetpath\sseq@theclippath\pgfusepath{draw}} +\path (\sseq@xmin-3,\sseq@ymin-3) -- (\sseq@xmax+3,\sseq@ymax+3); +\end{scope} + +\begin{scope}[background,|-|,blue] + +% tick gap +\draw[shift = {(\sseq@xmin-0.4,-\sseq@xaxisgap-0.02cm)}] (0,0)--(0,-\sseq@xlabelgap); +\draw[distance label,shift = {(\sseq@xmin-0.4,-\sseq@xaxisgap-0.02cm-\sseq@xlabelgap/2)}] (0,0) -- (-0.5,0) + node[left,black]{x tick gap}; + +\draw[shift = {(-0.02cm-\sseq@yaxisgap,\sseq@ymin-0.4)}] (0,0)--(-\sseq@ylabelgap,0); +\draw[distance label,shift = {(-0.02cm-\sseq@yaxisgap -\sseq@ylabelgap/2,\sseq@ymin-0.4)}] (0,0) -- (0,-0.6) + node[below,black]{y tick gap}; + +% border clip padding +\draw[shift = {(\sseq@xmin cm - \sseq@xaxis@start@extend+0.02cm,\sseq@ymin +1)}] (0,0)--(-\sseq@clip@padding@left,0); +\draw[distance label, shift = {(\sseq@xmin cm - \sseq@xaxis@start@extend-\sseq@clip@padding@left/2,\sseq@ymin +1)}] (0,0) .. controls (0,-0.5) ..(-0.5,-0.5) + node[description, left] {left clip\\ padding}; +% +\draw[shift = {(\sseq@xmax cm + \sseq@xaxis@end@extend-0.02cm,\sseq@ymin +1)}] (0,0)--(\sseq@clip@padding@right,0); +\draw[distance label, shift = {(\sseq@xmax cm + \sseq@xaxis@end@extend+\sseq@clip@padding@right/2,\sseq@ymin +1)}] (0,0) .. controls (0,-0.5) ..(0.5,-0.5) + node[description, right] {right clip\\ padding}; +% +\draw[shift = {(\sseq@xmin+1 ,\sseq@ymax cm+\sseq@yaxis@end@extend-0.02cm)}] (0,0)--(0,\sseq@clip@padding@top); +\draw[distance label, shift = {(\sseq@xmin+1,\sseq@ymax cm -0.02cm+\sseq@yaxis@end@extend+\sseq@clip@padding@top/2)}] (0,0) .. controls (-0.9,0)..(-0.9,0.3) + node[description, above] {top clip\\ padding}; +% +\draw[shift = {(\sseq@xmin +1 ,\sseq@ymin cm-\sseq@yaxis@start@extend+0.02cm)}] (0,0)--(0,-\sseq@clip@padding@bottom); +\draw[distance label, shift = {(\sseq@xmin +1 ,\sseq@ymin cm +0.02cm - \sseq@yaxis@start@extend-\sseq@clip@padding@bottom/2)}] (0,0) .. controls (-0.9,0)..(-0.9,-0.4) + node[description, below] {bottom clip\\ padding}; + +% extend axis +\draw[shift = {(\sseq@xmax,-\sseq@xaxisgap+0.1cm)}] (0,0)--(\sseq@xaxis@end@extend,0); +\draw[distance label,shift = {(\sseq@xmax cm+\sseq@xaxis@end@extend/2,-\sseq@xaxisgap+0.1cm)}] (0,0) .. controls (0,0.5) .. (0.9,0.5) + node[description, right] {x axis\\ extend end}; +% +\draw[shift = {(-\sseq@yaxisgap+0.1cm,\sseq@ymax)}] (0,0)--(0,\sseq@yaxis@end@extend); +\draw[distance label,shift = {(-\sseq@yaxisgap+0.1cm,\sseq@ymax cm+\sseq@yaxis@end@extend/2)}] (0,0) .. controls (0.4,0)..(0.4,0.7) + node[description, above] {y axis\\ extend end}; +% +\draw[shift = {(\sseq@xmin,-\sseq@xaxisgap+0.1cm)}] (0,0)--(-\sseq@xaxis@start@extend,0); +\draw[distance label,shift = {(\sseq@xmin cm-\sseq@xaxis@start@extend/2,-\sseq@xaxisgap+0.1cm)}] (0,0) .. controls (0,0.5) .. (-0.7,0.5) + node[description, left] {x axis\\ extend start}; +% +\draw[shift = {(-\sseq@yaxisgap+0.1cm,\sseq@ymin)}] (0,0)--(0,-\sseq@yaxis@start@extend); +\draw[distance label,shift = {(-\sseq@yaxisgap+0.1cm,\sseq@ymin cm-\sseq@yaxis@start@extend/2)}] (0,0) .. controls (2,0)..(2,-0.7) + node[description, below] {y axis\\ extend start}; +\end{scope} + +\class(0,0) +\class(5,0) +\class(0,5) +\end{sseqpage}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.pdf b/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.pdf Binary files differindex 268315a27a4..f39887f0710 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.pdf +++ b/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.pdf diff --git a/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.tex b/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.tex index 7b5a499f3e4..292836249c2 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.tex +++ b/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.tex @@ -1,8 +1,8 @@ %% -%% Package: spectralsequences.sty version 1.0 +%% Package: spectralsequences v1.1.0 %% Author: Hood Chatham %% Email: hood@mit.edu -%% Date: 2017-06-18 +%% Date: 2017-08-02 %% License: Latex Project Public License %% %% File: spectralsequencesmanual.tex @@ -12,6 +12,11 @@ % % TODO: +% families +% +% consistency issues? +% perhaps think about ordering, particularly of "Misc commands" section +% tutorial % explain / cross reference examples folder? % @@ -30,9 +35,9 @@ \begin{abstract} \noindent -The \sseqpages\space package is a specialized tool built on top of \pgfpkg/\tikzpkg\space for drawing spectral sequences. It provides a powerful, concise syntax for specifying the data of a spectral sequence, and then allows the user to print various pages of spectral sequence, automatically choosing which subset of the classes, differentials, and structure lines to display on each page. It also handles most of the details of the layout. At the same time, \sseqpages\space is extremely flexible. It is closely integrated with \tikzpkg\space to ensure that users can take advantage of as much as possible of its expressive power. It is possible to turn off most of the automated layout features and draw replacements using \tikzpkg\space commands. \sseqpages\space also has a carefully designed error reporting system intended to ensure that it is as clear as possible what is going wrong. +The \sseqpages\ package is a specialized tool built on top of \pgfpkg/\tikzpkg\ for drawing spectral sequence charts. It provides a powerful, concise syntax for specifying the data of a spectral sequence, and then allows the user to print various pages of a spectral sequence, automatically choosing which subset of the classes, differentials, and structure lines to display on each page. It also handles most of the details of the layout. At the same time, \sseqpages\ is extremely flexible. It is closely integrated with \tikzpkg\ to ensure that users can take advantage of as much as possible of its expressive power. It is possible to turn off most of the automated layout features and draw replacements using \tikzpkg\ commands. \sseqpages\ also has a carefully designed error reporting system intended to ensure that it is as clear as possible what is going wrong. -Many thanks to the authors of \tikzpkg\space for producing such a wonderful package with such thorough documentation. I would have needed to spend a lot more time reading the \tikzpkg\space code if the documentation weren't so excellent. I took ideas or code or both from \tikzcdpkg\ (part of the code for turning quotes into class or edge labels), \pgfplotspkg\ (axes labels), and \sseqpkg\ (the grid styles, the stack). I lifted a fair amount of code from tex stack exchange. Thanks to Eric Peterson for being a very early adopter and reporting many bugs, to Eva Belmont for many productive conversations and for the idea of adding the stack traces for errors and to Vishal Arul and Catherine Ray for helpful suggestions. Also thanks to all my friends, family, and acquaintances listened to me talk about \LaTeX\ programming even though they probably found it dreadfully boring. +Many thanks to the authors of \tikzpkg\ for producing such a wonderful package with such thorough documentation. I would have needed to spend a lot more time reading the \tikzpkg\ code if the documentation weren't so excellent. I took ideas or code or both from \tikzcdpkg\ (part of the code for turning quotes into class or edge labels), \pgfplotspkg\ (axes labels), and \sseqpkg\ (the grid types, the stack). I lifted a fair amount of code from \TeX stack exchange. Thanks to Eva Belmont for tons of helpful suggestions, bug reports, and productive conversations. Talking to her has helped to clarify many design concepts for the package. Thanks to Eric Peterson for being a very early adopter and reporting many bugs. Also thanks to all my friends, family, and acquaintances listened to me talk about \LaTeX\ programming even though they probably found it dreadfully boring. \end{abstract} \end{titlepage} @@ -43,7 +48,7 @@ Many thanks to the authors of \tikzpkg\space for producing such a wonderful pack \tableofcontents \newpage \section{Introduction} -The \sseqpages\space package consists of two main environments -- the \sseqdataenv\space environment, which specifies the data for a named spectral sequence diagram, and the \sseqpageenv\space environment, which prints a single page of a spectral sequence diagram. The |\printpage| command is also available as a synonym for a \sseqpageenv\space environment with an empty body. +The \sseqpages\ package consists of two main environments -- the \sseqdataenv\ environment, which specifies the data for a named spectral sequence, and the \sseqpageenv\ environment, which prints a single page of a spectral sequence. The |\printpage| command is also available as a synonym for a \sseqpageenv\ environment with an empty body. Here is a basic example: \begin{codeexample}[width = 9cm] @@ -58,30 +63,44 @@ Here is a basic example: \printpage[ name = ex1, page = 3 ] \quad \printpage[ name = ex1, page = 4 ] \end{codeexample} -%TODO: -|\begin{sseqdata}[|| name = ex1, cohomological Serre grading]| starts the declaration of the data of a spectral sequence named |ex1| whose page $\mathtt{r}$ differentials go $\mathtt{r}$ to the right and down $\mathtt{r-1}$ -- that is, it has cohomological Serre grading. Then we specify four classes and one page 3 differential, and we ask \sseqpages\space to print the third and fourth pages of the spectral sequence. Note that on the fourth page, the source and target of the differential have disappeared. +|\begin{sseqdata}[|| name = ex1, cohomological Serre grading]| starts the declaration of the data of a spectral sequence named |ex1| whose page $\mathtt{r}$ differentials go $\mathtt{r}$ to the right and down $\mathtt{r-1}$ -- that is, it has cohomological Serre grading. Then we specify four classes and one page 3 differential, and we ask \sseqpages\ to print the third and fourth pages of the spectral sequence. Note that on the fourth page, the source and target of the differential have disappeared. + +\subsection{Installation} +In both \miktex\ and \texlive\ installation should be automatic -- your \TeX\ distribution should automatically install the package the first time you include |\usepackage{spectralsequences}| in a document and compile it. However, in 2016, \texlive\ made an incompatible change to their database, so no new packages will run on versions of \texlive\ from before 2016. This includes \sseqpages. If you have an old version of \texlive, you can either perform a manual install, +or, better, you should install an up to date version of \texlive. If you want to do a manual install, see \href{https://tex.stackexchange.com/a/73017}{this \TeX stack exchange post} for instructions. + +\subsection{Memory Constraints} +In a default \TeX\ install, \pdfLaTeX\ has small static memory caps that prevent it from using more than about 60 megabytes of total ram. However, \spectralsequences\ and \pgfpkg/\tikzpkg\ use a large amount of memory. For this reason, using \pdfLaTeX\ with a default install, you cannot draw more than about 2500 classes across all of your diagrams (fewer if you include differentials, structure lines, and other features). There are a few solutions to this. + +The easiest solution is to run \LuaLaTeX. \LuaLaTeX\ dynamically allocates memory and so is unlikely to run out of it. Using \LuaLaTeX\ on my computer, I can compile a document that draws two copies of a diagram with 20,000 classes in it (so a total of 40,000 classes). This takes about 50 seconds and 250 megabytes of ram. I expect any real-world use case will compile fine on a modern computer using \LuaLaTeX. This option has the advantage that any modern \TeX\ install comes with a copy of \LuaLaTeX, and that \LuaLaTeX\ is the designated successor to \pdfLaTeX. It has the disadvantage that there are some incompatibilities between \LuaLaTeX\ and \pdfLaTeX\ so if your document depends on \pdfLaTeX-specific features, it might be a pain to switch to \LuaLaTeX. -\subsection{A warning about fragile macros}%TODO: does this go here? somewhere else -All the data in a \sseqpages\space environment is stored and used later. As a result, most of the \sseqpages\space commands currently cannot tolerate fragile macros. Unfortunately, it is impossible for \sseqpages\space to warn you about this situation -- if you use a fragile command in a place that it doesn't belong, the result will be an incomprehensible error message. If you are getting nonsense error messages, this is probably why. The solution is to convert fragile macros into robust ones. \href{http://www.tex.ac.uk/FAQ-protect.html}{See here for more information.} +Another option is to increase the static memory caps for \pdfLaTeX. See \href{https://tex.stackexchange.com/a/26213}{this \TeX stack exchange post} for instructions on how to do this. + +\subsection{A warning about fragile macros} +All the data in a \sseqpages\ environment is stored and used later. As a result, most of the \sseqpages\ commands currently cannot tolerate fragile macros. Unfortunately, it is impossible for \sseqpages\ to warn you about this situation -- if you use a fragile command in a place that it doesn't belong, the result will be an incomprehensible error message. If you are getting nonsense error messages, this is probably why. The solution is to convert fragile macros into robust ones. \href{http://www.tex.ac.uk/FAQ-protect.html}{See here for more information.} + + +\section{Package Options and Environments} +\begin{manualentry}{Draft Mode} +The drawings that \sseqpages\ produces can be quite slow, especially if they are large. Draft mode skips drawing the content of the spectral sequence, but still takes up exactly the same amount of space in the document, so that you can deal with formatting issues. To active draft mode, load the package by saying |\usepackage[draft]{spectralsequences}|. +\end{manualentry} -\section{The Environments} \begin{environment}{{sseqdata}\moptions} -The \sseqdataenv\space environment is for storing a spectral sequence to be printed later. This environment is intended for circumstances where you want to print multiple pages of the same spectral sequence. When using the \sseqdataenv\space environment, you must use the |name| option to tell \sseqpages\space where to store the spectral sequence so that you can access it later. +The \sseqdataenv\ environment is for storing a spectral sequence to be printed later. This environment is intended for circumstances where you want to print multiple pages of the same spectral sequence. When using the \sseqdataenv\ environment, you must use the |name| option to tell \sseqpages\ where to store the spectral sequence so that you can access it later. \end{environment} \begin{environment}{{sseqpage}\ooptions} -This environment is used for printing a page of existing spectral sequence that was already specified using the \sseqdataenv\space environment. The body of the environment adds local changes -- classes, differentials, structure lines, and arbitrary \tikzpkg\space options that are by default only printed on this particular page. The \sseqpageenv\space environment can also be used to print a standalone page of a spectral sequence -- that is, if you only want to print a single page of the spectral sequence, you can skip using the \sseqdataenv\space environment. +This environment is used for printing a page of existing spectral sequence that was already specified using the \sseqdataenv\ environment. The body of the environment adds local changes -- classes, differentials, structure lines, and arbitrary \tikzpkg\ options that are by default only printed on this particular page. The \sseqpageenv\ environment can also be used to print a stand-alone page of a spectral sequence -- that is, if you only want to print a single page of the spectral sequence, you can skip using the \sseqdataenv\ environment. \end{environment} -\needspace{5\baselineskip} \begin{command}{\printpage\moptions} -This command prints a single page of an existing spectral sequence as-is. This is equivalent to a \sseqpageenv\space environment with an empty body. +This command prints a single page of an existing spectral sequence as-is. This is equivalent to a \sseqpageenv\ environment with an empty body. \end{command} -\section{The main commands} +\section{The Main Commands} \begin{command}{\class\ooptions\parargtwo{x}{y}} -This places a class at |(x,y)| where |x| and |y| are integers. If multiple classes occur at the same position, \sseqpages\space will automatically arrange them in a pre-specified pattern. This pattern may be altered using the |class pattern| option. +This places a class at |(x,y)| where |x| and |y| are integers. If multiple classes occur at the same position, \sseqpages\ will automatically arrange them in a pre-specified pattern. This pattern may be altered using the |class pattern| option. \begin{codeexample}[] \begin{sseqpage}[ no axes, ymirror, yscale = 0.8 ] \class(0,0) @@ -125,19 +144,17 @@ After a class is the source or target of a differential, it disappears on the ne \d[->>]3(1,0) \replaceclass["2\mathbb{Z}"](1,0) \end{sseqdata} -\printpage[ name = replace class example, page = 2 ] -\hskip1cm -\printpage[ name = replace class example, page = 3 ] -\hskip1cm +\printpage[ name = replace class example, page = 2 ] \qquad +\printpage[ name = replace class example, page = 3 ] \qquad \printpage[ name = replace class example, page = 4 ] \end{codeexample} -Note that this will not restore any structlines coming into or off of the class, if you want the structlines to persist, you must call |\structline| again (or use the structline |structline:page| option) +Note that this will not restore any structure lines coming into or off of the class, if you want the structure lines to persist, you must call |\structline| again (or use the |structline:page| option). \end{commandlist} -\begin{commandlist}{{\classoptions\moptions\parargthreeopt{x}{y}{n}},\classoptions\moptions\pararg{classname}} -This adds options to a class that already exists. This can be used in a \sseqpageenv\space environment to modify the appearance of a class for just one drawing of the spectral sequence, for instance to highlight it for discussion purposes. +\begin{commandlist}{{\classoptions\moptions\parargthreeopt{x}{y}{n}},\classoptions\moptions\pararg{classname}, \classoptions\moptions} +This adds options to an existing class. This can be used in a \sseqpageenv\ environment to modify the appearance of a class for just one drawing of the spectral sequence, for instance to highlight it for discussion purposes. -If there are multiple classes at the coordinate |(x,y)| you may specify which using an integer or a |tag| $n$. By default, this command will affect the first class placed in that position. You can also provide the |class:name| of a class. +If there are multiple classes at the coordinate |(x,y)| you may specify which using an integer or a |tag| $n$. By default, this command will affect the first class placed in that position. You can also provide the |class:name| of a class. If no coordinate is indicated at all, then |\lastclass| is used. \begin{codeexample}[width = 6cm] \begin{sseqdata}[ name = class options example, classes = fill ] @@ -177,13 +194,14 @@ See the \pgfmanualpdfref{class options}{class options} section for a list of the \end{commandlist} \begin{commandlist}{ + {\d\ooptions\meta{page}}, {\d\ooptions\meta{page}\pars{\meta{x},\meta{y}\opt{,\sourcen,\targetn}}}, {\d\ooptions\meta{page}\pars{\sourcename\opt{,\targetn}}}, {\d\ooptions\meta{page}\pars{\sourcecoord}\pars{\targetcoord}}% } -Calling |\d\meta{page}|\parargtwo{x}{y} creates a differential starting at \parargtwo{x}{y} of length determined by the specified page. In order to use the |\d| command like this, you must first specify the |degree| of the differentials as an option to the \sseqdataenv\space or \sseqpageenv\space environment. The degree indicates how far to the right and how far up a page $\mathtt{r}$ differential will go as a function of $\mathtt{r}$. If there is a page $\mathtt{r}$ differential, on page $\mathtt{r+1}$, the source, target, and any |\structline|s connected to the source and target of the differential disappear. +Calling |\d\meta{page}|\parargtwo{x}{y} creates a differential starting at \parargtwo{x}{y} of length determined by the specified page. In order to use the |\d| command like this, you must first specify the |degree| of the differentials as an option to the \sseqdataenv\ or \sseqpageenv\ environment. The degree indicates how far to the right and how far up a page $\mathtt{r}$ differential will go as a function of $\mathtt{r}$. If there is a page $\mathtt{r}$ differential, on page $\mathtt{r+1}$, the source, target, and any structure lines connected to the source and target of the differential disappear. If no class is specified, the default is to use |\lastclass|. -If there are multiple nodes in the source or target, you may specify which one the differential should go to using an index or tag for \sourcen\space or \targetn. It is also possible to provide the name of the source coordinate and an optional target, or to separately provide the source and target coordinate, either as names or as \parargthree{x}{y}{n}. Using |\d| with explicit source and target coordinates works even if you did not provide a |degree| to the spectral sequence. If you did provide a |degree|, then \sseqpages\space will check whether the difference between the source and target is appropriate for a differential of a given page, and if not it will throw an error. If this is undesirable, you can use the |lax degree| option. +If there are multiple nodes in the source or target, you may specify which one the differential should go to using an index or tag for \sourcen\ or \targetn. It is also possible to provide the name of the source coordinate and an optional target, or to separately provide the source and target coordinate, either as names or as \parargthree{x}{y}{n}. Using |\d| with explicit source and target coordinates works even if you did not provide a |degree| to the spectral sequence. If you did provide a |degree|, then \sseqpages\ will check whether the difference between the source and target is appropriate for a differential of a given page, and if not it will throw an error. If this is undesirable, you can use the |lax degree| option. \begin{codeexample}[width = 7.5cm] \begin{sseqdata}[ name = d example, degree = {-1}{#1}, struct lines = blue, yscale = 1.3 ] @@ -196,8 +214,7 @@ If there are multiple nodes in the source or target, you may specify which one t \structline(1,1)(1,0) \d2(1,0) \end{sseqdata} -\printpage[ name = d example, page = 2 ] -\hskip0.3cm +\printpage[ name = d example, page = 2 ] \quad \printpage[ name = d example, page = 3 ] \end{codeexample} If there are multiple nodes in the source or target coordinate, then there is a funny syntax for indicating which one should be the source and target: @@ -215,7 +232,7 @@ If there are multiple nodes in the source or target coordinate, then there is a \d2(3,0,,2) \end{sseqpage} \end{codeexample} -Negative indices will count from the most recent class in the coordinate (so |-1| is the most recent, |-2| is the second most recent, etc). You can also use a |tag|, which works better if the situation is complicated. +Negative indices will count from the most recent class in the coordinate (so the most recent is |-1|, the second most recent is |-2|, etc). You can also use a |tag|, which works better if the situation is complicated. \begin{codeexample}[width = 7.5cm] \begin{sseqpage}[ Adams grading, yscale = 0.65 ] \class(1,0) @@ -238,22 +255,26 @@ Negative indices will count from the most recent class in the coordinate (so |-1 This command adds options to an existing differential, just like |\classoptions| except for differentials. Its syntax is identical to that of |\d|. \end{commandlist} -\begin{command}{\structline\ooptions\pars{\sourcecoord}\pars{\targetcoord}} -This command creates a structure line from \sourcecoord\space to \targetcoord. The source and target coordinates are either of the form \pars{\meta{x},\meta{y}\opt{,\meta{n}}} or \pararg{class name}. If there are multiple classes at $\mathtt{(x,y)}$, then \meta{n} specifies which of the classes at $\mathtt{(x,y)}$ the structline starts and ends at -- if n is positive, then it counts from the first class in that position, if n is negative, it counts backwards from the most recent. You can also use a |tag| for n. +\begin{command}{\kill\meta{page}\oarg{coord}} +This command sets the indicated coordinate to die on the indicated page, but does not establish a target for the differential. This is useful if you want to draw your own differential using tikz (see |\getdtarget|) or if you are not drawing the class on the other side of the differential for clutter reasons. As usual, if no coordinate is provided, the default argument is |\lastclass|. +\end{command} + +\begin{command}{\structline\ooptions\opt{\pars{\sourcecoord}\pars{\targetcoord}}} +This command creates a structure line from \sourcecoord\ to \targetcoord. The source and target coordinates are either of the form \pars{\meta{x},\meta{y}\opt{,\meta{n}}} or \pararg{class name}. If there are multiple classes at $\mathtt{(x,y)}$, then \meta{n} specifies which of the classes at $\mathtt{(x,y)}$ the structure line starts and ends at -- if n is positive, then it counts from the first class in that position, if n is negative, it counts backwards from the most recent. You can also use a |tag| for n. If the \targetcoord\ is omitted, then |\lastclass| is used, so that |\structline(\sourcecoord)| connects the most recent class to the specified coordinate. If both coordinates are omitted, then |\lastclass| and |\lastclass1| are used, and so |\structline| with no arguments at all will connect the two most recent classes. If the source or target of a structure line is hit by a differential, then on subsequent pages, the structure line disappears. If the source or target has had multiple generations (i.e., they got hit and you used |\replaceclass|), then the |\structline| will only appear starting on the first page where the current generation of both the source and target are present. If this is undesirable, you can use the |structline:page| option to change it. -\begin{codeexample}[width = 9cm] +\begin{codeexample}[width = 7cm] \DeclareSseqGroup\tower {} { \class(0,0) \foreach \y in {1,...,5} { \class(0,\y) - \structline(\lastclass1)(\lastclass) + \structline } \class(0,2) - \structline(0,1,-1)(\lastclass) - \structline(\lastclass)(0,3,-1) + \structline(0,1,-1) + \structline(0,3,-1) } \begin{sseqdata}[ name = structline example, classes = { circle, fill }, @@ -266,13 +287,12 @@ If the source or target has had multiple generations (i.e., they got hit and you \tower[struct lines = red](2,0) \d2(1,1,2) \end{sseqdata} -\printpage[name = structline example, page = 2] -\hskip1cm -\printpage[name = structline example, page = 3] +\printpage[ name = structline example, page = 2 ] \quad +\printpage[ name = structline example, page = 3 ] \end{codeexample} \end{command} -\begin{command}{\structlineoptions\moptions\pars{\sourcecoord}\pars{\targetcoord}} +\begin{command}{\structlineoptions\moptions\opt{\pars{\sourcecoord}\pars{\targetcoord}}} This command adds options to an existing structure line, just like |\classoptions| except for structure lines. Its syntax is identical to |\structline|. \end{command} @@ -281,7 +301,7 @@ This command is a lot like |\structline| except that it puts a circle around the \end{command} \begin{commandlist}{\draw,\path,\node,\clip} -Any code that would work in a \tikzpictureenv\space environment will also work unchanged in a \sseqdataenv\space or \sseqpageenv\space environment, with a few minor differences. This is a very flexible way to add arbitrary background or foreground features to the spectral sequence: +Any code that would work in a \tikzpictureenv\ environment will also work unchanged in a \sseqdataenv\ or \sseqpageenv\ environment, with a few minor differences. This is a very flexible way to add arbitrary background or foreground features to the spectral sequence: \begin{codeexample}[] \begin{sseqdata}[ name = tikz example, Adams grading, math nodes = false, tikz primitives = { blue, font = \tiny, <- }, circle classes = tikz primitive style, @@ -316,7 +336,7 @@ Any code that would work in a \tikzpictureenv\space environment will also work u \subsection{Universal options} The following options work with all of the drawing commands in this package, including |\class|, |\d|, and |\structline|, their friends |\replaceclass|, |\classoptions|, |\doptions|, and |\structlines|, as well as with \tikzpkg\ primitives. \begin{keylist}{xshift = \meta{integer},yshift = \meta{integer}} -Shifts by integer values are the only coordinate changes that are allowed to be applied to |\class|, |\d|, |\structline|, their relatives, or to a \scopeenv\space environment that contains any of these commands. These shift commands help with reusing code. For instance: +Shifts by integer values are the only coordinate changes that are allowed to be applied to |\class|, |\d|, |\structline|, their relatives, or to a \scopeenv\ environment that contains any of these commands. These shift commands help with reusing code. For instance: \begin{codeexample}[width = 6cm] \begin{sseqpage}[ cohomological Serre grading, yscale = 0.45 ] \foreach \x in {0,1} \foreach \y in {0,1} { @@ -328,7 +348,7 @@ Shifts by integer values are the only coordinate changes that are allowed to be } \end{sseqpage} \end{codeexample} -This code segment is very useful so \sseqpages\space has the command |\NewSseqGroup| which to make code like this more convenient. The following code produces the same output as above: +This code segment is very useful so \sseqpages\ has the command |\NewSseqGroup| which to make code like this more convenient. The following code produces the same output as above: \begin{codeexample}[code only,width = 6cm] \NewSseqGroup\examplegroup {} { \class(2,0) @@ -344,11 +364,11 @@ This code segment is very useful so \sseqpages\space has the command |\NewSseqGr \end{codeexample} -A word of warning: the behavior of |xshift| in \sseqpages\space is incompatible with the normal behavior of |xshift| in \tikzpkg. For some reason, saying |xshift = 1| in \tikzpkg\ does not shift the coordinate |(0,0)| to the coordinate |(1,0)| -- instead it shifts by 1pt. In \sseqpages\space, saying |xshift = 1| moves the coordinate |(0,0)| to the coordinate |(1,0)|. This includes \tikzpkg\ primitives: saying \codeverb|\draw[ xshift = 1 ] (0,0) -- (1,0);| inside a \sseqdataenv\space or \sseqpageenv\space environment is the same as saying \codeverb|\draw(1,0) -- (2,0);| despite the fact that this is not the case in the \tikzpictureenv\ environment. +A word of warning: the behavior of |xshift| in \sseqpages\ is incompatible with the normal behavior of |xshift| in \tikzpkg. For some reason, saying |xshift = 1| in \tikzpkg\ does not shift the coordinate |(0,0)| to the coordinate |(1,0)| -- instead it shifts by 1pt. In \sseqpages\ , saying |xshift = 1| moves the coordinate |(0,0)| to the coordinate |(1,0)|. This includes \tikzpkg\ primitives: saying \codeverb|\draw[ xshift = 1 ] (0,0) -- (1,0);| inside a \sseqdataenv\ or \sseqpageenv\ environment is the same as saying \codeverb|\draw(1,0) -- (2,0);| despite the fact that this is not the case in the \tikzpictureenv\ environment. \end{keylist} \begin{manualentry}{Colors} -These come from the \LaTeX\space \colorpkg\space package via \tikzpkg, so see the \href{\colormanualurl}{\colorpkg\space package documentation} for more information. +These come from the \LaTeX\ \colorpkg\ package via \tikzpkg, so see the \href{\colormanualurl}{\colorpkg\ package documentation} for more information. \begin{codeexample}[width = 6cm] \begin{sseqpage}[ classes = {fill,inner sep = 0.4em}, no axes, scale = 1.3 ] @@ -359,14 +379,14 @@ These come from the \LaTeX\space \colorpkg\space package via \tikzpkg, so see th \class[magenta](1,1) \class[yellow](2,1) \class[blue!50!red](0,2) % a 50-50 blend of blue and red -\class[green!30!yellow](1,2) % 70% green, 30% yellow +\class[green!30!yellow](1,2) % 30% green, 70% yellow \class[blue!50!black](2,2) \end{sseqpage} \end{codeexample} \end{manualentry} \begin{manualentry}{\pgfmanualpdflabel{""quotes}{}|"|\meta{text}|"|\opt{\meta{options}}} -Specify a label for a class, a differential, or a structure line. This uses the \tikzpkg\ quotes syntax. The options include anything you might pass as an option to a \tikzpkg\ node, including arbitrary coordinate transforms, colors, opacity options, shapes, fill, draw, etc. The behavior is a little different depending on whether you use it on a class or on a differential or struct line. +Specify a label for a class, a differential, or a structure line. This uses the \tikzpkg\ quotes syntax. If the label text includes an equal sign or comma, you need to enclose the entire label in braces, e.g., |\class["{x = y}"](0,0)|. The options include anything you might pass as an option to a \tikzpkg\ node, including arbitrary coordinate transforms, colors, opacity options, shapes, fill, draw, etc. The behavior is a little different depending on whether you use it on a class or on a differential or structure line. For a class, the \meta{text} is placed in the position |inside| the node by default -- in effect, the \meta{text} becomes the label text of the node (so saying |\class["label text"](0,0)| causes a similar effect to saying |\node at (0,0) {label text};|). There are other position options such as |left|, |above left|, etc which cause the label text to be placed in a separate node positioned appropriately. If the placement is above, left, etc, then any option that you may pass to a \tikzpkg\ node will also work for the label, including general coordinate transformations. If the placement is ``inside'', then the only relevant \opt{\meta{options}} are those that alter the appearance of text, such as opacity and color. \begin{codeexample}[width = 4cm] @@ -389,7 +409,21 @@ Note that it is also possible to give a label to a |\node| this way, although th \end{sseqpage} \end{codeexample} -For either a |\structline| or a |\class| the label normally goes on the right side of the edge. The special |'| option makes it go in the opposite position from the default. I imitated the label handling in the \tikzcdpkg\ package, so if you use \tikzcdpkg, this should be familiar. +\begin{key}{pin = \meta{style}} +The |pin| key makes \sseqpages\ draw a line connecting the label to the relevant class, which can provide necessary clarification in dense diagrams. The pin key itself can take options which adjust the way that the line is drawn: +\begin{codeexample}[width = 6cm] +\begin{sseqpage} +\class(0,0) +\class["xy" {above, xshift=-4pt, pin = red}](0,0) +\class(0,0) +\class(0,1) +\structline +\end{sseqpage} +\end{codeexample} +\end{key} + + +For either a |\structline| or a |\class| the label normally goes on the right side of the edge. The special option |'| makes it go in the opposite position from the default. I imitated the label handling in the \tikzcdpkg\ package, so if you use \tikzcdpkg, this should be familiar. \begin{codeexample}[width = 6cm] \begin{sseqpage}[ Adams grading, yscale = 0.63 ] \class(0,0) @@ -411,7 +445,10 @@ You can also use quotes to label edges drawn with \tikzpkg\ primitives: \draw (1,0) to["hi"'{ pos = 0.7, yshift = -0.5em }] (0,1); \end{sseqpage} \end{codeexample} -The special option ``description,'' stolen from \tikzcdpkg, places the label on top of the edge. In order to make this option work correctly, if the background coolor is not the default white, you must inform sseqpages about this using the key |background color = |\meta{color}. In this document, the background color is called \textit{graphicbackground}. + +\needspace{3\baselineskip} +\begin{key}{description} +The |description| key, stolen from \tikzcdpkg, places the label on top of the edge. In order to make this option work correctly, if the background coolor is not the default white, you must inform \sseqpages\ about this using the key |background color = |\meta{color}. In this document, the background color is called \textit{graphicbackground}. \begin{codeexample}[width = 6cm] \begin{sseqpage}[ no axes, background color = graphicbackground ] \foreach \x in {0,1,2} \foreach \y in {0,1} { @@ -422,6 +459,7 @@ The special option ``description,'' stolen from \tikzcdpkg, places the label on \structline["c" description](2,0)(2,1) \end{sseqpage} \end{codeexample} +\end{key} \end{manualentry} @@ -449,7 +487,7 @@ This shape is used for |\circleclasses|. It's a variant on the |ellipse| shape t There are many more \tikzpkg\ shapes in the shapes library, which you can load using the command |\usetikzlibrary{shapes}|. The following are some examples: \begin{codeexample}[width = 6cm] \begin{sseqpage}[ no axes, classes = { inner sep = 0.4em }, - class placement transform = { scale = 2 }, + class placement transform = { scale = 1.8 }, yscale = 1.63 ] \class(0,0) \class[isosceles triangle](2,0) @@ -462,7 +500,7 @@ There are many more \tikzpkg\ shapes in the shapes library, which you can load u \class[regular polygon, regular polygon sides = 8](2,2) \end{sseqpage} \end{codeexample} -See the \href{\pgfmanualurl#section.49}{\tikzpkg\space manual} for more information. +See the \href{\pgfmanualurl#section.49}{\tikzpkg\ manual} for more information. \end{manualentry} \begin{keylist}{minimum width = \meta{dimension}, minimum height = \meta{dimension}, minimum size = \meta{dimension}, inner sep = \meta{dimension}, outer sep = \meta{dimension}} @@ -523,6 +561,47 @@ This key adds a tag to the current class. Tags are used for identifying which of We want each differential to go from the |h21| vee to the |id| vee, independent of which classes are in the same position of the two vees. The easy way to accomplish this is by giving tags to each of the two vees. \end{key} +\begin{key}{insert = \meta{integer}} +If there are multiple classes in the same position, this option allows you to insert classes later into earlier positions. This is intended to help you put logically related classes next to each other. If the integer is positive, it inserts the class in the specified position, and if the integer is negative, it counts backwards from the end. Providing |0| is the same as omitting the option entirely. Values larger in absolute value than the total number of classes are truncated. + Consider: +\begin{codeexample}[] +\DeclareSseqGroup \tower {} { + \class(0,0) + \DoUntilOutOfBounds { + \class(\lastx,\lasty+1) + \structline + } +} + +\begin{sseqdata}[name=test, y range={0}{4}, class pattern = linear] +\tower(0,2) +\tower(0,3) +\tower(0,1) +\end{sseqdata} +\qquad +\begin{sseqpage}[name=test] +\tower[red,classes={insert=1}](0,0) +\end{sseqpage} +\qquad +\begin{sseqpage}[name=test] +\tower[red,classes={insert=2}](0,0) +\end{sseqpage} +\qquad +\begin{sseqpage}[name=test] +\tower[red,classes={insert=3}](0,0) +\end{sseqpage} +\qquad +\begin{sseqpage}[name=test] +\tower[red,classes={insert=-2}](0,0) +\end{sseqpage} +\qquad +\begin{sseqpage}[name=test] +\tower[red,classes={insert=-3}](0,0) +\end{sseqpage} +\end{codeexample} + +\end{key} + \begin{key}{offset = \{\pars{\meta{x offset},\meta{y offset}}\}} By default, a class uses the offset specified by |class pattern|. Occasionally this is undesirable. In this case, you can specify the offset for a particular class by hand. For example if the sum of two classes is hit by a differential, it looks better for the class replacing them to be centered: \begin{codeexample}[width = 9cm] @@ -547,9 +626,9 @@ By default, a class uses the offset specified by |class pattern|. Occasionally t \end{key} \begin{key}{tooltip = \meta{text}} -This key generates a ``tooltip'' over the given class. That is, if you hover your mouse over it, a little window will popup with the tooltip text. This is particularly useful to give the coordinates or names of classes in large diagrams where it may be hard to tell from looking at the picture what position the class is in, or there may not be room to supply names to classes. +This key generates a ``tooltip'' over the given class. That is, if you hover your mouse over it, a little window will popup with the tooltip text. This is particularly useful to give the coordinates or names of classes in large charts where it may be hard to tell from looking at the picture what position the class is in, or there may not be room to supply names to classes. -The tooltip is made using the |\pdftooltip| command from the |pdfcomment| package. This cannot handle math, but it will print math expressions into tex input form. Not all pdf viewers will display the tooltip correctly. If this concerns you, the command |\sseqtooltip| is used to produce the tooltip, and you can redefine it as any other command that takes |\sseqtooltip|\marg{text}\marg{tooltip text} and produces a tooltip. For instance, on \href{https://tex.stackexchange.com/a/164186/23866}{this stack exchange post}, there is code that supposedly produces tooltips that work with Evince. I have not tested whether it works by itself or whether it works with my package, but you could. You could potentially figure out how to get math to work in tooltips too -- if you find a satisfactory method, please let me know. +The tooltip is made using the |\pdftooltip| command from the |pdfcomment| package. This cannot handle math, but it will print math expressions into \TeX input form. Not all pdf viewers will display the tooltip correctly. If this concerns you, the command |\sseqtooltip| is used to produce the tooltip, and you can redefine it as any other command that takes |\sseqtooltip|\marg{text}\marg{tooltip text} and produces a tooltip. For instance, on \href{https://tex.stackexchange.com/a/164186/23866}{this stack exchange post}, there is code that supposedly produces tooltips that work with Evince. I have not tested whether it works by itself or whether it works with my package, but you could. You could potentially figure out how to get math to work in tooltips too -- if you find a satisfactory method, please let me know. Anyways, here's an example: \begin{codeexample}[] @@ -578,7 +657,7 @@ These options only work in |\classoptions|. The |page| option gives a range of p \printpage[ name = page_example, page = 4 ] \end{codeexample} A ``generation'' of a class is the interval from one call of |\class| or |\replaceclass| to the page on which it next supports or is hit by a differential. -By default the |\classoptions| command adds options only to the most recent generation of the class in a \sseqdataenv\space environment, or on the generation appropriate to the current page in a \sseqpageenv\space environment. Using the |generation| option allows you to provide a single generation or range of generations of the class that the options should apply to. The first generation is generation 0, and the most recent generation is generation -1. Larger negative values count backwards. +By default the |\classoptions| command adds options only to the most recent generation of the class in a \sseqdataenv\ environment, or on the generation appropriate to the current page in a \sseqpageenv\ environment. Using the |generation| option allows you to provide a single generation or range of generations of the class that the options should apply to. The first generation is generation 0, and the most recent generation is generation -1. Larger negative values count backwards. \begin{codeexample}[] \begin{sseqdata}[ name = page_example2, Adams grading, xscale = 0.6, yscale = 0.5 ] \class(0,2)\class(1,0) @@ -637,7 +716,7 @@ These commands represent the $\mathtt{x}$ and $\mathtt{y}$ coordinate of the cur Because the main job of the |\d| and |\structline| commands is to print an edge on the appropriate pages of the spectral sequence, most \tikzpkg\ options that you could apply to a \tikzpkg\ ``to'' operator (as in |\draw (x1,y1) to (x2,y2);|) can be applied to both |\d| and |\structline|. Some such options are as follows: \begin{keylist}{source anchor = \meta{anchor}, target anchor = \meta{anchor}} -Because you can't use the normal \tikzpkg\ mechanism for specifying the source and target anchors, \sseqpages\space has these two keys for |\d| and |\structline|: +Because you can't use the normal \tikzpkg\ mechanism for specifying the source and target anchors, \sseqpages\ has these two keys for |\d| and |\structline|: \begin{codeexample}[width = 4cm] \begin{sseqpage}[ no axes, yscale = 1.24 ] \foreach \x in {0,1} \foreach \y in {0,1} { @@ -651,11 +730,11 @@ Because you can't use the normal \tikzpkg\ mechanism for specifying the source a \begin{keylist}{shorten > = \meta{distance}, shorten < = \meta{distance}} -These behave exactly like the corresponding options from \tikzpkg\space, shortening the end and beginning of the edge respectively. Note that you can lengthen the edge by shortening by a negative amount. +These behave exactly like the corresponding options from \tikzpkg\ , shortening the end and beginning of the edge respectively. Note that you can lengthen the edge by shortening by a negative amount. \end{keylist} \begin{manualentry}{Dash patterns:} -See the \href{\pgfmanualurl#subsubsection.15.3.2}{\tikzpkg\space manual} for a complete explanation of the dash pattern related options. Some examples: +See the \href{\pgfmanualurl#subsubsection.15.3.2}{\tikzpkg\ manual} for a complete explanation of the dash pattern related options. Some examples: \begin{codeexample}[width = 6cm] \begin{sseqpage}[ no axes, yscale = 1.6 ] \foreach \x in {0,1,2} \foreach \y in {0,1} { @@ -682,12 +761,12 @@ See the \href{\pgfmanualurl#subsubsection.15.3.2}{\tikzpkg\space manual} for a c \end{codeexample} \end{keylist} -\begin{key}{invisible} -This key is only for |\d|. It prevents a differential from being drawn at all. The typical reason you might want this is so that you can draw your own differential using \tikzpkg\space commands. See |\getdtarget| for an example of this. -\end{key} +%\begin{key}{invisible} +%This key is only for |\d|. It prevents a differential from being drawn at all. The typical reason you might want this is so that you can draw your own differential using \tikzpkg\ commands. See |\getdtarget| for an example of this. +%\end{key} \begin{key}{structline:page = \meta{page}\opt{-{}-\meta{page max}}} -This key is only for |\structline| and |\structlineoptions|. By default, the |\structline| command only adds a structline starting on the page where the most recent generation of the source or target is born: +This key is only for |\structline| and |\structlineoptions|. By default, the |\structline| command only adds a structure line starting on the page where the most recent generation of the source or target is born: \begin{codeexample}[width = 7.6cm] \begin{sseqdata}[ name = structpage example, @@ -735,7 +814,7 @@ Similarly, for |\structlineoptions| you can specify a minimum page on which to a \subsection{Options for \sectionstring\circleclass} \begin{key}{fit = \meta{coordinates or nodes}} -The |\circleclasses| command uses the \href{\pgfmanualurl#section.52}{\tikzpkg\space fitting library}. Sometimes it's desirable to make the resulting node fit extra things, for example a label. It doesn't necessarily end up looking great though. +The |\circleclasses| command uses the \href{\pgfmanualurl#section.52}{\tikzpkg\ fitting library}. Sometimes it's desirable to make the resulting node fit extra things, for example a label. It doesn't necessarily end up looking great though. \begin{codeexample}[] \begin{sseqpage}[Adams grading,axes gap = 0.7cm] \class(0,2) @@ -756,27 +835,27 @@ By default, the shape drawn by |\circleclasses| is a ``newelipse'' which is a cu \end{key} \begin{keylist}{cc:class style,cc:permanent cycle style,cc:transient cycle style,cc:this page class style,cc:differential style,cc:struct line style} -See the \pgfmanualpdfref{class style}{corresponding entry} in the \tikzpkg\space primitives section. +See the \pgfmanualpdfref{class style}{corresponding entry} in the \tikzpkg\ primitives section. \end{keylist} \begin{key}{cc:page = \meta{page}\opt{-{}-\meta{page max}}} -By default, the ellipse will be drawn on the same set of pages that a structline between the two classes would be drawn on. This specifies a range of pages for the ellipse to be drawn. Note that unlike with structlines, you can instruct \circleclasses\ to draw the shape even on pages where one or both of the classes that it is fitting are dead. +By default, the ellipse will be drawn on the same set of pages that a structure line between the two classes would be drawn on. This specifies a range of pages for the ellipse to be drawn. Note that unlike with structure lines, you can instruct |\circleclasses| to draw the shape even on pages where one or both of the classes that it is fitting are dead. \end{key} -\subsection{Options for \tikzpkg\space primitives} +\subsection{Options for \tikzpkg\ primitives} \begin{key}{background} -This key instructs \sseqpages\space to put the current \tikzpkg\space primitive in the background. The way that the spectral sequence is printed is as follows: +This key instructs \sseqpages\ to put the current \tikzpkg\ primitive in the background. The way that the spectral sequence is printed is as follows: \begin{itemize} \item The title, axes, axes ticks, and axes labels are printed (the appropriate steps are skipped when the |no title|, |no axes|, |no ticks|, or |no labels| keys are used or if no title or axes labels are provided). -\item The \tikzpkg\space background paths are printed. +\item The \tikzpkg\ background paths are printed. \item The clipping is inserted (unless the |no clip| key is used). -\item All foreground elements (classes, differentials, structlines, and normal \tikzpkg\space paths) are printed. +\item All foreground elements (classes, differentials, structure lines, and normal \tikzpkg\ paths) are printed. \end{itemize} -In particular, this means that foreground \tikzpkg\space paths can be clipped by the standard clipping, but background paths that are outside of the clipping expand the size of the \tikzpkg\space picture. +In particular, this means that foreground \tikzpkg\ paths can be clipped by the standard clipping, but background paths that are outside of the clipping expand the size of the \tikzpkg\ picture. \begin{codeexample}[] \begin{sseqpage}[no ticks,yscale = 0.9,math nodes = false] \class(0,0) @@ -807,11 +886,10 @@ Here is an example where \tikzpkg\ labels with the |background| key are used to \printpage[name = tikz background example, page = 3] \end{codeexample} -For this particular use case, it's and probably better to use |title|, |x label|, and |y label|: +For this particular use case, it's probably better to use |title|, |x label|, and |y label|: \begin{codeexample}[] \begin{sseqdata}[ name = tikz background example2, cohomological Serre grading, classes = fill, - grid = go, title = { Page \page }, x label = { $H^*(B)$ }, y label = { $H^*(F)$ }, - x label style = { yshift = 10pt}, y label style = { xshift = 10pt } ] + grid = go, title = { Page \page }, x label = { $H^*(B)$ }, y label = { $H^*(F)$ } ] \class(0,0) \class(3,0) \class(0,2) @@ -823,16 +901,31 @@ For this particular use case, it's and probably better to use |title|, |x label| \end{codeexample} But if you need more flexible labeling, you'll likely want to use tikz primitives with |background|. See \example{KF3} for an instance where this key is useful. + +One useful tip is that you can ensure consistent bounding boxes between different diagrams using |\path[background] (smallest x, smallest y) -- (largest x, largest y);|: +\begin{codeexample}[] +\begin{sseqdata}[ name = boundingboxex, x range = {0}{2}, y range = {0}{2}, scale = 0.5 ] +\end{sseqdata} +\printpage[ name = boundingboxex, title = not aligned ] +\quad +\printpage[ name = boundingboxex, x label = Hi ] +\qquad +\begin{sseqpage}[ name = boundingboxex, keep changes, title = aligned ] +\path[background] (\xmin,\ymin-4) -- (\xmax,\ymax+2); +\end{sseqpage} +\quad +\printpage[ name = boundingboxex, x label = Hi, title = {} ] +\end{codeexample} \end{key} \begin{keylist}{page constraint = \meta{predicate}, page constraint or = \meta{predicate}} -This places a constraint on the pages in which the \tikzpkg\space primitive is printed. This predicate should look something like -\texttt{(\string\page< = 4)} |&&| \texttt{(\string\page> = 3)}. The predicate is anded together with any previous predicates, so that you can use this as an option for a \scopeenv\space and again for the individual \tikzpkg\ primitive. +This places a constraint on the pages in which the \tikzpkg\ primitive is printed. This predicate should look something like +\texttt{(\string\page< = 4)} |&&| \texttt{(\string\page> = 3)}. The predicate is anded together with any previous predicates, so that you can use this as an option for a \scopeenv\ and again for the individual \tikzpkg\ primitive. \begin{commandlist}{\isalive\pararg{coordinate},\isalive\{\pararg{coordinate 1}$\cdots$\pararg{coordinate n}\}} This command can only be used with |page constraint|. Saying $$|page constraint = ||{|\pars{\meta{x},\meta{y}\opt{,\meta{index}}}|}}|$$ -will print the \tikzpkg\space primitive only on pages where the specified class is alive. Saying +will print the \tikzpkg\ primitive only on pages where the specified class is alive. Saying $$|page constraint = ||{\isalive|\pars{\meta{coordinate 1}}\,\cdots\,\pars{\meta{coordinate n}}|}|$$ is equivalent to $$|page constraint = ||{\isalive|\pararg{coordinate 1}| &&|\,\cdots\,|&& \isalive|\pararg{coordinate n}|}|$$ @@ -843,7 +936,7 @@ is the same as |\structline(1,0)(2,2)|, except that you can't later use |\struct \end{keylist} \begin{keylist}{class style,permanent cycle style,transient cycle style,this page class style,differential style,struct line style} -These classes apply the styling of the corresponding element to your \tikzpkg\space commands. +These classes apply the styling of the corresponding element to your \tikzpkg\ commands. \begin{codeexample}[width = 6cm] \begin{sseqpage}[ differentials = blue, yscale = 0.65, no axes ] \class(0,2) @@ -857,7 +950,8 @@ See |\getdtarget| for a more natural example. -\section{Miscellaneous commands} +\section{Miscellaneous Commands} +\subsection{Settings} \begin{command}{\sseqset\marg{keys}} The |\sseqset| command is for adjusting the global options for all spectral sequences in the current scope, or for applying options to the rest of the current spectral sequence. For instance, if most of the spectral sequences in the current document are going to be Adams graded, you can say |\sseqset{Adams grading}| and all future spectral sequences in the current scope will have Adams grading (unless you specify a different grading explicitly). As another example, |\sseqset{no axes}| will suppress axes from spectral sequences in the current scope. Note that defaults only apply to new \sseqdataenv\ environments or to unnamed \sseqpageenv\ environments; they won't apply to existing spectral sequences. @@ -868,10 +962,10 @@ You can also use |\sseqset| to create styles to be used in spectral sequences. .sseq style = \meta{keys}, .sseq append style = \meta{keys} } -These handlers create reusable styles to be used in spectral sequences. If this style is a set of global options, then use the |.global sseq style| handler, whereas if it is supposed to be applied to individual features (classes, differentials, struct lines, circle classes, and tikz primitives) then use the |.sseq style| handler. +These handlers create reusable styles to be used in spectral sequences. If this style is a set of global options, then use the |.global sseq style| handler, whereas if it is supposed to be applied to individual features (classes, differentials, structure lines, circle classes, and tikz primitives) then use the |.sseq style| handler. \begin{codeexample}[width=6cm] \sseqset{ - mysseq/.style = { + mysseq/.global sseq style = { Adams grading, title = Page \page, x range = {0}{4}, y range = {0}{2}, xscale = 0.5, yscale = 1.35 @@ -881,7 +975,8 @@ These handlers create reusable styles to be used in spectral sequences. If this \begin{sseqpage}[ mysseq ] \class(0,0) \class(0,1) \class(0,2) \class(0,3) \class(3,1) \class(3,2) \class(3,3) -\structline(0,0)(0,1) \structline(0,1)(0,2) \structline(0,2)(0,3) +\structline(0,0)(0,1) \structline(0,1)(0,2) +\structline(0,2)(0,3) \structline(3,1)(3,2) \structline(3,2)(3,3) \structline[htwostruct](0,0)(3,1) \structline[htwostruct](0,1)(3,2) @@ -891,26 +986,94 @@ These handlers create reusable styles to be used in spectral sequences. If this \end{keylist} \end{command} -\begin{command}{\foreach} -This command is from \tikzpkg\space and works in pretty much the same way in \sseqpages, though with slightly better variants. The |\foreach| command is very flexible and has a lot of variants. See the \href{\pgfmanualurl#section.64}{\tikzpkg\space manual} for more details. -\end{command} - \begin{command}{\sseqerrortowarning\meta{error-name}} -Turns the error with the given name into a warning. An error message will start by saying |sseqpages error: "error-name"|. This is the name you need to put into this command. +Turns the error with the given name into a warning. An error message will start by saying \let\eatclnifpresent\empty|spectralsequences error: "error-name"|. This is the name you need to put into this command. \end{command} -\begin{command}{\sseqnormalizemonomial} -This command simplifies a monomial by combining like variables and removing bases that are raised to the 0th power, removing exponents of 1, removing 1's, and replacing the empty monomial with 1. It outputs its result into |\processedlabel|. This command is specifically meant to be used as a value for |class label handler|, so see the example there for the actual purpose. The exponents must be integers or else it will misbehave. -\begin{codeexample}[] -\sseqnormalizemonomial{x^0y^0} $\processedlabel$, \quad -\sseqnormalizemonomial{x^3yx^{-1}z^0} $\processedlabel$, \quad -\sseqnormalizemonomial{1x_2^2x^2_2} $\processedlabel$ +\subsection{Code reuse commands} +\begin{command}{\foreach } +This command is from \tikzpkg\ and works in pretty much the same way in \sseqpages, though with slightly better variants. The |\foreach| command is very flexible and has a lot of variants. The basic usage is |\foreach \x in {\meta{xmin},...,\meta{xmax}} \marg{loop body}| which will execute |\meta{loop body}| with |\x| set to each value between \meta{xmin} and \meta{xmax} inclusive. If you want a step greater than 1, try |\foreach \x in {\meta{xmin},\meta{xmin}+\meta{xstep},...,\meta{xmax}} \marg{loop body}|. + +If you need to do multiple loops with a common body, you can just stack the |\foreach| commands: +\begin{codeexample}[width=6cm] +\begin{sseqpage}[ xscale = 0.5, x tick step = 2 ] +\foreach \x in {0,2,...,6} +\foreach \y in {0,...,3}{ + \class(\x,\y) +} +\end{sseqpage} \end{codeexample} + +You can also loop through tuples, for instance: +\begin{codeexample}[width=6cm] +\begin{sseqpage}[ xscale = 0.5 ] +\foreach \x/\y/\label in {0/1/a,1/1/b,0/0/c,1/0/d}{ + \class["\label" above](\x,\y) +} +\end{sseqpage} +\end{codeexample} +See the last example for |normalize monomial| for a better example of this usage. + +There are tons of other things you can do with |\foreach|, though I haven't yet found need for them in combination with \sseqpages. See the \href{\pgfmanualurl#section.64}{\tikzpkg\ manual} for more details. \end{command} -\begin{commandlist}{\NewSseqCommand \texttt{\textbackslash}\meta{command}\marg{argspec}\marg{body}, - \DeclareSseqCommand\texttt{\textbackslash}\meta{command}\marg{argspec}\marg{body}} -The \xparsepkg\ package provides these very powerful commands for defining macros. They are used internally to the \sseqpages\space package to define |\class|, |\d|, etc. To help you create variants of these commands, I will record here the argument specifications for each of them. See the \href{\xparseurl}{\xparsepkg\ manual} for a better explanation and more information. +\begin{commandlist}{ + \Do\marg{iterations}\meta{loop body}, + \DoUntilOutOfBounds\meta{loop body}, + \DoUntilOutOfBoundsThenNMore\marg{extra iterations}\meta{loop body}, + \iteration +} +The one use case that |\foreach| doesn't cover all that well is if you want the loop to always repeat until the features you are drawing go off the page. This is what |\DoUntilOutOfBounds| and |\DoUntilOutOfBoundsThenNMore| are for. These help ensure that if you change the range of your chart, infinite families will automatically be drawn correctly without the need to adjust a bunch of loop bounds. The purpose of |\DoUntilOutOfBoundsThenNMore| is for towers that are receiving a differential. If your spectral sequence is Adams graded, and a tower is receiving a $d_r$ differential from another tower, you should use |\DoUntilOutOfBoundsThenNMore{r}|: +\begin{codeexample}[width=7cm] +\begin{sseqpage}[ + Adams grading, classes = fill, + x range = {0}{10}, y range = {0}{6}, + x tick step = 2, + xscale = 0.3,yscale = 0.7, + run off differentials = {->} +] +\class(0,0) +\DoUntilOutOfBoundsThenNMore{3}{ + \class(\lastx+1,\lasty+1) + \structline +} +\class(4,0) +\DoUntilOutOfBounds{ + \class(\lastx+1,\lasty+1) + \structline + \d3 +} +\end{sseqpage} +\end{codeexample} +You can also nest |\DoUntilOutOfBounds| reasonably: +\begin{codeexample}[width=7cm] +\begin{sseqpage}[ + x range = {0}{6}, y range = {0}{6}, + tick step = 2, + scale = 0.6 +] +\class(0,0) +\DoUntilOutOfBounds{ + \class(\lastx+1,\lasty+1) + \structline + \DoUntilOutOfBounds{ + \class(\lastx,\lasty+1) + \structline + } +} +\end{sseqpage} +\end{codeexample} +One important difference between |\foreach| and the |\Do| family of commands is that |\Do| has no effect on the stack. This is in order to ensure that they nest properly. + +Note that if you are using these commands and you are planning to draw several pictures of the chart with restricted range, you need to specify a range for the \sseqdataenv\ that contains all of the ranges of pages that you want to draw. If you then want to set a smaller default range, specify the smaller range the first time you use \sseqpageenv\ or |\printpage| to draw the spectral sequence, and include the |keep changes| key. + +The |\Do| command is less general than |\foreach|; the purpose is to provide a syntax for stack-based looping that is similar to |\DoUntilOutOfBounds| but with a fixed range. So |\Do{n}\marg{loop body}| repeats \meta{loop body} |n| times. The assumption is that the loop body draws something relative to the position of the |\lastclass|. + +If you need to know how many iterations one of these three commands has gone through, this is stored in the variable |\iteration|. +\end{commandlist} +\begin{commandlist}{\NewSseqCommand \cmdarg{command}\marg{argspec}\marg{body}, + \DeclareSseqCommand\cmdarg{command}\marg{argspec}\marg{body}} +The \xparsepkg\ package provides these very powerful commands for defining macros. They are used internally to the \sseqpages\ package to define |\class|, |\d|, etc. To help you create variants of these commands, I will record here the argument specifications for each of them. See the \href{\xparseurl}{\xparsepkg\ manual} for a better explanation and more information. To make a command like |\class|, you can use the argument specification |O{}r()|. The argument type \texttt{O\marg{default}} stands for a bracket delimited optional argument with default value \meta{default}. In this case, we've specified the default to be empty. |r()| stands for a ``required'' argument delimited by |(| and |)|. In the command definition, access the optional argument with |#1| and the coordinate with |#2|. \begin{codeexample}[width = 6.5cm,vbox] @@ -956,7 +1119,7 @@ An example where this is actually useful: \DeclareSseqCommand\etaclass{ O{} d() }{ \IfNoValueF{#2}{ \pushstack(#2) } \class[#1] (\lastx+1, \lasty+1) - \structline (\lastclass) (\lastclass1) + \structline } \begin{sseqpage}[ classes = fill, yscale = 0.55 ] \class(0,0) @@ -968,6 +1131,11 @@ An example where this is actually useful: The |\d| command has argument specification |O{} U( r()|. The argument type |U| is special to \sseqpages, and is a variant of until that reinserts the delimiting token. This allows the |(| token to also delimit the beginning of the |r()| argument. Note that the argument type |U| is specially added by \sseqpages\ and might be removed in the future if the \LaTeX3 team yells at me or something. + \ExplSyntaxOn + \cs_set_eq:NN \__xparse_add_type_U:w \sseq__xparse_add_type_U:w + \cs_set_eq:NN \__xparse_normalize_type_U:w \sseq__xparse_normalize_type_U:w + \sseq@install@xparse@Uarggrabber + \ExplSyntaxOff \begin{codeexample}[width = 7cm,vbox] \DeclareDocumentCommand {\demo} { O{} U( r() } { \#1 = \textcolor{purple}{\{#1\}}; @@ -990,10 +1158,10 @@ The |\structline| and |\changeclasses| commands have argument specification |O{} \end{codeexample} \end{commandlist} -\begin{commandlist}{\NewSseqGroup\texttt{\textbackslash}\meta{command}\oarg{argspec}\marg{body}, - \DeclareSseqGroup\texttt{\textbackslash}\meta{command}\oarg{argspec}\marg{body}} -% TODO: explain me -So that calling |\mygroup(x,y)| prints the whole group shifted to start at $\mathtt{(x,y)}$ instead of $\mathtt{(0,0)}$. For instance: +\begin{commandlist}{\NewSseqGroup\cmdarg{command}\marg{argspec}\marg{body}, + \DeclareSseqGroup\cmdarg{command}\marg{argspec}\marg{body}} +These are similar to |\NewSseqCommand| and |\DeclareSseqCommand| except that the commands defined take an optional square bracket delimited options list, followed by an optional parenthesis delimited |(x,y)| pair and wraps the body of the code in |\begin{scope}[xshift = \meta{xcoord}, yshift = \meta{ycoord}, options]|. +For instance: \begin{codeexample}[width = 8cm] \DeclareSseqGroup\tower {m} { \class(0,0) @@ -1003,28 +1171,115 @@ So that calling |\mygroup(x,y)| prints the whole group shifted to start at $\mat } } \begin{sseqpage} -\tower[orange](0,0){4} -\tower[red](1,1){2} +\tower[orange]{4} +\tower(1,1){2} \end{sseqpage} \end{codeexample} +Here we define a command which takes an options list, a coordinate, and a single mandatory argument. The options are applied to all the classes and structlines, the coordinate shifts the origin, and the mandatory argument is the length of the tower. \end{commandlist} -\begin{command}{\getdtarget\marg{macro}\marg{page}\pars{\sourcecoord}} -Sets \meta{macro} equal to the coordinates of the target position of a length \meta{page} differential starting at \sourcecoord. This helps to make commands that draw fancy differentials. For instance, consider the following example, suggested by Catherine Ray: +\subsection{Families} +\spectralsequences\ has a concept of ``class families'' that can be drawn or suppressed as a group, and that can have styling options applied to them as a group. +\begin{command}{\sseqnewfamily\marg{family name}} +This makes a new family with name \meta{family name}. The effect of this is to define global options |\meta{family name} style| which apply options to all classes in the family, |draw \meta{family name}| which causes the family to be drawn, and |no \meta{family name}| which suppresses the family (drawing is the default behavior of course). It also defines an option |\meta{family name}| which puts a feature into the family -- so it can be used as an option to any of the normal commands like |\class|, |\d|, |\structline|, etc and to a scope. + +\begin{codeexample}[vbox] +\sseqnewfamily{imJ} +\begin{sseqdata}[ + name=ANSS-S_2, Adams grading, + class labels={below}, label distance=-1pt, + class placement transform={rotate=90,scale=2}, + differentials=blue, + x range={0}{9}, y range={0}{4}, + xscale=0.7, grid=go +] +% Image of J classes +\begin{scope}[imJ] +\class[rectangle,fill,inner sep=3pt](0,0) +\DoUntilOutOfBoundsThenNMore{3}{\etaclass} +\classoptions["\alpha_1" above left](1,1) +\class["\alpha_{2/2}",circlen=2](3,1) +\structline(0,0) \structline[dashed](3,3) +\class["\alpha_3"](5,1) \d3\relax +\DoUntilOutOfBounds{ \etaclass \d3 } +\class["\alpha_{4/4}", rectangle, "16" {font=\tiny,inside}, inner sep=1pt](7,1) +\DoUntilOutOfBoundsThenNMore{3}{\etaclass} +\end{scope} + +% Other classes +\class["\beta_{2/2}" {below right=-4pt}, insert = 1](6,2) +\structline(3,1) +\class["\beta_{2}" left](8,2) +\etaclass\structline(6,2,2) % This is a *nu +\end{sseqdata} + +\printpage[name=ANSS-S_2, title = with image of J, imJ style=purple] + +\printpage[name=ANSS-S_2, no imJ, x range={2}{9}, title = without image of J] +\end{codeexample} +\end{command} + + +\subsection{Utilities} +\begin{command}{\sseqparseint\cmdarg{macro}\marg{integer expression}} +Stores the result of evaluating an integer expression into \cmdarg{macro}. An integer expression consists of |+|, |-|, |*|, |/|, parentheses, and macros that expand to more of the same. The exact rules regarding what is a valid expression are pretty much what you would expect. Note that juxtaposition is a syntax error, not multiplication, so |2(1+1)| is invalid, you must say |2*(1+1)|. +\end{command} + +\begin{command}{\sseqifempty\marg{expression}\marg{true code}\marg{false code}} +This tests if an expression is the empty expression. This is mainly useful for giving systematic labels to things. Probably it won't ever matter to you. +\end{command} + +\begin{commandlist}{ + \IfOutOfBoundsTF\pararg{coordinate}\marg{true code}\marg{false code}, + \IfOutOfBoundsT\pararg{coordinate}\marg{true code}, + \IfOutOfBoundsF\pararg{coordinate}\marg{false code}, + \IfInBoundsTF\pararg{coordinate}\marg{true code}\marg{false code}, + \IfInBoundsT\pararg{coordinate}\marg{true code}, + \IfInBoundsF\pararg{coordinate}\marg{false code} +} +Test whether an existing class is in bounds or out of bounds. I don't have an obvious use for these. I had to make commands to do this as part of the drawing code and in order to make |\DoUntilOutOfBounds| and it was no extra effort to expose them. Maybe they will be helpful at some point. +\end{commandlist} + + +\begin{command}{\sseqnormalizemonomial} +This command simplifies a monomial by combining like variables and removing bases that are raised to the 0th power, removing exponents of 1, removing 1's, and replacing the empty monomial with 1. It outputs its result into |\processedlabel|. This command is specifically meant to be used as a value for |class label handler|, so see the example there for the actual purpose. The exponents must be integers or else it will misbehave. \begin{codeexample}[] -% O{}u(u) is the arg-spec for \d, O{}u(u)mm looks like \d with two extra mandatory arguments -\NewSseqCommand{\twods}{ O{} U( r() m m }{ - \getdtarget\target#2{#3} % Store the target position in \target - \nameclass{source}(#3) % naming the classes gives us a speed boost - \nameclass{target1}(\target,#4) % by preventing sseqpages from reparsing the coordinate - \nameclass{target2}(\target,#5) % it also makes the code easier to read +\sseqnormalizemonomial{x^0y^0} $\processedlabel$, \quad +\sseqnormalizemonomial{x^3yx^{-1}z^0} $\processedlabel$, \quad +\sseqnormalizemonomial{1x_2^2x^2_2} $\processedlabel$ +\end{codeexample} +\end{command} + + +\subsection{Coordinate parsers and related} +% \parsecoordinate and \parsedifferential +\begin{command}{\parsecoordinate\cmdarg{macro}(\meta{coordinate})} +This command parses the coordinate and puts the triple |(x,y,n)| into \cmdarg{macro}. It also puts the components of the coordinate into macros, for instance if \cmdarg{macro} is |\coord|, then |\xcoord| will contain the x coordinate, |\ycoord| will contain the y coordinate, and |\ncoord| will contain the index. The coordinate can be anything that would be valid to use in a differential or structure line; this is the macro that is used internally to handle coordinates. +\end{command} + +\begin{command}{\getdtarget\cmdarg{macro}\marg{page}\pars{\sourcecoord}} +Sets \cmdarg{macro} equal to the coordinates of the target position of a length \meta{page} differential starting at \sourcecoord. This helps to make commands that draw fancy differentials. +\end{command} + +\begin{command}{\parsedifferential\meta{page}(\meta{differential coordinate})\opt{\pararg{differential target}}} +This has the same weird syntax of |\d|, except that you are required to put braces around the page (if it has multiple digits) and you are required to provide at least one coordinate (you have to say |\parsedifferential{2}(\lastclass)| for instance). This command is similar in effect to saying both |\parsecoordinate\source\meta{source coordinate}| and |\parsecoordinate\target\meta{target coordinate}|, but it handles determination of the target coordinate for you. + + +For instance, consider the following example, suggested by Catherine Ray: +\begin{codeexample}[] +% O{} U( r() is the arg-spec for \d, O{} U( r() mm looks like \d with one extra mandatory arguments +\NewSseqCommand{\twods}{ O{} U( r() d() m }{ + \parsedifferential{#2}(#3)(#4) % Store the target position in \target + \nameclass{source}(\sourcecoord,\nsource) % give names to the three classes + \nameclass{target1}(\targetcoord,\ntarget) + \nameclass{target2}(\targetcoord,#5) % - \circleclasses[ cc:differential style, #1, - name path = circ, page = #2--#2 ] - (target1)(target2) % Circle the classes, use differential style + \circleclasses[ cc:differential style, name path = circ, + #1, page = #2--#2 ] + (target1)(target2) % Circle the classes, use differential style % - \d[invisible]#2(source)(target1) % don't draw anything, but record source and targets as hit. - \d[invisible]#2(source)(target2) + % record source and targets as hit. + \kill#2(source) \kill#2(target1) \kill#2(target2) % \path(target1)--(target2) coordinate[midway](midpt);% put a coordinate in the center of the two classes @@ -1040,7 +1295,7 @@ Sets \meta{macro} equal to the coordinates of the target position of a length \m \class(0,2) \class(1,0)\class(1,0) -\twods2(1,0,-1){1}{2} +\twods2(1,0,-1,1){2} \end{sseqdata} \printpage[ name = cathex, page = 1 ] \qquad @@ -1051,21 +1306,21 @@ Sets \meta{macro} equal to the coordinates of the target position of a length \m \end{command} \begin{command}{\nameclass\marg{name}\pararg{coordinate}} -The |\nameclass| command gives a name to a class. It's similar to saying |\doptions[name = |\meta{name}|]|, but faster. It's also similar to saying |\pushstack|\pararg{coordinate}. Giving temporary names to coordinates that you are going to use repeatedly makes the code easier to read and is faster (though this only matters in very large diagrams). See |\getdtarget| for an example. +The |\nameclass| command gives a name to a class. It's similar to saying |\doptions[name = |\meta{name}|]|, but faster. It's also similar to saying |\pushstack|\pararg{coordinate}. Giving temporary names to coordinates that you are going to use repeatedly makes the code easier to read and is faster (though this only matters in very large charts). See |\getdtarget| for an example. \end{command} \begin{command}{\tagclass\marg{tag}\pararg{coordinate}} The |\tagclass| command gives a tag to a class. It's similar to saying |\doptions[tag = |\meta{name}|]|, but faster. See \example{tmfmayss} for a use case for this. \end{command} -\begin{command}{\gettag\texttt{\textbackslash}\meta{somecontrolsequence}\pararg{coordinate}} +\begin{command}{\gettag\cmdarg{somecontrolsequence}\pararg{coordinate}} The |\gettag| command finds the most recent tag applied to the coordinate and stores it into the command. This is useful for connecting groups of nodes. For example, consider the following code, inspired by \example{tmfmayss}. \begin{codeexample}[width=6cm] \DeclareSseqCommand \tower { O{} } { \begin{scope}[#1] \foreach\i in {1,...,7}{ \class(\lastx,\lasty+1) - \structline(\lastclass1)(\lastclass) + \structline } \end{scope} \restorestack @@ -1077,12 +1332,12 @@ The |\gettag| command finds the most recent tag applied to the coordinate and st \begin{scope}[#1] \gettag\thetag(\lastclass) \class(\lastx+3,\lasty+1) - \structline[gray](\lastclass)(\lastclass1) + \structline[gray] \savestack \foreach\i in {1,...,7}{ \class(\lastx,\lasty+1) - \structline(\lastclass1)(\lastclass) - \structline[gray](\lastx-3,\lasty-1,\thetag)(\lastclass) + \structline + \structline[gray](\lastx-3,\lasty-1,\thetag) } \restorestack \end{scope} @@ -1101,16 +1356,55 @@ The |\gettag| command finds the most recent tag applied to the coordinate and st \end{command} -\subsection{The Class Stack} +\subsection{The class stack} \label{sec:class stack} -The class stack is a linked list of the classes in the order that they are produced that \sseqpages\space maintains. I've only recently implemented this feature, so it is more liable to change in the future than other things. Whenever you use the |\class| function, the class you added is pushed onto the stack. Here's an example that demonstrates basic usage: +The class stack is a linked list of the classes in the order that they are produced that \sseqpages\ maintains. I've only recently implemented this feature, so it is more liable to change in the future than other things. Whenever you use the |\class| function, the class you added is pushed onto the stack. Here's an example that demonstrates basic usage: The following commands are used to access the stack: \begin{commandlist}{\lastx\opt{\meta{n}},\lasty\opt{\meta{n}},\lastclass\opt{\meta{n}}} The commands |\lastx| and |\lasty| evaluate to the |x| and |y| position, respectively, of the $n$th class on the stack. If $n = 0$ you can leave it off. -The command |\lastclass| evaluates to the coordinate of +The command |\lastclass| evaluates to the coordinate of the most recent class on the stack. This is useful for writing turtle-style code: +\begin{codeexample}[width=6cm] +\DeclareSseqCommand \etaclass {}{ + \class(\lastx+1,\lasty+1) + \structline +} +\DeclareSseqCommand \divtwoclass {}{ + \class(\lastx,\lasty-1) + \structline +} +\begin{sseqpage} +\class(0,0) +\savestack +\foreach \y in { 1,...,5 }{ + \class(0,\y) + \structline +} +\restorestack +\etaclass\etaclass\etaclass +\divtwoclass\divtwoclass +\end{sseqpage} +\end{codeexample} + +You can use |\lastx| and |\lasty| in other contexts than in the body of a \sseqpages\ command, most notably inside |\sseqparseint| (they also go fine inside |\pgfmathparse| if you need it or one of its siblings). For instance, consider the following tower command: +\begin{codeexample}[width=6cm] +\DeclareSseqCommand \tower { } { + \savestack + \sseqparseint\numclasses{\ymax-\lasty0} + \foreach \n in {1,...,\numclasses}{ + \class(\lastx,\lasty+1) + \structline + } + \restorestack +} +\begin{sseqpage}[y range = {0}{5}] +\class(0,0)\tower +\class(1,3)\tower +\class(3,2)\tower +\end{sseqpage} +\end{codeexample} \end{commandlist} @@ -1124,7 +1418,7 @@ This saves and reverts the stack. Saves nest. Most frequently, you will want to \section{Styles} -The \sseqpages\space package has a large number of styles which control the appearance of specific components (e.g., classes, differentials, or structlines) of a spectral sequence. Each style has two corresponding keys: |classes| and |change classes|. Saying |classes = |\marg{keys} adds the keys to the list of options used to style every future class, whereas |change classes = |\marg{keys} only makes sense in a \sseqpageenv\space environment, and temporarily overwrites the list of options. Note that |change classes| only applies to classes that existed before the current page, and that even with the |keep changes| option, the |change classes| options are local to the current page. Compare: +The \sseqpages\ package has a large number of styles which control the appearance of specific components (e.g., classes, differentials, or structure lines) of a spectral sequence. Each style has two corresponding keys: |classes| and |change classes|. Saying |classes = |\marg{keys} adds the keys to the list of options used to style every future class, whereas |change classes = |\marg{keys} only makes sense in a \sseqpageenv\ environment, and temporarily overwrites the list of options. Note that |change classes| only applies to classes that existed before the current page, and that even with the |keep changes| option, the |change classes| options are local to the current page. Compare: \begin{codeexample}[width = 8cm] \begin{sseqdata}[ name = stylesex ] \class(0,0)\class(1,1) @@ -1142,7 +1436,7 @@ The \sseqpages\space package has a large number of styles which control the appe \end{sseqpage} \end{codeexample} -You can modify these styles outside of a spectral sequence or inside it using |\sseqset|, you can modify them as options to the \sseqdataenv\space and \sseqpageenv\space environments, or you can modify them as arguments to the \scopeenv\space environment. +You can modify these styles outside of a spectral sequence or inside it using |\sseqset|, you can modify them as options to the \sseqdataenv\ and \sseqpageenv\ environments, or you can modify them as arguments to the \scopeenv\ environment. In cases where the same drawing feature is affected by multiple of these styles, the more specific style takes precedence. For instance, for a class that is the source or target of a differential on the current page, the precedence order from lowest to highest goes: |sseq style|, |class style|, |transient cycle style|, |this page cycle style|, and then any options from scopes in the order they appear, and any local options (the options that come right with the class, e.g., |\class[local options](x,y)|). If you don't want the options to your scopes to override more specific styles, use |sseq|: \begin{codeexample}[width = 7cm] @@ -1157,7 +1451,7 @@ In cases where the same drawing feature is affected by multiple of these styles, \begin{sseqpage}[ classes = { blue, fill }, title style = { align = center, text width = 2.4cm }, - title = { only structline is orange } ] + title = { only structure line is orange } ] \begin{scope}[ sseq = orange ] \class(0,0) \class(0,1) \structline(0,0)(0,1) @@ -1239,8 +1533,7 @@ These options change the appearance of all cycles which support or are hit by a \class(1,3) \class(2,0) \d2(1,0) \d3(2,0) \end{sseqdata} -\printpage[ name = this page cycles example, page = 2 ] -\hskip1cm +\printpage[ name = this page cycles example, page = 2 ] \qquad \printpage[ name = this page cycles example, page = 3 ] \end{codeexample} \end{stylekeylist} @@ -1254,19 +1547,20 @@ This style applies to structure lines whose source or target is hit on the curre \end{stylekeylist} \begin{stylekeylist}{tikz primitives,change tikz primitives} -Applies to all \tikzpkg\space primitives. +Applies to all \tikzpkg\ primitives. \end{stylekeylist} \begin{stylekeylist}{labels,change labels} -This style applies to labels on classes, differentials, and structlines. All the more specific label styles take precedence over it. +This style applies to labels on classes, differentials, and structure lines. All the more specific label styles take precedence over it. \end{stylekeylist} \begin{stylekeylist}{class labels,inner class labels,outer class labels, change class labels,change inner class labels,change outer class labels} Inner class labels specifically applies to class labels that are inside the node, outer class labels specifically applies to ones outside it: \begin{codeexample}[] -\begin{sseqpage}[ no axes, classes = { inner sep = 0.1cm }, +\begin{sseqpage}[ no axes, classes = { inner sep = 1pt }, + label distance=2pt, outer class labels = { red }, inner class labels = { blue } ] \class["a", "b" above](0,0) @@ -1301,9 +1595,9 @@ This sets the default distance from a class to an outer label. There are also va \begin{keylist}{run off = \meta{start tip}--\meta{end tip}, run off struct lines = \meta{start tip}--\meta{end tip} (initially {...--...}), run off differentials = \meta{start tip}--\meta{end tip} (initially {...--...})} -Change the default behavior of run off edges for either all edges, just struct lines, or just differentials respectively. Local arrowhead options override this. +Change the default behavior of run off edges for either all edges, just structure lines, or just differentials respectively. Local arrowhead options override this. -If an edge runs off the edge of the clipping, sseqpages automatically add an arrowhead to indicate that the edge continues. This option controls which arrow head is added if the start or end of an edge runs off the page. +If an edge runs off the edge of the clipping, \sseqpages\ automatically add an arrowhead to indicate that the edge continues. This option controls which arrow head is added if the start or end of an edge runs off the page. \begin{codeexample}[width = 6cm] \begin{sseqpage}[ x range = {0}{2}, y range = {0}{2}, draw orphan edges, run off = >-stealth ] @@ -1325,13 +1619,13 @@ The main function \sseqpages\ provides for use here is |\sseqnormalizemonomial{# Here is an example of a function that evaluates an arithmetic expression: \begin{codeexample}[width=6cm] \begin{sseqpage}[ - class label handler = { \edef\processedlabel{\the\numexpr#1} } + class label handler = { \sseqparseint\processedlabel{#1} } ] \class["1+1"](0,0) \class["1+2*(1+3*(4-1))"](1,1) \end{sseqpage} \end{codeexample} -Here's an example using |\sseqnormalizepolynomial|: +Here's an example using |\sseqnormalizemonomial|: \begin{codeexample}[width = 6cm] \NewSseqGroup \test {m} { \class["1#1"](0,0) @@ -1350,6 +1644,7 @@ Here's an example using |\sseqnormalizepolynomial|: \end{codeexample} Here is another example which demonstrates a useful idiom for drawing Serre spectral sequences. For a more complete example, see \example{KF3n}. Note the use of braces in |{Sq^1\iota_2}|. Without braces, |\sseqnormalizemonomial| will simplify |Sq^1xSq^2x| into $S^2q^3x^2$, which is obviously undesirable, so the correct way to input this is |{Sq^1x}{Sq^2x}|. Unfortunately, |\foreach| strips a pair of braces from its arguments, so you need to put two pairs of braces. +%\pgfmanualpdflabel{normalizemonomialex-labels} \begin{codeexample}[width=8cm] \begin{sseqpage}[ xscale = 1.4, @@ -1368,20 +1663,22 @@ Here is another example which demonstrates a useful idiom for drawing Serre spec \end{key} -\section{Global options} -These options can only be set at the beginning of a \sseqdataenv\space or \sseqpageenv\space environment. When it makes sense, you can also set a default value using |\sseqset|. Generally, these options either modify the plot style or the logic for the spectral sequence. +\section{Global Options} +These options can only be set at the beginning of a \sseqdataenv\ or \sseqpageenv\ environment. When it makes sense, you can also set a default value using |\sseqset|. Generally, these options either modify the plot style or the logic for the spectral sequence. \begin{key}{name = \meta{sseq name}} -This option must be used with the \sseqdataenv\space environment where it indicates the name of the spectral sequence, which will be used with the \sseqpageenv\space environment or |\printpage| command to draw the spectral sequence. The name used in a \sseqdataenv\space environment must be new unless the environment is used with the |update existing| key in which case the \sseqdataenv\space environment will add to the existing spectral sequence. It is optional when used with \sseqpageenv\space, and if included the name given must be the name of an existing spectral sequence. +This option must be used with the \sseqdataenv\ environment where it indicates the name of the spectral sequence, which will be used with the \sseqpageenv\ environment or |\printpage| command to draw the spectral sequence. The name used in a \sseqdataenv\ environment must be new unless the environment is used with the |update existing| key in which case the \sseqdataenv\ environment will add to the existing spectral sequence. It is optional when used with \sseqpageenv\ , and if included the name given must be the name of an existing spectral sequence. \end{key} -\begin{key}{page = \meta{page number} (initially 0)} -This key is for \sseqpageenv\space and |\printpage|. It specifies which page of the spectral sequence is to be printed. On page r, all |\class|es that are not hit by differentials on pages less than r will be printed, as well as all |\structline|s whose source and target classes are both printed on page r, and all differentials of length exactly r. The special value |page = 0| prints all classes, differentials, and structure lines. +\begin{key}{page = \meta{page number}\opt{--\meta{page max} (initially 0)}} +This key is for \sseqpageenv\ and |\printpage|. It specifies which page of the spectral sequence is to be printed. On page r, all |\class|es that are not hit by differentials on pages less than r will be printed, as well as all |\structline|s whose source and target classes are both printed on page r, and all differentials of length exactly r. The special value |page = 0| prints all classes, differentials, and structure lines. + +If you use this key with a range, then all differentials in that range of lengths will be drawn. The larger number only changes which differentials are drawn. If you use 0 for the \meta{page max}, then all differentials longer than \meta{page number} will be drawn. \end{key} \begin{keylist}{degree = \marg{x degree}\marg{y degree},cohomological Serre grading, homological Serre grading, Adams grading} Specifies the degree of differentials. The \meta{x degree} and \meta{y degree} should both be mathematical expressions in one variable |#1| that evaluate to integers on any input. They specify the $\mathtt{x}$ and $\mathtt{y}$ displacement of a page $\mathtt{\#1}$ differential. In practice, they will be linear expressions with |#1| coefficient 1, -1, or 0. -The |degree| option must be given before placing any differentials. It can be specified at the beginning of the \sseqdataenv\space environment, at the beginning of the \sseqpageenv\space environment if it is being used as a standalone page, or as a default by saying |\sseqset{degree = \marg{x degree}\marg{y degree}}| or |\sseqset{Adams grading}| outside of the \sseqdataenv\space and \sseqpages\space environments. +The |degree| option must be given before placing any differentials. It can be specified at the beginning of the \sseqdataenv\ environment, at the beginning of the \sseqpageenv\ environment if it is being used as a standalone page, or as a default by saying |\sseqset{degree = \marg{x degree}\marg{y degree}}| or |\sseqset{Adams grading}| outside of the \sseqdataenv\ and \sseqpages\ environments. You can make a named grading convention by saying \codeverb|\sseqset{my grading/.sseq grading = \marg{x degree}\marg{y degree}}|. Then later passing |my grading| to a spectral sequence is equivalent to saying |degree = \marg{x degree}\marg{y degree}|. The following grading conventions exist by default: \begin{codeexample}[width = 6cm] @@ -1411,7 +1708,7 @@ You can make a named grading convention by saying \codeverb|\sseqset{my grading/ \end{keylist} \begin{keylist}{strict degree, lax degree} -If the degree is strict, then latex will throw an error if you try to specify a differential that doesn't have the proper grading. The degree is strict by default. +If the degree is strict, then \LaTeX will throw an error if you try to specify a differential that doesn't have the proper grading. The degree is strict by default. \begin{codeexample}[code only] \begin{sseqdata}[ name = laxdegree, Adams grading ] \class(0,2) @@ -1432,13 +1729,13 @@ If the degree is strict, then latex will throw an error if you try to specify a \end{keylist} \begin{key}{update existing} -This key is only for the \sseqdataenv\space environment. It specifies that the current \sseqdataenv\space environment is adding data to an existing spectral sequence. If you don't pass this key, then giving a \sseqdataenv\space environment the same |name| as a different \sseqdataenv\space environment will cause an error. This is intended to help you avoid accidentally reusing the same name. +This key is only for the \sseqdataenv\ environment. It specifies that the current \sseqdataenv\ environment is adding data to an existing spectral sequence. If you don't pass this key, then giving a \sseqdataenv\ environment the same |name| as a different \sseqdataenv\ environment will cause an error. This is intended to help you avoid accidentally reusing the same name. \end{key} \begin{key}{keep changes =\meta{boolean} (default true)(initially false)} -This option is only for the \sseqpageenv\space environment, and only works when a |name| is provided. -This option specifies that all of the commands in the current \sseqpageenv\space environment should be carried forward to future pages of the same named spectral sequence. For example: +This option is only for the \sseqpageenv\ environment, and only works when a |name| is provided. +This option specifies that all of the commands in the current \sseqpageenv\ environment should be carried forward to future pages of the same named spectral sequence. For example: \begin{codeexample}[] \begin{sseqdata}[ name = keep changes example, Adams grading, y range = {0}{3} ] \class(0,0) @@ -1463,15 +1760,12 @@ This option specifies that all of the commands in the current \sseqpageenv\space \printpage[ name = keep changes example, page = 3 ] \end{codeexample} -Note that the orange classes and differential do not persist because the |keep changes| option is not set in the first \sseqpageenv\space environment, but the blue classes and differential do, since the |keep changes| option is set in the second \sseqpageenv\space environment. +Note that the orange classes and differential do not persist because the |keep changes| option is not set in the first \sseqpageenv\ environment, but the blue classes and differential do, since the |keep changes| option is set in the second \sseqpageenv\ environment. \end{key} \begin{keylist}{no differentials,draw differentials} The option |no differentials| suppresses all of the differentials on the current page, whereas |draw differentials| causes the page appropriate differentials to be drawn. This is useful for explaining how the computation of a spectral sequence goes, or if you want to display one of the edges of the spectral sequence, like in \example{KF3n}. -%\begin{codeexample}[] -%TODO: build example -%\end{codeexample} \end{keylist} \begin{keylist}{no struct lines,draw struct lines} @@ -1528,16 +1822,16 @@ Creates a new class pattern. For example, the |linear| class pattern is created (-0.5,0)(-0.3,0)(-0.1,0)(0.1,0)(0.3,0)(0.5,0); } \end{codeexample} -For instance the third row indicates that if there are three classes at the position |(x,y)| they should be printed at |(x-0.2,y)|, |(x,y)|, and |(x+0.2,y)|. You can give as many rows as you like; \sseqpages\space will throw an error if there are more classes in any position than the maximum number that your class pattern can handle -- for instance, the |linear| class pattern can handle up to six classes based on this definition. +For instance the third row indicates that if there are three classes at the position |(x,y)| they should be printed at |(x-0.2,y)|, |(x,y)|, and |(x+0.2,y)|. You can give as many rows as you like; \sseqpages\ will throw an error if there are more classes in any position than the maximum number that your class pattern can handle -- for instance, the |linear| class pattern can handle up to six classes based on this definition. \end{command} \end{key} \begin{key}{class placement transform = \marg{transform keys}, add class placement transform = \marg{transform keys} } \declareasstyle{class placement transform}\declareasstyle{add class placement transform} -The option |class placement transform| allows the user to specify a \tikzpkg\space coordinate transform to adjust the relative position of multiple nodes in the same $\mathtt{(x,y)}$ position. The |class placement transform| key overrides the previous value of transformations, the |add class placement transform| just adds the new transformation to the end of the list. This coordinate transform can only involve rotation and scaling, no translation. Specifying a scaling factor helps if the nodes are too large and overlap. In some cases a rotation makes it easier to see which class is the target of a differential. +The option |class placement transform| allows the user to specify a \tikzpkg\ coordinate transform to adjust the relative position of multiple nodes in the same $\mathtt{(x,y)}$ position. The |class placement transform| key overrides the previous value of transformations, the |add class placement transform| just adds the new transformation to the end of the list. This coordinate transform can only involve rotation and scaling, no translation. Specifying a scaling factor helps if the nodes are too large and overlap. In some cases a rotation makes it easier to see which class is the target of a differential. \begin{codeexample}[width = 5cm] -\begin{sseqpage}[ class placement transform = { xscale = 3 }, +\begin{sseqpage}[ class placement transform = { xscale = 1.5 }, class pattern = linear, classes = { draw = none }, xscale = 2, x axis extend end = 0.7cm ] @@ -1563,7 +1857,7 @@ With multiple large class names, the best option is to arrange the classes verti \begin{codeexample}[width = 5.5cm] \begin{sseqpage}[ classes = {draw = none }, xscale = 2, yscale=1.55, class pattern = linear, - class placement transform = { scale = 3, rotate = 90 }, + class placement transform = { scale = 1.5, rotate = 90 }, right clip padding = 20pt, top clip padding = 20pt, x axis gap = 30pt, y axis gap = 20pt ] \class["\iota_3\beta\iota_3"](7,0) @@ -1584,28 +1878,34 @@ With multiple large class names, the best option is to arrange the classes verti \end{key} \begin{key}{math nodes = \meta{boolean} (default true)(initially true)} -This key instructs \sseqpages\space to put all labels in math mode automatically. +This key instructs \sseqpages\ to put all labels in math mode automatically. \end{key} -\subsection{Global Coordinate Transformations} -Of the normal \tikzpkg\ coordinate transformations, only the following can be applied to a sseq diagram: +\subsection{Global coordinate transformations} +Of the normal \tikzpkg\ coordinate transformations, only the following can be applied to a \sseqpages\ chart: \begin{keylist}{scale = \meta{factor},xscale = \meta{factor}, yscale = \meta{factor}, xmirror, ymirror} -Scale the diagram by \meta{factor}. Under normal circumstances, you can tell \tikzpkg\ to mirror a diagram by saying, for instance, |xscale = -1|, but \sseqpages\space needs to be aware that the diagram has been mirrored in order to draw the axes correctly. Thus, if you want to mirror a spectral sequence, use the |xmirror| and |ymirror| options as appropriate. +Scale the chart by \meta{factor}. Under normal circumstances, you can tell \tikzpkg\ to mirror a chart by saying, for instance, |xscale = -1|, but \sseqpages\ needs to be aware that the chart has been mirrored in order to draw the axes correctly. Thus, if you want to mirror a spectral sequence, use the |xmirror| and |ymirror| options as appropriate. \end{keylist} \begin{key}{rotate = \meta{angle}} It probably won't look great if you pick an angle that isn't a multiple of 90 degrees. \end{key} -\subsection{Plot Options and Axes Style} +\subsection{Plot options and axes style} \begin{keylist}{x range = \marg{x min}\marg{x max},y range = \marg{y min}\marg{y max}} -These options force the x and y range to be a specific interval. By default, if no range is specified then the range is chosen to fit all the classes. If an x range is specified but no y range, then the y range is chosen to fit all the classes that lie inside the specified x range, and vice versa. +These options set the x range (respectively y range) to be a specific interval. By default, if no range is specified then the range is chosen to fit all the classes. If an x range is specified but no y range, then the y range is chosen to fit all the classes that lie inside the specified x range, and vice versa. The values must be integers -- if you want to extend the x axis a noninteger amount, try using |x axis start extend| or |x axis end extend|. \end{keylist} -\begin{key}{grid = \marg{grid style}} -Makes \sseqpages\space draw a grid. The grid styles and a significant part of the code that produces them were stolen from the \sseqpkg\ package. +\begin{keylist}{ + grid = \meta{grid type}, + grid color = \meta{color}, + grid step = \meta{positive integer}, + x grid step = \meta{positive integer}, + y grid step = \meta{positive integer} +} +Makes \sseqpages\ draw a grid. The grid types and a significant part of the code that produces them were stolen from the \sseqpkg\ package. \begin{codeexample}[vbox] \begin{sseqdata}[ name = grid example, scale = 0.8 ] \class(0,0) @@ -1616,27 +1916,31 @@ Makes \sseqpages\space draw a grid. The grid styles and a significant part of th \class(3,3) \end{sseqdata} \hbox{ -\printpage[ name = grid example, grid = chess ] +\printpage[ name = grid example, grid = chess, title=chess ] \qquad -\printpage[ name = grid example, grid = crossword ] -\qquad -\printpage[ name = grid example, grid = dots ] +\printpage[ name = grid example, grid = crossword, title=crossword ] } \vskip20pt \hbox{ -\printpage[ name = grid example, grid = go ] +\printpage[ name = grid example, grid = go, title=go ] \qquad \printpage[ name = grid example, grid = none ] } \end{codeexample} -It is possible to make your own grid style by defining the command |\sseq@grid@yourgridname| to draw a grid. -\end{key} +It is possible to make your own grid type by defining the command |\sseq@grid@yourgridname| to draw a grid. + +It is a known problem that acrobat reader displays grids very dark and thick. This is caused by the enhance thin lines ``feature'' of Acrobat reader. You can turn it off globally by going into the acrobat reader preferences window and unchecking the ``Enhance thin lines'' checkbox in the ``Rendering'' section. Unfortunately, there is no way to instruct Acrobat Reader to not apply this feature to a particular document. This has apparently been annoying graphic designers for over a decade. + +The grid color option changes the color of the grid; the default value is |gray|. +The grid step keys change the grid step. +\end{keylist} \begin{keylist}{title = \meta{text}, title style = \meta{keys}, x label = \meta{text}, y label = \meta{text},x label style = \meta{keys}, y label style = \meta{keys}, label style = \meta{keys}} \declareasstyle{title style} \declareasstyle{x label style} \declareasstyle{y label style} \declareasstyle{label style} +This make chart labels. \begin{codeexample}[width = 6cm] \begin{sseqpage}[ title = { An example }, yscale = 0.5, x label = { x axis label }, @@ -1648,19 +1952,17 @@ It is possible to make your own grid style by defining the command |\sseq@grid@y \class(2,2) \end{sseqpage} \end{codeexample} +Note that if you make multiple versions of the same chart and some of the charts have labels and others don't, they might not align the way you want. An easy solution to this is to use |\path[background] (min x, min y) -- (max x, max y);| where the coordinates are below and to the left, respectively above and to the right, of everything else drawn in any picture. This makes the bounding boxes for all of the pictures the same size, so that they line up even if the exact collection of things drawn changes. See the example at the end of the |background| key for an illustration of this. \end{keylist} - +\needspace{5\baselineskip} \begin{keylist}{no title, draw title, no x label, no y label, no labels, draw x label, draw y label, draw labels} Suppress or unsuppress the title, x label, y label, or both x and y labels, respectively. \end{keylist} -\begin{keylist}{no x axis, no y axis, no axes, draw x axis, draw y axis, draw axes} -Suppress the axis. Also suppresses axes ticks. If there is a title or axes labels they will still be drawn. You can draw your own axes using \tikzpkg\space inside a \scopeenv\space environment with the |background| key. -\end{keylist} \begin{keylist}{no x ticks, no y ticks, no ticks, draw x ticks, draw y ticks, draw ticks} -Suppress axes ticks (the numbers next to the axes). Only matters if axes are drawn. You can make your own ticks using \tikzpkg\space inside a \scopeenv\space environment with the |background| key. For instance, you might want to label the axes as 0, $n$, $2n$, \ldots You can achieve this as follows: (you can also use |x tick handler|). +Suppress axes ticks (the numbers next to the axes). Only matters if axes are drawn. You can make your own ticks using \tikzpkg\ inside a \scopeenv\ environment with the |background| key. For instance, you might want to label the axes as 0, $n$, $2n$, \ldots You can achieve this as follows: (you can also use |x tick handler|). \begin{codeexample}[width = 5.7cm] \begin{sseqpage}[ no x ticks, x range = {0}{3} ] \begin{scope}[ background ] @@ -1677,10 +1979,38 @@ Suppress axes ticks (the numbers next to the axes). Only matters if axes are dra \end{codeexample} \end{keylist} + \begin{keylist}{x tick step = \meta{positive integer} (initially 1),y tick step = \meta{positive integer} (initially 1),tick step = \meta{positive integer} (initially 1)} Sets the interval between labels. \end{keylist} +\begin{keylist}{x tick offset = \meta{integer} (initially 0),y tick offset = \meta{integer} (initially 0),tick offset = \meta{integer} (initially 0)} +Sets the label offset -- by default the ticks will always be the set of numbers that are 0 mod \meta{tick step}. Change it so that the ticks are the set of numbers that are \meta{tick offset} mod \meta{tick step}. +\end{keylist} + +\begin{keylist}{ + x major tick step=\meta{nonnegative integer} (initially 0), + y major tick step=\meta{nonnegative integer} (initially 0), + major tick step=\meta{nonnegative integer}, + x minor tick step=\meta{nonnegative integer} (initially 0), + y minor tick step=\meta{nonnegative integer} (initially 0), + minor tick step=\meta{nonnegative integer}% +} +If these are nonzero, they control the placement of tick marks on the axes. The value 0 prevents tick marks from being drawn. Uses |x tick offset| as an offset. +\begin{codeexample}[width=7cm] +\begin{sseqpage}[ + tick step = 5, + major tick step = 5, + minor tick step = 1, + scale = 0.4, + axes type = frame +] +\class(0,0) +\class(10,10) +\end{sseqpage} +\end{codeexample} +\end{keylist} + \begin{stylekeylist}{x tick style,y tick style,tick style} Change the tick style: \begin{codeexample}[width = 7cm] @@ -1716,11 +2046,17 @@ The value for |x tick handler| should be a function that takes in the current $\ \end{codeexample} \end{keylist} -\needspace{5\baselineskip} +\newpage \subsection{Layout} -\begin{keylist}{x axis style = \meta{style} (initially border), y axis style = \meta{style} (initially border),axes style = \meta{style} (initially border)} -The \meta{style} is either |border| or |center|. The |border| option puts the axes on the bottom and left of the picture; the center option by default places the axes at $\mathtt{x = y = 0}$. This option is only worth using for multi-quadrant spectral sequences. See \example{KRAHSS} and \example{KUHFPSS} for examples where this is used. -%TODO: example? +\begin{keylist}{x axis type = \meta{type} (initially border), y axis type = \meta{type} (initially border),axes type = \meta{type} (initially border), no x axis, no y axis, no axes} +The \meta{type} is either |border|, |center|, |frame|, or |none|. |no axes| is a shorthand for |axes type=none|. The |border| type is the default and puts the axes on the bottom and left of the picture. The |center| type by default places the axes to pass through $(0,0)$; this can be modified using the |x axis origin| and |y axis origin| keys. See \example{KRAHSS} and \example{KUHFPSS} for examples where this is used. The |frame| type draws a frame around the entire chart: + +\begin{codeexample}[width=6cm] +\begin{sseqpage}[axes type=frame] +\class(0,0) +\class(3,2) +\end{sseqpage} +\end{codeexample} \end{keylist} \parskip=0pt @@ -1728,109 +2064,48 @@ The \meta{style} is either |border| or |center|. The |border| option puts the ax If you use |axes style = center|, these keys change the position of the axes. Otherwise, they are ignored. \end{keylist} % -% \begin{keylist}{x axis gap = \meta{dimension} (initially 0.5cm),y axis gap = \meta{dimension} (initially 0.5cm), axes gap = \meta{dimension} (initially 0.5cm)} % \end{keylist} % -% \begin{keylist}{x tick gap = \meta{dimension} (initially 0.5cm),y tick gap = \meta{dimension} (initially 0.5cm)} % \end{keylist} % -\begin{keylist}{x axis start extend = \meta{dimension} (initially 0.5cm), y axis start extend = \meta{dimension} (initially 0.5cm), - x axis end extend = \meta{dimension} (initially 0.9cm), y axis end extend = \meta{dimension} (initially 0.9cm)} +\begin{keylist}{ + x axis start extend = \meta{dimension} (initially 0.5cm), y axis start extend = \meta{dimension} (initially 0.5cm), + x axis extend end = \meta{dimension} (initially 0.5cm), y axis extend end = \meta{dimension} (initially 0.5cm), + x axis tail = \meta{dimension} (initially 0.9cm), y axis tail = \meta{dimension} (initially 0.9cm)% +} \end{keylist} % \begin{keylist}{x axis clip padding = \meta{dimension} (initially 0.1cm), y axis clip padding = \meta{dimension} (initially 0.1cm)} \end{keylist} % -\begin{keylist}{right clip padding = \meta{dimension} (initially 0.1cm), left clip padding = \meta{dimension} (initially 0.4cm), - top clip padding = \meta{dimension} (initially 0.1cm), bottom clip padding = \meta{dimension} (initially 0.4cm)} +\begin{keylist}{ + right clip padding = \meta{dimension} (initially 0.1cm), left clip padding = \meta{dimension} (initially 0.1cm), + top clip padding = \meta{dimension} (initially 0.1cm), bottom clip padding = \meta{dimension} (initially 0.1cm)% +} \end{keylist} +\afterpage{ \begin{center} -\pgfkeys{/sseqpages/tikz primitives/distance label/.style = {orange,{<[width = 4pt]}-}, /sseqpages/tikz primitives/description/.style = {black,/tikz/align = center}} -\begin{sseqpage}[ grid = chess, - x range = {0}{5}, y range = {0}{5}, math nodes = false, - x axis clip padding = 0.15cm, y axis clip padding = 0.15cm, - right clip padding = 0.2cm, top clip padding = 0.2cm, axes gap = 25pt] -\begin{scope}[background,red] -\sseq@savedpaths@add{\pgfsetpath\sseq@theclippath\pgfusepath{draw}} -\end{scope} -\catcode`\| = 12 -\begin{scope}[background,|-|,blue] -% clip gap -\draw[shift = {(\sseq@xmax+0.8,-\sseq@xaxisgap)}] (0,0)--(0,\sseq@xclip@axisgap); -\draw[shift = {(-\sseq@yaxisgap,\sseq@ymax+0.8)}] (0,0)--(\sseq@yclip@axisgap,0); -\draw[distance label,shift = {(\sseq@xmax+0.8,-\sseq@xaxisgap+\sseq@xclip@axisgap/2)}] (0,0) -- (2,0) -node[description, right] {x axis\\ clip gap}; -\draw[distance label,shift = {(-\sseq@yaxisgap+\sseq@yclip@axisgap/2,\sseq@ymax+0.8)}] (0,0) .. controls (0,0.5) .. (-0.5,0.5) -node[description, left] {y axis\\ clip gap}; - - -% border clip padding -\draw[shift = {(\sseq@xmax cm + \sseq@xaxis@end@extend,\sseq@ymin cm-\sseq@xaxisgap-0.3cm)}] (0,0)--(\sseq@clip@padding@right,0); -\draw[shift = {(\sseq@xmin cm -\sseq@yaxisgap-0.3cm,\sseq@ymax cm+\sseq@yaxis@end@extend)}] (0,0)--(0,\sseq@clip@padding@top); -\draw[distance label, shift = {(\sseq@xmax cm + \sseq@xaxis@end@extend+\sseq@clip@padding@right/2,\sseq@ymin cm-\sseq@xaxisgap-0.3cm)}] (0,0) .. controls (0,-0.7) ..(1.5,-0.7) -node[description, right] {right clip\\ padding}; -\draw[distance label, shift = {(\sseq@xmin cm -\sseq@yaxisgap-0.3cm,\sseq@ymax cm+\sseq@yaxis@end@extend+\sseq@clip@padding@top/2)}] (0,0) -- (-2,0) -node[description, left] {top clip\\ padding}; - -% extend start axis -\draw[shift = {(\sseq@xmin-\sseq@yaxisgap-0.02cm,\sseq@ymin-\sseq@xaxisgap+0.1cm)}] (0,0) -- (-\sseq@xaxis@start@extend, 0); -\draw[shift = {(\sseq@xmin-\sseq@yaxisgap+0.1cm,\sseq@ymin-\sseq@xaxisgap-0.02cm)}] (0,0) -- (0, -\sseq@yaxis@start@extend); -\draw[distance label,shift = {(\sseq@xmin-\sseq@yaxisgap-0.02cm-\sseq@xaxis@start@extend/2,\sseq@ymin-\sseq@xaxisgap+0.1cm)}] (0,0) .. controls (0,0.5) .. (-1,0.5) -node[description, left]{x axis\\ extend start}; -\draw[distance label,shift = {(\sseq@xmin-\sseq@yaxisgap+0.1cm,\sseq@ymin-\sseq@xaxisgap-0.02cm-\sseq@yaxis@start@extend/2)}] (0,0) .. controls (0.5,0) .. (0.5,-1) -node[description, below]{y axis\\ extend start}; - -% extend end axis -\draw[shift = {(\sseq@xmax,\sseq@ymin-\sseq@xaxisgap-0.1cm)}] (0,0)--(\sseq@xaxis@end@extend,0); -\draw[shift = {(\sseq@xmin cm-\sseq@yaxisgap-0.1cm,\sseq@ymax)}] (0,0)--(0,\sseq@yaxis@end@extend); -\draw[distance label,shift = {(\sseq@xmax cm+\sseq@xaxis@end@extend/2,\sseq@ymin-\sseq@xaxisgap-0.1cm)}] (0,0) -- (0,-1.5) - node[description, below] {x axis\\ extend end}; -\draw[distance label,shift = {(\sseq@xmin cm- \sseq@yaxisgap-0.1cm,\sseq@ymax cm+\sseq@yaxis@end@extend/2)}] (0,0) .. controls (-2,0) .. (-2,-1) -node[description, below] {y axis\\ extend end}; - - - -% tick gap -\draw[shift = {(\sseq@xmin+\sseq@xmax/2+0.2,-0.5-\sseq@xaxisgap)}] (0,0)--(0,-\sseq@xlabelgap); -\draw[shift = {(-0.5-\sseq@yaxisgap,\sseq@ymin+\sseq@ymax/2+0.2)}] (0,0)--(-\sseq@ylabelgap,0); -\draw[distance label,shift = {(\sseq@xmin+\sseq@xmax/2+0.2,-\sseq@xlabelgap/2-\sseq@xaxisgap)}] (0,0) .. controls (0.5 ,0) .. (0.5,-0.8) - node[below,black]{x tick gap}; -\draw[distance label,shift = {(-\sseq@yaxisgap -\sseq@ylabelgap/2,\sseq@ymin+\sseq@ymax/2+0.2)}] (0,0) .. controls (0, -0.3) .. (-0.5,-0.7) -node[left,black]{y tick gap}; - -% axis gap -\draw[shift = {(\sseq@xmax cm+0.17cm,\sseq@ymin cm-\sseq@xaxisgap+0.02cm)}] (0,0) -- (0, \sseq@xaxisgap); -\draw[shift = {(\sseq@xmin cm-\sseq@yaxisgap+0.02cm,\sseq@ymax cm+0.17cm)}] (0,0) -- (\sseq@yaxisgap,0); -\draw[distance label,shift = {(\sseq@xmax cm+0.17cm,\sseq@ymin cm-\sseq@xaxisgap/2+0.02cm)}](0,0) .. controls (2,0) .. (2,0.5) -node[above,description]{x axis gap}; -\draw[distance label,shift = {(\sseq@xmin cm-\sseq@yaxisgap/2+0.02cm,\sseq@ymax cm+0.17cm)}](0,0)--(0,2) %.. controls (0,1) .. (0.5,1); -node[above,description]{y axis gap}; -\end{scope} - -\class(0,0) -\class(10,10) -\draw (0,0) -- (11,11); -\class(5,0) -\class(0,5) -\end{sseqpage} +\input spectralsequencesmanual-layoutcharts \end{center} +} + \parskip=10pt \begin{key}{custom clip = \meta{clip path}} -Give a custom clipping. The clipping specified must be in the form of a valid \tikzpkg\space path, for instance |\clip (0,0) rectangle (10,10);|. This clipping is also applied to any grid and is used to draw ellipses on appropriate differentials or struct lines that go out of bounds and to determine whether a differential or struct line is an ``orphan''. It is not applied to any background elements, which is important because these are often used for axes labels and such that should lie outside of the clipping region. Weird things can happen with out of range edges if use this option with an oddly shaped path. +Give a custom clipping. The clipping specified must be in the form of a valid \tikzpkg\ path, for instance |\clip (0,0) rectangle (10,10);|. This clipping is also applied to any grid and is used to draw ellipses on appropriate differentials or structure lines that go out of bounds and to determine whether a differential or structure line is an ``orphan''. It is not applied to any background elements, which is important because these are often used for axes labels and such that should lie outside of the clipping region. Weird things can happen with out of range edges if you provide an oddly shaped path. \end{key} \begin{key}{clip = \meta{boolean} (default true)(initially true)} -If this is false the spectral sequence won't be clipped. I'm not really sure why you would want that, but there might be some use case. Setting this to be false is not fully supported, and it's possible that weird things will happen with some of the edges that go out of range. +If this is false the spectral sequence chart won't be clipped. I'm not really sure why you would want that, but there might be some use case. Setting this to be false is not fully supported, and it's possible that weird things will happen with some of the edges that go out of range. \end{key} \begin{key}{rotate labels = \meta{boolean} (default true)(initially false)} -If you use |rotate = 90| but also want the labels rotated (so that the whole diagram is sideways) use this key. +If you use |rotate = 90| but also want the labels rotated (so that the whole chart is sideways) use this key. \end{key} -\end{document}
\ No newline at end of file +\end{document} diff --git a/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanualpreamble.tex b/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanualpreamble.tex index f2897deb03a..4930d4e8766 100644 --- a/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanualpreamble.tex +++ b/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanualpreamble.tex @@ -1,8 +1,8 @@ %% -%% Package: spectralsequences.sty version 1.0 +%% Package: spectralsequences v1.1.0 %% Author: Hood Chatham %% Email: hood@mit.edu -%% Date: 2017-06-18 +%% Date: 2017-08-02 %% License: Latex Project Public License %% %% File: spectralsequencesmanualpreamble.tex @@ -17,6 +17,7 @@ \usepackage{spectralsequences} \usetikzlibrary{shapes.geometric} \usepackage{amssymb} +\usepackage{afterpage} \usepackage[notmath]{sansmathfonts} \usepackage{verbatim} \usepackage{needspace} @@ -239,6 +240,7 @@ \declarecustomhandler{page constraint}{\codehandler} \declarecustomhandler{page constraint}{\codehandler} + \let\pgfmanualpdflabel@opt@old\pgfmanualpdflabel@opt \def\pgfmanualpdflabel@opt[#1]#2#3{% \pgfkeys@spdef\temp{#2}% @@ -330,6 +332,8 @@ % cs arguments/marg/.initial=1, cs/marg/.code={\marg{\@gobble#1}}, + cs arguments/metatt/.initial=1, + cs/metatt/.code={\meta{\texttt{\textup{\@gobble#1}}}}, % cs arguments/pars/.initial=1, cs/pars/.code={\@xp\pars\@xp{\@xp\pgfmanualprettyprintpgfkeys\@xp{\@gobble#1}}}, @@ -434,6 +438,23 @@ } + +\hypersetup{ + pdftitle={The Sseqpages Package}, + pdfauthor={Hood Chatham}, + pdfsubject={A spectral sequence drawing package build on tikz}, + pdfkeywords={spectral sequences,algebraic topology,homotopy theory,math,tikz,sseq}, + pdflicenseurl={http://www.latex-project.org/lppl/} +} + +\def\pars#1{|(|#1|)|} +\def\pararg#1{\pars{\meta{#1}}} +\def\parargtwo#1#2{|(\meta{#1},\meta{#2})|} +\def\parargthree#1#2#3{|(\meta{#1},\meta{#2},\meta{#3})|} +\def\parargthreeopt#1#2#3{|(\meta{#1},\meta{#2}|\opt{|,\meta{#3}|}|)|} +\def\parargthreevar#1#2#3{|(\meta{#1},\meta{#2}#3)|} + +\def\cmdarg{\texttt{\textbackslash}\meta} \def\ooptions{\oarg{options}} \def\moptions{|[|\meta{options}|]|} \def\sourcecoord{\meta{source coordinate}} @@ -442,7 +463,7 @@ \def\targetn{\meta{target n}} \def\sourcename{\meta{source name}} -\def\version{version 1.0} +\def\version{version 1.0.0} \def\today{\the\year/\the\month/\the\day} \def\pgfmanualurl{http://math.mit.edu/~hood/pgfmanual_v3.0.1a.pdf} \def\xparseurl{http://mirror.ctan.org/macros/latex2e/contrib/l3packages/xparse.pdf} @@ -450,6 +471,7 @@ \def\pkg#1{\textsf{\textmd{#1}}} \def\sseqpages{\textsc{\pkg{spectralsequences}}} +\let\spectralsequences\sseqpages \def\sseqpkg{\pkg{sseq}} \let\tikzpkg\tikzname \def\pgfpkg{\pkg{\textmd{PGF}}} @@ -457,29 +479,21 @@ \def\pgfplotspkg{\textsc{\pkg{pgfplots}}} \def\xparsepkg{\pkg{xparse}} \def\colorpkg{\pkg{color}} - -\bgroup\lccode`\(=`\{\lccode`\)=`\}\lowercase{\egroup - \def\sseqpageenv{\pgfmanualpdfref{sseqpage}{\texttt{(sseqpage)}}} - \def\sseqdataenv{\pgfmanualpdfref{sseqdata}{\texttt{(sseqdata)}}} - \def\tikzpictureenv{\texttt{(tikzpicture)}} - \def\scopeenv{\texttt{(scope)}} -} - - -\hypersetup{ - pdftitle={The Sseqpages Package}, - pdfauthor={Hood Chatham}, - pdfsubject={A spectral sequence drawing package build on tikz}, - pdfkeywords={spectral sequences,algebraic topology,homotopy theory,math,tikz,sseq}, - pdflicenseurl={http://www.latex-project.org/lppl/} -} - -\def\pars#1{|(|#1|)|} -\def\pararg#1{\pars{\meta{#1}}} -\def\parargtwo#1#2{|(\meta{#1},\meta{#2})|} -\def\parargthree#1#2#3{|(\meta{#1},\meta{#2},\meta{#3})|} -\def\parargthreeopt#1#2#3{|(\meta{#1},\meta{#2}|\opt{|,\meta{#3}|}|)|} -\def\parargthreevar#1#2#3{|(\meta{#1},\meta{#2}#3)|} +\def\texlive{\TeX\ Live} +\def\miktex{MiK\TeX} +\def\pdflatex{\textsc{PDF}\LaTeX} +\def\lualatex{Lua\LaTeX} +\let\pdfLaTeX\pdflatex +\let\LuaLaTeX\lualatex + + +\def\env#1{\texttt{\{#1\}}} +\def\sseqpageenv{\pgfmanualpdfref{sseqpage}{\env{sseqpage}}} +\def\sseqdataenv{\pgfmanualpdfref{sseqdata}{\env{sseqdata}}} +\def\tikzpictureenv{\env{tikzpicture}} +\def\scopeenv{\env{scope}} +\def\tikzcdenv{\env{tikzcd}} +\def\eTeX{\leavevmode\hbox{$\varepsilon$}-\TeX} \def\example#1{\path{example_#1.tex}} diff --git a/Master/texmf-dist/tex/latex/spectralsequences/spectralsequences.sty b/Master/texmf-dist/tex/latex/spectralsequences/spectralsequences.sty deleted file mode 100644 index 62ff3e40a4f..00000000000 --- a/Master/texmf-dist/tex/latex/spectralsequences/spectralsequences.sty +++ /dev/null @@ -1,279 +0,0 @@ -%% -%% Package: spectralsequences.sty version 1.0 -%% Author: Hood Chatham -%% Email: hood@mit.edu -%% Date: 2017-06-18 -%% License: Latex Project Public License -%% -%% A package for drawing spectral sequences -%% - - -% TODO: -% label handler key, \sseqnormalizepolynomial -% speed up off page edges (uses 10% of the draw time for page 0 of tmfass) -% speed up label nodes -% try to restrict fragility issues to tooltips and tikz primitives... annoying -% error messages that should be warnings by default? -% improve axes options? allow axis to be centered on coordinate or centered between coordinates -% recover from failing to patch pgfkeys - -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{spectralsequences}[2017/06/04 v1.0] - -\RequirePackage{tikz} -\RequirePackage{etoolbox} -\RequirePackage{xparse} -\RequirePackage{verbatim} -\RequirePackage{pdfcomment} - -\usetikzlibrary{quotes} -\usetikzlibrary{fit} -\usetikzlibrary{positioning} -\usetikzlibrary{intersections} -\usetikzlibrary{backgrounds} -\usepgflibrary{arrows.meta} -\usetikzlibrary{shapes} -%\usetikzlibrary{profiler} - -\newif\ifsseq@draftmode -\DeclareOption{draft}{\sseq@draftmodetrue} -\ProcessOptions\relax - -\def\sseq@authorname{Hood Chatham} -\def\sseq@authoremail{hood@mit.edu} - - -%\sseq@draftmodetrue - -%%%%%% %%%%%% -%% %% -%% Declarations and preliminaries %% -%% %% -%%%%%% %%%%%% -\newif\ifsseq@inprogress - -\newif\ifsseq@hasname -\newif\ifsseq@updateexisting -\newif\ifsseq@ispageenv -\newif\ifsseq@keepchanges -\newif\ifsseq@keepglobaloptions -\newif\ifsseq@globaldetone - -\newif\ifsseq@needstikz -\newif\ifsseq@thispage -\newif\ifsseq@outofrange -\newif\ifsseq@classlabel -\newif\ifsseq@draworphanedges -\newif\ifsseq@drawedge -\newif\ifsseq@tikzprims@integershift -\newif\ifsseq@anchor -\sseq@drawedgetrue -\sseq@tikzprims@integershifttrue - -\newif\ifsseq@patchforeach -\newif\ifsseq@patchfit - -\newif\ifsseq@tempif -\newif\ifsseq@gtempif -\newif\ifsseq@error - -\newtoks\sseq@temptoks -\newtoks\sseq@temptoksii -\newtoks\sseq@scope@toks - -\newcount\sseq@thepagecount -\newcount\sseq@anonsseqcount -\newcount\sseq@x -\newcount\sseq@y -\newcount\sseq@tempcount -\newcount\sseq@tempcountb -\newcount\sseq@tempx -\newcount\sseq@tempy -\newcount\sseq@tempxb -\newcount\sseq@tempyb - -\newcount\sseq@stackdepth - -\newdimen\sseq@tooltip@height -\newdimen\sseq@tooltip@width -\newdimen\sseq@gridstrokethickness -\sseq@gridstrokethickness=.1pt - -% Ensure \@xp and \@nx have the correct values in case that amsmath isn't loaded -\let\@xp\expandafter -\let\@nx\noexpand -\def\@xptwo{\@xp\@xp\@xp} -\def\@xpthree{\@xp\@xp\@xp\@xp\@xp\@xp\@xp} -\def\sseq@nil{\sseq@thisshouldnthappen@nil unique expansion} % This expansion text should be unique so that \ifx\sseq@nil\othercommand is false. -\def\sseq@infinity{10000} % Larger than any coordinate anyone will ever use. -\newcount\sseq@infinitycount -\sseq@infinitycount=\sseq@infinity\relax -\def\sseq@macroname{\@xp\@gobble\string} -\def\sseq@gobble@to@nil#1\sseq@nil{} -\def\sseq@macrogobble#1->{} - -% These are only used by defertikzcommand now -\def\sseq@callas#1{\def\sseq@callcmd{#1}} -\def\sseq@call#1{\bgroup\@xp\let\sseq@callcmd#1\@xptwo\egroup\sseq@callcmd} - -\def\sseq@getfirstchar#1#2\sseq@nil{#1} % used in shift/checkshift transform -\def\sseq@smuggle@macro#1#2\egroup{\@xp\egroup\@xp\def\@xp#1\@xp{#1}} - - -\def\sseq@protected@edef{\let\sseq@store@slsl\\\def\\{\protect\\}\let\@@protect \protect \let \protect \@unexpandable@protect \afterassignment \sseq@restore@protect \edef} -\def\sseq@protected@xdef{\let\sseq@store@slsl\\\def\\{\protect\\}\let\@@protect \protect \let \protect \@unexpandable@protect \afterassignment \sseq@restore@protect \xdef} -\def\sseq@restore@protect{\let\protect\@@protect\let\\\sseq@store@slsl} - -\def\sseq@eval#1{\bgroup\edef\sseq@temp{#1}\@xp\egroup\sseq@temp}% I got this from sseq.sty -\def\sseq@protectedeval#1{\bgroup\sseq@protected@edef\sseq@temp{#1}\@xp\egroup\sseq@temp} -\def\sseq@eval@show#1{\bgroup\edef\sseq@temp{#1}\show\sseq@temp\@xp\egroup\sseq@temp} -\def\sseq@profilenew#1#2{\pgfprofilenew{#1}\pretocmd#2{\pgfprofilestart{#1}}{}{\error}\apptocmd#2{\pgfprofileend{#1}}{}{\error}} - -%%%% add to macro commands -\def\sseq@d@addto@macro#1#2{\@xp\def\@xp#1\@xp{#1#2}} -\def\sseq@e@addto@macro#1#2{\edef#1{\unexpanded\@xp{#1}#2}} % let #2 be expanded -\def\sseq@eo@addto@macro#1#2{\edef#1{\unexpanded\@xp{#1}\unexpanded\@xp{#2}}} % let #2 be expanded once -\def\sseq@g@addto@macro#1#2{\@xp\gdef\@xp#1\@xp{#1#2}} -\def\sseq@x@addto@macro#1#2{\xdef#1{\unexpanded\@xp{#1}#2}} % let #2 be expanded -\def\sseq@xprotected@addto@macro#1#2{\sseq@protected@xdef#1{\unexpanded\@xp{#1}#2}} - -\def\sseq@d@addto@toks#1#2{#1\@xp{\the#1#2}} -\def\sseq@e@addto@toks#1#2{\sseq@eval{#1{\the#1#2}}} - -\def\sseq@d@addto@temptoks{\sseq@d@addto@toks\sseq@temptoks} -\def\sseq@e@addto@temptoks{\sseq@e@addto@toks\sseq@temptoks} - - -% Used in sseqkeys to delete spaces from style commands. -\def\sseq@setmacronospaces#1#2{% - \bgroup\catcode`\ =9\relax - \scantokens{\@xp\egroup\@xp\def\@xp#1\@xp{\csname #2\endcsname}}% -} - - -\def\sseq@removeparens{\@xp\sseq@removeparens@} -\def\sseq@removeparens@(#1){#1} - -% Stolen from trimspaces.sty -\bgroup -\catcode`\Q=3 -\gdef\sseq@trimspaces#1{% - \romannumeral-`\q\sseq@trim@trim@\noexpand#1Q Q% -} -\long\gdef\sseq@trim@trim@#1 Q{\sseq@trim@trim@@#1Q} -\long\gdef\sseq@trim@trim@@#1Q#2{#1} -\egroup -\def\sseq@trimleadingspaces{\romannumeral-`q} - -\def\sseq@ifempty#1{% - \@xp\ifx\@xp\sseq@nil\detokenize{#1}\sseq@nil - \@xp\@firstoftwo - \else - \@xp\@secondoftwo - \fi -} - -\def\sseq@ifnil#1{ - \ifx\sseq@nil#1 - \@xp\@firstoftwo - \else - \@xp\@secondoftwo - \fi -} - -\let\sseq@breakpoint\relax -\def\sseq@break#1\sseq@breakpoint{} -\def\sseq@break@withcleanup#1\sseq@breakpoint#2{} - -\def\sseq@breakfi{\fi\sseq@break} -\def\sseq@breakfifi{\fi\fi\sseq@break} -\def\sseq@breakfififi{\fi\fi\fi\sseq@break} -\long\def\sseq@breakdataenv#1\end#2{ - \def\sseq@tempa{sseqdata}\def\sseq@tempb{#2}\ifx\sseqtempa\sseqtempb - \@xp\sseq@breakdataenv@ - \else - \@xp\sseq@breakdataenv - \fi -} -\def\sseq@breakdataenv@{\let\endsseqdata\sseq@breakendsseqdata\end{sseqdata}} - -\long\def\sseq@breakpageenv#1\end#2{ - \def\sseq@tempa{sseqpage}\def\sseq@tempb{#2}\ifx\sseqtempa\sseqtempb - \@xp\sseq@breakpageenv@ - \else - \@xp\sseq@breakpageenv - \fi -} -\def\sseq@breakpageenv@{\let\endsseqpage\sseq@breakendsseqpage\end{sseqpage}} -\def\sseq@breakendsseqdata{} -\def\sseq@breakendsseqpage{} - -\def\sseq@seteverythingtonoops{% - \let\sseqdata\comment - \let\sseqpage\comment - \let\sseqkeys\@gobble - \let\sseqnewgroup\@gobblethree -} - -% Commands we are going to expose just inside of environments -\def\sseq@macrolist{% - % These are defined in sseqmain: - \class\replaceclass\d\structline\classoptions\doptions\structlineoptions\circleclasses - % The following are defined in sseqparsers: - \pgfmathparse\isalive\lastx\lasty\lastclass\savestack\restorestack\pushstack\nameclass\tagclass - \parsecoordinate\parsedifferential\getdtarget\gettag - \xcoord\ycoord\page %\xmin\xmax\ymin\ymax % these just get protected -} - -% All the tikz commands. We replace these in our environment too. Replacements defined in sseqparsers. -\def\sseq@tikzcommands{% - \clip\coordinate\draw\fill\filldraw - \graph\matrix\node\path\pattern - \shade\shadedraw\useasboundingbox -} - - -\input sseqmessages.code.tex % Exposes directly: \sseqerrortowarning -\input sseqcheckdefinitions.code.tex - -%\sseq@patchforeachfalse - -\ifsseq@tempif\else % Set to false in checkdefinitions if it failed to patch the key-value system. - \sseq@seteverythingtonoops - \sseq@pgfkeyspatchfailed -\fi - -\input sseqloadstore.code.tex % Responsible for installing environment-only macros -\input sseqmacromakers.code.tex % Exposes directly: \DeclareSseqCommand, \NewSseqCommand, \DeclareSseqGroup, \NewSseqGroup - -\input sseqparsers.code.tex % Responsible for making tikz modifications, exposes directly \sseqnormalizemonomial - - -\ifsseq@patchforeach - \input sseqforeach.code.tex -\else - \def\sseq@patchfor{} -\fi - -\input sseqkeys.code.tex % Exposes directly: \sseqset -\input sseqmain.code.tex % Defines all the main commands. Exposes directly: the environments, \xmin, \xmax, etc. -\input sseqdrawing.code.tex - - -%%% Some default key settings -\sseqset{ - edge labels={auto=right}, - classes={draw,circle,inner sep=0pt,minimum size=0.35em}, - circle classes={newellipse, ellipse ratio=1.2,draw, inner sep=2pt}, - edges=draw, - math nodes, - differentials=-> -} - -% Extra commands to expose: -\let\sseqifempty\sseq@ifempty - -\def\sseqpower#1#2{\@xp\sseqtypesetpower@\@xp{\the\numexpr#2}{#1}{1}} -\def\sseqpowerempty#1#2{\@xp\sseqtypesetpower@\@xp{\the\numexpr#2}{#1}{}} -\def\sseqtypesetpower@#1#2#3{\ifnum#1=\z@#3\else\ifnum#1=\@ne#2\else#2^{#1}\fi\fi} diff --git a/Master/texmf-dist/tex/latex/spectralsequences/sseqcheckdefinitions.code.tex b/Master/texmf-dist/tex/latex/spectralsequences/sseqcheckdefinitions.code.tex index bdbc68f51b5..a9de53c794c 100644 --- a/Master/texmf-dist/tex/latex/spectralsequences/sseqcheckdefinitions.code.tex +++ b/Master/texmf-dist/tex/latex/spectralsequences/sseqcheckdefinitions.code.tex @@ -1,8 +1,8 @@ %% -%% Package: spectralsequences.sty version 1.0 +%% Package: spectralsequences v1.1.0 %% Author: Hood Chatham %% Email: hood@mit.edu -%% Date: 2017-06-18 +%% Date: 2017-08-02 %% License: Latex Project Public License %% %% File: sseqcheckdefinitions.code.tex @@ -15,13 +15,54 @@ \sseq@tempiftrue \begingroup - +\def\sseq@checkprotecteddef#1{\def\sseq@temp{\sseq@checkdef@{#1}}\afterassignment\sseq@temp\protected\long\@xp\def\csname sseq@check@\sseq@macroname#1\endcsname} \def\sseq@checkdef#1{\def\sseq@temp{\sseq@checkdef@{#1}}\afterassignment\sseq@temp\@xp\def\csname sseq@check@\sseq@macroname#1\endcsname} \def\sseq@checkdef@#1{\@xp\ifx\csname sseq@check@\sseq@macroname#1\endcsname#1\else \sseq@tempiffalse \fi} %% +%% sseqmacromakers.code.tex +%% + +\ExplSyntaxOn +% I should work out how old the version of xparse has to be before this breaks, but I'm too lazy. +% It would also be nice if I could figure out how to ensure that my trick of setting \l__xparse_grab_expandably_bool to false works correctly, but this might be difficult +\@ifpackagelater{xparse}{2017/02/08}{ + \sseq@checkprotecteddef \__xparse_grab_u:w #1#2 \__xparse_run_code:{ + \__xparse_grab_u_aux:nnN {#1} {#2} \cs_set_protected_nopar:Npn + } + + \sseq@checkprotecteddef\__xparse_grab_u_aux:nnN #1#2#3 + { + \tl_set:Nn \l__xparse_signature_tl {#2} + \exp_after:wN #3 \l__xparse_fn_tl ##1 #1 + { \__xparse_add_arg:n {##1} } + \l__xparse_fn_tl + } + + + \sseq@checkprotecteddef \__xparse_normalize_type_u:w #1 { + \quark_if_recursion_tail_stop_do:nn {#1} { \__xparse_bad_arg_spec:wn } + \__xparse_normalize_check_lu:N u + \__xparse_add_arg_spec:n { u {#1} } + \int_incr:N \l__xparse_mandatory_args_int + \tl_clear:N \l__xparse_last_delimiters_tl + \__xparse_normalize_arg_spec_loop:n + } + + \ifsseq@tempif + \global\sseq@patchxparseUtrue + \else + %\sseq@warning{fit-patch-failed} + \global\sseq@patchxparseUfalse + \fi + \sseq@tempiftrue +}{} + +\ExplSyntaxOff + +%% %% sseqkeys.code.tex %% diff --git a/Master/texmf-dist/tex/latex/spectralsequences/sseqdrawing.code.tex b/Master/texmf-dist/tex/latex/spectralsequences/sseqdrawing.code.tex index 098e73f9110..c8bba066b23 100644 --- a/Master/texmf-dist/tex/latex/spectralsequences/sseqdrawing.code.tex +++ b/Master/texmf-dist/tex/latex/spectralsequences/sseqdrawing.code.tex @@ -1,8 +1,8 @@ %% -%% Package: spectralsequences.sty version 1.0 +%% Package: spectralsequences v1.1.0 %% Author: Hood Chatham %% Email: hood@mit.edu -%% Date: 2017-06-18 +%% Date: 2017-08-02 %% License: Latex Project Public License %% %% File: sseqdrawing.code.tex @@ -14,165 +14,314 @@ %% the axes ticks was taking about 1/3 of the compile time (a little under 1s out of a 3.2) %% +% Only for integer valued coordinates... +\def\sseq@qpointxy#1#2{\pgfqpointxy{\numexpr#1+\sseq@xoffset\relax}{\numexpr#2+\sseq@yoffset\relax}} +\def\sseq@transform@xymirror{ + \pgfsetxvec{\pgfqpoint{1cm}{0cm}} + \pgfsetyvec{\pgfqpoint{0cm}{1cm}} + \pgftransformcm{0}{1}{1}{0}{\pgfpointxy{\sseq@xoffset*\sseq@xscale }{\sseq@yoffset*\sseq@yscale}} % Reflect x and y axes, + \pgftransformshift{\pgfpointxy{-\sseq@xoffset*\sseq@yscale}{-\sseq@yoffset*\sseq@xscale}} % but we need to conjugate by a shift of (xoffset,yoffset) + \pgfsetyvec{\pgfqpoint{0cm}{\sseq@xscale cm}} + \pgfsetxvec{\pgfqpoint{\sseq@yscale cm}{0cm}} +} + + +\def\sseq@setlayoutparameter#1#2{\@xp\let\csname sseq@#1\@xp\endcsname\csname sseq@#1@#2\endcsname} +\def\sseq@setlayoutparameters{ + \sseq@setlayoutparameter{yaxisorigin}{x\sseq@xaxistype} + \sseq@setlayoutparameter{drawyaxis}{x\sseq@xaxistype} + \sseq@setlayoutparameter{yaxisstartoffset}{x\sseq@xaxistype} + \sseq@setlayoutparameter{yaxisendoffset}{x\sseq@xaxistype} + \sseq@setlayoutparameter{bottomgridpadding}{x\sseq@xaxistype} + \sseq@setlayoutparameter{topgridpadding}{x\sseq@xaxistype} + \sseq@setlayoutparameter{bottomclippadding}{x\sseq@xaxistype} + \sseq@setlayoutparameter{topclippadding}{x\sseq@xaxistype} + \sseq@setlayoutparameter{xlabelposition}{x\sseq@xaxistype} +% + \sseq@setlayoutparameter{xaxisorigin}{y\sseq@yaxistype} + \sseq@setlayoutparameter{drawxaxis}{y\sseq@xaxistype} + \sseq@setlayoutparameter{xaxisstartoffset}{y\sseq@yaxistype} + \sseq@setlayoutparameter{xaxisendoffset}{y\sseq@yaxistype} + \sseq@setlayoutparameter{leftgridpadding}{y\sseq@yaxistype} + \sseq@setlayoutparameter{rightgridpadding}{y\sseq@yaxistype} + \sseq@setlayoutparameter{leftclippadding}{y\sseq@yaxistype} + \sseq@setlayoutparameter{rightclippadding}{y\sseq@yaxistype} + \sseq@setlayoutparameter{ylabelposition}{y\sseq@xaxistype} +} + +% The appropriate one of these is chosen by the "axis type" keys in sseqkeys. + +% Used to determine axis and ticks placement +\def\sseq@xaxisorigin@yborder{\sseq@xmin} +\def\sseq@xaxisorigin@yframe{\sseq@xmin} +\def\sseq@xaxisorigin@ycenter{\sseq@xaxisorigin@center@} +\def\sseq@yaxisorigin@xborder{\sseq@ymin} +\def\sseq@yaxisorigin@xframe{\sseq@ymin} +\def\sseq@yaxisorigin@xcenter{\sseq@yaxisorigin@center@} + +% Used to determine clipping and grid boundaries +\def\sseq@leftgridpadding@yborder{\dimexpr\sseq@yaxisgap-\sseq@yclip@axisgap\relax} +\def\sseq@rightgridpadding@yborder{\sseq@xaxis@end@extend} +\def\sseq@leftgridpadding@ycenter{\sseq@xaxis@start@extend} +\def\sseq@rightgridpadding@ycenter{\sseq@xaxis@end@extend} +\def\sseq@leftgridpadding@yframe{\dimexpr\sseq@yaxisgap-\sseq@yclip@axisgap\relax} +\def\sseq@rightgridpadding@yframe{5cm} % Just make it big enough to push off the end of the clip +\def\sseq@leftgridpadding@ynone{\sseq@yaxisgap} +\def\sseq@rightgridpadding@ynone{\sseq@yaxisgap} + + +\def\sseq@bottomgridpadding@xborder{\dimexpr\sseq@xaxisgap-\sseq@xclip@axisgap\relax} +\def\sseq@topgridpadding@xborder{\sseq@yaxis@end@extend} +\def\sseq@bottomgridpadding@xcenter{\sseq@yaxis@start@extend} +\def\sseq@topgridpadding@xcenter{\sseq@yaxis@end@extend} +\def\sseq@bottomgridpadding@xframe{\dimexpr\sseq@xaxisgap-\sseq@xclip@axisgap\relax} +\def\sseq@topgridpadding@xframe{5cm} +\def\sseq@bottomgridpadding@xnone{\sseqxaxisgap} +\def\sseq@topgridpadding@xnone{\sseq@xaxisgap} + +\def\sseq@leftclippadding@yborder{\dimexpr-\sseq@yaxisgap+\sseq@yclip@axisgap\relax} +\def\sseq@rightclippadding@yborder{\dimexpr\sseq@xaxis@end@extend+\sseq@clip@padding@right\relax} +\def\sseq@leftclippadding@ycenter{\dimexpr-\sseq@xaxis@start@extend-\sseq@clip@padding@left\relax} +\def\sseq@rightclippadding@ycenter{\dimexpr\sseq@xaxis@end@extend+\sseq@clip@padding@right\relax} +\def\sseq@leftclippadding@yframe{\dimexpr-\sseq@yaxisgap+\sseq@yclip@axisgap\relax} +\def\sseq@rightclippadding@yframe{\dimexpr\sseq@yaxisgap-\sseq@yclip@axisgap\relax} +\def\sseq@leftclippadding@ynone{\dimexpr-\sseq@yaxisgap-\sseq@clip@padding@left\relax} +\def\sseq@rightclippadding@ynone{\dimexpr\sseq@yaxisgap+\sseq@clip@padding@right\relax} + +\def\sseq@bottomclippadding@xborder{\dimexpr-\sseq@xaxisgap+\sseq@xclip@axisgap\relax} +\def\sseq@topclippadding@xborder{\dimexpr\sseq@yaxis@end@extend+\sseq@clip@padding@top\relax} +\def\sseq@bottomclippadding@xcenter{\dimexpr-\sseq@yaxis@start@extend-\sseq@clip@padding@bottom\relax} +\def\sseq@topclippadding@xcenter{\dimexpr\sseq@yaxis@end@extend+\sseq@clip@padding@top\relax} +\def\sseq@bottomclippadding@xframe{\dimexpr-\sseq@xaxisgap+\sseq@xclip@axisgap\relax} +\def\sseq@topclippadding@xframe{\dimexpr\sseq@xaxisgap-\sseq@xclip@axisgap\relax} +\def\sseq@bottomclippadding@xnone{\dimexpr-\sseq@xaxisgap-\sseq@clip@padding@bottom\relax} +\def\sseq@topclippadding@xnone{\dimexpr\sseq@xaxisgap+\sseq@clip@padding@top\relax} + +% Used to figure out how much further beyond (min -- max) to draw axes +\def\sseq@xaxisstartoffset@yborder{\dimexpr\sseq@xaxis@tail+\sseq@yaxisgap\relax} +\def\sseq@xaxisendoffset@yborder{\sseq@xaxis@end@extend} +\def\sseq@xaxisstartoffset@ycenter{\sseq@xaxis@start@extend} +\def\sseq@xaxisendoffset@ycenter{\sseq@xaxis@end@extend} +\def\sseq@xaxisstartoffset@yframe{\sseq@yaxisgap} +\def\sseq@xaxisendoffset@yframe{\sseq@yaxisgap} +\def\sseq@yaxisstartoffset@xborder{\dimexpr\sseq@yaxis@tail+\sseq@xaxisgap\relax} +\def\sseq@yaxisendoffset@xborder{\sseq@yaxis@end@extend} +\def\sseq@yaxisstartoffset@xcenter{\sseq@yaxis@start@extend} +\def\sseq@yaxisendoffset@xcenter{\sseq@yaxis@end@extend} +\def\sseq@yaxisstartoffset@xframe{\sseq@xaxisgap} +\def\sseq@yaxisendoffset@xframe{\sseq@xaxisgap} + +\def\sseq@xlabelposition@xborder{(0,-\sseq@xaxisstartoffset)} +\def\sseq@xlabelposition@xcenter{(-\sseq@yaxisgap,-\sseq@xaxisstartoffset-5pt)} +\def\sseq@xlabelposition@xframe{(0,-\sseq@xaxisgap-\sseq@xlabelgap-10pt)} +\def\sseq@xlabelposition@xnone{(0,0)} + +\def\sseq@ylabelposition@yborder{(0,\sseq@yaxisstartoffset)} +\def\sseq@ylabelposition@ycenter{(-\sseq@xaxisgap,\sseq@yaxisstartoffset+5pt)} +\def\sseq@ylabelposition@yframe{(0,\sseq@yaxisgap+\sseq@ylabelgap+10pt)} +\def\sseq@ylabelposition@ynone{(0,0)} %%% %%% Draw axes and clip %%% \def\sseq@handlexaxis{ - \ifsseq@drawxaxis - \bgroup - \ifsseq@borderxaxis\else - \let\sseq@ymin\sseq@yaxisorigin % Warning: this is a stupid, lazy hack. - \fi - \sseq@drawxaxis - \ifsseq@drawxaxisticks - \sseq@drawxticks - \fi - \egroup + \bgroup + \sseq@drawxaxis + \ifsseq@drawxaxisticks + \sseq@drawxticks \fi + \egroup } \def\sseq@handleyaxis{ - \ifsseq@drawyaxis - \bgroup - \ifsseq@borderyaxis\else - \let\sseq@xmin\sseq@xaxisorigin % Warning: this is a stupid, lazy hack. - \fi - \sseq@drawyaxis - \ifsseq@drawyaxisticks - \sseq@drawyticks - \fi - \egroup + \bgroup + \sseq@drawyaxis + \ifsseq@drawyaxisticks + \sseq@drawyticks \fi + \egroup } -\def\sseq@drawxaxis{ - \bgroup - \pgftransformreset - \sseq@globaldetonetransform - % + +% Draws an x axis. Use with \sseq@transform@xymirror to draw y axis. +% #1 -- horizontal start offset +% #2 -- horizontal end offset +% #3 -- vertical offset +% #4 -- start value +% #5 -- end value +% #6 -- vertical value +\def\sseq@drawaxis@generic#1#2#3#4#5#6{ \bgroup - \pgftransformxshift{\sseq@xaxis@end@extend}\pgftransformyshift{-\sseq@xaxisgap} - \sseq@globalscaletransform - \pgfpathmoveto{\pgfpoint{\sseq@xmax cm}{\sseq@ymin cm}} + \pgftransformshift{\pgfqpoint{#2}{#3}} + \pgfpathmoveto{\sseq@qpointxy{#5}{#6}} \egroup +% \bgroup - \pgftransformxshift{-\sseq@yaxisgap} - %\pgftransformxshift{-\sseq@ylabelgap} - \pgftransformxshift{-\sseq@xaxis@start@extend} - \pgftransformyshift{-\sseq@xaxisgap} - \sseq@globalscaletransform - \pgfpathlineto{\pgfpoint{\sseq@xmin cm}{\sseq@ymin cm}} - \egroup + \pgftransformshift{\pgfqpoint{#1}{#3}} + \pgfpathlineto{\sseq@qpointxy{#4}{#6}} \egroup +} + +\def\sseq@drawxaxis@ynone{ + \sseq@drawxaxisticksfalse +} +\def\sseq@drawyaxis@xnone{ + \sseq@drawyaxisticksfalse +} + +\def\sseq@drawxaxis@yborder{ + \sseq@drawaxis@generic{-\sseq@xaxisstartoffset}{\sseq@xaxisendoffset}{-\sseq@xaxisgap}{\sseq@xmin}{\sseq@xmax}{\sseq@yaxisorigin} \pgfusepath{stroke} } -\def\sseq@drawyaxis{ - \bgroup - \pgftransformreset - \sseq@globaldetonetransform +\let\sseq@drawxaxis@ycenter\sseq@drawxaxis@yborder + +\def\sseq@drawxaxis@yframe{ + \sseq@drawaxis@generic{-\sseq@xaxisstartoffset}{\sseq@xaxisendoffset}{-\sseq@xaxisgap}{\sseq@xmin}{\sseq@xmax}{\sseq@ymin} + \sseq@drawaxis@generic{-\sseq@xaxisstartoffset}{\sseq@xaxisendoffset}{ \sseq@xaxisgap}{\sseq@xmin}{\sseq@xmax}{\sseq@ymax} + \pgfusepath{stroke} +} +\def\sseq@drawyaxis@xborder{ \bgroup - \pgftransformyshift{\sseq@yaxis@end@extend}\pgftransformxshift{-\sseq@yaxisgap} - \sseq@globalscaletransform - \pgfpathmoveto{\pgfpoint{\sseq@xmin cm}{\sseq@ymax cm}} + \sseq@transform@xymirror + \sseq@drawaxis@generic{-\sseq@yaxisstartoffset}{\sseq@yaxisendoffset}{-\sseq@yaxisgap}{\sseq@ymin}{\sseq@ymax}{\sseq@xaxisorigin} + \pgfusepath{stroke}% \egroup +} +\let\sseq@drawyaxis@xcenter\sseq@drawyaxis@xborder +\def\sseq@drawyaxis@xframe{ \bgroup - \pgftransformyshift{-\sseq@xaxisgap} - %\pgftransformyshift{-\sseq@xlabelgap} - \pgftransformyshift{-\sseq@yaxis@start@extend} - \pgftransformxshift{-\sseq@yaxisgap} - \sseq@globalscaletransform - \pgfpathlineto{\pgfpoint{\sseq@xmin cm}{\sseq@ymin cm}} - \egroup - \egroup + \sseq@transform@xymirror + \sseq@drawaxis@generic{-\sseq@yaxisstartoffset}{\sseq@yaxisendoffset}{-\sseq@yaxisgap}{\sseq@ymin}{\sseq@ymax}{\sseq@xmin} + \sseq@drawaxis@generic{-\sseq@yaxisstartoffset}{\sseq@yaxisendoffset}{ \sseq@yaxisgap}{\sseq@ymin}{\sseq@ymax}{\sseq@xmax} \pgfusepath{stroke}% + \egroup } -\def\sseq@drawxticks{ - \sseq@tempy=\sseq@ymin\relax - \sseq@tempx=\sseq@xmax\relax - \advance\sseq@tempx\@ne\relax - \edef\sseq@temp{\the\sseq@tempx}% - \sseq@tempx=\sseq@xmin\relax + +\ExplSyntaxOn +\def\sseq@intdivceiling#1#2{% + \ifnum#1>\z@ % \int_div_truncate:nn rounds towards 0. We want \int_div_ceiling + \int_div_truncate:nn{#1+#2-1}{#2} % if positive, use ceil(p/q)=floor((p+q-1)/q) for p,q integers + \else + \int_div_truncate:nn{#1}{#2} % if we are negative, towards 0 is ceiling + \fi +} +\def\sseq@intdivfloor#1#2{% + \ifnum#1<\z@ % \int_div_truncate:nn rounds towards 0. We want \int_div_floor + \int_div_truncate:nn{#1-#2+1}{#2} % if we are negative, use floor(p/q) = ceil(p-q+1/q) for p,q integers + \else + \int_div_truncate:nn{#1}{#2} % if positive, towards 0 is floor + \fi +} +\ExplSyntaxOff + +% #1 -- xmin +% #2 -- xmax +% #3 -- step +% #4 -- offset +% #5 -- ymin +% #6 -- xaxisgap +% #7 -- code +\def\sseq@tickloop@generic#1#2#3#4#5#6#7{ + \sseq@tempx=\numexpr % min + \sseq@intdivceiling{#1}{#3} * #3 + - + \sseq@intdivceiling{#4}{#3} * #3 + #4 + \relax + \ifnum\sseq@tempx<#1\relax + \advance\sseq@tempx#3\relax + \fi + \sseq@tempxb=\numexpr#2+1\relax % max \loop \bgroup - \sseq@eval{\@nx\pgftransformshift{\@nx\pgfpoint{\the\sseq@tempx cm}{\the\sseq@tempy cm}}} - \pgftransformresetnontranslations - \sseq@globaldetonetransform - \pgftransformyshift{-\sseq@xlabelgap}\pgftransformyshift{-\sseq@xaxisgap} - \pgftransformresetnontranslations - \ifsseq@rotatelabels\sseq@globalrotatetransform\fi + \pgftransformshift{\sseq@qpointxy{\sseq@tempx}{#5}}% + \pgftransformshift{\pgfqpoint{0pt}{#6}} + #7 + \egroup + \advance\sseq@tempx#3\relax + \ifnum\sseq@tempx<\sseq@tempxb\repeat +} + + +\def\sseq@drawxticks{% + \sseq@tickloop@generic{\sseq@xmin}{\sseq@xmax}{\sseq@xtickstep}{\sseq@xtickstepoffset}{\sseq@yaxisorigin}{-\sseq@xaxisgap}{ \sseq@xtickstyle \tikz@options - \pgftext{\hbox{$\sseq@xtickfn{\the\sseq@tempx}$}} - \egroup - \advance\sseq@tempx\sseq@xtickstep\relax - \ifnum\sseq@tempx<\sseq@temp\repeat -} -\def\sseq@drawyticks{ - \sseq@tempx=\sseq@xmin\relax - \sseq@tempy=\sseq@ymax\relax - \advance\sseq@tempy\@ne\relax - \edef\sseq@tempmax{\the\sseq@tempy} - \sseq@tempy=\sseq@ymin\relax - \loop - \bgroup - \sseq@eval{\@nx\pgftransformshift{\@nx\pgfpoint{\the\sseq@tempx cm}{\the\sseq@tempy cm}}} - \pgftransformresetnontranslations - \sseq@globaldetonetransform - \pgftransformxshift{-\sseq@ylabelgap}\pgftransformxshift{-\sseq@yaxisgap} - \pgftransformresetnontranslations - \ifsseq@rotatelabels\sseq@globalrotatetransform\fi + \pgftransformshift{\pgfqpoint{0pt}{-\sseq@ylabelgap}} + \pgftext{\hbox{$\sseq@xtickfn{\the\sseq@tempx}$}}% + } + \ifnum\sseq@xmajortickstep>\z@ + \sseq@tickloop@generic{\sseq@xmin}{\sseq@xmax}{\sseq@xmajortickstep}{\sseq@xtickstepoffset}{\sseq@yaxisorigin}{-\sseq@xaxisgap}{ + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0}{-0.4*\sseq@xaxisgap}} + } + \fi + \ifnum\sseq@xminortickstep>\z@ + \sseq@tickloop@generic{\sseq@xmin}{\sseq@xmax}{\sseq@xminortickstep}{\sseq@xtickstepoffset}{\sseq@yaxisorigin}{-\sseq@xaxisgap}{ + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0}{-0.2*\sseq@xaxisgap}} + } + \fi + \pgfusepath{stroke} +} +\def\sseq@drawyticks{% + \sseq@transform@xymirror + \sseq@tickloop@generic{\sseq@ymin}{\sseq@ymax}{\sseq@ytickstep}{\sseq@ytickstepoffset}{\sseq@xaxisorigin}{-\sseq@yaxisgap}{ \sseq@ytickstyle \tikz@options - \pgftext{\hbox{$\sseq@ytickfn{\the\sseq@tempy}$}} - \egroup - \advance\sseq@tempy\sseq@ytickstep\relax - \ifnum\sseq@tempy<\sseq@tempmax\repeat + \pgftransformshift{\pgfqpoint{0pt}{-\sseq@ylabelgap}} + \pgftransformresetnontranslations + \pgftext{\hbox{$\sseq@ytickfn{\the\sseq@tempx}$}}% + } + \ifnum\sseq@ymajortickstep>\z@ + \sseq@tickloop@generic{\sseq@ymin}{\sseq@ymax}{\sseq@ymajortickstep}{\sseq@ytickstepoffset}{\sseq@xaxisorigin}{-\sseq@yaxisgap}{ + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0}{-0.4*\sseq@yaxisgap}} + } + \fi + \ifnum\sseq@yminortickstep>\z@ + \sseq@tickloop@generic{\sseq@ymin}{\sseq@ymax}{\sseq@yminortickstep}{\sseq@ytickstepoffset}{\sseq@xaxisorigin}{-\sseq@yaxisgap}{ + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0}{-0.2*\sseq@yaxisgap}} + } + \fi + \pgfusepath{stroke} } + + \def\sseq@setupclip{ %\clip(\sseq@xmin-0.4,\sseq@ymin-0.4) rectangle (\sseq@xmax+0.5,\sseq@ymax+0.5);% \ifsseq@clip \ifx\sseq@customclip\pgfutil@empty \bgroup - \pgftransformreset - \sseq@globaldetonetransform - \ifsseq@borderyaxis - \def\xmin{\pgftransformxshift{-\sseq@yaxisgap}\pgftransformxshift{\sseq@yclip@axisgap}} - \else - \def\xmin{\pgftransformxshift{-\sseq@xaxis@start@extend}\pgftransformxshift{-\sseq@clip@padding@left}} - \fi - \ifsseq@borderxaxis - \def\ymin{\pgftransformyshift{-\sseq@xaxisgap}\pgftransformyshift{\sseq@xclip@axisgap}} - \else - \def\ymin{\pgftransformyshift{-\sseq@yaxis@start@extend}\pgftransformyshift{-\sseq@clip@padding@bottom}} - \fi - \def\xmax{\pgftransformxshift{\sseq@xaxis@end@extend}\pgftransformxshift{\sseq@clip@padding@right}} - \def\ymax{\pgftransformyshift{\sseq@yaxis@end@extend}\pgftransformyshift{\sseq@clip@padding@top}} + \def\xmin{\pgftransformshift{\pgfqpoint{\sseq@leftclippadding}{0pt}}} + \def\ymin{\pgftransformshift{\pgfqpoint{0pt}{\sseq@bottomclippadding}}} + \def\xmax{\pgftransformshift{\pgfqpoint{\sseq@rightclippadding}{0pt}}} + \def\ymax{\pgftransformshift{\pgfqpoint{0pt}{\sseq@topclippadding}}} \bgroup - \xmin\ymin\sseq@globalscaletransform - \pgfpathmoveto{\pgfpoint{\sseq@xmin cm}{\sseq@ymin cm}} + \xmin\ymin + \pgfpathmoveto{\pgfqpointxy{\numexpr\sseq@xmin+\sseq@xoffset\relax}{\numexpr\sseq@ymin+\sseq@yoffset\relax}} \egroup \bgroup - \xmin\ymax\sseq@globalscaletransform - \pgfpathlineto{\pgfpoint{\sseq@xmin cm}{\sseq@ymax cm}} + \xmin\ymax + \pgfpathlineto{\pgfqpointxy{\numexpr\sseq@xmin+\sseq@xoffset\relax}{\numexpr\sseq@ymax+\sseq@yoffset\relax}} \egroup \bgroup - \xmax\ymax\sseq@globalscaletransform - \pgfpathlineto{\pgfpoint{\sseq@xmax cm}{\sseq@ymax cm}} + \xmax\ymax + \pgfpathlineto{\pgfqpointxy{\numexpr\sseq@xmax+\sseq@xoffset\relax}{\numexpr\sseq@ymax+\sseq@yoffset\relax}} \egroup \bgroup - \xmax\ymin\sseq@globalscaletransform - \pgfpathlineto{\pgfpoint{\sseq@xmax cm}{\sseq@ymin cm}} + \xmax\ymin + \pgfpathlineto{\pgfqpointxy{\numexpr\sseq@xmax+\sseq@xoffset\relax}{\numexpr\sseq@ymin+\sseq@yoffset\relax}} \egroup \egroup \pgfpathclose - \pgfgetpath\sseq@theclippath % This stores the clipping so I can find intersections later + \pgfgetpath\sseq@theclippath % This stores the clipping so I can apply it later \pgfusepath{discard}% This has to be after the egroup or else the clipping gets screwed up +% \bgroup - %\sseq@globalscaletransform - \pgfpathmoveto{\pgfpoint{\sseq@xmin cm}{\sseq@ymin cm}} - \pgfpathlineto{\pgfpoint{\sseq@xmin cm}{\sseq@ymax cm}} - \pgfpathlineto{\pgfpoint{\sseq@xmax cm}{\sseq@ymax cm}} - \pgfpathlineto{\pgfpoint{\sseq@xmax cm}{\sseq@ymin cm}} + \pgfpathmoveto{\pgfqpointxy{\numexpr\sseq@xmin+\sseq@xoffset\relax}{\numexpr\sseq@ymin+\sseq@yoffset\relax}} + \pgfpathlineto{\pgfqpointxy{\numexpr\sseq@xmin+\sseq@xoffset\relax}{\numexpr\sseq@ymax+\sseq@yoffset\relax}} + \pgfpathlineto{\pgfqpointxy{\numexpr\sseq@xmax+\sseq@xoffset\relax}{\numexpr\sseq@ymax+\sseq@yoffset\relax}} + \pgfpathlineto{\pgfqpointxy{\numexpr\sseq@xmax+\sseq@xoffset\relax}{\numexpr\sseq@ymin+\sseq@yoffset\relax}} \pgfpathclose \egroup \pgfgetpath\sseq@therangepath % Only for deciding whether to draw "tricky edges" @@ -188,66 +337,194 @@ \fi } \def\sseq@useclip{\ifx\sseq@theclippath\relax\else\pgfsetpath\sseq@theclippath\pgfusepath{clip}\fi} + + +% sets \pgf@xa and \pgf@ya equal to the coordinates of (1,1), sets \pgf@xb and \pgf@xb equal to (x grid step, y grid step) +\def\sseq@grid@setstepandgridstep{ + \pgf@process{\pgfqpointxy{1}{1}} + \pgf@xa=\pgf@x + \pgf@ya=\pgf@y + \pgf@process{\pgfqpointxy{\sseq@xgridstep}{\sseq@ygridstep}} + \pgf@xb=\pgf@x + \pgf@yb=\pgf@y +} + +% #1 -- macro to store result in +% #2 -- "x" or "y" as appropriate +% #3 -- length (with units) +% #4 -- fraction of gridstep +% If #2 is x, then it either sets #1 to #3/(x scale) or xgridstep*#4, whichever is smaller +% The output is intended for use with \pgfpointxy. +\def\sseq@grid@atmostgridstep#1#2#3#4{ + \ifdim#3<\dimexpr\csname pgf@#2b\endcsname*#4\relax + \pgfmathparse{#3/\csname pgf@#2a\endcsname} + \let#1\pgfmathresult + \else + \edef#1{\csname sseq@#2gridstep\endcsname*#4} + \fi +} + +% This grid was a huge pain in the ass to get right... \def\sseq@grid@chess{ - \bgroup - \pgfscope - \sseq@useclip - \pgflowlevelsynccm - \pgfsetlinewidth{1cm} - \pgfsetdash{{1cm}{1cm}}{1cm} - \pgfsetcolor{lightgray} - \pgfpathgrid[stepx=2cm,stepy=2cm]{\pgfpoint{-0.5cm}{-0.5cm}}{\pgfpoint{\sseq@xmax cm+0.499cm}{\sseq@ymax cm+0.499cm}} - \pgfusepath{stroke} - \endpgfscope - \egroup + \bgroup + \pgfscope + % Pad on the right and top by either the grid padding, or the remaining piece of the checkerboard before it would start a new square + % (it looks ugly to have a tiny sliver). Annoyingly, mod returns its result with the same sign as its input, so in order to reduce mod + % \sseq@xgridstep and get a positive result, we have to do it twice. The 0.5cm*scale here matches the -0.5 in the \pgfpathgrid call. + \pgfmathsetmacro\sseq@rightpadding{min( + \sseq@rightgridpadding, + 1cm* mod(mod(-\sseq@xmax,\sseq@xgridstep)+\sseq@xgridstep,\sseq@xgridstep)+0.5cm*\sseq@xscale-0.05cm + )} + \pgfmathsetmacro\sseq@toppadding{min( + \sseq@topgridpadding, + 1cm * mod(mod(-\sseq@ymax,\sseq@ygridstep)+\sseq@ygridstep,\sseq@ygridstep)+0.5cm*\sseq@yscale-0.02cm + )} + % Because of complicated aliasing issues that arise when misusing the \pgfgrid command in this way, + % it's more convenient to add a clip than to actually stop things in the right place. + \clip (\sseq@xmin-\sseq@xoffset,\sseq@ymin-\sseq@yoffset) ++ (-0.48, -0.48) + rectangle ([shift={(\sseq@rightpadding pt,\sseq@toppadding pt)}]\sseq@xmax,\sseq@ymax); +% + \sseq@useclip + \pgfsetcolor{\sseq@gridcolor} + \pgfsetstrokeopacity{0.3} % We don't set low opacity for the other grids, but this one is visible even if it is very faint. + \sseq@grid@setstepandgridstep +% +% Use ifdim with cm to compare real scalars b/c tex is dumb. + % okay, now we need to be careful in order to avoid overflows. The hack we are using requires that the xvec and the yvec are equal + % because we can't apply these via lowlevelsynccm. However, xvec and yvec are the things that prevent overflows. + % What we need to do is set them both equal to the smaller value. Now the scale factor determines the size of the squares, + % so we mix in the grid steps. We also need to scale the larger scaled coordinate by the ratio of the two scales. + \ifdim\sseq@xscale cm<\sseq@yscale cm\relax + % x is smaller so set both x and y vecs to \sseq@xscale cm. + \pgfsetxvec{\pgfpoint{\sseq@xscale cm}{0cm}} + \pgfsetyvec{\pgfpoint{0cm}{\sseq@xscale cm}} + \def\sseq@xadjustscale{\sseq@xgridstep} + \def\sseq@yadjustscale{\sseq@yscale/\sseq@xscale*\sseq@ygridstep} + \def\sseq@stepscale{\sseq@xscale} + \else + \pgfsetxvec{\pgfpoint{\sseq@yscale cm}{0cm}} + \pgfsetyvec{\pgfpoint{0cm}{\sseq@yscale cm}} + \def\sseq@xadjustscale{(\sseq@xscale/\sseq@yscale*\sseq@xgridstep)} + \def\sseq@yadjustscale{\sseq@ygridstep} + \def\sseq@stepscale{\sseq@yscale} + \fi + \pgftransformxscale{\sseq@xadjustscale} + \pgftransformyscale{\sseq@yadjustscale} + % Now we have to put in some ridiculously complicated shift in order to get the bottom corner in the right place. + % I found this formula mostly by trial and error. + % The basic idea that we should be making something divisible by twice the grid step (which is the actual period of our grid) + % is reasonable enough, but what the heck are these other two terms for? I don't know either, thank god it works. + \pgftransformshift{\pgfpointxy{ + floor((\sseq@xgridstep-1)/2)/\sseq@xgridstep + + \ifodd\sseq@xgridstep\space 0 \else 0.5/\sseq@xgridstep\fi + + mod(1+\sseq@xmin/\sseq@xgridstep,2*\sseq@xgridstep) + }{ + floor((\sseq@ygridstep-1)/2)/\sseq@ygridstep + + \ifodd\sseq@ygridstep\space 0\else 0.5/\sseq@ygridstep\fi + + mod(1+\sseq@ymin/\sseq@ygridstep,2*\sseq@ygridstep) + } + } + % We use lowlevelsynccm to make the scale adjust the line width. Normally scaling doesn't affect line width, text size, etc, which is sensible. + % When you apply \pgflowlevelsynccm, pgf loses track of the coordinate matrix and it gets indiscriminately applied to everything. + % This is good for us, because we're doing this absurd thing where we make a checkerboard by drawing a really really fat line. + \pgflowlevelsynccm + \pgfsetlinewidth{1cm*\sseq@stepscale} + \pgfsetdash{{1cm*\sseq@stepscale}{1cm*\sseq@stepscale}}{1cm*\sseq@stepscale} +% + % Naturally some trial and error occurred here too. + % Note the huge multiples of \sseq@xgridstep I added in -- they probably aren't necessary, but I don't understand what's going on so whatever. + % The basic idea is that things need to be divisible by twice the grid step. The part I added in the shift above + % was the remainder when you divide \sseq@xmin by twice the grid step, now we need to add in the multiple of twice the grid step. + % The -0.5 is ensuring that the checkerboard boundaries lie at half-integer coordinates (I think). + \pgfpathgrid[stepx= 2cm*\sseq@stepscale,stepy=2cm*\sseq@stepscale] + { \pgfpointxy + { -0.5 + \sseq@intdivfloor{\numexpr\sseq@xmin - \sseq@xgridstep\relax}{2*\sseq@xgridstep}*2*\sseq@xgridstep + \sseq@xoffset - 50*\sseq@xgridstep } + { -0.5 + \sseq@intdivfloor{\numexpr\sseq@ymin - \sseq@ygridstep\relax}{2*\sseq@ygridstep}*2*\sseq@ygridstep + \sseq@yoffset - 50*\sseq@ygridstep} + }{ \pgfpointxy + { \sseq@xmax + \sseq@xoffset + 50*\sseq@xgridstep } + { \sseq@ymax + \sseq@yoffset + 50*\sseq@ygridstep } + } + \pgfusepath{stroke} + \endpgfscope + \egroup } + \def\sseq@grid@crossword{ - \bgroup - \pgfscope - \pgfsetlinewidth{\the\sseq@gridstrokethickness} - \sseq@useclip - \pgftransformxshift{-0.5cm} - \pgftransformyshift{-0.5cm} - \pgfpathgrid[stepx=1cm,stepy=1cm]{\pgfpoint{-1cm}{-1cm}}{\pgfpoint{\xmax cm+0.99cm}{\ymax cm+0.99cm}} - \pgfusepath{stroke} - \endpgfscope - \egroup + \bgroup + \pgfscope + \sseq@useclip + \pgfsetcolor{\sseq@gridcolor} + \pgfsetlinewidth{\the\sseq@gridstrokethickness} + \sseq@grid@setstepandgridstep +% + % We don't want the grid to end with an extra line, so extend it by one half the step distance or + % \sseq@---gridpadding, whichever is shorter. + \sseq@grid@atmostgridstep\sseq@xminpadding{x}{\sseq@leftgridpadding}{1/2} + \sseq@grid@atmostgridstep\sseq@xmaxpadding{x}{\sseq@rightgridpadding}{1/2} + \sseq@grid@atmostgridstep\sseq@yminpadding{y}{\sseq@bottomgridpadding}{1/2} + \sseq@grid@atmostgridstep\sseq@ymaxpadding{y}{\sseq@topgridpadding}{1/2} +% + \pgftransformshift{\pgfpointxy{-\sseq@xgridstep/2}{-\sseq@ygridstep/2}} + \pgfpathgrid[stepx=\pgf@xb,stepy=\pgf@yb] + { \pgfpointxy + { \sseq@xmin - \sseq@xminpadding + 0.01 + \sseq@xoffset + \sseq@xgridstep/2 } + { \sseq@ymin - \sseq@yminpadding + 0.01 + \sseq@yoffset + \sseq@ygridstep/2 } } + { \pgfpointxy + { \sseq@xmax + \sseq@xmaxpadding - 0.01 + \sseq@xoffset + \sseq@xgridstep/2 } + { \sseq@ymax + \sseq@ymaxpadding - 0.01 + \sseq@yoffset + \sseq@ygridstep/2 } } + \pgfusepath{stroke} + \endpgfscope + \egroup } \def\sseq@grid@go{ - \bgroup - \pgfscope - \sseq@useclip - \pgfsetlinewidth{\the\sseq@gridstrokethickness} - \pgfpathgrid[stepx=1cm,stepy=1cm]{\pgfpoint{-1cm}{-1cm}}{\pgfpoint{\xmax cm+0.5cm}{\ymax cm+0.5cm}} - \pgfusepath{stroke} - \endpgfscope - \egroup + \bgroup + \pgfscope + \sseq@useclip + \pgfsetcolor{\sseq@gridcolor} + \pgfsetlinewidth{\the\sseq@gridstrokethickness} + \sseq@grid@setstepandgridstep +% + % We don't want the grid to end with an extra line, so extend it by one step distance or + % \sseq@---gridpadding, whichever is shorter. + \sseq@grid@atmostgridstep\sseq@xminpadding{x}{\sseq@leftgridpadding}{1} + \sseq@grid@atmostgridstep\sseq@xmaxpadding{x}{\sseq@rightgridpadding}{1} + \sseq@grid@atmostgridstep\sseq@yminpadding{y}{\sseq@bottomgridpadding}{1} + \sseq@grid@atmostgridstep\sseq@ymaxpadding{y}{\sseq@topgridpadding}{1} +% + \pgfpathgrid[stepx=\pgf@xb,stepy=\pgf@yb] + { \pgfpointxy + { \sseq@xmin - \sseq@xminpadding + 0.01 + \sseq@xoffset } + { \sseq@ymin - \sseq@yminpadding + 0.01 + \sseq@yoffset } } + { \pgfpointxy + { \sseq@xmax + \sseq@xmaxpadding - 0.01 + \sseq@xoffset } + { \sseq@ymax + \sseq@ymaxpadding - 0.01 + \sseq@yoffset } + } + \pgfusepath{stroke} + \endpgfscope + \egroup } \def\sseq@grid@none{} \def\sseq@grid@dots{ - \bgroup - \pgfscope - \pgfgettransform\sseq@savetransform - \pgftransformreset - \sseq@globalscaletransform - \pgfgettransformentries{\sseq@a}{\sseq@b}{\sseq@c}{\sseq@d}{\sseq@u}{\sseq@v} - \pgfsettransform\sseq@savetransform - \sseq@useclip - \pgftransformxshift{-1.5cm} - \pgftransformyshift{-0.5cm} - \pgfsetdash{{1pt}{\sseq@a*1cm-1pt}}{0.5cm+.5pt} - \pgfsetlinewidth{1pt} - \sseq@tempy=\sseq@ymin\relax - \advance\sseq@tempy\m@ne - \loop - \advance\sseq@tempy\@ne - \pgfpathmoveto{\pgfpoint{\sseq@xmin cm+0.5cm/\sseq@a}{\the\sseq@tempy cm}} - \pgfpathlineto{\pgfpoint{\sseq@xmax cm+1.01cm }{\the\sseq@tempy cm}} - \ifnum\sseq@tempy<\sseq@ymax\repeat - %\pgfpathgrid[stepx=1cm,stepy=1cm]{\pgfpoint{-0.5cm}{-0.5cm}}{\pgfpoint{\xmax cm-0.5cm}{\ymax cm-0.5cm}} - \pgfusepath{stroke} - \endpgfscope - \egroup + \bgroup + \pgfscope + \pgfgettransform\sseq@savetransform + \pgfgettransformentries{\sseq@a}{\sseq@b}{\sseq@c}{\sseq@d}{\sseq@u}{\sseq@v} + \pgfsettransform\sseq@savetransform + \sseq@useclip + \pgftransformshift{\pgfqpoint{-1.5cm}{-0.5cm}} + \pgfsetdash{{1pt}{\sseq@a*1cm-1pt}}{0.5cm+.5pt} + \pgfsetlinewidth{1pt} + \sseq@tempy=\sseq@ymin\relax + \advance\sseq@tempy\m@ne + \loop + \advance\sseq@tempy\@ne + \pgfpathmoveto{\pgfpointxy{\sseq@xmin + 0.5/\sseq@a}{\the\sseq@tempy}} + \pgfpathlineto{\pgfpointxy{\sseq@xmax + 1.01 }{\the\sseq@tempy}} + \ifnum\sseq@tempy<\sseq@ymax\repeat + %\pgfpathgrid[stepx=1cm,stepy=1cm]{\pgfpoint{-0.5cm}{-0.5cm}}{\pgfpoint{\xmax cm-0.5cm}{\ymax cm-0.5cm}} + \pgfusepath{stroke} + \endpgfscope + \egroup } %%% %%% Draw Classes @@ -261,6 +538,7 @@ (-0.16,-0.16)(0.16,-0.16)(-0.16,0.16)(0.16,0.16)(0,0); (-0.13,-0.2)(-0.13,0)(-0.13,0.2)(0.13,-0.2)(0.13,0)(0.13,0.2); } + \sseqnewclasspattern{linear}{ (0,0); (-0.13,0)(0.13,0); @@ -270,15 +548,21 @@ (-0.5,0)(-0.3,0)(-0.1,0)(0.1,0)(0.3,0)(0.5,0); } \def\sseq@offset#1#2{ - \sseq@eval{\@nx\pgftransformshift{\@nx\pgfpoint{0\csname sseq@\sseq@classpattern xoffset#1/#2\endcsname cm}{0\csname sseq@\sseq@classpattern yoffset#1/#2\endcsname cm}}} + \sseq@eval{\@nx\pgftransformshift{ + \@nx\pgfqpointxy + { \csname sseq@\sseq@classpattern xoffset#1/#2\endcsname } + { \csname sseq@\sseq@classpattern yoffset#1/#2\endcsname } + }} } \def\sseq@class@getparts#1(#2,#3,#4)[#5].{ \sseq@seterrorannotation@drawing{#1}{#2}{#3}{#4}{#5} \def\sseq@thisclassname{class.(#2,#3,#4)} \def\sseq@thisnodename{sseq{#2,#3,#4}} \def\sseq@thispos{(#2,#3)} - \def\sseq@thisposnum{#4} + \edef\sseq@thisposnum{\sseq@obj{class.(#2,#3,#4).n}} \def\sseq@thisclassnum{#5} + \sseq@tempx=#2\relax + \sseq@tempy=#3\relax } \def\sseqtooltip#1#2{% @@ -298,11 +582,14 @@ } % #1 -- the name of the node object +% Someday I should document this horrible mess of code here +\newif\ifsseq@permanentcycle +\newcount\sseq@totalclassesdrawn +\AtEndDocument{\message{Total classes: \the\sseq@totalclassesdrawn}} \def\sseq@class@drawnode#1{% + \global\advance\sseq@totalclassesdrawn\@ne \begingroup \sseq@class@getparts#1. - \sseq@tempx=\sseq@obj{\sseq@thisclassname.x}\relax - \sseq@tempy=\sseq@obj{\sseq@thisclassname.y}\relax \sseq@needstikzfalse \sseq@options@firstpassmode \sseq@thesseqstyle @@ -318,7 +605,7 @@ \the\sseq@scope@toks \sseq@obj{#1.needstikz} % - \sseq@outofrangetrue + \sseq@outofrangetrue\relax % Mysterious that we need this \relax here... \ifnum\sseq@tempx<\sseq@xmaxpp\relax\ifnum\sseq@tempx>\sseq@xminmm\relax\ifnum\sseq@tempy<\sseq@ymaxpp\relax\ifnum\sseq@tempy>\sseq@yminmm\relax \sseq@outofrangefalse \pgfscope @@ -329,17 +616,19 @@ \sseq@thesseqstyle \sseq@theclassstyle \ifnum\sseq@obj{#1.page}=\sseq@infinitycount + \sseq@permanentcycletrue % This is to communicate with family style code... \sseq@thepermanentcyclestyle \else + \sseq@permanentcyclefalse \sseq@thetransientcyclestyle \ifsseq@thispage \sseq@thethispagecyclestyle \fi \fi + \def\sseq@collections@featuretype{class} \the\sseq@scope@toks \sseq@obj{#1.options}% - \sseq@eval{\@nx\pgftransformshift{\@nx\pgfpoint{\the\sseq@tempx cm}{\the\sseq@tempy cm}}} - \sseq@eval{\@nx\pgftransformshift{\@nx\pgfpoint{-\the\sseq@x cm}{-\the\sseq@y cm}}} + \pgftransformshift{\pgfqpointxy{\numexpr\sseq@tempx +\sseq@xoffset-\sseq@x\relax}{\numexpr\sseq@tempy + \sseq@yoffset-\sseq@y\relax}} \iftikz@fullytransformed\pgfgettransform{\savetransform}\fi \pgftransformresetnontranslations \sseq@globalrotatetransform @@ -351,24 +640,23 @@ \tikz@options \ifsseq@needstikz \let\sseq@mode\tikz@mode - \tikzset{every text node part/.code/.expand once={\sseq@globalrotatetransform\sseq@obj{#1.nodetext.options}}}% + \tikzset{every text node part/.code/.expand once={\sseq@globalrotatetransform\sseq@obj@ifdef{#1.nodetext.options}{\sseq@obj{#1.nodetext.options}}{}}}% \sseq@eval{% \@nx\node[/utils/exec={\let\@nx\tikz@mode\@nx\sseq@mode}, /handlers/first char syntax/the character "/.initial=\@nx\sseq@handlequote - ] (\sseq@thisnodename) {\unexpanded\@xpthree{\sseq@obj{#1.nodetext}}} - [every text node part/.code={}] - \@nx\sseq@obj{#1.labelnodes}; + ] (\sseq@thisnodename) {\sseq@obj@ifdef{#1.nodetext}{\unexpanded\@xpthree{\sseq@obj{#1.nodetext}}}{}} + [every text node part/.code={}]; }% \else \tikz@node@textfont - \edef\sseq@classnodetextoptions{\@xptwo\@nx\sseq@obj{#1.nodetext.options}} - \edef\sseq@classnodetext{\@xptwo\@nx\sseq@obj{#1.nodetext}} - \sseq@setnodetext + \edef\sseq@classnodetextoptions{\sseq@obj@ifdef{#1.nodetext.options}{\@xptwo\@nx\sseq@obj{#1.nodetext.options}}{}} + \edef\sseq@classnodetext{\sseq@obj@ifdef{#1.nodetext}{\@xptwo\@nx\sseq@obj{#1.nodetext}}{}} + \sseq@setnodetext{\sseq@classnodetext}{\sseq@classnodetextoptions} \let\tikz@fig@name\sseq@thisnodename \pgfmultipartnode{\tikz@shape}{\tikz@anchor}{\tikz@fig@name}{\sseq@drawnode}% \tikz@alias - \sseq@obj{#1.labelnodes} \fi + \sseq@obj{#1.labelnodes} \sseq@obj@ifdef{#1.tooltip}{ \pgfpointanchor{\sseq@thisnodename}{west} \pgf@xa=\pgf@x @@ -386,7 +674,7 @@ \endpgfinterruptpicture } {% - \pgftransformshift{\pgfpoint{\pgf@xa}{\pgf@ya}}% + \pgftransformshift{\pgfqpoint{\pgf@xa}{\pgf@ya}}% \pgfapproximatenonlineartransformation% \pgfqboxsynced{\tikz@tempbox}% }% @@ -394,8 +682,7 @@ \endpgfscope \fi\fi\fi\fi \ifsseq@outofrange - \sseq@eval{\@nx\pgftransformshift{\@nx\pgfpoint{\the\sseq@tempx cm}{\the\sseq@tempy cm}}}% - \sseq@eval{\@nx\pgftransformshift{\@nx\pgfpoint{-\the\sseq@x cm}{-\the\sseq@y cm}}} + \sseq@eval{\@nx\pgftransformshift{\@nx\pgfqpointxy{\numexpr\sseq@tempx+\sseq@xoffset-\sseq@x\relax}{\numexpr\sseq@tempy+\sseq@yoffset-\sseq@y\relax}}}% \pgftransformresetnontranslations \sseq@globalrotatetransform \sseq@classplacementtransform @@ -404,11 +691,14 @@ \fi \endgroup } -\def\sseq@setnodetext{% + +% #1 -- label text +% #2 -- options +\def\sseq@setnodetext#1#2{% \setbox\pgfnodeparttextbox=\hbox{% \pgfscope% + #2 \tikzset{every text node part/.try}% - \sseq@classnodetextoptions \ifx\tikz@textopacity\pgfutil@empty% \else% \pgfsetfillopacity{\tikz@textopacity}% @@ -430,7 +720,7 @@ \fi% \pgfsetcolor{.}% \tikz@atbegin@node% - \sseq@classnodetext% + #1% \tikz@atend@node% \ifx\tikz@text@width\pgfutil@empty% \else% @@ -489,6 +779,51 @@ \global\pgflinewidth=\pgfutil@tempdima% } +%%% Labels + +% #1 -- label text +% #2 -- options +\def\sseq@drawlabel#1#2{ + \bgroup\pgfscope + \def\tikz@mode{} + \let\sseq@tikz@transform@save\tikz@transform + \pgfkeyssetvalue{/pgf/inner xsep}{2pt} + \pgfkeyssetvalue{/pgf/inner ysep}{2pt} + \def\tikz@shape{rectangle} + \let\tikz@transform\empty % The next line was set up to fix the classlabelstyle glitch + \sseq@options@secondpassmode + \sseq@thesseqstyle\sseq@thelabelstyle\sseq@theclasslabelstyle#2 + \tikz@options + \pgftransformreset + \pgftransformshift{\tikz@node@at} + \tikz@lib@pos@call + \tikz@transform + \tikz@mode + \let\tikz@transform\sseq@tikz@transform@save + \sseq@setnodetext{\sseq@labeltextfn{#1}}{} + \pgfmultipartnode{\tikz@shape}{\tikz@anchor}{label}{\sseq@drawnode}% + \ifsseq@pin + \def\sseq@pinoptions{} + \let\tikz@options\empty + \let\tikz@mode\empty + \sseq@thepinstyle + #2 + \sseq@pinoptions + \tikz@options + \tikz@mode + \sseq@drawedge@findsourcetarget{\tikz@fig@name}{}{label}{} + \pgfpathmoveto{\sseq@sourcecoord}% + \pgfpathlineto{\sseq@targetcoord}% + \sseq@eval{\noexpand\pgfusepath{% + draw + \iftikz@mode@fill fill,\fi + \iftikz@mode@draw draw,\fi + }}% + \fi + \endpgfscope\egroup +} + + %%% %%% Drawing edges %%% @@ -506,6 +841,34 @@ \fi } +% #1 -- source node +% #2 -- source anchor +% #3 -- target node +% #4 -- target anchor +% Calculate actual start and end of the edge (node borders), return the results stored in \sseq@sourcecoord, \sseq@targetcoord +\def\sseq@drawedge@findsourcetarget#1#2#3#4{ + \edef\sseq@edgesourceanchor{#2} + \edef\sseq@edgetargetanchor{#4} + \let\tempaf\pgfutil@empty + \ifx\sseq@edgesourceanchor\pgfutil@empty % Check that the source doesn't have a specified anchor + \def\tempa{\pgfpointanchor{#1}{center}}% if so, start by taking the center of that coordinate + \else + \edef\tempa{\@nx\pgfpointanchor{#1}{\sseq@edgesourceanchor}} % If it has an anchor, use that + \let\tempaf\tempa + \fi + \ifx\sseq@edgetargetanchor\pgfutil@empty % check that the target doesn't have a specified anchor + \def\tempb{\pgfpointshapeborder{#3}{\tempa}}% if so, our end point is the point on the boundary of node b that is in the direction of our initial start coordinate + \else + \edef\tempb{\@nx\pgfpointanchor{#3}{\sseq@edgetargetanchor}}% If it has a specified anchor, use that + \fi + \let\tempbf\tempb + \ifx\tempaf\pgfutil@empty% + \def\tempaf{\pgfpointshapeborder{#1}{\tempb}}% + \fi + \let\sseq@sourcecoord\tempaf + \let\sseq@targetcoord\tempbf +} + \def\sseq@fullcoord@to@partialcoord(#1){\sseq@fullcoord@to@partialcoord@#1,\@nil} \def\sseq@fullcoord@to@partialcoord@#1,#2,#3\@nil{{#1cm}{#2cm}} % #1 -- source (full) @@ -514,7 +877,15 @@ % #4 -- options \def\sseq@drawedge(#1)(#2)#3#4{% \begingroup\pgfscope + % If either class is part of a family we aren't drawing, don't draw the edge either. + \expandafter\ifx\csname pgf@sh@pi@sseq{#1}\endcsname\pgfpictureid\else + \@xp\sseq@break + \fi + \expandafter\ifx\csname pgf@sh@pi@sseq{#2}\endcsname\pgfpictureid\else + \@xp\sseq@break + \fi \def\sseq@edgetype{#3} + \let\sseq@collections@featuretype\sseq@edgetype \let\sseq@edgesourceanchor\pgfutil@empty \let\sseq@edgetargetanchor\pgfutil@empty % @@ -524,40 +895,34 @@ \sseq@thesseqstyle \sseq@theedgestyle\csname sseq@the#3style\endcsname\the\sseq@scope@toks #4% - \sseq@eval{\@nx\pgftransformshift{\@nx\pgfpoint{-\the\sseq@x cm}{-\the\sseq@y cm}}}% - % First calculate actual start and end of the edge - \let\tempaf\pgfutil@empty - \ifx\sseq@edgesourceanchor\pgfutil@empty % Check that the source doesn't have a specified anchor - \def\tempa{\pgfpointanchor{sseq{#1}}{center}}% if so, start by taking the center of that coordinate - \else - \edef\tempa{\@nx\pgfpointanchor{sseq{#1}}{\sseq@edgesourceanchor}} % If it has an anchor, use that - \let\tempaf\tempa - \fi - \ifx\sseq@edgetargetanchor\pgfutil@empty % check that the target doesn't have a specified anchor - \def\tempb{\pgfpointshapeborder{sseq{#2}}{\tempa}}% if so, our end point is the point on the boundary of node b that is in the direction of our initial start coordinate - \else - \edef\tempb{\@nx\pgfpointanchor{sseq{#2}}{\sseq@edgetargetanchor}}% If it has a specified anchor, use that - \fi - \let\tempbf\tempb - \ifx\tempaf\pgfutil@empty% - \def\tempaf{\pgfpointshapeborder{sseq{#1}}{\tempb}}% - \fi + \csname sseq@collections@#3@hook\endcsname + \pgftransformshift{\pgfqpointxy{-\the\sseq@x}{-\the\sseq@y}}% + % puts results into \sseq@sourcecoord and \sseq@targetcoord + \sseq@drawedge@findsourcetarget{sseq{#1}}{\sseq@edgesourceanchor}{sseq{#2}}{\sseq@edgetargetanchor} % \tikz@options \tikz@mode \def\temparrowstartspec{}% \def\temparrowendspec{}% - \pgfcoordinate{tempa}{\tempaf}% - \pgfcoordinate{tempb}{\tempbf}% + \pgfcoordinate{tempa}{\sseq@sourcecoord}% + \pgfcoordinate{tempb}{\sseq@targetcoord}% \pgftransformreset - \sseq@ifinrange(#1){\sseq@ifinrange(#2){\sseq@outofrangefalse}{\sseq@outofrangetrue}}{\sseq@outofrangetrue}% + \sseq@outofrangefalse + \sseq@ifinrange(#1){}{ + \edef\temparrowstartspec{\@nx\pgfsetarrowsstart{\csname sseq@runoffarrow@start@#3@spec\endcsname}} + \sseq@outofrangetrue + }% + \sseq@ifinrange(#2){}{ + \edef\temparrowendspec{\@nx\pgfsetarrowsend{\csname sseq@runoffarrow@end@#3@spec\endcsname}} + \sseq@outofrangetrue + } \ifsseq@outofrange - \sseq@handleoffpageedge{#1}{#2}{#3}% + \sseq@handleoffpageedge{#1}{#2}% \fi \ifsseq@drawedge % TODO: should some sort of transformation manipulation be here? Maybe allow user to specify preference? % Don't draw dots on very short segments - \pgfpointdiff{\tempbf}{\tempaf} + \pgfpointdiff{\sseq@targetcoord}{\sseq@sourcecoord} \pgfmathveclen{\pgf@x}{\pgf@y}% \@xp\pgfmathint\@xp{\pgfmathresult}% \ifnum\pgfmathresult<10\relax%%17? % TODO: Fix this predicate @@ -591,10 +956,10 @@ \endpgfscope\endgroup } -% TODO: this macro is super expensive. Make it faster (avoid -\def\sseq@handleoffpageedge#1#2#3{ - \pgfpathmoveto{\tempaf}% - \pgfpathlineto{\tempbf}% +% TODO: this macro is super expensive. Make it faster +\def\sseq@handleoffpageedge#1#2{ + \pgfpathmoveto{\sseq@sourcecoord}% + \pgfpathlineto{\sseq@targetcoord}% \pgfgetpath\thispath \pgfusepath{discard}% \pgfintersectionofpaths{\pgfsetpath\sseq@theclippath}{\pgfsetpath\thispath}% @@ -603,20 +968,16 @@ \sseq@ifinrange(#1){% If the first endpoint is in range, the second must be out of range b/c sseq@outofrange is true. %\edef\temparrowendspec{\@nx\pgfsetarrowsend{\csname sseq@runoffarrow@end@#3@spec\endcsname}} }{% - \sseq@ifinrange(#2){% - \edef\temparrowstartspec{\@nx\pgfsetarrowsstart{\csname sseq@runoffarrow@start@#3@spec\endcsname}} - }{\sseq@drawedge@handletrickyedge}% uh-oh, both ends are out of range + \sseq@ifinrange(#2){}{\sseq@drawedge@handletrickyedge}% uh-oh, both ends are out of range }% \or \sseq@ifinrange(#1){% If the startpoint is in range, the intersection must be the end. - \def\tempbf{\pgfpointintersectionsolution{1}} - \edef\temparrowendspec{\@nx\pgfsetarrowsend{\csname sseq@runoffarrow@end@#3@spec\endcsname}} - \pgfcoordinate{tempb}{\tempbf} + \def\sseq@targetcoord{\pgfpointintersectionsolution{1}} + \pgfcoordinate{tempb}{\sseq@targetcoord} }{% \sseq@ifinrange(#2){% If the startpoint is out of range and the endpoint is in range, the intersection must be the start - \def\tempaf{\pgfpointintersectionsolution{1}}% - \edef\temparrowstartspec{\@nx\pgfsetarrowsstart{\csname sseq@runoffarrow@start@#3@spec\endcsname}}% - \pgfcoordinate{tempa}{\tempaf}% + \def\sseq@sourcecoord{\pgfpointintersectionsolution{1}}% + \pgfcoordinate{tempa}{\sseq@sourcecoord}% }{\sseq@drawedge@handletrickyedge}% Uh-oh, both ends are out of range. } \or% an orphan @@ -653,26 +1014,33 @@ \def\sseq@drawedge@handleorphan{% - \def\tempaf{\pgfpointintersectionsolution{1}}% - \def\tempbf{\pgfpointintersectionsolution{2}}% + \def\sseq@sourcecoord{\pgfpointintersectionsolution{1}}% + \def\sseq@targetcoord{\pgfpointintersectionsolution{2}}% \edef\temparrowstartspec{\@nx\pgfsetarrowsstart{\csname sseq@runoffarrow@start@\sseq@edgetype @spec\endcsname}}% \edef\temparrowendspec{\@nx\pgfsetarrowsend{\csname sseq@runoffarrow@end@\sseq@edgetype @spec\endcsname}}% - \pgfcoordinate{tempa}{\tempaf}% - \pgfcoordinate{tempb}{\tempbf}% + \pgfcoordinate{tempa}{\sseq@sourcecoord}% + \pgfcoordinate{tempb}{\sseq@targetcoord}% } -% -% #1 -- first coordinate -% #2 -- second coordinate -% #3 -- uid +% #1 -- uid +% #2 -- first coordinate +% #3 -- second coordinate \def\sseq@circleclass@draw#1#2#3{ \begingroup + % If either class is part of a family we aren't drawing, don't draw the fit either. + \expandafter\ifx\csname pgf@sh@pi@sseq{#2}\endcsname\pgfpictureid\else + \@xp\sseq@break + \fi + \expandafter\ifx\csname pgf@sh@pi@sseq{#3}\endcsname\pgfpictureid\else + \@xp\sseq@break + \fi \pgfmathanglebetweenpoints{\pgfpointanchor{sseq{#2}}{center}}{\pgfpointanchor{sseq{#3}}{center}} \let\tempangle\pgfmathresult \let\tikz@lib@fit@scan@handle\sseq@fit@tikz@lib@fit@scan@handle % install fit modifications. \let\tikz@calc@anchor\sseq@fit@tikz@calc@anchor \sseq@tempiftrue + \sseq@options@secondpassmode \node[ rotate fit=\tempangle, /utils/exec={\sseq@thesseqstyle\sseq@thecircleclassstyle\the\sseq@scope@toks\sseq@savedoptioncode @@ -681,6 +1049,7 @@ \@xp\pgfkeysalso\@xp{\romannumeral0\sseq@obj{#1.tikzprimoptions}} } ] {}; + \sseq@breakpoint \endgroup } % Modifies tikz commands \tikz@lib@fit@scan@handle from \pgf\frontendlayer\tikz\libraries\tikzlibraryfit.code.tex line 81 and @@ -711,6 +1080,94 @@ } +%% +%% Patch tikz coords +%% + +\def\sseq@patchtikzcoords{ + \let\sseq@tikz@scan@one@point@noshift\sseq@tikz@scan@one@point@noshift@active + \tikzoption{shift}{\sseq@tikzshift{##1}} + \let\tikz@@@parse@regular\sseq@tikz@@@parse@regular + \let\tikz@to@curve@path\sseq@tikz@to@curve@path + \let\tikz@@@to@compute@relative\sseq@tikz@@@to@compute@relative + + \let\tikz@grid\sseq@tikz@grid + \let\tikz@scan@handle@options\sseq@tikz@scan@handle@options + \let\tikz@@@parse@polar\sseq@tikz@@@parse@polar +} + +% Some of the stuff in tikzlibrarycalc will probably be broken, hopefully not too much +\let\sseq@tikz@scan@one@point@noshift\tikz@scan@one@point +\let\sseq@tikz@@@parse@regular@save\tikz@@@parse@regular + +\def\sseq@tikz@scan@one@point@noshift@active#1{% + \let\tikz@@@parse@regular\sseq@tikz@@@parse@regular@save + \def\sseq@scanonepoint@cmd{\let\tikz@@@parse@regular\sseq@tikz@@@parse@regular#1} + \tikz@scan@one@point\sseq@scanonepoint@cmd% +} + +% Probably there are more places that shouldn't have shifts inserted. +\def\sseq@tikzshift#1{\tikz@addtransform{\sseq@tikz@scan@one@point@noshift\pgftransformshift#1\relax}} + + +\def\sseq@tikz@to@curve@path{% + [every curve to] + \pgfextra{ + \let\tikz@@@parse@regular\sseq@tikz@@@parse@regular@save % I added this to prevent repeated offsets from screwing us up + %\let\sseq@tikz@scan@one@point@noshift\tikz@scan@one@point + \iftikz@to@relative\tikz@to@compute@relative\else\tikz@to@compute\fi + } + \tikz@computed@path + \tikztonodes% +} + +\let\sseq@tikz@@@to@compute@relative\tikz@@@to@compute@relative + + +\patchcmd\sseq@tikz@@@to@compute@relative{% + \let\tikz@second@point=\tikz@toto +}{% + \pgf@process{\pgfpointadd{\tikz@toto}{\pgfqpointxy{\sseq@xoffset}{\sseq@yoffset}}}% + \edef\tikz@toto{\@nx\pgfpoint{\the\pgf@x}{\the\pgf@y}}% + \let\tikz@second@point=\tikz@toto +}{}{\error} + + + + +% \tikz@parse@splitxyz: we should set up an error to make this unreachable? +\let\sseq@tikz@grid\tikz@grid % line 3158 +\let\sseq@tikz@scan@handle@options\tikz@scan@handle@options % 4959 +\let\sseq@tikz@@@parse@polar\tikz@@@parse@polar % 5063 + +\def\sseq@tikz@@@parse@regular#1#2#3){% + \pgfutil@in@,{#3}% + \ifpgfutil@in@% + \tikz@parse@splitxyz{#1}{#2}#3,% + \else% + \tikz@checkunit{#2}% + \iftikz@isdimension% + \tikz@checkunit{#3}% + \iftikz@isdimension% + \def\@next{#1{\pgfpointxy{(#2)/1cm+\sseq@xoffset}{(#3)/1cm+\sseq@yoffset}}}% + \else% + \def\@next{#1{\pgfpointxy{(#2)/1cm+\sseq@xoffset}{#3+\sseq@yoffset}}}% + \fi% + \else% + \tikz@checkunit{#3}% + \iftikz@isdimension% + \def\@next{#1{\pgfpointxy{#2+\sseq@xoffset}{(#3)/1cm+\sseq@yoffset}}}% + \else% + \def\@next{#1{\pgfpointxy{#2+\sseq@xoffset}{#3+\sseq@yoffset}}}% + \fi% + \fi% + \fi% + \@next% +} + + + + %% New shapes and arrows %% These use lots of keys with spaces so it's convenient to turn off ExplSyntax. @@ -987,4 +1444,5 @@ \pgfusepathqfill }, defaults = { length = 0.3cm } -}
\ No newline at end of file +} + diff --git a/Master/texmf-dist/tex/latex/spectralsequences/sseqforeach.code.tex b/Master/texmf-dist/tex/latex/spectralsequences/sseqforeach.code.tex index 0d4c4758215..4e2a5da7e89 100644 --- a/Master/texmf-dist/tex/latex/spectralsequences/sseqforeach.code.tex +++ b/Master/texmf-dist/tex/latex/spectralsequences/sseqforeach.code.tex @@ -1,31 +1,218 @@ %% -%% Package: spectralsequences.sty version 1.0 +%% Package: spectralsequences v1.1.0 %% Author: Hood Chatham %% Email: hood@mit.edu -%% Date: 2017-06-18 +%% Date: 2017-08-02 %% License: Latex Project Public License %% %% File: sseqforeach.code.tex %% %% Patches the \foreach command to obtain better error reporting +%% Also defines some of my own looping commands, \Do, \DoUntilOutOfBounds, \DoUntilOutOfBoundsThenNMore +%% All of the \foreach stuff we are modifying is defined by tikz in the file /pgf/utilities/pgffor.code.tex %% - -% All of this \foreach stuff is defined by tikz in the file /pgf/utilities/pgffor.code.tex - -\def\sseq@for@nopatch{\sseq@error{foreach-patch-failed}\def\sseq@patchfor{}\endinput} - -\newtoks\sseq@foreachcall - \def\sseq@for@vars{} \def\sseq@for@savemacro#1{\sseq@d@addto@macro\sseq@for@vars{\sseq@for@vars@do#1}} +\def\sseq@for@savemacro@noslash#1{\sseq@d@addto@macro\sseq@for@vars{\sseq@for@vars@do@noslash#1}} \def\sseq@for@vars@do#1{; \string#1 = #1} -\def\sseq@for@vars@donx#1{; \string#1= #1} +\def\sseq@for@vars@do@noslash#1{; \sseq@macroname#1 = #1} + \ExplSyntaxOn \def\sseq@for@printvars{\ifx\sseq@for@vars\pgfutil@empty\else\exp_last_unbraced:Nf\@gobble\sseq@for@vars\fi} + +\newcount\sseq@Do@depth + +\def\sseq@save@Do@var{ + \sseq@atbeginforeach@msgsetup + \advance\sseq@Do@depth\@ne + \exp_args:Nc \sseq@for@savemacro@noslash { iteration ~ \the \sseq@Do@depth } + \def\iteration{0} +} + +\def\sseq@stepiteration{ + \edef\iteration{\the\numexpr\iteration+1} + \cs_set_eq:cN { iteration ~ \the \sseq@Do@depth } \iteration +} + +\protected\def\sseq@Do{ + \begingroup + \edef\sseq@inputline{\the\inputlineno} + \sseq@callas{\Do} + \sseq@call{\sseq@Do@} +} + +\def\sseq@Do@#1#2{ + \sseq@esetthiscall{\string\Do\unexpanded{#1}} + \sseq@opushstacktrace{\string\Do{#1}} + \sseq@ifintexpr{#1}{ + \sseq@savestack + \sseq@save@Do@var + \prg_replicate:nn {#1} { + \sseq@stepiteration + #2 + \relax + } + \sseq@restorestack + }{\sseq@error@xx{Do-invalid-int-expr}{\string\Do}{\unexpanded{#1}}} + \endgroup +} + +\protected\def\sseq@DoUntilOutOfBounds{ + \begingroup + \edef\sseq@inputline{\the\inputlineno} + \sseq@callas{\DoUntilOutOfBounds} + \sseq@call{\sseq@DoUntilOutOfBounds@} +} + +\def\sseq@DoUntilOutOfBounds@ #1 { + \sseq@esetthiscall{\string\DoUntilOutOfBoundsThenNMore} + \sseq@opushstacktrace{\string\DoUntilOutOfBounds} + \ifx\xmin\sseq@xmin\else\ifx\ymin\sseq@ymin\else + \sseq@error@x{DoUntil-no-bound}{\string\DoUntilOutOfBounds} + \sseq@breakfifi + \fi\fi + \def\sseq@commandname{\string\DoUntilOutOfBounds} + \sseq@savestack % so we can nest these + \sseq@DoUntilOutOfBounds@body{#1} + \sseq@restorestack + \sseq@breakpoint + \endgroup +} + +\protected\def\sseq@DoUntilOutOfBoundsThenNMore{ + \begingroup + \edef\sseq@inputline{\the\inputlineno} + \sseq@callas{\DoUntilOutOfBoundsThenNMore} + \sseq@call{\sseq@DoUntilOutOfBoundsThenNMore@} +} + +\def\sseq@DoUntilOutOfBoundsThenNMore@ #1#2 { + \sseq@esetthiscall{\string\DoUntilOutOfBoundsThenNMore\unexpanded{#1}} + \sseq@opushstacktrace{\string\DoUntilOutOfBoundsThenNMore{#1}} + \ifx\xmin\sseq@xmin\else\ifx\ymin\sseq@ymin\else + \sseq@error@n{DoUntil-no-bound}{\DoUntilOutOfBoundsThenNMore} + \sseq@breakfifi + \fi\fi + \sseq@ifintexpr{#1}{}{ + \sseq@error@xx{Do-invalid-int-expr}{\string\DoUntilOutOfBoundsThenNMore}{\unexpanded{#1}} + \sseq@break + } + \def\sseq@commandname{\string\DoUntilOutOfBoundsThenNMore} + \sseq@savestack + \sseq@DoUntilOutOfBounds@body{#2} + \prg_replicate:nn {#1} { + \sseq@stepiteration + #2 + \relax + } + \sseq@restorestack + \sseq@breakpoint + \endgroup +} + +\def\sseq@DoUntilOutOfBounds@body#1{ + \sseq@save@Do@var % Set iteration so that \DoUntilOutOfBoundsThenNMore doesn't get upset if we're already out of bounds + % If we're already out of bounds, we'll just do nothing. + \sseq_if_out_of_bounds_noparse:nnTF{\lastx{0}}{\lasty{0}}{ + \bool_set_true:N \l_tmpa_bool + }{ + \bool_set_false:N \l_tmpa_bool + % Now we need to set up the loop descent condition. + \sseq@tempxb=\lastx{0}\relax % Record current x and y values + \sseq@tempyb=\lasty{0}\relax + \sseq@stepiteration + #1 % run loop body once + \relax % protect from \d page grabber + \sseq_if_out_of_bounds_noparse:nnTF{\lastx{0}}{\lasty{0}}{ % If we're out of bounds now, we can quit + \bool_set_true:N \l_tmpa_bool + }{ % Otherwise, determine descent check + \sseq@tempx=\lastx{0}\relax % store new last value for comparison + \sseq@tempy=\lasty{0}\relax + \bool_set_false:N \l_tmpb_bool % This is to record whether there is a defined x range or y range. If neither, we'll throw an error. +% \def\sseq@checkbound{\bool_set_false:N \l_tmpb_bool} + \ifx\xmin\sseq@xmin + \ifnum\sseq@tempx>\sseq@tempxb + \bool_set_true:N \l_tmpb_bool % We have a descent condition +% \sseq@d@addto@macro\sseq@checkbound{ +% \ifnum\sseq@tempx>\sseq@tempxb % Any stage of the loop is okay as long as it increases x +% \bool_set_true:N \l_tmpb_bool +% \fi +% } + \else + \ifnum\sseq@tempx<\sseq@tempxb + \bool_set_true:N \l_tmpb_bool +% \sseq@d@addto@macro\sseq@checkbound{ % Any stage of the loop is okay as long as it decreases x +% \ifnum\sseq@tempx<\sseq@tempxb +% \bool_set_true:N \l_tmpb_bool +% \fi +% } + \fi + \fi + \fi + \ifx\ymin\sseq@ymin + \ifnum\sseq@tempy>\sseq@tempyb + \bool_set_true:N \l_tmpb_bool +% \sseq@d@addto@macro\sseq@checkbound{ +% \ifnum\sseq@tempy>\sseq@tempyb +% \bool_set_true:N \l_tmpb_bool +% \fi +% } + \else + \ifnum\sseq@tempy<\sseq@tempyb + \bool_set_true:N \l_tmpb_bool +% \sseq@d@addto@macro\sseq@checkbound{ +% \ifnum\sseq@tempy<\sseq@tempyb +% \bool_set_true:N \l_tmpb_bool +% \fi +% } + \fi + \fi + \fi + \if_bool:N \l_tmpb_bool\else: + \sseq@error@x{DoUntil-no-progress}{\sseq@commandname} + \fi: + } + } + \bool_until_do:Nn \l_tmpa_bool { + \sseq@stepiteration + #1 + \relax + \sseq_if_out_of_bounds_noparse:nnTF{\lastx{0}}{\lasty{0}}{% we're done + \bool_set_true:N \l_tmpa_bool + }{% Check descent condition +% \ifnum\iteration/10*10-\iteration=\z@ +% \sseq@tempx=\lastx{0}\relax % store new last value for comparison +% \sseq@tempy=\lasty{0}\relax +% \bool_set_false:N \l_tmpb_bool +% \sseq@checkbound +% \if_bool:N \l_tmpb_bool\else: +% \sseq@error{DoUntilOutOfBounds-descent-failed} +% \fi: +% \sseq@tempxb=\sseq@tempx +% \sseq@tempyb=\sseq@tempx +% \fi + } + } +} + + + \ExplSyntaxOff +\def\sseq@for@nopatch{\sseq@error{foreach-patch-failed}\def\sseq@patchfor{}\endinput} + +\newtoks\sseq@foreachcall + +\def\sseq@pgffor@atbeginforeach{% + \begingroup % + \sseq@atbeginforeach@msgsetup + % \pgffor@macro@list calls \pgffor@normal@list, so we need to mark that the list has already been added to foreachcall. + \sseq@tempiftrue +} + + \def\sseq@patchfor{% \let\pgffor@atbeginforeach\sseq@pgffor@atbeginforeach \let\pgffor@@vars@opt\sseq@pgffor@@vars@opt @@ -47,17 +234,8 @@ } - \bgroup\lccode`\*=`\#\lowercase{\egroup - -\def\sseq@pgffor@atbeginforeach{% - \begingroup % - \sseq@atbeginforeach@msgsetup - % \pgffor@macro@list calls \pgffor@normal@list, so we need to mark that the list has already been added to foreachcall. - \sseq@tempiftrue -} - % Modify the foreach argument parser commands to put the call into \sseq@foreachcall and to tell us what the variables are \def\sseq@pgffor@@vars@opt[#1]{\sseq@foreachcall\@xp{\the\sseq@foreachcall#1}\pgfkeys{/sseqpages/foreach/.cd,#1}\pgffor@vars} diff --git a/Master/texmf-dist/tex/latex/spectralsequences/sseqkeys.code.tex b/Master/texmf-dist/tex/latex/spectralsequences/sseqkeys.code.tex index 74667335805..a231aca7b42 100644 --- a/Master/texmf-dist/tex/latex/spectralsequences/sseqkeys.code.tex +++ b/Master/texmf-dist/tex/latex/spectralsequences/sseqkeys.code.tex @@ -1,8 +1,8 @@ %% -%% Package: spectralsequences.sty version 1.0 +%% Package: spectralsequences v1.1.0 %% Author: Hood Chatham %% Email: hood@mit.edu -%% Date: 2017-06-18 +%% Date: 2017-08-02 %% License: Latex Project Public License %% %% File: sseqkeys.code.tex @@ -12,7 +12,7 @@ %% - +% Run \pgfqkeys{directory}{keys} but for a list of directories. Helps to avoid code duplication. \def\sseq@pgfqkeysdirlist#1#2{% \sseq@temptoks{#2}% \sseq@pgfqkeysdirlist@#1,\sseq@nil @@ -27,7 +27,7 @@ % These are the things that are used outside of this section: \let\sseq@pgfkeys@error@save\pgfkeys@error \pgfkeys{/sseqpages/userstyles/.unknown/.code={\sseq@passoptionto{\sseq@sseqsetdirectory}}} -\def\sseqset#1{\pgfqkeys{/sseqpages/userstyles}{#1}} +\protected\def\sseqset#1{\pgfqkeys{/sseqpages/userstyles}{#1}} \def\sseq@sseqsetdirectory{/sseqpages/global/default} @@ -60,7 +60,7 @@ % on the first pass. Some only do things on the first pass or only do things on the second pass. % For example, shifts: shifts apply a coordinate transform on the second pass, but also need to factor into the coordinates of % classes etc which are computed at specification time not at draw time. So xshift=2 increases \sseq@x by 2 on it's first pass and -% applies a coordinate transfrom by 2cm on the second pass. +% applies a coordinate transform by 2cm on the second pass. % normal mode does the firstpass options now and saves the secondpass options in \sseq@savedoptioncode for later use. % firstpass mode does the firstpass options and throws away the secondpass options. @@ -131,24 +131,33 @@ % This is for .unknown handlers. Try same key in different directory #1. \def\sseq@passoptionto#1{\sseq@eval{\@nx\pgfqkeys{#1}{\pgfkeyscurrentname={\unexpanded\@xp{\pgfkeyscurrentvalue}}}}} +% Immediately execute a key that is either a tikz or pgf key. +% #1 -- key +% #2 -- value \def\sseq@pgfkeysdocommand#1#2{ \sseq@tempiffalse - \sseq@pgfkeysdocommand@try{/tikz/#1}{#2} - \sseq@pgfkeysdocommand@try{/pgf/#1}{#2} - % is this really an internal error? Maybe we should have failed earlier? + \sseq@pgfkeysdocommand@try{/tikz}{#1}{#2} + \sseq@pgfkeysdocommand@try{/pgf}{#1}{#2} \ifsseq@tempif\else\sseq@error@internal@nn{do-command-failed}{#1}{#2}\fi } -\def\sseq@pgfkeysdocommand@try#1#2{ +% Execute a key if \sseq@tempif is true and it is defined, if so set \sseq@tempif to false. +% These are meant to cascade. +% #1 -- directory +% #2 -- key +% #3 -- value +\def\sseq@pgfkeysdocommand@try#1#2#3{ \ifsseq@tempif\else - \pgfkeysifdefined{#1/.@cmd}{ + \pgfkeysifdefined{#1/#2/.@cmd}{ \sseq@tempiftrue - \pgfkeysgetvalue{#1/.@cmd}{\pgfkeys@code}% - \pgfkeys@code#2\pgfeov + \def\pgfkeysdefaultpath{#1/} + \edef\pgfkeyscurrentkey{#1/#2} + \pgfkeysgetvalue{#1/#2/.@cmd}{\pgfkeys@code}% + \pgfkeys@code#3\pgfeov }{ - \pgfkeysifdefined{#1}{ + \pgfkeysifdefined{#1/#2}{ \sseq@tempiftrue - \pgfkeyssetvalue{#1}{#2} + \pgfkeyssetvalue{#1/#2}{#3} }{} } \fi @@ -180,13 +189,13 @@ \@xp\pgfutil@in@\@xp-\@xp{\tikz@key}% \ifpgfutil@in@% % Ah, an arrow spec! - \sseq@add@tikzkey@to@options{\@nx\tikz@processarrows{\tikz@key}}% + \sseq@add@tikzkey@to@options{\@nx\sseq@options@secondpass{\@nx\tikz@processarrows{\tikz@key}}}% \else% % Ok, third chance: A shape! \@xp\ifx\csname pgf@sh@s@\tikz@key\endcsname\relax% \sseq@keys@unknown@error% \else% - \sseq@add@tikzkey@to@options{\def\@nx\tikz@shape{\tikz@key}}% + \sseq@add@tikzkey@to@options{\@nx\sseq@options@secondpass{\def\@nx\tikz@shape{\tikz@key}}}% \fi% \fi% }% @@ -195,8 +204,8 @@ } \def\sseq@keys@unknown@handlecolor{% - \sseq@add@tikzkey@to@options{\@nx\tikz@addoption{\@nx\tikz@compat@color@set{\tikz@key}}}% - \sseq@add@tikzkey@to@options{\def\@nx\tikz@textcolor{\tikz@key}}% + \sseq@add@tikzkey@to@options{\@nx\sseq@options@secondpass{\@nx\tikz@addoption{\@nx\tikz@compat@color@set{\tikz@key}}}}% + \sseq@add@tikzkey@to@options{\@nx\sseq@options@secondpass{\def\@nx\tikz@textcolor{\tikz@key}}}% } %%% \sseq@keys@try@addtooptions @@ -223,9 +232,10 @@ \def\pgfkeysdefaultpath{#1/}% \def\next{\egroup\@ifnextchar\sseq@nil{\@xp\@secondoftwo\@gobble}{\sseq@keys@try@addtooptions@}}% \pgfkeysifdefined{#1/\pgfkeyscurrentname/.@cmd}{% + \edef\pgfkeyscurrentkey{#1/\pgfkeyscurrentname}% \ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text% Hmm... no value \pgfkeysifdefined{#1/\pgfkeyscurrentname/.@def}% - {\pgfkeysgetvalue{#1/\pgfkeyscurrentname/.@def}{\pgfkeyscurrentvalue}} + {\pgfkeysgetvalue{#1/\pgfkeyscurrentname/.@def}{\pgfkeyscurrentvalue}}% {}% no default, so leave it \fi% \pgfkeysgetvalue{#1/\pgfkeyscurrentname/.@cmd}{\pgfkeys@code}% @@ -236,29 +246,70 @@ }{% \pgfkeysifdefined{#1/\pgfkeyscurrentname}{% \egroup - \sseq@add@tikzkey@to@options{\@nx\pgfkeyssetvalue{#1/\pgfkeyscurrentname}{\unexpanded\@xp{\pgfkeyscurrentvalue}}}% + \sseq@add@tikzkey@to@options{\@nx\sseq@options@secondpass{\@nx\pgfkeyssetvalue{#1/\pgfkeyscurrentname}{\unexpanded\@xp{\pgfkeyscurrentvalue}}}}% \def\next{\@xp\@firstoftwo\sseq@gobble@to@nil}% }{}% }% \next } +% Iterate over list and run \pgfkeysalso's when we find them. Note that we use our variants of \pgfkeys@case@... which hand control back to this command, +% so this is recursive -- the result is guaranteed not to have any instance of \pgfkeysalso in it! \def\sseq@keys@addtooptions@checkalso#1{% \let\pgfkeys@case@one\sseq@pgfkeys@case@one@store \let\pgfkeys@case@two@extern\sseq@pgfkeys@case@two@extern@store \sseq@keys@addtooptions@checkalso@#1\pgfkeysalso\sseq@nil } + \def\sseq@keys@addtooptions@checkalso@#1\pgfkeysalso#2{% - \sseq@add@tikzkey@to@options{\unexpanded{#1}}% - \ifx\sseq@nil#2% + \def\sseq@tempa{/tikz/}% + \def\sseq@tempb{/pgf/}% + % This is an extra hook I needed to add so that my own keys can execute code when they need to... + \sseq@keys@addtooptions@checkdo#1\sseq@keys@do\sseq@nil + \ifx\sseq@nil#2% We're done, restore pgfkeys. \let\pgfkeys@case@one\sseq@pgfkeys@case@one@save \let\pgfkeys@case@two@extern\sseq@pgfkeys@case@two@extern@save \else - \pgfkeysalso{#2}% - \@xp\sseq@keys@addtooptions@checkalso@ + \ifx\expandafter#2 % if they wanted to expand the first token, handle that + \sseq@add@tikzkey@to@options{\sseq@options@secondpass@iftikz{\relax\relax}}% The last token was an \expandafter, we need to keep it from doing anything + \@xptwo\sseq@keys@addtooptions@checkalso@xp + \else + \pgfkeysalso{#2}% + \@xptwo\sseq@keys@addtooptions@checkalso@ + \fi + \fi +} + +\def\sseq@keys@addtooptions@checkalso@xp#1{% + \@xp\pgfkeysalso\@xp{#1}% + \sseq@keys@addtooptions@checkalso@ +} + +% Used to get collections code to run right. +\def\sseq@keys@addtooptions@checkdo#1\sseq@keys@do#2{% + \sseq@add@tikzkey@to@options{\sseq@options@secondpass@iftikz{\unexpanded{#1}}}% + \ifx#2\sseq@nil\else + #2% + \@xp\sseq@keys@addtooptions@checkdo + \fi +} + +% This has to be expandable, so \sseq@tempa and \sseq@tempb are set to "/tikz/" and "/pgf/" ahead of time +% Defer the command if it is in directories /pgf or /tikz, otherwise run it now. TODO: explain here why we need this. +\def\sseq@options@secondpass@iftikz{% + \ifx\pgfkeysdefaultpath\sseq@tempa + \@nx\sseq@options@secondpass + \else + \ifx\pgfkeysdefaultpath\sseq@tempb + \@nx\sseq@options@secondpass + \else + \@xptwo\@firstofone + \fi \fi } + +% Here we hook into pgfkeys. This is remarkably easy! \let\sseq@pgfkeys@case@one@save\pgfkeys@case@one \let\sseq@pgfkeys@case@two@extern@save\pgfkeys@case@two@extern \def\sseq@pgfkeys@case@one@store{% @@ -275,7 +326,7 @@ \else% % The following line is the only change, it used to be (roughly) \pgfkeyssetvalue{\pgfkeyscurrentkey}{\pgfkeyscurrentvalue} % which would immediately set the value. Instead we store in it \sseq@savedoptioncode - \sseq@add@tikzkey@to@options{\@nx\pgfkeyssetvalue{\pgfkeyscurrentkey}{\unexpanded\@xp{\pgfkeyscurrentvalue}}}% + \sseq@add@tikzkey@to@options{\@nx\sseq@options@secondpass{\@nx\pgfkeyssetvalue{\pgfkeyscurrentkey}{\unexpanded\@xp{\pgfkeyscurrentvalue}}}}% \fi% } @@ -296,6 +347,7 @@ /sseqpages/class/.is family, /sseqpages/class/label/.is family, /sseqpages/class/label/.unknown/.code={\sseq@keys@unknown}, + /sseqpages/class/label/pin/.unknown/.code={\sseq@keys@unknown}, /sseqpages/class/node texts/.is family, /sseqpages/class/node texts/.unknown/.code={\sseq@passoptionto{/tikz}}, /sseqpages/differential/.is family, @@ -307,6 +359,7 @@ /sseqpages/tikz primitives/.is family, /sseqpages/tikz primitives/.unknown/.code={\sseq@keys@unknown}, % One off directories + /sseqpages/fit/.is family, /sseqpages/fit/.unknown/.code={\sseq@passoptionto{/sseqpages}}, /sseqpages/foreach/.unknown/.code={\sseq@passoptionto{/pgf/foreach}}, /sseqpages/class placement/.unknown/.code={\sseq@passoptionto{/tikz}} @@ -314,10 +367,18 @@ \pgfqkeys{/sseqpages/class}{shape/.code={\edef\tikz@shape{\pgfkeyscurrentname}}} % shape=whatever shape passing +\newif\ifsseq@pin \pgfqkeys{/sseqpages/class/label}{% maybe implement multipart node labels this way? No way! node/.sseq @ first pass code={\sseq@classlabelfalse}, - inside/.sseq @ first pass code={\sseq@classlabelfalse} + inside/.sseq @ first pass code={\sseq@classlabelfalse}, + pin/.sseq @ first pass code = { + \let\sseq@savedoptioncode@save\sseq@savedoptioncode + \sseq@processoptions{class/label/pin}{#1} + \edef\sseq@savedoptioncode{\unexpanded\@xp{\sseq@savedoptioncode@save}\@nx\sseq@d@addto@macro\@nx\sseq@pinoptions{\unexpanded\@xp{\sseq@savedoptioncode}}} + }, + pin/.sseq @ second pass append code = {\sseq@pintrue} } +\def\sseq@pinoptions{} %% label directions \def\sseq@labeldirectionlist{\\{above}\\{below}\\{left}\\{right}\\{above left}\\{above right}\\{below left}\\{below right}} @@ -342,8 +403,7 @@ -\sseq@setlabeldirectionkeys{/sseqpages/class/label}[/.sseq @ first pass code] - {\sseq@classlabeltrue\def\sseq@class@labelposition@name{#1}\def\sseq@class@labelposition@distance{##1}} +\sseq@setlabeldirectionkeys{/sseqpages/class/label}[/.sseq @ first pass code]{\sseq@classlabeltrue} \sseq@setlabeldirectionkeys{/sseqpages/class/label}[/.sseq @ second pass append code]{\sseq@class@positionlabel{#1}{##1}} \sseq@setlabeldirectionkeys{/sseqpages/class/label}[/.default]{\sseq@defaultlabeldistance{#1}} \sseq@setlabeldirectionkeys{/sseqpages/global/class/label}[/.default]{\sseq@defaultlabeldistance{#1}} @@ -355,12 +415,12 @@ label distance/.code={\sseq@setdefaultlabeldistances{#1}} } -\def\sseq@class@positionlabel#1#2{\sseq@pgfkeysdocommand{#1}{#2}} +\def\sseq@class@positionlabel#1#2{\ifx\tikz@fig@name\undefined\else\sseq@pgfkeysdocommand{#1}{#2 of \tikz@fig@name}\fi} \sseq@addtostorelist\sseq@classlabeltextfn{} % \sseq@classlabeltextfn is public via "class label handler" -\let\sseq@classlabeltextfn@default\@gobble +\def\sseq@classlabeltextfn@default#1{\def\processedlabel{#1}} \def\sseq@labeltextfn#1{#1} % labeltextfn is private \def\sseq@labeltextfn@rotatescale#1{% \@nx\ifmmode @@ -403,8 +463,15 @@ \def\sseq@edgeoptionhook{}% This is just to make description work. +%% Labels +%% The code for this that actually does most of the work is inside of sseqmain.code.tex -- search for "Labels" +%% This just handles the interface with the keyvalue system here. + + %% Quote handling % \sseq@handlequote will be installed later as the 'first char syntax' for ". +% Problem is that 'first char syntax' isn't allowed to care what directory it is in, but we need different handling +% for classes versus edges versus scopes. Solution is to use \pgfkeysalso and then define the handler in a key. \def\sseq@protectlabel{\@nx\sseq@protectlabel\@nx} \def\sseq@handlequote#1{\pgfkeysalso{handle quote=#1}} \pgfkeys{% @@ -415,20 +482,13 @@ \let\tikz@quotes@as\tikz@quotes@as@save }, /sseqpages/handle quote/.code={% - \begingroup % group gets ended by handleedgequotes \let\tikz@quotes@as\sseq@handleedgequotes \tikz@quote@parser{#1}% + \let\tikz@quotes@as\tikz@quotes@as@save } } -\def\sseq@processlabels@default{% - \global\let\sseq@classnodetext\pgfutil@empty - \global\let\sseq@classnodetextoptions\pgfutil@empty - \global\let\sseq@classlabelnodes\pgfutil@empty -} -\let\sseq@processlabels\sseq@processlabels@default - \def\sseq@handlescopequotes#1#2{% We use this via \let\tikz@quotes@as\sseq@handleclassquotes /utils/exec={% so it's called inside \pgfkeysalso{stuff}. Need to surround with /utils/exec={} to get out. \global\let\sseq@classnodetext\pgfutil@empty% @@ -442,103 +502,6 @@ % so it's called inside \pgfkeysalso{stuff}. Need to surround with /utils/exec={} to get out. \def\sseq@handleclassquotes#1#2{/utils/exec={\sseq@d@addto@macro\sseq@processlabels{\sseq@handleclassquotes@inner{#1}{#2}}}} -\def\sseq@handleclassquotes@inner#1#2{% - \begingroup\pgfscope - \sseq@options@firstpassmode - \sseq@thesseqstyle - \sseq@thelabelstyle - \sseq@theclasslabelstyle - \the\sseq@scope@toks - \sseq@options@normalmode - \sseq@processoptions{class/label}{#2}% - \ifx\sseq@classlabeltextfn\@gobble - \def\processedlabel{#1}% - \else - \sseq@classlabeltextfn{#1}% labeltextfn is a private handler, classlabeltextfn is exposed via "class label handler" - \fi - \ifsseq@classlabel - \sseq@options@firstpassmode - \the\sseq@outerclasslabelstyle - \sseq@xprotected@addto@macro\sseq@classlabelnodes{ - \@nx\ifsseq@needstikz - node[ - /sseqpages/class/label, - /utils/exec={ - \let\@nx\sseq@tikz@transform@save\@nx\tikz@transform - \let\@nx\tikz@transform\relax % The next line was set up to fix the classlabelstyle glitch - \the\sseq@sseqstyle\@nx\the\sseq@sseqstyle@page - \the\sseq@labelstyle\@nx\the\sseq@labelstyle@page\the\sseq@classlabelstyle\@nx\the\sseq@classlabelstyle@page - \sseq@theouterclasslabelstyle\unexpanded\@xp{\sseq@savedoptioncode}% - % \@nx\iftikz@fullytransformed\@nx - % \@nx\tikz@fullytransformedtrue - % \else - % \@nx{\@nx\pgftransformresetnontranslations\@nx\sseq@globalrotatetransform} - % \@nx\fi - \let\@nx\tikz@transform\@nx\sseq@tikz@transform@save - }% - ]{\sseq@labeltextfn{\processedlabel}}% - \@nx\else - \@nx\node[ - /sseqpages/class/label, - /utils/exec={ - \let\@nx\sseq@tikz@transform@save\@nx\tikz@transform - \let\@nx\tikz@transform\relax % The next line was set up to fix the classlabelstyle glitch - \the\sseq@sseqstyle\@nx\the\sseq@sseqstyle@page - \the\sseq@labelstyle\@nx\the\sseq@labelstyle@page\the\sseq@classlabelstyle\@nx\the\sseq@classlabelstyle@page - \sseq@theouterclasslabelstyle\unexpanded\@xp{\sseq@savedoptioncode} - % \@nx\iftikz@fullytransformed\@nx - % \@nx\tikz@fullytransformedtrue - % \else - % \@nx{\@nx\pgftransformresetnontranslations\@nx\sseq@globalrotatetransform} - % \@nx\fi - \let\@nx\tikz@transform\@nx\sseq@tikz@transform@save - } - ]{\unexpanded\@xp{\@xp\sseq@labeltextfn\@xp{\processedlabel}}};% - \@nx\fi - }% - \else - \sseq@options@firstpassmode - \the\sseq@innerclasslabelstyle - \sseq@options@normalmode - \sseq@protectedeval{\@nx\pgfqkeys{/sseqpages/class/label}{#2}}% - \sseq@protected@xdef\sseq@classnodetext{\processedlabel}% - \xdef\sseq@classnodetextoptions{% - %\unexpanded{\def\pgfkeysdefaultpath{/sseqpages/class/node texts/}}% - \sseq@thelabelstyle\sseq@theinnerclasslabelstyle\unexpanded\@xp{\sseq@savedoptioncode}% - }% - \fi - \endpgfscope\endgroup -} - -\def\sseq@handleedgequotes#1#2{% We use this via \let\tikz@quotes@as\sseq@handleedgequotes - /utils/exec={% so it's called inside \pgfkeysalso{stuff}. Need to surround with /utils/exec={} to get out. - \endgroup - \let\sseq@savedoptioncode@save\sseq@savedoptioncode - \sseq@processoptions{label}{#2} - \sseq@needstikztrue - \let\sseq@temp\sseq@savedoptioncode - \let\sseq@savedoptioncode\sseq@savedoptioncode@save - \sseq@e@addto@options{ - \@nx\tikzset{ - every to/.append style={ - edge node={ - node [/sseqpages/label, - /utils/exec={ - \let\@nx\sseq@tikz@transform@save\@nx\tikz@transform - \let\@nx\tikz@transform\relax - \@nx\sseq@thelabelstyle\@nx\sseq@theedgelabelstyle - \unexpanded\@xp{\sseq@temp} - \ifsseq@rotatelabels\iftikz@fullytransformed\else\@nx\tikz@fullytransformedtrue\@nx\tikz@addtransform{\@nx\pgftransformresetnontranslations\@nx\sseq@globalrotatetransform}\fi\fi - \unexpanded\@xp{\sseq@edgeoptionhook} % this is just to make description work - \let\@nx\tikz@transform\@nx\sseq@tikz@transform@save - } - ]{\sseq@labeltextfn{#1}} - } - } - } - } - } -} \def\sseq@checktransform@error{\sseq@error@nn{illegal-transform}} @@ -550,6 +513,7 @@ \let\sseq@tikzprimitives@coords@maybeclass\sseq@tikzprimitives@coords@notaclass \let\sseq@checktransform\@gobbletwo \let\sseq@tikz@shifttransform\sseq@okayshifttransform + % TODO: This needs fixing: %(((((((((((((((((( \def\class##1){\sseq@setthiscall{\string\class##1)}\sseq@error@x{standard-parse}{\string\class}}% \def\replaceclass##1){\sseq@setthiscall{\string\replaceclass##1)}\sseq@error@x{standard-parse}{\string\replaceclass}}% @@ -560,6 +524,7 @@ \def\structlineoptions##1)##2){\sseq@setthiscall{\string\structlineoptions##1)##2)}\sseq@error@x{standard-parse}{\string\structlineoptions}}% } +% I don't think this is ever actually used... \def\sseq@nodeparse{% \let\sseq@tikzprimitives@coords@maybeclass\sseq@tikzprimitives@coords@maybeclass@save \let\sseq@tikzprimitives@coords@maybeclass @@ -596,10 +561,12 @@ background/.sseq @ first pass code={\sseq@error@n{option-tikz-prims-only}{background}} } +% Some class options. All of these will make changes local to the current \class command. They are communicated to \class via these commands, +% which we initialize here as empty. \def\sseq@class@tag{} \def\sseq@class@tagprefix{} \def\sseq@class@name{} -\def\sseq@namehandler{}%\@xp\sseq@normalizepolynomial\@xp{\sseq@class@name}\let\sseq@class@name\sseq@polynomial} +\def\sseq@namehandler{} \def\sseq@currenttag{\sseq@class@tag}% for the user ?? \def\sseq@tooltip{} \pgfqkeys{/sseqpages/scope}{ @@ -607,14 +574,16 @@ tag prefix/.code={\pgfkeys@spdef\temp{#1}\sseq@e@addto@macro\sseq@class@tagprefix{\unexpanded\@xp{#1}}} } +\def\sseq@classinsert{} \pgfqkeys{/sseqpages/class}{ name/.code={\def\sseq@class@name{#1}\pgfkeysalso{/sseqpages/alias=#1}}, - show name/.code={\def\sseq@class@showname{#1}}, + show name/.store in=\sseq@class@showname, page/.code={\sseq@getnumrange\sseq@class@page{#1}},% page & gen are only for \classoptions. generation/.code={\sseq@getnumrange\sseq@gen{#1}}, % \class tests if \sseq@class@page is set and throw an error if so. tag/.code={\sseq@d@addto@macro\sseq@class@tag{#1}}, - offset/.code={\def\sseq@tempoffset{#1}}, - tooltip/.sseq @ first pass code={\def\sseq@tooltip{#1}} + offset/.store in=\sseq@tempoffset, + tooltip/.sseq @ first pass code={\def\sseq@tooltip{#1}}, + insert/.store in=\sseq@classinsert } \pgfqkeys{/sseqpages/struct line}{ @@ -647,8 +616,9 @@ } \pgfqkeys{/sseqpages}{needs tikz/.code=\sseq@needstikztrue} +% All of these things need tikz to draw but otherwise require no special handling. \sseq@needstikzandpass{/sseqpages}{% - shade, blend mode, pattern, path picture, path fading, decorate, pin, label + shade, blend mode, pattern, path picture, path fading, decorate, pin, label % should pin be here? } \sseq@needstikzandpass{/sseqpages/differential}{% @@ -671,8 +641,8 @@ % rectangle split/.code=\sseq@needstikzandpass, % align/.code=\sseq@needstikzandpass, -\sseq@addtostorelist\sseq@runoffarrow@start@differential@spec{...} -\sseq@addtostorelist\sseq@runoffarrow@end@differential@spec{...} +\sseq@addtostorelist\sseq@runoffarrow@start@differential@spec{} +\sseq@addtostorelist\sseq@runoffarrow@end@differential@spec{>} \sseq@addtostorelist\sseq@runoffarrow@start@structline@spec{...} \sseq@addtostorelist\sseq@runoffarrow@end@structline@spec{...} \sseq@pgfqkeysdirlist{/sseqpages/global,/sseqpages}{ @@ -704,11 +674,24 @@ %% Add key code to \sseq@savedoptioncode % #1 -- a list of directories to search % #2 -- keys +% +% This is pretty similar in basic concept to \sseq@processoptions, but instead of using the .unknown handlers to walk up the directory, +% it just tries the key in each directory in the list. I'm not actually sure anymore why it was important to do it this way, but there probably was a good reason... +% % This is a faster and sloppier way of doing: -%\def\sseq@temp{#1} -%\pgfqkeys{/sseqpages/alwaysunknown}{#2} +% \def\sseq@temp{#1} +% \pgfqkeys{/sseqpages/alwaysunknown}{#2} % and defining an event handler: alwaysunknown/.unknown/.code={\@xp\sseq@keys@try@addtooptions\@xp{\sseq@temp}{}{\sseq@keys@unknown} +% That basically takes advantage of the pgfkeys parser but gives me back control over what to do with the parsed things. +% +% For some reason I made the probably misguided decision that that approach was too slow, even though this isn't performance +% critical code. Maybe I had a better reason for doing this that I can't remember. Instead I copied pgfkeys but deleted all the +% parts that are useless in this context, which is most of it. Occasionally bugs crop up here when it turns out I deleted a little too much. +% +% This uses a hook \sseq@addstylecodetooptions@unknown to allow the sseqs style to sift out the nonglobal keys and handle them differently. +% % Copied with modification from /pgf/utilities/pfgkeys.code.tex + \def\sseq@addstylecodetooptions#1#2{% \def\sseq@directorylist{#1}% \sseq@simple@pgfkeys@parse#2,\pgfkeys@mainstop @@ -733,6 +716,7 @@ \pgfkeys@spdef\pgfkeyscurrentvalue{#2}% \ifx\pgfkeyscurrentkey\pgfkeys@empty\else \def\next{\@xp\sseq@keys@try@addtooptions\@xp{\sseq@directorylist}{}{\sseq@addstylecodetooptions@unknown}}% + % We deleted the general "first char syntax" handler, so we need to do our own check for the quote. \sseq@simple@pgfkeys@checkquote#1\sseq@nil{% \def\pgfkeyscurrentname{handle quote}% \def\pgfkeyscurrentvalue{#1}% @@ -747,6 +731,7 @@ \@xp\next \fi } +% This is a hook for the "sseqs" style. \let\sseq@addstylecodetooptions@unknown\sseq@keys@unknown \long\def\sseq@simple@pgfkeys@checkquote#1#2\sseq@nil{% @@ -757,17 +742,42 @@ \fi } -\def\sseq@sseqstyle@globalpart{} - \def\sseq@stylelist{} \def\sseq@clearchangestyles{} +% The basic idea here is we make a tokens list \sseq@structlinestyle and define a key "struct lines" that takes a list of keys +% and adds the keys to \sseq@structlinestyle. In order to do this, I need some special trick to delete spaces. +% The macro \sseq@setmacronospaces defined in spectralsequences.sty accomplishes this. \def\sseq@newstyles#1#2{\def\sseq@temppath{#1}\sseq@newstyles@#2,\sseq@nil} \def\sseq@newstyles@#1,{\sseq@newsseqstyle{\sseq@trimleadingspaces#1}\@ifnextchar\sseq@nil{\@gobble}{\sseq@newstyles@}} -\def\sseq@set@newstyle#1{\pgfqkeys{/sseqpages}{#1}\pgfqkeys{/sseqpages/global}{#1}\pgfqkeys{/sseqpages/global/default}{#1}\pgfqkeys{/sseqpages/first pass}{#1}} +\def\sseq@set@newstyle#1{\pgfqkeys{/sseqpages}{#1}\pgfqkeys{/sseqpages/global}{#1}\pgfqkeys{/sseqpages/global/default}{#1}} + +% Here are two useful wrappers around addstylecodetotoks. + +% #1 -- token list +% #2 -- path +% #3 -- code +\def\sseq@addstylecodetotoks#1#2#3{% + \let\sseq@savedoptioncode@store\sseq@savedoptioncode + \edef\sseq@savedoptioncode{\the#1}% + \sseq@addstylecodetooptions{#2}{#3}% + #1\@xp{\sseq@savedoptioncode}% + \let\sseq@savedoptioncode\sseq@savedoptioncode@store +} + +% #1 -- macro +% #2 -- path +% #3 -- code +\def\sseq@addstylecodetomacro#1#2#3{% + \let\sseq@savedoptioncode@store\sseq@savedoptioncode + \let\sseq@savedoptioncode#1% + \sseq@addstylecodetooptions{#2}{#3}% + \let#1\sseq@savedoptioncode + \let\sseq@savedoptioncode\sseq@savedoptioncode@store +} \def\sseq@newsseqstyle#1{% \sseq@setmacronospaces\sseq@tempcmd{sseq@#1style}% @@ -780,23 +790,15 @@ \sseq@x@addto@macro\sseq@clearchangestyles{\sseq@tempcmdb{}}% \sseq@set@newstyle{% #1s/.ecode={% - \let\@nx\sseq@savedoptioncode@store\@nx\sseq@savedoptioncode - \edef\@nx\sseq@savedoptioncode{\@nx\the\sseq@tempcmd}% - \@nx\sseq@addstylecodetooptions{\sseq@temppath}{##1}% - \sseq@tempcmd\@nx\@xp{\@nx\sseq@savedoptioncode}% + \@nx\sseq@addstylecodetotoks{\sseq@tempcmd}{\sseq@temppath}{##1} \@nx\ifsseq@inprogress \@nx\sseq@savedpaths@xadd{\sseq@tempcmd{\@nx\the\sseq@tempcmd}}% \@nx\fi - \let\@nx\sseq@savedoptioncode\@nx\sseq@savedoptioncode@store },% change #1s/.ecode={% \@nx\ifsseq@ispageenv\@nx\else\@nx\sseq@error@nn{change-style-data}{#1}{##1}\@nx\fi \@nx\ifsseq@hasname\@nx\else\@nx\sseq@error@nn{change-style-standalone}{#1}{##1}\@nx\fi - \let\@nx\sseq@savedoptioncode@store\@nx\sseq@savedoptioncode - \edef\@nx\sseq@savedoptioncode{\@nx\the\sseq@tempcmdb}% - \@nx\sseq@addstylecodetooptions{\sseq@temppath}{##1}% - \sseq@tempcmdb\@nx\@xp{\@nx\sseq@savedoptioncode}% - \let\@nx\sseq@savedoptioncode\@nx\sseq@savedoptioncode@store + \@nx\sseq@addstylecodetotoks{\sseq@tempcmdb}{\sseq@temppath}{##1} } }% } @@ -808,12 +810,13 @@ % sseqs has to be handled separately, because it must decide whether an option is a global option or not % and handle them at different times. This makes the code a little trickier. +\def\sseq@sseqstyle@globalpart{} \sseq@g@addto@macro\sseq@stylelist{\sseq@sseqstyle{\the\sseq@sseqstyle}}% \sseq@g@addto@macro\sseq@clearchangestyles{\sseq@sseqstyle@page{}}% \sseq@set@newstyle{ sseqs/.code={% - \let\sseq@savedoptioncode@store\sseq@savedoptioncode - \let\sseq@savedoptioncode\sseq@sseqstyle@globalpart + % This will get called on each key that isn't a defined global option. Then we add it to \sseq@sseqstyle to be applied + % locally to absolutely everything. \def\sseq@addstylecodetooptions@unknown{% \let\sseq@sseqstyle@globalpart\sseq@savedoptioncode \edef\sseq@savedoptioncode{\the\sseq@sseqstyle}% @@ -821,32 +824,30 @@ \sseq@sseqstyle\@xp{\sseq@savedoptioncode}% \let\sseq@savedoptioncode\sseq@sseqstyle@globalpart }% - \sseq@addstylecodetooptions{/sseqpages/global}{#1}% - \let\sseq@sseqstyle@globalpart\sseq@savedoptioncode + \sseq@addstylecodetomacro\sseq@sseqstyle@globalpart{/sseqpages/global}{#1}% \ifsseq@inprogress \sseq@savedpaths@xadd{\sseq@sseqstyle{\the\sseq@sseqstyle}}% \fi + % Restore hook \let\sseq@addstylecodetooptions@unknown\sseq@keys@unknown - \let\sseq@savedoptioncode\sseq@savedoptioncode@store },% + % It's not clear to me that "change sseqs" should even exist as an option. change sseqs/.code={% \ifsseq@ispageenv\else\sseq@error@nn{change-style-data}{sseq}{#1}\fi \ifsseq@hasname\else\sseq@error@nn{change-style-standalone}{sseq}{#1}\fi - \let\sseq@savedoptioncode@store\sseq@savedoptioncode - \edef\sseq@savedoptioncode{\the\sseq@sseqstyle@page}% - \sseq@addstylecodetooptions{\sseq@temppath}{#1}% - \sseq@sseqstyle@page\@xp{\sseq@savedoptioncode}% - \let\sseq@savedoptioncode\sseq@savedoptioncode@store + \sseq@addstylecodetotoks{\sseq@sseqstyle@page}{\sseq@temppath}{#1}% } } +% sseq needs special handling, so is done by hand above. %\sseq@newstyles{/sseqpages/}{sseq}% DON'T make this /global/default! Bad things will happen. \sseq@newstyles{/sseqpages/label,/sseqpages}{edge, label, edge label, differential label, struct line label} \sseq@newstyles{/sseqpages/class,/sseqpages}{class, permanent cycle, transient cycle, this page cycle} \sseq@newstyles{/sseqpages/differential,/sseqpages}{differential} \sseq@newstyles{/sseqpages/struct line,/sseqpages}{struct line, this page struct line} \sseq@newstyles{/sseqpages/class/label}{class label, inner class label, outer class label} +\sseq@newstyles{/sseqpages/class/label/pin}{pin} \sseq@newstyles{/sseqpages/tikz primitives}{tikz primitive} \sseq@newstyles{/sseqpages/fit}{circle class} @@ -860,11 +861,6 @@ permanent classes/.code={\pgfkeysalso{permanent cycles={#1}}}, transient classes/.code={\pgfkeysalso{transient cycles={#1}}}, this page classes/.code={\pgfkeysalso{this page cycles={#1}}}, - cycle style/.code={\pgfkeysalso{class style={#1}}}, - permanent class style/.code={\pgfkeysalso{permanent cycle style={#1}}}, - transient class style/.code={\pgfkeysalso{transient cycle style={#1}}}, - this page class style/.code={\pgfkeysalso{this page cycle style={#1}}}, - class label position/.code={\pgfkeysalso{class label positions={#1}}} }% \def\sseq@newplotstyle#1{ @@ -874,21 +870,13 @@ \@xp\def\sseq@tempcmdb{} \pgfqkeys{/sseqpages/global}{% #1 style/.ecode={ - \unexpanded{\let\sseq@savedoptioncode@store\sseq@savedoptioncode} - \let\@nx\sseq@savedoptioncode\@xp\@nx\sseq@tempcmd - \unexpanded{\sseq@addstylecodetooptions{/tikz}}{##1} - \let\@xp\@nx\sseq@tempcmd\@nx\sseq@savedoptioncode - \unexpanded{\let\sseq@savedoptioncode\sseq@savedoptioncode@store} + \@nx\sseq@addstylecodetomacro{\@xp\@nx\sseq@tempcmd}{/tikz}{##1} } } % Only difference here is \sseq@tempcmdb -- which puts it in the default code -- instead of \sseq@tempcmd \pgfqkeys{/sseqpages/global/default}{% #1 style/.ecode={ - \unexpanded{\let\sseq@savedoptioncode@store\sseq@savedoptioncode} - \let\@nx\sseq@savedoptioncode\@xp\@nx\sseq@tempcmdb - \unexpanded{\sseq@addstylecodetooptions{/tikz}}{##1} - \let\@xp\@nx\sseq@tempcmdb\@nx\sseq@savedoptioncode - \unexpanded{\let\sseq@savedoptioncode\sseq@savedoptioncode@store} + \@nx\sseq@addstylecodetomacro{\@xp\@nx\sseq@tempcmdb}{/tikz}{##1} } } } @@ -896,10 +884,152 @@ \def\sseq@newplotstyles#1{\def\sseq@temppath{#1}\sseq@newplotstyles@#1,\sseq@nil} \def\sseq@newplotstyles@#1,{\sseq@newplotstyle{\sseq@trimleadingspaces#1}\@ifnextchar\sseq@nil{\@gobble}{\sseq@newplotstyles@}} - \sseq@newplotstyles{x tick, y tick} +%% +%% +%% Families (also called collections in code) +%% +%% These are supposed to make it easy to display / hide and change appearance of logically connected families of classes. +%% In order to allow a set of options to be given that applies uniformly to all features, we separately apply the options in each of these bins. +%% + + +\def\sseq@featurelist{\\{class}\\{differential}\\{structline}\\{circleclass}\\{tikzprimitive}} +\def\sseq@mapfeaturelist#1{\def\\##1{#1}\sseq@featurelist} + +\def\sseq@familylist{} + +\def\sseq@collections@featuretype{} +\def\sseqnewfamily#1{% + % Make five bins associated to the new family, one for each feature type. Add them to storelist with empty defaults. + \sseq@mapfeaturelist{ + \@xp\sseq@setmacronospaces\csname sseq@tempcmd@##1\endcsname{sseq@user@#1@##1@style} + \@xp\sseq@setmacronospaces\csname sseq@tempcmd@##1@default\endcsname{sseq@user@#1@##1@style@default} + \sseq@eval{\@nx\sseq@addtostorelist\@xptwo\@nx\csname sseq@tempcmd@##1\endcsname{\@xptwo\@nx\csname sseq@tempcmd@##1@default\endcsname}} + \@xptwo\def\csname sseq@user@#1@##1@style@default\endcsname{} + } + % This is for deciding what set of options to apply to a feature + \@xp\sseq@setnospaces\csname sseq@tempcmd\endcsname{sseq@user@#1} +% + % A flag to decide whether to draw the family. Set/unset using "draw family" and "no family". + \@xp\sseq@addtostorelist\csname sseq@#1@maybedraw\endcsname{} + \pgfqkeys{/sseqpages/global}{% + #1 style/.ecode={% + \@nx\sseq@addstylecodetomacro\@xp\@nx\sseq@tempcmd@class{/sseqpages/class,/sseqpages/collections/class}{##1}% + \@nx\sseq@addstylecodetomacro\@xp\@nx\sseq@tempcmd@differential{/sseqpages/differential,/sseqpages/collections/differential}{##1}% + \@nx\sseq@addstylecodetomacro\@xp\@nx\sseq@tempcmd@structline{/sseqpages/struct line,/sseqpages/collections/struct line}{##1}% + \@nx\sseq@addstylecodetomacro\@xp\@nx\sseq@tempcmd@circleclass{/sseqpages/fit,/sseqpages/collections/fit}{##1}% + \@nx\sseq@addstylecodetomacro\@xp\@nx\sseq@tempcmd@tikzprimitive{/sseqpages/tikz primitives,/sseqpages/collections/tikz primitives}{##1}% + }, + draw #1/.ecode = {\def\@xp\@nx\csname sseq@#1@maybedraw\endcsname{\@nx\sseq@drawtrue}}, + no #1/.ecode = {\def\@xp\@nx\csname sseq@#1@maybedraw\endcsname{\@nx\sseq@drawfalse}} + }% + \pgfqkeys{/sseqpages/global/default}{% + #1 style/.ecode={% + \@nx\sseq@addstylecodetomacro\@xp\@nx\sseq@tempcmd@class@default{/sseqpages/class}{##1}% + \@nx\sseq@addstylecodetomacro\@xp\@nx\sseq@tempcmd@differential@default{/sseqpages/differential}{##1}% + \@nx\sseq@addstylecodetomacro\@xp\@nx\sseq@tempcmd@structline@default{/sseqpages/struct line}{##1}% + \@nx\sseq@addstylecodetomacro\@xp\@nx\sseq@tempcmd@circleclass@default{/sseqpages/fit}{##1}% + \@nx\sseq@addstylecodetomacro\@xp\@nx\sseq@tempcmd@tikzprimitive@default{/sseqpages/tikz primitives}{##1}% + }, + draw #1/.ecode = {\def\@xp\@nx\csname sseq@#1@maybedraw@default\endcsname{\@nx\sseq@drawtrue}}, + no #1/.ecode = {\def\@xp\@nx\csname sseq@#1@maybedraw@default\endcsname{\@nx\sseq@drawfalse}} + }% +% + \pgfqkeys{/sseqpages}{ + #1/.ecode={ + \@nx\sseq@d@addto@macro\@nx\sseq@familylist{\@nx\csname sseq@#1@maybedraw\endcsname} + \@nx\sseq@options@secondpass{ + \unexpanded\@xp{\@xp\csname\sseq@tempcmd @\sseq@collections@featuretype @style\endcsname} + } + } + } +} + + + + +\def\sseq@collections@classlabels@hook{} +\def\sseq@collections@innerclasslabels@hook{} +\def\sseq@collections@outerclasslabels@hook{} +\def\sseq@collections@pins@hook{} + +\def\sseq@collections@labels@hook{} +\def\sseq@collections@edgelabels@hook{} +\def\sseq@collections@differentiallabels@hook{} +\def\sseq@collections@structlinelabels@hook{} + +\def\sseq@collections@setempty#1{\sseq@collections@setempty@#1,\sseq@nil} +\def\sseq@collections@setempty@#1,{ + \pgfqkeys{/sseqpages/collections}{ + class/#1/.code={}, + differential/#1/.code={}, + struct line/#1/.code={}, + fit/#1/.code={}, + tikz primitives/#1/.code={} + } + \@ifnextchar\sseq@nil{\@gobble}{\sseq@collections@setempty@} +} + +\sseq@collections@setempty{% + classes, cycles, permanent classes, permanent cycles, transient classes, transient cycles, this page classes, this page cycles, + edges, differentials,struct lines, this page struct lines,circleclasses, tikz primitives, + labels, edge labels, differential labels, struct line labels, + class labels, inner class labels, outer class labels,pins +} + +% #1 -- path +% #2 -- hook name +% #3 -- code +\def\sseq@collections@addtohook#1#2#3{ + \sseq@keys@do{ + \let\sseq@savedoptioncode@store\sseq@savedoptioncode\let\sseq@savedoptioncode\empty + \pgfqkeys{#1}{#3} + \edef\sseq@savedoptioncode{\unexpanded\@xp{\sseq@savedoptioncode@store}\def\@nx#2{\unexpanded\@xp{\sseq@savedoptioncode}}} + } +} + +\pgfqkeys{/sseqpages/collections}{ + class/classes/.style={/sseqpages/class/.cd,#1}, + class/cycles/.style={/sseqpages/class/.cd,#1}, + class/permanent classes/.code={\ifsseq@permanentcycle\pgfkeysalso{/sseqpages/class/.cd,#1}\fi}, + class/permanent cycles/.code={\ifsseq@permanentcycle\pgfkeysalso{/sseqpages/class/.cd,#1}\fi}, + class/transient classes/.code={\ifsseq@permanentcycle\else\pgfkeysalso{/sseqpages/class/.cd,#1}\fi}, + class/transient cycles/.code={\ifsseq@permanentcycle\else\pgfkeysalso{/sseqpages/class/.cd,#1}\fi}, + class/this page classes/.code={\ifsseq@thispage\pgfkeysalso{/sseqpages/class/.cd,#1}\fi}, + class/this page cycles/.code={\ifsseq@thispage\pgfkeysalso{/sseqpages/class/.cd,#1}\fi}, + differential/edges/.style={/sseqpages/differential/.cd,#1}, + differential/differentials/.style={/sseqpages/differential/.cd,#1}, + struct line/edges/.style={/sseqpages/struct line/.cd,#1}, + struct line/struct lines/.style={/sseqpages/struct line/.cd,#1}, + struct line/this page struct lines/.code={\ifsseq@thispage\pgfkeysalso{/sseqpages/struct line/.cd,#1}\fi}, + fit/circleclasses/.style={/sseqpages/fit/.cd,#1}, + tikz primitives/tikz primitives/.style={/sseqpages/tikz primitives/.cd,#1}, +% labels + class/class labels/.code/.expanded={\unexpanded\@xp{\sseq@collections@addtohook{/sseqpages/class/label}{\sseq@collections@classlabels@hook}{#1}}}, + class/inner class labels/.code/.expanded={\unexpanded\@xp{\sseq@collections@addtohook{/sseqpages/class/label}{\sseq@collections@innerclasslabels@hook}{#1}}}, + class/outer class labels/.code/.expanded={\unexpanded\@xp{\sseq@collections@addtohook{/sseqpages/class/label}{\sseq@collections@outerclasslabels@hook}{#1}}}, + class/pins/.code/.expanded={\unexpanded\@xp{\sseq@collections@addtohook{/sseqpages/class/label/pin}{\sseq@collections@pins@hook}{#1}}}, +% + class/labels/.code/.expanded={\unexpanded\@xp{\sseq@collections@addtohook{/sseqpages/label}{\sseq@collections@labels@hook}{#1}}}, + differential/labels/.code/.expanded={\unexpanded\@xp{\sseq@collections@addtohook{/sseqpages/label}{\sseq@collections@labels@hook}{#1}}}, + struct line/labels/.code/.expanded={\unexpanded\@xp{\sseq@collections@addtohook{/sseqpages/label}{\sseq@collections@labels@hook}{#1}}}, +% + differential/edge labels/.code/.expanded= + {\unexpanded\@xp{\sseq@collections@addtohook{/sseqpages/label}{\sseq@collections@edgelabels@hook}{#1}}}, + struct line/edge labels/.code/.expanded= + {\unexpanded\@xp{\sseq@collections@addtohook{/sseqpages/label}{\sseq@collections@edgelabels@hook}{#1}}}, + differential/differential labels/.code/.expanded= + {\unexpanded\@xp{\sseq@collections@addtohook{/sseqpages/label}{\sseq@collections@differentiallabels@hook}{#1}}}, + struct line/struct line labels/.code/.expanded= + {\unexpanded\@xp{\sseq@collections@addtohook{/sseqpages/label}{\sseq@collections@structlinelabels@hook}{#1}}}, +} + + + + %%% Global keys handlers and infrastructure \def\sseq@keys@lastpart{% @@ -909,6 +1039,50 @@ \edef\sseq@temp@ii{\pgfkeyscurrentkey}% } +\def\sseq@sanitize@intexpr#1#2{ + \sseq@ifintexpr{#1}{ + \edef\sseq@sanitize@output{\the\numexpr#1} + }{ + \sseq@error@xx{invalid-intexpr}{\unexpanded{#2}}{#1} + \sseq@break + } +} + +\def\sseq@sanitize@positiveintexpr#1#2{ + \sseq@sanitize@intexpr{#1}{#2} + \ifnum\sseq@sanitize@output<1\relax + \sseq@error@xx{invalid-positive-intexpr}{\unexpanded{#2}}{#1} + \@xp\sseq@break + \fi +} + +\def\sseq@sanitize@dimenexpr#1#2{ + \sseq@ifpgfmathexpr{#1}{ + \ifpgfmathunitsdeclared\else + \sseq@error@xx{invalid-dimenexpr}{\unexpanded{#2}}{#1} + \@xp\sseq@break + \fi + \edef\sseq@sanitize@output{\sseq@mathresult} + }{ + \sseq@error@xx{invalid-dimenexpr}{\unexpanded{#2}}{#1} + \sseq@break + } +} + +\def\sseq@sanitize@color#1#2{ + \begingroup + \global\sseq@gtempiffalse + \def\c@lor@error##1{\global\sseq@gtempiftrue} + \color{#1} + \endgroup + \ifsseq@gtempif + \sseq@error@xx{invalid-color}{\unexpanded{#2}}{#1} + \@xp\sseq@break + \else + \def\sseq@sanitize@output{#1} + \fi +} + \pgfqkeys{/handlers}{ .sseq store in/.code 2 args={% \sseq@addtostorelist#1{#2}% @@ -918,6 +1092,44 @@ /sseqpages/global/default/\sseq@temp/.store in/.expand once=\csname \sseq@macroname#1@default\endcsname }% }, + .sseq store in sanitize/.code n args={3}{% + \sseq@addtostorelist#1{#2}% + \sseq@keys@lastpart + \pgfkeys{% + \sseq@temp@ii/.code/.expanded={% + \unexpanded{#3{##1}}{\sseq@temp=\unexpanded{##1}}% + \unexpanded{\edef#1{\unexpanded\@xp{\sseq@sanitize@output}}}% + %\show\@nx#1 + \sseq@breakpoint + }, + \sseq@temp@ii/.value required, + /sseqpages/global/default/\sseq@temp/.code/.expanded={% + \unexpanded{#3{##1}}{\sseq@temp=\unexpanded{##1}}% + \edef\@xp\@nx\csname \sseq@macroname#1@default\endcsname\unexpanded{{\unexpanded\@xp{\sseq@sanitize@output}}}% + \sseq@breakpoint + }, + /sseqpages/global/default/\sseq@temp/.value required + }% + + }, + .sseq store int in/.code 2 args={ + \sseq@keys@lastpart + \pgfkeysalso{% + \sseq@temp@ii/.sseq store in sanitize={#1}{#2}\sseq@sanitize@intexpr + } + }, + .sseq store positive int in/.code 2 args={ + \sseq@keys@lastpart + \pgfkeysalso{% + \sseq@temp@ii/.sseq store in sanitize={#1}{#2}\sseq@sanitize@positiveintexpr + } + }, + .sseq store dimen in/.code 2 args={ + \sseq@keys@lastpart + \pgfkeysalso{% + \sseq@temp@ii/.sseq store in sanitize={#1}{#2}\sseq@sanitize@dimenexpr + } + }, .sseq append to style/.code 2 args={% \sseq@addkeytostorelist{#1}{\pgfkeysalso{#2}}% \sseq@keys@lastpart @@ -970,8 +1182,8 @@ \sseq@usedparam\sseq@tempb \fi \pgfkeys{% - /sseqpages/global/\sseq@temp/.ecode={\@nx\pgfkeysalso{\sseq@tempb{x}={##1},\sseq@tempb{y}={##1}}},% - /sseqpages/global/default/\sseq@temp/.ecode={\@nx\pgfkeysalso{\sseq@tempb{x}={##1},\sseq@tempb{y}={##1}}}% + /sseqpages/global/\sseq@temp/.code/.expanded={\@nx\pgfkeysalso{\sseq@tempb{x}=\unexpanded{{##1}},\sseq@tempb{y}=\unexpanded{{##1}}}},% + /sseqpages/global/default/\sseq@temp/.code/.expanded={\@nx\pgfkeysalso{\sseq@tempb{x}=\unexpanded{{##1}},\sseq@tempb{y}=\unexpanded{{##1}}}}% }% } } @@ -987,32 +1199,35 @@ } } -\def\sseq@add@tikzkey@to@options@forstylehander#1{\sseq@e@addto@options{\@nx\sseq@options@secondpass{#1}}} +\def\sseq@patchrepeat#1#2#3{% + \patchcmd#1{#2}{#3}{\sseq@patchrepeat{#1}{#2}{#3}}{}% +} + +\def\sseq@stylehandler@processpath#1#2{% + \def\sseq@savedoptioncode{}% + \sseq@eval{\@nx\sseq@addstylecodetooptions{/sseqpages/#1}{\unexpanded\@xp{\sseq@keybody{*1}}}}% + \edef\sseq@savedoptioncode##1{\unexpanded\@xp{\sseq@savedoptioncode}}% + \sseq@patchrepeat\sseq@savedoptioncode{*1}{##1}% + \sseq@eval{\@nx\pgfqkeys{/sseqpages/#1}{\sseq@temp/.#2={\unexpanded\@xp{\sseq@savedoptioncode{##1}}}}}% +} + +\def\sseq@add@tikzkey@to@options@forstylehander#1{\sseq@e@addto@options{#1}} \pgfqkeys{/handlers}{ % defines sseq style, etc sseq @@ make style handler/.style 2 args={% .sseq #1/.code={% + \def\sseq@keybody####1{##1}% \sseq@keys@lastpart \let\sseq@savedoptioncode@store\sseq@savedoptioncode \def\sseq@keys@unknown@error{}% - \def\sseq@savedoptioncode{}% \let\sseq@add@tikzkey@to@options\sseq@add@tikzkey@to@options@forstylehander - \sseq@addstylecodetooptions{/sseqpages/scope}{##1}% - \sseq@eval{\@nx\pgfkeys{/sseqpages/scope/\sseq@temp/.#2={\unexpanded\@xp{\sseq@savedoptioncode}}}}% - \def\sseq@savedoptioncode{}% - \sseq@addstylecodetooptions{/sseqpages/class}{##1}% - \sseq@eval{\@nx\pgfkeys{/sseqpages/class/\sseq@temp/.#2={\unexpanded\@xp{\sseq@savedoptioncode}}}}% - \def\sseq@savedoptioncode{}% - \sseq@addstylecodetooptions{/sseqpages/differential}{##1}% - \sseq@eval{\@nx\pgfkeys{/sseqpages/differential/\sseq@temp/.#2={\unexpanded\@xp{\sseq@savedoptioncode}}}}% - \def\sseq@savedoptioncode{}% - \sseq@addstylecodetooptions{/sseqpages/struct line}{##1}% - \sseq@eval{\@nx\pgfkeys{/sseqpages/struct line/\sseq@temp/.#2={\unexpanded\@xp{\sseq@savedoptioncode}}}}% - \def\sseq@savedoptioncode{}% - \sseq@addstylecodetooptions{/sseqpages/circle classes}{##1} - \sseq@eval{\@nx\pgfkeys{/sseqpages/circle classes/\sseq@temp/.#2={\unexpanded\@xp{\sseq@savedoptioncode}}}}% - \def\sseq@savedoptioncode{}% - \sseq@addstylecodetooptions{/sseqpages/tikz primitives}{##1}% - \sseq@eval{\@nx\pgfkeys{/sseqpages/tikz primitives/\sseq@temp/.#2={\unexpanded\@xp{\sseq@savedoptioncode}}}}% +% + \sseq@stylehandler@processpath{scope}{#2}% + \sseq@stylehandler@processpath{class}{#2}% + \sseq@stylehandler@processpath{differential}{#2}% + \sseq@stylehandler@processpath{struct line}{#2}% + \sseq@stylehandler@processpath{circle classes}{#2}% + \sseq@stylehandler@processpath{tikz primitives}{#2}% +% \let\sseq@savedoptioncode\sseq@savedoptioncode@store \let\sseq@addstylecodetooptions@unknown\sseq@keys@unknown \let\sseq@keys@unknown@error\sseq@keys@unknown@error@normal @@ -1036,7 +1251,7 @@ sseq @@ make code handler=code, sseq @@ make code handler=prefix code, sseq @@ make code handler=append code, -% +% these just are the same as /.style, etc. .global sseq style/.code={\pgfkeys{\pgfkeyscurrentpath/.code=\pgfkeysalso{#1}}}, .global sseq prefix style/.code={\pgfkeys{\pgfkeyscurrentpath/.add code={\pgfkeysalso{#1}}{}}}, .global sseq append style/.code={\pgfkeys{\pgfkeyscurrentpath/.add code={}{\pgfkeysalso{#1}}}}, @@ -1147,11 +1362,19 @@ name/.sseq default error, ~page/.code={ \ifsseq@hasname - \sseq@ifintexpr{#1}{ - \def\sseq@thepage{#1}\sseq@thepagecount=#1\relax\let\page\sseq@thepage - }{ - \sseq@error{invalid-page}{#1} - } + \sseq@getnumrange\sseq@thepage{#1} + \sseq@thepagecount=\sseq@thepage\relax + \let\page\sseq@thepage + \edef\sseq@thepagemm{\the\numexpr\sseq@thepagecount-1\relax} + \ifx\sseq@thepagemax\undefined + \edef\sseq@thepagemaxpp{\the\numexpr\sseq@thepagecount+1\relax} + \else + \ifnum\sseq@thepagemax=\z@ + \let\sseq@thepagemaxpp\sseq@infinity + \else + \edef\sseq@thepagemaxpp{\the\numexpr\sseq@thepagemax+1\relax} + \fi + \fi \else \sseq@error{page-no-name} \fi @@ -1168,6 +1391,11 @@ }, grid/.code={\ifcsname sseq@grid@#1\endcsname\@xp\let\@xp\sseq@grid\csname sseq@grid@#1\endcsname\else\sseq@error@n{unknown-grid}{#1}\fi}, grid/.sseq default code={\ifcsname sseq@grid@#1\endcsname\@xp\let\@xp\sseq@grid@default\csname sseq@grid@#1\endcsname\else\sseq@error@n{unknown-grid}{#1}\fi}, + grid color/.sseq store in sanitize=\sseq@gridcolor{gray}\sseq@sanitize@color, + grid step/.sseq x y alias, + grid step/.value required, + x grid step/.sseq store positive int in=\sseq@xgridstep{1}, + y grid step/.sseq store positive int in=\sseq@ygridstep{1}, math nodes/.sseq is if=mathnodes, % TODO: make this locally toggleable custom clip/.sseq store in=\sseq@customclip{}, clip/.sseq is if=clip, @@ -1178,7 +1406,7 @@ draw orphan edges/.sseq is if=draworphanedges, no orphan edges/.sseq is if false={draworphanedges}, class pattern/.sseq store in=\sseq@classpattern{standard}, - class pattern/.append code={\ifcsname sseq@\sseq@classpattern xoffset1/1\endcsname\else\sseq@error{unknown-class-pattern}\fi}, + class pattern/.add code={\ifcsname sseq@#1xoffset1/1\endcsname\else\sseq@error{unknown-class-pattern}\@xp\sseq@break\fi}{\sseq@breakpoint}, class placement transform/.code={% \bgroup \let\tikz@transform\pgfutil@empty @@ -1218,8 +1446,6 @@ \sseq@addtostorelist\sseq@classplacementtransform{} -\sseq@addiftostorelist@truedefault{borderxaxis}\sseq@addiftostorelist@truedefault{borderyaxis} -\sseq@addtostorelist\sseq@xaxisorigin{0}\sseq@addtostorelist\sseq@yaxisorigin{0} %%% Range keys and commands \sseq@globalkeys{% @@ -1249,18 +1475,27 @@ \@xp\sseq@addtostorelist\@xp\sseq@xmaxpp\@xp{\sseq@infinity} \@xp\sseq@addtostorelist\@xp\sseq@ymaxpp\@xp{\sseq@infinity} +\sseq@addiftostorelist{specifiedxrange} +\sseq@addiftostorelist{specifiedyrange} \def\sseq@xrange#1#2{% \global\let\sseq@xminmax\@gobbletwo % Don't need to calculate range of nodes if user specifies it - \gdef\sseq@xmin{#1}% - \gdef\sseq@xmax{#2}% + \global\sseq@specifiedxrangetrue + \sseq@sanitize@intexpr{#1}{x range={#1}{#2}} + \sseq@sanitize@intexpr{#2}{x range={#1}{#2}} + \xdef\sseq@xmin{\the\numexpr#1}% + \xdef\sseq@xmax{\the\numexpr#2}% \let\xmin\sseq@xmin \let\xmax\sseq@xmax % Need to know decremented \xmin and incremented \xmax to decide which nodes to print \sseq@tempcount=#1 \advance\sseq@tempcount-1\xdef\sseq@xminmm{\the\sseq@tempcount}% \sseq@tempcount=#2 \advance\sseq@tempcount1\xdef\sseq@xmaxpp{\the\sseq@tempcount}% + \sseq@breakpoint } \def\sseq@yrange#1#2{% \global\let\sseq@yminmax\@gobbletwo % + \sseq@sanitize@intexpr{#1}{x range={#1}{#2}} + \sseq@sanitize@intexpr{#2}{x range={#1}{#2}} + \global\sseq@specifiedyrangetrue \gdef\sseq@ymin{#1}% \gdef\sseq@ymax{#2}% \let\ymin\sseq@ymin @@ -1340,6 +1575,7 @@ %%% Axes and Layout options \sseq@addtostorelist{\sseq@xtickfn}{} % These should initially be the identity macro, but addtostorelist doesn't accept functions as default \sseq@addtostorelist{\sseq@ytickfn}{} % so the default is instated in begin{sseqdata} / begin{sseqpicture}. + \sseq@globalkeys{% title/.sseq store in=\sseq@title{}, title style/.sseq append to style={/sseqpages/global/every title}{at={(0.5*\xmin+0.5*\xmax,\ymax)}}, @@ -1358,13 +1594,9 @@ no labels/.sseq x y alias=no #1 label, draw labels/.sseq x y alias=draw #1 label, % - no x axis/.sseq is if false={drawxaxis}, - no y axis/.sseq is if false={drawyaxis}, - no axes/.value forbidden, - no axes/.sseq x y alias=no #1 axis, - draw x axis/.sseq is if=drawxaxis, - draw y axis/.sseq is if=drawyaxis, - draw axes/.sseq x y alias=draw #1 axis, + no x axis/.style={x axis type=none}, + no y axis/.style={y axis type=none}, + no axes/.style={axes type=none}, rotate labels/.sseq is if=rotatelabels, % draw x ticks/.sseq is if=drawxaxisticks, @@ -1377,62 +1609,135 @@ draw ticks/.default=true, tick step/.sseq x y alias, tick step/.value required, - x tick step/.sseq store in=\sseq@xtickstep{1}, - y tick step/.sseq store in=\sseq@ytickstep{1}, + x tick step/.sseq store positive int in=\sseq@xtickstep{1}, + y tick step/.sseq store positive int in=\sseq@ytickstep{1}, + tick offset/.sseq x y alias, + tick offset/.value required, + x tick offset/.sseq store int in=\sseq@xtickstepoffset{0}, + y tick offset/.sseq store int in=\sseq@ytickstepoffset{0}, + major tick step/.sseq x y alias, + x major tick step/.sseq store int in=\sseq@xmajortickstep{0}, + y major tick step/.sseq store int in=\sseq@ymajortickstep{0}, + minor tick step/.sseq x y alias, + x minor tick step/.sseq store int in=\sseq@xminortickstep{0}, + y minor tick step/.sseq store int in=\sseq@yminortickstep{0}, x tick handler/.code={\def\sseq@xtickfn##1{#1}}, x tick handler/.sseq default code={\def\sseq@xtickfn@default##1{#1}}, y tick handler/.code={\def\sseq@ytickfn##1{#1}}, y tick handler/.sseq default code={\def\sseq@ytickfn@default##1{#1}}, - class label handler/.code = {\long\def\sseq@classlabeltextfn##1{#1}}, % \long so that \ifx\classlabeltextfn\@gobble compares true if this is empty (\@gobble is long...) - class label handler/.sseq default code={\long\def\sseq@classlabeltextfn@default##1{#1}}, + class label handler/.code = { % \long so that \ifx\classlabeltextfn\@gobble compares true if this is empty (\@gobble is long...) + \long\def\sseq@classlabeltextfn##1{#1} + \ifx\sseq@classlabeltextfn\@gobble + \def\sseq@classlabeltextfn##1{\def\processedlabel{##1}} + \else + \edef\sseq@tempa{\unexpanded\@xp{\sseq@classlabeltextfn{}}} + \edef\sseq@tempb{\unexpanded\@xp{\sseq@classlabeltextfn{blah}}} + \ifx\sseq@tempa\sseq@tempb + \long\def\sseq@classlabeltextfn##1{#1{##1}} + \fi + \fi + }, + class label handler/.sseq default code={ + \long\def\sseq@classlabeltextfn@default##1{#1} + \ifx\sseq@classlabeltextfn@default\@gobble + \def\sseq@classlabeltextfn@default##1{\def\processedlabel{##1}} + \else + \edef\sseq@tempa{\unexpanded\@xp{\sseq@classlabeltextfn@default{}}} + \edef\sseq@tempb{\unexpanded\@xp{\sseq@classlabeltextfn@default{blah}}} + \ifx\sseq@tempa\sseq@tempb + \long\def\sseq@classlabeltextfn@default##1{#1{##1}} + \fi + \fi + }, x tick style/.sseq store in=\sseq@xtickstyle{}, y tick style/.sseq store in=\sseq@ytickstyle{}, tick style/.sseq x y alias, % - x axis style/.is choice, - y axis style/.is choice, - axes style/.sseq x y alias=axis style, - ~x axis style/border/.code={\sseq@drawxaxistrue\sseq@borderxaxistrue}, - ~y axis style/border/.code={\sseq@drawyaxistrue\sseq@borderyaxistrue}, - ~x axis style/center/.code={ - \sseq@drawxaxistrue\sseq@borderxaxisfalse - \ifx\sseq@xaxisgap\sseq@xaxisgap@default - \def\sseq@xaxisgap{0cm} - \fi - }, - ~y axis style/center/.code={\sseq@drawyaxistrue\sseq@borderyaxisfalse\ifx\sseq@yaxisgap\sseq@yaxisgap@default\def\sseq@yaxisgap{0cm}\fi}, - ~x axis style/none/.code={\sseq@drawxaxisfalse}, - ~y axis style/none/.code={\sseq@drawyaxisfalse}, - x axis origin/.sseq store in=\sseq@xaxisorigin{0}, - y axis origin/.sseq store in=\sseq@yaxisorigin{0}, + axes type/.sseq x y alias=axis type, + axes type/.add code={\let\sseq@axistypesanitizer\sseq@axistypesanitizerb}{\let\sseq@axistypesanitizer\sseq@axistypesanitizera}, + axes type/.value required, + x axis type/.sseq store in sanitize=\sseq@xaxistype{border}\sseq@axistypesanitizer, + x axis type/.value required, + y axis type/.sseq store in sanitize=\sseq@yaxistype{border}\sseq@axistypesanitizer, + y axis type/.value required, + x axis origin/.sseq store int in=\sseq@xaxisorigin@center@{0}, + y axis origin/.sseq store int in=\sseq@yaxisorigin@center@{0}, axes origin/.sseq x y alias=axis origin, } + +\def\sseq@validaxestypesa{border, center, or none. The value frame only works with the 'axes type' key.} +\def\sseq@validaxestypesb{border, center, frame, or none.} +\let\sseq@validaxestypes\sseq@validaxestypesa + +\let\sseq@axistypekeya\@firstofone +\def\sseq@axistypekeyb#1{axes type} +\let\sseq@axistypekey\sseq@axistypekeya + +\def\sseq@uptoequal#1{\sseq@uptoequal@#1\sseq@nil} +\def\sseq@uptoequal@#1=#2\sseq@nil{#1} +\def\sseq@axistypesanitizerb#1#2{ + \let\sseq@validaxestypes\sseq@validaxestypesb + \let\sseq@axistypekey\sseq@axistypekeyb + \@xp\ifx\csname sseq@leftgridpadding@y#1\endcsname\relax + \sseq@error@xx{invalid-axis-type}{#1}{\sseq@uptoequal{#2}} + \sseq@breakfi + \else + \def\sseq@sanitize@output{#1} + \fi + \let\sseq@validaxestypes\sseq@validaxestypesa + \let\sseq@axistypekey\sseq@axistypekeya +} + +\def\sseq@axistype@frame{frame} +\def\sseq@axistypesanitizera#1#2{ + \def\temp{#1} + \ifx\sseq@axistype@frame\temp + \sseq@error@xx{invalid-axis-type}{#1}{\sseq@uptoequal{#2}} + \sseq@breakfi + \fi + \sseq@axistypesanitizerb{#1}{#2} +} +\let\sseq@axistypesanitizer\sseq@axistypesanitizera + \pgfqkeys{/sseqpages}{% - class label handler/.code = {\long\def\sseq@classlabeltextfn##1{#1}} + class label handler/.code = { % \long so that \ifx\classlabeltextfn\@gobble compares true if this is empty (\@gobble is long...) + \long\def\sseq@classlabeltextfn##1{#1} + \ifx\sseq@classlabeltextfn\@gobble + \def\sseq@classlabeltextfn##1{\def\processedlabel{##1}} + \else + \edef\sseq@tempa{\unexpanded\@xp{\sseq@classlabeltextfn{}}} + \edef\sseq@tempb{\unexpanded\@xp{\sseq@classlabeltextfn{blah}}} + \ifx\sseq@tempa\sseq@tempb + \long\def\sseq@classlabeltextfn##1{#1{##1}} + \fi + \fi + } } \sseq@globalkeys{ axes gap/.sseq x y alias=axis gap, axes gap/.value required, - x axis gap/.sseq store in=\sseq@xaxisgap{0.5cm}, - y axis gap/.sseq store in=\sseq@yaxisgap{0.5cm}, + x axis gap/.sseq store dimen in=\sseq@xaxisgap{0.5cm}, + y axis gap/.sseq store dimen in=\sseq@yaxisgap{0.5cm}, tick gap/.sseq x y alias, tick gap/.value required, - x tick gap/.sseq store in=\sseq@xlabelgap{0.5cm}, - y tick gap/.sseq store in=\sseq@ylabelgap{0.5cm}, - x axis extend start/.sseq store in=\sseq@xaxis@start@extend{0.9cm}, - y axis extend start/.sseq store in=\sseq@yaxis@start@extend{0.9cm}, + x tick gap/.sseq store dimen in=\sseq@xlabelgap{0.5cm}, + y tick gap/.sseq store dimen in=\sseq@ylabelgap{0.5cm}, + x axis tail/.sseq store dimen in=\sseq@xaxis@tail{0.9cm}, + y axis tail/.sseq store dimen in=\sseq@yaxis@tail{0.9cm}, + x axis extend start/.sseq store dimen in=\sseq@xaxis@start@extend{0.5cm}, + y axis extend start/.sseq store dimen in=\sseq@yaxis@start@extend{0.5cm}, axes extend start/.sseq x y alias=axis extend start, - x axis extend end/.sseq store in=\sseq@xaxis@end@extend{0.5cm}, - y axis extend end/.sseq store in=\sseq@yaxis@end@extend{0.5cm}, + x axis extend end/.sseq store dimen in=\sseq@xaxis@end@extend{0.5cm}, + y axis extend end/.sseq store dimen in=\sseq@yaxis@end@extend{0.5cm}, axes extend end/.sseq x y alias=axis extend end, - x axis clip padding/.sseq store in=\sseq@xclip@axisgap{0.1cm}, - y axis clip padding/.sseq store in=\sseq@yclip@axisgap{0.1cm}, + x axis clip padding/.sseq store dimen in=\sseq@xclip@axisgap{0.1cm}, + y axis clip padding/.sseq store dimen in=\sseq@yclip@axisgap{0.1cm}, axes clip padding/.sseq x y alias=axis clip padding, - right clip padding/.sseq store in=\sseq@clip@padding@right{0.1cm}, - left clip padding/.sseq store in=\sseq@clip@padding@left{0.4cm}, - top clip padding/.sseq store in=\sseq@clip@padding@top{0.1cm}, - bottom clip padding/.sseq store in=\sseq@clip@padding@bottom{0.4cm} + right clip padding/.sseq store dimen in=\sseq@clip@padding@right{0.1cm}, + left clip padding/.sseq store dimen in=\sseq@clip@padding@left{0.1cm}, + top clip padding/.sseq store dimen in=\sseq@clip@padding@top{0.1cm}, + bottom clip padding/.sseq store dimen in=\sseq@clip@padding@bottom{0.1cm} } %%% @@ -1445,6 +1750,9 @@ \sseq@addtostorelist\sseq@globalrotatetransform{} \sseq@addtostorelist\sseq@globalscaletransform{} +\sseq@addtostorelist\sseq@xscale{1} +\sseq@addtostorelist\sseq@yscale{1} + \def\sseq@globaldetoneoption#1#2{% \ifsseq@globaldetone\else \sseq@error@n{det-one-after-scale}{#2} @@ -1454,7 +1762,7 @@ } \def\sseq@globalscaleoption#1{% \sseq@globaldetonefalse - \@xp\gdef\@xp\sseq@globalscaletransform\@xp{\sseq@globalscaletransform#1}#1% + \@xp\gdef\@xp\sseq@globalscaletransform\@xp{\sseq@globalscaletransform#1}% } \pgfqkeys{/sseqpages/global}{% x/.sseq @ illegal, @@ -1481,28 +1789,44 @@ mirror/.forward to=/sseqpages/global/xmirror, mirror/.forward to=/sseqpages/global/ymirror, xscale/.code={% - \pgfmathparse{int(#1-1)}% - \ifnum\pgfmathresult<\z@% + \sseq@ifpgfmathexpr{int(#1-1)}{}{ + \sseq@error@nn{invalid-scale}{x}{#1}% + \sseq@break + } + \ifpgfmathunitsdeclared + \sseq@error@nn{unit-scale}{x}{#1}% + \sseq@break + \fi + \ifnum\sseq@mathresult<\z@ \sseq@error@nn{negative-scale}{x}{#1}% + \sseq@break \fi - \sseq@globalscaleoption{\pgftransformxscale{#1}}% + \sseq@globalscaleoption{\pgfsetxvec{\pgfpointxy{#1}{0}}} + \pgfmathparse{\sseq@xscale*#1} + \edef\sseq@xscale{\pgfmathresult} + \sseq@breakpoint }, xscale/.value required, yscale/.code={% - \pgfmathparse{int(#1-1)}% - \ifnum\pgfmathresult<\z@ + \sseq@ifpgfmathexpr{int(#1-1)}{}{ + \sseq@error@nn{invalid-scale}{y}{#1}% + \sseq@break + } + \ifpgfmathunitsdeclared + \sseq@error@nn{unit-scale}{y}{#1}% + \sseq@break + \fi + \ifnum\sseq@mathresult<\z@ \sseq@error@nn{negative-scale}{y}{#1}% + \sseq@break \fi - \sseq@globalscaleoption{\pgftransformyscale{#1}}% + \sseq@globalscaleoption{\pgfsetyvec{\pgfpointxy{0}{#1}}} + \pgfmathparse{\sseq@yscale*#1} + \edef\sseq@yscale{\pgfmathresult} + \sseq@breakpoint }, yscale/.value required, - scale/.code={% - \pgfmathparse{int(#1-1)}% - \ifnum\pgfmathresult<\z@ - \sseq@error@nn{negative-scale}{}{#1}% - \fi - \sseq@globalscaleoption{\pgftransformscale{#1}}% - }, + scale/.sseq x y alias=#1scale, scale/.value required } @@ -1520,11 +1844,11 @@ x/.code={\sseq@error@n{option-illegal}{#1}}, y/.code={\sseq@error@n{option-illegal}{#1}}, z/.code={\sseq@error@n{option-illegal}{#1}}, - xshift/.sseq @ second pass code={\sseq@shifttransform{x}{#1}}, % I don't know why it has to be this way, - xshift/.sseq @ first pass append code={\sseq@firstpass@shifttransform{x}{#1}}, % but it definitely breaks if I change it... + xshift/.sseq @ first pass code=\sseq@tikz@firstpass@checkshifttransform{x}{#1}, + yshift/.sseq @ first pass code=\sseq@tikz@firstpass@checkshifttransform{y}{#1}, + xshift/.append code=\sseq@options@scopeshiftsecondpass{\sseq@tikz@shifttransform{x}{#1}},%% Note special scopeshiftsecondpass command + yshift/.append code=\sseq@options@scopeshiftsecondpass{\sseq@tikz@shifttransform{y}{#1}},%% xshift/.value required, - yshift/.sseq @ second pass code={\sseq@shifttransform{y}{#1}}, - yshift/.sseq @ first pass append code={\sseq@firstpass@shifttransform{y}{#1}}, yshift/.value required, shift/.sseq @ transform, shift/.value required, shift only/.sseq @ transform, @@ -1541,7 +1865,6 @@ transform canvas/.sseq @ transform, transform canvas/.value required } -% These two should be exactly the same \def\sseq@shift@firstpassprocess#1{\sseq@shift@firstpassprocess@#1\sseq@nil} \def\sseq@shift@firstpassprocess@#1#2\sseq@nil{\ifx#1\pgfpointxy\sseq@shift@firstpassprocess@@#2\else\sseq@standardparse\fi} \def\sseq@shift@firstpassprocess@@#1#2{ @@ -1556,6 +1879,15 @@ \sseq@tikz@shifttransform{y}{#2} } +% special second pass handler for scopes to prevent shifts from causing out of memory style errors, +% see the longer comment at the definition of sseq@scope in main.code.tex +\def\sseq@options@scopeshiftsecondpass{\sseq@options@secondpass} + +\sseq@pgfqkeysdirlist{/sseqpages/scope,/sseqpages/tikz primitives,/sseqpages,/sseqpages/label,/sseqpages/class/label}{ + align/.sseq @ second pass code=\tikzset{align/#1}, + align/.sseq @ first pass append code={\sseq@needstikztrue\def\sseq@classquotes@smugglehook@inner{\sseq@needstikztrue\tikzset{align/#1}}} +} + \sseq@pgfqkeysdirlist{/sseqpages/scope,/sseqpages/tikz primitives}{ shift/.code={ \sseq@options@firstpass{\tikz@scan@one@point\sseq@shift@firstpassprocess#1\relax} @@ -1563,8 +1895,8 @@ }, xshift/.sseq @ first pass code=\sseq@tikz@firstpass@checkshifttransform{x}{#1}, yshift/.sseq @ first pass code=\sseq@tikz@firstpass@checkshifttransform{y}{#1}, - xshift/.sseq @ second pass append code=\sseq@tikz@shifttransform{x}{#1}, - yshift/.sseq @ second pass append code=\sseq@tikz@shifttransform{y}{#1}, + xshift/.append code=\sseq@options@scopeshiftsecondpass{\sseq@tikz@shifttransform{x}{#1}},%% Note special scopeshiftsecondpass command + yshift/.append code=\sseq@options@scopeshiftsecondpass{\sseq@tikz@shifttransform{y}{#1}},%% rotate around/.sseq @ second pass code={\sseq@standardparse\sseq@pgfkeysdocommand{rotate}{#1}}, rotate/.sseq @ stdparse do transform, rotate/.value required, xslant/.sseq @ stdparse do transform, xslant/.value required, @@ -1589,7 +1921,7 @@ \let\sseq@firstpass@shifttransform\sseq@firstpass@checkshifttransform \def\sseq@checkshifttransform#1#2{% - \pgfmathparse{#2}% + \pgfmathparse{(#2)}% \sseq@ifpgfmathresultisunitlessint{% \@xp\pgfmathint\@xp{\pgfmathresult}% \@xp\advance\csname sseq@#1\endcsname\pgfmathresult\relax @@ -1619,7 +1951,7 @@ \sseq@ifpgfmathresultisunitlessint{% \@xp\pgfmathint\@xp{\pgfmathresult}% \@xp\advance\csname sseq@\sseq@getfirstchar#1\sseq@nil\endcsname\pgfmathresult\relax - \sseq@pgfkeysdocommand{#1shift}{#2cm} + \sseq@pgfkeysdocommand{#1shift}{#2cm*\csname sseq@#1scale\endcsname} }{ \sseq@standardparse \ifpgfmathunitsdeclared diff --git a/Master/texmf-dist/tex/latex/spectralsequences/sseqloadstore.code.tex b/Master/texmf-dist/tex/latex/spectralsequences/sseqloadstore.code.tex index e86a1baf071..a72988b39dc 100644 --- a/Master/texmf-dist/tex/latex/spectralsequences/sseqloadstore.code.tex +++ b/Master/texmf-dist/tex/latex/spectralsequences/sseqloadstore.code.tex @@ -1,8 +1,8 @@ %% -%% Package: spectralsequences.sty version 1.0 +%% Package: spectralsequences v1.1.0 %% Author: Hood Chatham %% Email: hood@mit.edu -%% Date: 2017-06-18 +%% Date: 2017-08-02 %% License: Latex Project Public License %% %% File: sseqloadstore.code.tex @@ -21,6 +21,7 @@ \sseq@x@addto@macro\sseq@storelist@setdefaults{\global\let\@nx#1\@xp\@nx\csname \sseq@macroname#1@default\endcsname}% \@xp\gdef\csname\sseq@macroname#1@default\endcsname{#2}% } +% TODO: is this used? \def\sseq@addtostorelistlet#1#2{% \sseq@g@addto@macro\sseq@storelist{\\#1}% \sseq@x@addto@macro\sseq@storelist@setdefaults{\global\let\@nx#1\@xp\@nx\csname \sseq@macroname#1@default\endcsname}% @@ -68,7 +69,6 @@ \global\@xp\let\csname pgfk@#1/.@body\@xp\endcsname\csname pgfk@#1/.@body@@@\sseq@thename\endcsname } - \def\sseq@storecmds{\let\\\sseq@storelist@store\let\sseq@storelistif\sseq@storelistif@store\let\sseq@storelistkey\sseq@storelistkey@store\sseq@storelist} \def\sseq@getcmds{\let\\\sseq@storelist@get\let\sseq@storelistif\sseq@storelistif@get\let\sseq@storelistkey\sseq@storelistkey@get\sseq@storelist} @@ -82,18 +82,19 @@ \def\sseq@obj@xdef#1{\@xptwo\xdef\sseq@obj{#1}} \def\sseq@obj@protectedxdef#1{\@xptwo\sseq@protected@xdef\sseq@obj{#1}} \def\sseq@obj@xodef#1{\@xp\gdef\csname \sseq@obj@fullname{#1}\@xp\endcsname\@xp} -\def\sseq@obj@let#1{\@xptwo\let\sseq@obj{#1}} +\def\sseq@obj@let#1{\@xptwo\let\sseq@obj{#1}} % This shouldn't be used anywhere because all object assignments should be global... +\def\sseq@obj@glet#1{\global\@xptwo\let\sseq@obj{#1}} \def\sseq@obj@gletcsname#1#2{\global\@xp\let\csname\sseq@obj@fullname{#1}\@xp\endcsname\csname#2\endcsname} \def\sseq@obj@gletobj#1#2{\global\@xp\let\csname\sseq@obj@fullname{#1}\@xp\endcsname\csname\sseq@obj@fullname{#2}\endcsname} -\def\sseq@obj@undef#1{\@xptwo\let\sseq@obj{#1}\relax} +\def\sseq@obj@undef#1{\global\@xptwo\let\sseq@obj{#1}\relax} \def\sseq@obj@show#1{\@xptwo\show\sseq@obj{#1}} \def\sseq@obj@ifundef#1{\@ifundefined{\sseq@obj@fullname{#1}}} \def\sseq@obj@ifdef#1#2#3{\@ifundefined{\sseq@obj@fullname{#1}}{#3}{#2}} +\def\sseq@obj@useifdef@else#1#2{\@ifundefined{\sseq@obj@fullname{#1}}{#2}{\sseq@obj{#1}}} \def\sseq@obj@inc#1{\bgroup\sseq@tempcount\sseq@obj{#1}\relax\advance\sseq@tempcount\@ne\sseq@obj@xdef{#1}{\the\sseq@tempcount}\egroup} -\def\sseq@obj@gaddto{\@xptwo\sseq@g@addto@macro\sseq@obj} -\def\sseq@obj@xaddto{\@xptwo\sseq@x@addto@macro\sseq@obj} -\def\sseq@obj@xaddto{\@xptwo\sseq@x@addto@macro\sseq@obj} -\def\sseq@obj@xoaddto#1{\@xp\sseq@g@addto@macro\csname \sseq@obj@fullname{#1}\@xp\endcsname\@xp} +\def\sseq@obj@gaddto#1{\sseq@obj@ifundef{#1}{\sseq@obj@gdef{#1}}{\@xptwo\sseq@g@addto@macro\sseq@obj{#1}}} +\def\sseq@obj@xaddto#1{\sseq@obj@ifundef{#1}{\sseq@obj@xdef{#1}}{\@xptwo\sseq@x@addto@macro\sseq@obj{#1}}} +\def\sseq@obj@xoaddto#1{\sseq@obj@ifundef{#1}{\sseq@obj@xodef{#1}}{\@xp\sseq@g@addto@macro\csname \sseq@obj@fullname{#1}\@xp\endcsname\@xp}} \def\sseq@obj@map#1#2{\def\\##1{#2}\sseq@obj{#1}} @@ -126,6 +127,7 @@ \def\sseq@savedpaths@addclass@standard#1{\sseq@x@addto@macro\sseq@savedpaths{\@nx\sseq@class@draw@ifpage{#1}}} \def\sseq@savedpaths@adddifferential@standard#1{\sseq@x@addto@macro\sseq@savedpaths{\@nx\sseq@differential@draw@ifpage{#1}}} \def\sseq@savedpaths@addstructline@standard#1{\sseq@x@addto@macro\sseq@savedpaths{\@nx\sseq@structline@draw@ifpage{#1}}} +\def\sseq@savedpaths@xaddtikzpath@standard#1{\sseq@x@addto@macro\sseq@savedpaths{#1}} \def\sseq@savedpaths@add@standard{\sseq@g@addto@macro\sseq@savedpaths} \def\sseq@savedpaths@xadd@standard{\sseq@x@addto@macro\sseq@savedpaths} \def\sseq@savedpaths@show@standard{\show\sseq@savedpaths} @@ -134,6 +136,7 @@ \def\sseq@savedpaths@addclass@temporary#1{\sseq@x@addto@macro\sseq@tempsavedpaths{\@nx\sseq@class@draw@ifpage{#1}}} \def\sseq@savedpaths@adddifferential@temporary#1{\sseq@x@addto@macro\sseq@tempsavedpaths{\@nx\sseq@differential@draw@ifpage{#1}}} \def\sseq@savedpaths@addstructline@temporary#1{\sseq@x@addto@macro\sseq@tempsavedpaths{\@nx\sseq@structline@draw@ifpage{#1}}} +\def\sseq@savedpaths@xaddtikzpath@temporary#1{\sseq@x@addto@macro\sseq@tempsavedpaths{#1}} \def\sseq@savedpaths@add@temporary{\sseq@g@addto@macro\sseq@tempsavedpaths} \def\sseq@savedpaths@xadd@temporary{\sseq@x@addto@macro\sseq@tempsavedpaths} \def\sseq@savedpaths@show@temporary{\show\sseq@tempsavedpaths} @@ -143,6 +146,7 @@ \def\sseq@savedpaths@addclass@background#1{\sseq@error@internal@n{illegal-add-background-mode}{\sseq@savedpaths@addclass}} \def\sseq@savedpaths@adddifferential@background#1{\sseq@error@internal@n{illegal-add-background-mode}{\sseq@savedpaths@adddifferential}} \def\sseq@savedpaths@addstructline@background#1{\sseq@error@internal@n{illegal-add-background-mode}{\sseq@savedpaths@addstructline}} +\def\sseq@savedpaths@xaddtikzpath@background#1{\sseq@x@addto@macro\sseq@savedbackgroundpaths{#1}} \def\sseq@savedpaths@add@background{\sseq@g@addto@macro\sseq@savedbackgroundpaths} \def\sseq@savedpaths@xadd@background{\sseq@x@addto@macro\sseq@savedbackgroundpaths} \def\sseq@savedpaths@show@background{\show\sseq@savedbackgroundpaths} @@ -150,6 +154,7 @@ \def\sseq@savedpaths@addclass@ignore#1{} \def\sseq@savedpaths@adddifferential@ignore#1{} \def\sseq@savedpaths@addstructline@ignore#1{} +\def\sseq@savedpaths@xaddtikzpath@ignore#1{} \def\sseq@savedpaths@add@ignore#1{} \def\sseq@savedpaths@xadd@ignore#1{} \def\sseq@savedpaths@show@ignore#1{} @@ -159,6 +164,7 @@ \@xp\let\@xp\sseq@savedpaths@addclass \csname sseq@savedpaths@addclass@#1\endcsname \@xp\let\@xp\sseq@savedpaths@adddifferential\csname sseq@savedpaths@adddifferential@#1\endcsname \@xp\let\@xp\sseq@savedpaths@addstructline \csname sseq@savedpaths@addstructline@#1\endcsname + \@xp\let\@xp\sseq@savedpaths@xaddtikzpath \csname sseq@savedpaths@xaddtikzpath@#1\endcsname \@xp\let\@xp\sseq@savedpaths@add \csname sseq@savedpaths@add@#1\endcsname \@xp\let\@xp\sseq@savedpaths@xadd \csname sseq@savedpaths@xadd@#1\endcsname \pgfutil@ifundefined{sseq@scope@savedpaths@add@#1}{}{% @@ -167,9 +173,14 @@ }% } -\def\sseq@usesavedpaths{% - \sseq@savedpaths - \sseq@clearchangestyles - \sseq@tempsavedpaths - \gdef\sseq@tempsavedpaths{}% -}
\ No newline at end of file +% We don't want to add anything to paths except for tikz paths in background mode +% We need to draw those because they might affect the bounding box. +\def\sseq@setsavedpaths@draftmode{ + \sseq@setsavedpaths{ignore} % Don't add stuff to paths + % Only add tikzpaths if in background mode (so ignore in standard or temporary) + \let\sseq@savedpaths@xaddtikzpath@standard\@gobble + \let\sseq@savedpaths@xaddtikzpath@temporary\@gobble + % Only update mode for tikzpath + \def\sseq@setsavedpaths##1{\@xp\let\@xp\sseq@savedpaths@xaddtikzpath \csname sseq@savedpaths@xaddtikzpath@##1\endcsname} +} + diff --git a/Master/texmf-dist/tex/latex/spectralsequences/sseqmacromakers.code.tex b/Master/texmf-dist/tex/latex/spectralsequences/sseqmacromakers.code.tex index 1a89dc4b66a..b6ec7c5ec46 100644 --- a/Master/texmf-dist/tex/latex/spectralsequences/sseqmacromakers.code.tex +++ b/Master/texmf-dist/tex/latex/spectralsequences/sseqmacromakers.code.tex @@ -1,8 +1,8 @@ %% -%% Package: spectralsequences.sty version 1.0 +%% Package: spectralsequences v1.1.0 %% Author: Hood Chatham %% Email: hood@mit.edu -%% Date: 2017-06-18 +%% Date: 2017-08-02 %% License: Latex Project Public License %% %% File: sseqmacromakers.code.tex @@ -25,17 +25,6 @@ %%% Install user commands % copy commands into user namespace by removing sseq@ prefixes % given a list of commands, \let\thiscommand\sseq@thiscommand on each one - -\def\sseq@recordmacros{\@xp\sseq@recordmacros@\sseq@macrolist\sseq@nil} -\def\sseq@recordmacros@#1{% - \ifx#1\sseq@nil\else % if so, that was the last command in the list - \@xp\def\csname sseq@builtin\sseq@macroname#1\endcsname{} - \@xp\sseq@recordmacros@ - \fi % -} - - - \def\sseq@installmacros{\@xp\sseq@installmacros@\sseq@macrolist\sseq@nil} \def\sseq@installmacros@#1{% \ifx#1\sseq@nil\else % if so, that was the last command in the list @@ -44,28 +33,74 @@ \fi % } - % Capital U argument type is "Until" but puts back the token when it's done. -\cs_new_protected:Npn \sseq__xparse_add_type_U:w #1 - { - \__xparse_flush_m_args: - \__xparse_add_grabber_mandatory:N U - \tl_put_right:Nn \l__xparse_signature_tl { {#1} } - \__xparse_prepare_signature:N - } - -\cs_new_protected:Npn \sseq__xparse_grab_U:w #1#2 \l__xparse_args_tl - { \sseq__xparse_grab_U_aux:nnN {#1} {#2} \cs_set_protected_nopar:Npn } - -\cs_new_protected:Npn \sseq__xparse_grab_U_aux:nnN #1#2#3 - { - \exp_after:wN #3 \l__xparse_fn_tl ##1 #1 + +% So xparse changed a bunch between the copy pushed to CTAN on February 7th and the copy pushed on February 9th +\@ifpackagelater{xparse}{2017/02/08}{ + \ifsseq@patchxparseU + % NEW CODE + \cs_new_protected:Npn \sseq__xparse_grab_U:w #1#2 \__xparse_run_code: + { \sseq__xparse_grab_U_aux:nnN {#1} {#2} \cs_set_protected_nopar:Npn } + \cs_new_protected:Npn \sseq__xparse_grab_U_aux:nnN #1#2#3 + { + \tl_set:Nn \l__xparse_signature_tl {#2} + \exp_after:wN #3 \l__xparse_fn_tl ##1 #1 + { \__xparse_add_arg:n {##1} #1 } + \l__xparse_fn_tl + } + \cs_new_protected:Npn \sseq__xparse_add_type_U:w #1 + { + \__xparse_flush_m_args: + \__xparse_add_default: + \__xparse_add_grabber_mandatory:N U + \tl_put_right:Nn \l__xparse_signature_tl { {#1} } + \__xparse_prepare_signature:N + } + \else + % Assumptions failed, so just make U give an error (this isn't such a big deal since we don't use it for \d anymore). + \cs_new_protected:Npn \sseq__xparse_add_type_U:w #1 + { + \sseq@error{U-xparse-incompatible} + } + \fi +}{ + % OLD CODE + \cs_new_protected:Npn \sseq__xparse_grab_U:w #1#2 \l__xparse_args_tl + { \sseq__xparse_grab_U_aux:nnN {#1} {#2} \cs_set_protected_nopar:Npn } + \cs_new_protected:Npn \sseq__xparse_grab_U_aux:nnN #1#2#3 + { + \exp_after:wN #3 \l__xparse_fn_tl ##1 #1 + { + \__xparse_add_arg:n {##1} + #2\l__xparse_args_tl #1 + } + \l__xparse_fn_tl + } + \cs_new_protected:Npn \sseq__xparse_add_type_U:w #1 { - \__xparse_add_arg:n {##1} - #2\l__xparse_args_tl #1 + \__xparse_flush_m_args: + \__xparse_add_grabber_mandatory:N U + \tl_put_right:Nn \l__xparse_signature_tl { {#1} } + \__xparse_prepare_signature:N } - \l__xparse_fn_tl - } +}% END \@ifpackagelater + + +\cs_new_protected:Npn \sseq__xparse_normalize_type_U:w #1 { + \quark_if_recursion_tail_stop_do:nn {#1} { \__xparse_bad_arg_spec:wn } + \__xparse_normalize_check_lu:N U + \__xparse_add_arg_spec:n { U {#1} } + \int_incr:N \l__xparse_mandatory_args_int + \tl_clear:N \l__xparse_last_delimiters_tl + \__xparse_normalize_arg_spec_loop:n +} + +% Expandable commands are a menace to us because they define a bunch of helper commands that we then have to keep track of. +% We are too lazy to do this, so force \l__xparse_grab_expandably_bool to be false. +% This is backwards compatible (I think) because \bool_set_false:N just performs a chardef (no existence check) +% so in old versions, \l__xparse_grab_expandably_bool will be created harmlessly. +\let\sseq__xparse_prepare_signature:n\__xparse_prepare_signature:n +\pretocmd\sseq__xparse_prepare_signature:n { \bool_set_false:N \l__xparse_grab_expandably_bool } {}{\error} % I would like to patch the \__xparse_grab_U:w's in my commands into \sseq__xparse_grab_U:w's but I can't because of -NoValue-. \def\sseq@install@xparse@Uarggrabber{ \cs_set_eq:NN \__xparse_grab_U:w \sseq__xparse_grab_U:w } @@ -77,10 +112,15 @@ % so the result is that it defines \sseq@somecommand intended to be \let to \somecommand later. \cs_new_protected:Npn\sseq@DeclareDocumentCommand#1{% - \exp_args:Nc \sseq@DeclareDocumentCommandAs { sseq @ \cs_to_str:N #1 }#1 + \exp_args:Nc \sseq@DeclareDocumentCommandAs@setinputline { sseq @ \cs_to_str:N #1 }#1 +} + +\cs_new_protected:Npn\sseq@DeclareDocumentCommandAs@setinputline#1{ + \protected\edef #1 { \@nx\sseq@setinputline \@xp\@nx\csname \cs_to_str:N #1 @@unique@@ start \endcsname } + \exp_args:Nc \sseq@DeclareDocumentCommandAs { \cs_to_str:N #1 @@unique@@ start } } -%%% \sseq@DeclareDocumentCommandAS +%%% \sseq@DeclareDocumentCommandAs % % #1 - the command to define % #2 - the command to use in argument parsing errors @@ -89,13 +129,12 @@ % % See my stack exchange question: https://tex.stackexchange.com/questions/350596/control-error-messages-made-by-commands-defined-with-newdocumentcommand - - \cs_new_protected:Npn\sseq@DeclareDocumentCommandAs#1#2#3#4{ \group_begin: \cs_set_eq:NN \__xparse_add_type_U:w \sseq__xparse_add_type_U:w - \cs_set_eq:cN { tempsave_ \cs_to_str:N #2 } #2 % Store the original value of #2 - \cs_set_eq:cc { tempsave_ \cs_to_str:N #2 \c_space_tl code } { \cs_to_str:N #2 \c_space_tl code } % Store the original value of #2 + \cs_set_eq:NN \__xparse_normalize_type_U:w \sseq__xparse_normalize_type_U:w + \cs_set_eq:NN \__xparse_prepare_signature:n \sseq__xparse_prepare_signature:n + %\cs_set:Npn \__xparse_declare_cmd_code:Nnn {\bool_set_false:N \l__xparse_grab_expandably_bool\__xparse_declare_cmd_code_aux:Nnn} \sseq@installmsghooks \def\sseq@error@setup{} \def\sseq@error@cleanup{\sseq@errortrue} @@ -109,16 +148,25 @@ \cs_if_exist:cTF{ \cs_to_str:N #2 \c_space_tl code }{ \cs_gset:Npx #1{ \begingroup + \exp_not:N \cs_set_eq:NN % force xparse to always ignore spaces! + \exp_not:N \peek_meaning:NTF + \exp_not:N \peek_meaning_ignore_spaces:NTF + \exp_not:N \cs_set_eq:NN % force xparse to always ignore spaces! + \exp_not:N \peek_meaning_remove:NTF + \exp_not:N \peek_meaning_remove_ignore_spaces:NTF + % Not sure why we use set_eq:cc and exp_not:n here but I'm concerned that something will break if I change it... + \exp_not:N \cs_set_eq:cc + \exp_not:n {{ \cs_to_str:N #2 \c_space_tl code }} + \exp_not:n {{ \cs_to_str:N #1 \c_space_tl code }} \exp_not:N \cs_set_eq:NN - \exp_not:c { \cs_to_str:N #2 \c_space_tl code } - \exp_not:c { \cs_to_str:N #1 \c_space_tl code } + \exp_not:c { \cs_to_str:N #2 \c_space_tl } + \exp_not:c { \cs_to_str:N #1 \c_space_tl } \exp_not:c { \cs_to_str:N #1 \c_space_tl inner } } - \pretocmd:cnnn { \cs_to_str:N #2 \c_space_tl code } { \endgroup } { } { \sseq@error@x { macro-patch-failed } { \string#1 } } + \pretocmd:cnnn { \cs_to_str:N #2 \c_space_tl code } { \endgroup{} } { } { \sseq@error@x { macro-patch-failed } { \string#1 } } \cs_gset_eq:cN { \cs_to_str:N #1 \c_space_tl inner } #2 \cs_gset_eq:cc { \cs_to_str:N #1 \c_space_tl code } { \cs_to_str:N #2 \c_space_tl code } - \cs_gset_eq:Nc #2 { tempsave _ \cs_to_str:N #2 } - \cs_gset_eq:cc { \cs_to_str:N #2 \c_space_tl code } { tempsave_ \cs_to_str:N #2 \c_space_tl code } + \cs_gset_eq:cc { \cs_to_str:N #1 \c_space_tl }{ \cs_to_str:N #2 \c_space_tl } % sometimes the new version of xparse stores stuff in #2<space> }{ \cs_gset_eq:NN #1 #2 } @@ -135,7 +183,8 @@ \cs_new_protected:Npn\NewSseqCommand#1{% \cs_if_free:cTF { sseq @ usermacro @ \cs_to_str:N #1 } { \DeclareSseqCommand#1 } { \sseq@error@x{usermacro-not-free}{\string#1} \use_none:nn } } - +\let\begingroupa\begingroup +\let\begingroupb\begingroup \cs_new_protected:Npn\DeclareSseqCommand#1#2#3{% \cs_if_exist:cTF { sseq @ builtin @ \cs_to_str:N #1 } {\sseq@error@x{wont-override-system-macro}{\string#1}\sseq@break} {} \cs_if_free:cT { sseq @ usermacro @ \cs_to_str:N #1 } { @@ -143,8 +192,10 @@ } % Make sure \cs_if_exist doesn't pass because there was a previously defined user macro with same name \cs_undefine:c { sseq @ usermacro @ \cs_to_str:N #1 \c_space_tl code } - \exp_args:Nc \sseq@DeclareDocumentCommandAs { sseq @ usermacro @ \cs_to_str:N #1 } #1 { #2 } { - #3 + \exp_args:Nc \sseq@DeclareDocumentCommandAs@setinputline { sseq @ usermacro @ \cs_to_str:N #1 } #1 { #2 } {% + \sseq@loadinputline + \sseq@atbeginusermacro@msgsetup + {}#3{} % prevent space patching space hazards with these {}'s \endgroup }% \ifsseq@error @@ -155,22 +206,22 @@ % You might think we could skip this patching, and it's probably possible. % However, this is responsible for turning the #'s of catcode other into #'s of catcode arg. I don't have as good of a way to do that. % Also, this allows me to use \sseq@parseargspec after defining the command, so I don't have to run any error checking inside of it - % because if the argspec is invalid, \DeclareDocumentCommand will let me know. - \cs_if_exist:cTF{ sseq @ usermacro @ \cs_to_str:N #1 \c_space_tl code }{ - \patchcmd:cnfnn{ sseq @ usermacro @ \cs_to_str:N #1 \c_space_tl code }{\endgroup}{ + % because if the argspec is invalid, \DeclareDocumentCommand will let me know.\sseq@temptoks + \cs_if_exist:cTF{ sseq @ usermacro @ \cs_to_str:N #1 @@unique@@ start \c_space_tl code }{ + \patchcmd:cnfnn{ sseq @ usermacro @ \cs_to_str:N #1 @@unique@@ start \c_space_tl code }{\endgroup{}}{ \@xp\endgroup - \@xp\begingroup + \@xp\begingroupa \the\sseq@temptoks - \sseq@atbeginusermacro@msgsetup - }{}{\error\sseq@error@x{usermacro-failed-patch}{\string#1}} + }{}{\sseq@error@x{usermacro-failed-patch}{\string#1}} + \cs_gset_eq:cc { sseq @ usermacro @ \cs_to_str:N #1 @@unique@@ start \c_space_tl code } { sseq @ usermacro @ \cs_to_str:N #1 @@unique@@ start \c_space_tl code} }{ - \pretocmd:cfnn{ sseq @ usermacro @ \cs_to_str:N #1 }{ - \@xp\begingroup + \pretocmd:cfnn{ sseq @ usermacro @ \cs_to_str:N #1 @@unique@@ start }{ + \@xp\begingroupb \the\sseq@temptoks - \sseq@atbeginusermacro@msgsetup - }{}{\error\sseq@error@x{usermacro-failed-patch}{\string#1}} + }{}{\sseq@error@x{usermacro-failed-patch}{\string#1}} } \cs_gset_eq:cc { sseq @ usermacro @ \cs_to_str:N #1 } { sseq @ usermacro @ \cs_to_str:N #1 } + \cs_gset_eq:cc { sseq @ usermacro @ \cs_to_str:N #1 @@unique@@ start } { sseq @ usermacro @ \cs_to_str:N #1 @@unique@@ start} \ifsseq@inprogress \cs_set_eq:Nc #1 { sseq @ usermacro @ \cs_to_str:N #1 } \fi @@ -178,12 +229,6 @@ } %%% Commands to help the user define "groups" of commands to be reused -\def\sseqnewgroup@splitcoord#1,#2\sseq@nil{% - \sseq@eval{ - \@nx\begin{scope}[xshift=#1,yshift=#2,\unexpanded\@xp{\sseq@options}] - } -} - % #1 -- command % #2 -- argspec % #3 -- body of function (long) @@ -197,8 +242,7 @@ \long\def\DeclareSseqGroup@#1#2#3#4{% \group_begin: \let\sseq@parseargspec\@gobbletwo % Get rid of argparse so we can change what gets added for setting up thiscall - \sseq@temptoks\@xp{\sseq@SseqGroup@argspec} % This gets added to the outer command by DeclareSseqCommand -% +% why are we doing these things here? \sseq@installmsghooks \def\sseq@error@setup{} \def\sseq@error@cleanup{\sseq@errortrue} @@ -206,50 +250,64 @@ % % undefine so we can tell whether we need to patch \command<space>code or \command \cs_undefine:c { sseq @ usermacro @ \cs_to_str:N #2 @ helper \c_space_tl code } - \exp_args:Nc \DeclareDocumentCommand { sseq @ usermacro @ \cs_to_str:N #2 @ helper } { #3 } { - #4 + \exp_args:Nc \sseq@DeclareDocumentCommandAs { sseq @ usermacro @ \cs_to_str:N #2 @ helper } #2 { #3 } { + \sseq@loadinputline + \sseq@usermacro@esetthiscall{\the\sseq@groupthiscalltoks} + \sseq@atbeginusermacro@msgsetup % the stack push happens in here + \sseq@scopecall + {}#4{} \end{scope} + \endgroup }% \ifsseq@error \@xp\sseq@break \fi + \sseq@temptoks\@xp{\sseq@SseqGroup@argspec} % This gets added to the command by DeclareSseqCommand #1#2{od()}{% + %can't use \sseq@atbeginusermacro@msgsetup until next spot b/c don't know what the whole call looks like yet \IfNoValueTF{##1}{\def\sseq@options{}}{\def\sseq@options{##1}}% \IfNoValueTF{##2}{% - \sseq@eval{ - \@nx\begin{scope}[\unexpanded\@xp{\sseq@options}] - }% + \edef\sseq@scopecall{\@nx\begin{scope}[\unexpanded\@xp{\sseq@options}]} }{% \sseqnewgroup@splitcoord##2\sseq@nil }% - \csname sseq @ usermacro @ \sseq@macroname #2 @ helper \@xp\endcsname \@gobble % This gobble eats the endgroup added by sseqDeclareDocumentCommand + \csname sseq @ usermacro @ \sseq@macroname #2 @ helper \@xp\endcsname\@gobbletwo % This gobble eats the endgroup added by sseqDeclareDocumentCommand }% \sseq@parseargspec@newgroup{#2}{#3}% % You might think we could skip this patching, and it's probably possible. - % However, this is responsible for turning the #'s of catcode other into #'s of catcode arg. I don't have as good of a way to do that. + % However, this is responsible for turning the #'s of catcode other into #'s of catcode arg. I don't have as good of a way to do that. \cs_if_exist:cTF{ sseq @ usermacro @ \cs_to_str:N #2 @ helper \c_space_tl code }{ \pretocmd:cfnn { sseq @ usermacro @ \cs_to_str:N #2 @ helper \c_space_tl code }{ \the\sseq@temptoks - \sseq@atbeginusermacro@msgsetup - }{}{\error\sseq@error@x{usermacro-failed-patch}{\string#1}} - \cs_gset_eq:cc { sseq @ usermacro @ \cs_to_str:N #2 @ helper \c_space_tl code } { sseq @ usermacro @ \cs_to_str:N #2 @ helper \c_space_tl code } % globalize definition + }{}{\sseq@error@x{usermacro-failed-patch}{\string#1}} + % globalize definition: + \cs_gset_eq:cc { sseq @ usermacro @ \cs_to_str:N #2 @ helper \c_space_tl code } { sseq @ usermacro @ \cs_to_str:N #2 @ helper \c_space_tl code } }{ \pretocmd:cfnn { sseq @ usermacro @ \cs_to_str:N #2 @ helper }{ \the\sseq@temptoks - \sseq@atbeginusermacro@msgsetup - }{}{\error\sseq@error@x{usermacro-failed-patch}{\string#1}} + }{}{\sseq@error@x{usermacro-failed-patch}{\string#1}} } \cs_gset_eq:cc { sseq @ usermacro @ \cs_to_str:N #2 @ helper } { sseq @ usermacro @ \cs_to_str:N #2 @ helper } % globalize definition \let\sseq@parseargspec\sseq@parseargspec@normal \sseq@breakpoint \group_end: } -\let\sseqnewgroup\NewSseqGroup + +\def\sseqnewgroup@splitcoord#1,#2\sseq@nil{% + \edef\sseq@scopecall{ + \@nx\begin{scope}[xshift=#1,yshift=#2,\unexpanded\@xp{\sseq@options}] + } +} +\newtoks\sseq@groupargspectoks +\newtoks\sseq@groupthiscalltoks \bgroup\catcode`\#=12\relax - \gdef\sseq@SseqGroup@argspec{\sseq@eval{\sseq@temptoks{\IfNoValueF{#1}{\unexpanded{[#1]}}\IfNoValueF{#2}{\unexpanded{(#2)}}}}\@gobble} + \gdef\sseq@SseqGroup@argspec{ + \sseq@eval{\global\sseq@groupargspectoks{\IfNoValueF{#1}{\unexpanded{[#1]}}\IfNoValueF{#2}{\unexpanded{(#2)}}}} + \@gobbletwo + } \gdef\sseq@thearg{#\the\sseq@tempcount} \egroup @@ -271,7 +329,18 @@ \sseq@temptoks{} \sseq@temptoksii{}% \sseq@parseargspec@#2\sseq@nil - \sseq@eval{\sseq@temptoks{\the\sseq@temptoksii\@nx\sseq@usermacro@esetthiscall{\@nx\@nx\@nx#1\@nx\the\sseq@temptoks\the\sseq@temptoks}}} + % What's the second temptoks for? + \sseq@eval{ + \sseq@temptoks{ + \the\sseq@temptoksii + \@nx\sseq@esetthiscall{ + \@nx\@nx\@nx#1 + \@nx\the\sseq@groupargspectoks + \the\sseq@temptoks + } + \global\sseq@groupthiscalltoks\@nx\@xp{\@nx\the\sseq@thiscalltoks} + } + } } @@ -308,6 +377,8 @@ } } +% v, E, and e are illegal + % Mandatory \def\sseq@parseargspec@m{% \sseq@e@addto@temptoks{{\@nx\unexpanded{\sseq@thearg}}} @@ -360,7 +431,7 @@ \sseq@parseargspec@ } - +% Optional with default \def\sseq@parseargspec@O#1{ \sseq@parseargspec@setargdefault{#1}% @@ -383,7 +454,6 @@ \sseq@parseargspec@ } - \ExplSyntaxOff -% +%
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex b/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex index edc87c5d2b0..b7dea7f4149 100644 --- a/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex +++ b/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex @@ -1,8 +1,8 @@ %% -%% Package: spectralsequences.sty version 1.0 +%% Package: spectralsequences v1.1.0 %% Author: Hood Chatham %% Email: hood@mit.edu -%% Date: 2017-06-18 +%% Date: 2017-08-02 %% License: Latex Project Public License %% %% File: sseqmain.code.tex @@ -16,14 +16,21 @@ %%% Environment definitions %%% %%%%%%% +\def\sseq@usesavedpaths{% + \sseq@savedpaths + \sseq@clearchangestyles + \sseq@tempsavedpaths + \gdef\sseq@tempsavedpaths{}% +} \sseq@addtostorelist\sseq@savedbackgroundpaths{} \sseq@addtostorelist\sseq@restorestyles{} -\def\sseqdata{\@ifnextchar[{\sseqdata@}{\sseqdata@[]}}%} - \def\sseq@page{\protect\sseq@thepage} + +\def\sseqdata{\@ifnextchar[{\sseqdata@}{\sseqdata@[]}}%} + \def\sseqdata@[#1]{% \edef\sseq@restorefont{\font@name} \selectfont\nullfont % Avoid space hazards! @@ -91,14 +98,18 @@ } \sseq@savedpaths@xadd{\sseq@stylelist} \sseq@savedpaths@add{\begingroup} % prevent some of the two-pass user macros horrors + \let\sseq@error@setup\sseq@error@setup@withinfo } % Just store all the settings \def\endsseqdata{ + \let\sseq@error@setup\sseq@error@setup@noinfo + \sseq@checkend{sseqdata} \sseq@savedpaths@add{\endgroup} % prevent some of the two-pass user macros horrors \xdef\sseq@restorestyles{\sseq@stylelist} \sseq@storecmds \ignorespacesafterend + \sseq@breakpoint } \def\sseqpage{\@ifnextchar[{\sseqpage@}{\sseqpage@[]}} %] @@ -118,11 +129,9 @@ \sseq@ispageenvtrue \def\sseq@sseqsetdirectory{/sseqpages} % - \let\sseq@xminmax\sseq@xminmax@active - \let\sseq@yminmax\sseq@yminmax@active - \ifsseq@mathnodes - \let\sseq@maybemathswitch=$\@gobble$ - \fi +% \ifsseq@mathnodes +% \let\sseq@maybemathswitch=$\@gobble$ +% \fi % % Copy commands into user namespace \sseq@installmacros @@ -176,28 +185,88 @@ \@xp\@nx\csname pgfk@/sseqpages/global/{\sseq@currentoptionpath} options/.@cmd\endcsname } \fi +% + \ifsseq@specifiedxrange + \let\sseq@xminmax\@gobbletwo + \else + \let\sseq@xminmax\sseq@xminmax@active + \fi + \ifsseq@specifiedyrange + \let\sseq@yminmax\@gobbletwo + \else + \let\sseq@yminmax\sseq@yminmax@active + \fi +% \sseq@savedpaths@xadd{\sseq@stylelist} \sseq@savedpaths@add{\begingroup} % prevent some of the two-pass user macros horrors \ifx\sseq@targetx\pgfutil@empty\else \sseq@hasdegreetrue \fi + \let\sseq@error@setup\sseq@error@setup@withinfo } % Here we do all of the work to actually print the page \def\endsseqpage{ + \let\sseq@error@setup\sseq@error@setup@noinfo + \sseq@checkend{sseqpage} \sseq@savedpaths@add{\endgroup} % prevent some of the two-pass user macros horrors +% + \sseq@xscalecm=\sseq@xscale cm + \sseq@yscalecm=\sseq@yscale cm +% +% check that range is okay +% \ifx\sseq@xmin\sseq@infinity\sseq@error{no-range}\def\sseq@xmin{0}\def\sseq@xmax{0}\@xp\sseq@break\fi % could be warning \ifx\sseq@ymin\sseq@infinity\sseq@error{no-range}\def\sseq@ymin{0}\def\sseq@ymax{0}\@xp\sseq@break\fi % + \ifnum\numexpr\sseq@xmax-\sseq@xmin\relax>\numexpr\maxdimen/\dimexpr1pt\relax-1\relax + \sseq@error@xx{range-super-overflow}{x} + {from \sseq@xmin\space to \sseq@xmax\space (xmax - xmin = \the\numexpr\sseq@xmax-\sseq@xmin)} + \@xp\sseq@break + \fi + \ifnum\numexpr\sseq@ymax-\sseq@ymin\relax>\numexpr\maxdimen/\dimexpr1pt\relax-1\relax + \sseq@error@xx{range-super-overflow}{y} + {from \sseq@ymin\space to \sseq@ymax\space (ymax - ymin = \the\numexpr\sseq@ymax-\sseq@ymin)} + \@xp\sseq@break + \fi +% + \sseq@tempdimen = \dimexpr \textwidth -\sseq@clip@padding@right - \sseq@xaxis@end@extend - \sseq@xaxis@start@extend - \sseq@yaxisgap \relax + \sseq@tempcount = \numexpr \sseq@tempdimen /\sseq@xscalecm \relax + \ifnum \numexpr\sseq@xmax-\sseq@xmin + 1 > \sseq@tempcount + \pgfmathparse{\sseq@tempdimen/1cm/(\sseq@xmax-\sseq@xmin+1)} + \sseq@error@xxxx{range-overflow}{x} + {from \sseq@xmin\space to \sseq@xmax\space (xmax - xmin = \the\numexpr\sseq@xmax-\sseq@xmin)} + {\the\sseq@tempcount}% max x range + {\pgfmathresult}% max xscale + \@xp\sseq@break + \fi +% + \sseq@tempdimen = \dimexpr \textheight - \sseq@clip@padding@top - \sseq@yaxis@end@extend - \sseq@yaxis@start@extend - \sseq@xaxisgap \relax + \sseq@tempcount = \numexpr \sseq@tempdimen /\sseq@yscalecm \relax + \ifnum \numexpr\sseq@ymax-\sseq@ymin +1 > \sseq@tempcount + \pgfmathparse{\sseq@tempdimen/1cm/(\sseq@ymax-\sseq@ymin+1)} + \sseq@error@xxxx{range-overflow}{y} + {from \sseq@ymin\space to \sseq@ymax\space (ymax - ymin = \the\numexpr\sseq@ymax-\sseq@ymin)} + {\the\sseq@tempcount}% max x range + {\pgfmathresult}% max xscale + \@xp\sseq@break + \fi +% + % Really this could be anything between -\sseq@xmin and -\sseq@xmax and it wouldn't matter. We'll split the difference. + \sseq@xoffset=\numexpr\sseq@intdivceiling{\numexpr-\sseq@xmin-\sseq@xmax\relax}{\numexpr4*\sseq@xgridstep\relax}*(2*\sseq@xgridstep)\relax + \sseq@yoffset=\numexpr\sseq@intdivceiling{\numexpr-\sseq@ymin-\sseq@ymax\relax}{\numexpr4*\sseq@ygridstep\relax}*(2*\sseq@ygridstep)\relax +% +% \tikzset{ z=0pt, every path/.style={}, every node/.style={} } \let\errmessage\sseq@errmessage@std + \sseq@setlayoutparameters \begin{tikzpicture}[/sseqpages/global/{default} options,\ifsseq@hasname/sseqpages/global/{\sseq@thename} options\fi,/sseqpages/global/{this page} options]% \sseq@sseqstyle@globalpart - \pgftransformreset + %\pgftransformreset \sseq@globaldetonetransform \sseq@globalscaletransform % @@ -205,32 +274,49 @@ \let\sseq@shifttransform\sseq@checkshifttransform % Allow shifts as long as they are by integers and have no units. % \sseq@setupclip +% + \sseq@patchtikzcoords +% \pgfonlayer{background}% % Axes labels only occur once per page, so the cost of typesetting them with tikz doesn't matter ... THANK GOD \ifx\sseq@title\pgfutil@empty\else \ifsseq@drawtitle - \sseq@eval{\unexpanded{\path (0.5*\xmin+0.5*\xmax,\ymax) node[ + \sseq@eval{\@nx\path (0,-\sseq@yoffset) node[ /sseqpages/global/every title, - above=\sseq@clip@padding@top+\sseq@yaxis@end@extend+10pt - ]} {\unexpanded\expandafter{\sseq@title}};} + above=\sseq@topclippadding+5pt + ] {\unexpanded\expandafter{\sseq@title}}; + } \fi \fi % Don't touch the shifts -- they are very persnickety. \ifx\sseq@xaxislabel\pgfutil@empty\else\ifsseq@drawxaxislabel - \sseq@eval{\noexpand\node[/sseqpages/global/every x axis label, yshift=-\sseq@xaxisgap-\sseq@yaxis@start@extend-10pt] {\unexpanded\expandafter{\sseq@xaxislabel}};} + \sseq@eval{\noexpand\node[ + align=center, + /sseqpages/global/every x axis label, + below, + shift={\sseq@xlabelposition}, + ] {\unexpanded\expandafter{\sseq@xaxislabel}};} \fi\fi \ifx\sseq@yaxislabel\pgfutil@empty\else\ifsseq@drawyaxislabel - \sseq@eval{\noexpand\node[/sseqpages/global/every y axis label,rotate=90,yshift=\sseq@yaxisgap+\sseq@xaxis@start@extend+10pt] {\unexpanded\expandafter{\sseq@yaxislabel}};} + \sseq@eval{\noexpand\node[ + align=center, + /sseqpages/global/every y axis label, + above, + rotate=90, + shift={\sseq@ylabelposition}, + ] {\unexpanded\expandafter{\sseq@yaxislabel}};} \fi\fi +% + \sseq@grid \sseq@handlexaxis % Draw the axis with pgf primitives. These are defined in sseqdrawing.code.tex \sseq@handleyaxis - \sseq@grid \endpgfonlayer % \ifsseq@mathnodes \tikzset{execute at begin node=$,execute at end node=$}% \fi %\let\sseq@error@setup\sseq@error@setup@withinfo +% \begingroup \sseq@savedbackgroundpaths \endgroup @@ -267,11 +353,18 @@ %%% Scope \newcount\sseq@scope@savestackid +\def\sseq@scope@secondpasstoks{} \def\sseq@scope{\@ifnextchar[{\sseq@scope@}{\sseq@scope@[]}}%] \def\sseq@scope@[#1]{% \sseq@scope@savedpaths@add{\begin{scope}}% + % This is a funky hack to fix a problem with shifts. On tmfass, if we don't handle shifts specially, we actually put so much stuff into + % this \sseq@scope@secondpasstoks macro that we exceed TeX's upper bound for the maximum total macro memory. Or something like that -- I don't understand the error, + % but it definitely only depends on how much stuff there is overall and on there being lots of scopes, not on any particular part of the diagram. + % Anyways, to avoid this excessive storage demand, we don't put the shifts into the scope toks and apply them tons of times, we just do them once. + \let\sseq@options@scopeshiftsecondpass\sseq@scope@savedpaths@add \sseq@processoptions{scope}{#1}% outputs into \sseq@savedoptioncode - \sseq@eval{\@nx\sseq@scope@savedpaths@add{\sseq@scope@toks{\unexpanded\@xp{\sseq@savedoptioncode\tikz@options}}}}% + \edef\sseq@scope@secondpasstoks{\unexpanded\@xp{\sseq@scope@secondpasstoks}\unexpanded\@xp{\sseq@savedoptioncode}} + \sseq@eval{\@nx\sseq@scope@savedpaths@add{\sseq@scope@toks{\unexpanded\@xp{\sseq@scope@secondpasstoks}}}}% %\advance\sseq@scope@savestackid\@ne %\sseq@savestack@name{scope@save\the\sseq@scope@savestackid} } @@ -284,25 +377,13 @@ \ifsseq@draftmode % Okay, have to dummy out all the main commands. - \sseq@setsavedpaths{ignore} % Don't add stuff to paths - \let\sseq@setsavedpaths\@gobble % and dummy out the normal mechanism that would change this - - % We don't really want to add anything to the saved paths, but the whole tikz parser is already loaded in parsers and we want to dummy a bit of it out. - % It's good to have the parser itself though, because it is responsible for sanity checking the structure of the input. Just get rid of the hard tasks - % the parser does once it's parsed the stuff. - \def\sseq@defer@tikzcommand@option[#1]{% - \sseq@g@addto@macro\sseq@whattheusersaid{[#1]}% - \sseq@defer@tikzcommand@ - } % These are the two expensive handlers, redefine them to do nothing. - \def\sseq@defer@tikzcommand@coord(#1){% - \sseq@g@addto@macro\sseq@whattheusersaid{(#1)}% - \sseq@defer@tikzcommand@ - } - - + % Only add tikz background paths to the savedpaths. We need to draw background paths because they might change the bounding box! + \sseq@setsavedpaths@draftmode +% % All we want to do here is record the range. Have to process options in order to figure out where it is. \sseq@DeclareDocumentCommand\class{or()}{% \begingroup + \sseq@loadinputline \IfNoValueT{#2}{\sseq@break}% \sseq@xsetthiscall{\string\class\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}% \sseq@options@firstpassmode @@ -317,13 +398,10 @@ \sseq@yminmax{\xcoord}{\ycoord}% \sseq@pushstack@\coord % also need the class stack to calculate other \class commands. \sseq@cleanup@obj{partcoord.(\partialcoord).numnodes}% - \sseq@cleanup@obj{partcoord.(\partialcoord).numnodespp}% \ifnum\nodenum=\@ne \sseq@obj@gdef{partcoord.(\partialcoord).numnodes}{0}% - \sseq@obj@gdef{partcoord.(\partialcoord).numnodespp}{1}% \fi \sseq@obj@xdef{partcoord.(\partialcoord).numnodes}{\nodenum}% - \sseq@obj@xdef{partcoord.(\partialcoord).numnodespp}{\the\numexpr\nodenum+1}% \edef\classname{class.\coord[0]}% \ifx\sseq@class@tag\pgfutil@empty\else \sseq@obj@ifdef{partcoord.(\partialcoord).tag.\sseq@class@tagprefix\sseq@class@tag}{% @@ -344,12 +422,11 @@ } % Now the rest of these can be no-ops - \sseq@DeclareDocumentCommand\classoptions{or()}{} - \sseq@DeclareDocumentCommand\replaceclass{or()}{} - \sseq@DeclareDocumentCommand\d{oU(r()d()}{} - \sseq@DeclareDocumentCommand\doptions{oU(r()d()}{} - \sseq@DeclareDocumentCommand\structline{or()r()}{} - \sseq@DeclareDocumentCommand\structlineoptions{or()r()}{} + \sseq@DeclareDocumentCommand\classoptions{od()}{} + \sseq@DeclareDocumentCommand\replaceclass{od()}{} + \def\sseq@d@main#1#2#3#4#5{} % makes both \d and \doptions do nothing + \sseq@DeclareDocumentCommand\structline{od()d()}{} + \sseq@DeclareDocumentCommand\structlineoptions{od()d()}{} \sseq@DeclareDocumentCommand\circleclasses{or()r()}{} \endinput \fi @@ -365,6 +442,7 @@ %%% \class, \classoptions, \replaceclass \sseq@DeclareDocumentCommand\class{or()}{% \begingroup + \sseq@loadinputline \IfNoValueT{#2}{\sseq@break} \sseq@xsetthiscall{\string\class\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}% \sseq@options@firstpassmode @@ -384,18 +462,33 @@ \sseq@error@xxxx{classpattern-too-many-classes}{(\partialcoord)}{\nodenum}{\sseq@classpattern}{\@xp\the\csname sseq@\sseq@classpattern @maxclasses\endcsname} \sseq@breakfi \fi - \sseq@processlabels +%%%% No more breaks after this point +% + \ifx\sseq@classinsert\empty + % by default, just insert to the right of previous classes + \edef\sseq@classinsert{\nodenum} + \else + \ifnum\sseq@classinsert<\z@ + % negative 1 is where we would normally insert things + \edef\sseq@classinsert{\the\numexpr\nodenum+\sseq@classinsert+1} + \fi + \ifnum\sseq@classinsert<\@ne + \def\sseq@classinsert{1} + \fi + \ifnum\sseq@classinsert>\nodenum\relax + \edef\sseq@classinsert{\nodenum} + \fi + \ifnum\nodenum>\@ne + \@xp\sseq@class@adjustclasses\@xp{\partialcoord} % Adjust all of the indices of the classes to the right of the one we're inserting + \fi + \fi +% + \sseq@processlabels % This sets up the label nodes, now that we know the position of the class (I think that's what we needed?) % \sseq@xminmax{\xcoord}{\ycoord}% \sseq@yminmax{\xcoord}{\ycoord}% \sseq@cleanup@obj{partcoord.(\partialcoord).numnodes}% - \sseq@cleanup@obj{partcoord.(\partialcoord).numnodespp}% - \ifnum\nodenum=\@ne - \sseq@obj@gdef{partcoord.(\partialcoord).numnodes}{0}% - \sseq@obj@gdef{partcoord.(\partialcoord).numnodespp}{1}% - \fi \sseq@obj@xdef{partcoord.(\partialcoord).numnodes}{\nodenum}% - \sseq@obj@xdef{partcoord.(\partialcoord).numnodespp}{\the\numexpr\nodenum+1}% \edef\classname{class.\coord[0]}% \ifx\sseq@class@tag\pgfutil@empty\else \sseq@obj@ifdef{partcoord.(\partialcoord).tag.\sseq@class@tagprefix\sseq@class@tag}{ @@ -421,14 +514,25 @@ % \sseq@obj@gdef{class.\coord.num}{0}% For \replaceclass \sseq@obj@xdef{\classname.page}{\sseq@infinity}% - \sseq@obj@xodef{\classname.options}{\sseq@savedoptioncode}% - \sseq@obj@xodef{\classname.nodetext}{\sseq@classnodetext}% - \sseq@obj@xodef{\classname.nodetext.options}{\sseq@classnodetextoptions}% - \sseq@obj@xodef{\classname.labelnodes}{\sseq@classlabelnodes}% - \sseq@obj@xdef{class.\coord.x}{\xcoord}% - \sseq@obj@xdef{class.\coord.y}{\ycoord}% - \sseq@obj@gdef{\classname.dependencies}{}% - \sseq@obj@xdef{\classname.needstikz}{\ifsseq@needstikz\@nx\sseq@needstikztrue\fi}% + \sseq@obj@xdef{class.\coord.n}{\sseq@classinsert} + \ifx\sseq@familylist\pgfutil@empty\else + \sseq@obj@xodef{\classname.familylist}{\sseq@familylist} + \fi + \ifx\sseq@savedoptioncode\pgfutil@empty\else + \sseq@obj@xodef{\classname.options}{\sseq@savedoptioncode}% + \fi + \ifx\sseq@classnodetext\pgfutil@empty\else + \sseq@obj@xodef{\classname.nodetext}{\sseq@classnodetext} + \fi + \ifx\sseq@classnodetextoptions\pgfutil@empty\else + \sseq@obj@xodef{\classname.nodetext.options}{\sseq@classnodetextoptions} + \fi + \ifx\sseq@classlabelnodes\pgfutil@empty\else + \sseq@obj@xodef{\classname.labelnodes}{\sseq@classlabelnodes}% + \fi + \ifsseq@needstikz + \sseq@obj@xdef{\classname.needstikz}{\sseq@needstikztrue}% + \fi \@ifundefined{sseq@tempoffset}{}{% \tikz@scan@one@point\sseq@setoffset\sseq@tempoffset }% @@ -437,17 +541,31 @@ \fi % \sseq@savedpaths@addclass{class.\coord}% - \sseq@obj@gdef{class.\coord.style}{}% \sseq@breakpoint \endgroup } \def\sseq@setoffset#1{\sseq@obj@gdef{\classname.offset}{\pgftransformshift{#1}}} -\sseq@DeclareDocumentCommand\classoptions{or()}{% +% This is for use with "insert" key. Add one to offset index of each class later than the one currently being inserted +% Takes the partial coordinate "x,y" in #1, and the position that the new class is being inserted into in \sseq@classinsert. +\def\sseq@class@adjustclasses#1{ + \sseq@tempcount=\z@ + \sseq@tempcountb=\sseq@obj{partcoord.(#1).numnodes} + \loop + \advance\sseq@tempcount\@ne + \ifnum\sseq@obj{class.(#1,\the\sseq@tempcount).n}<\sseq@classinsert\relax\else + \sseq@cleanup@obj{class.(#1,\the\sseq@tempcount).n} + \sseq@eval{\@nx\sseq@obj@inc{class.(#1,\the\sseq@tempcount).n}} % unfortunately, \sseq@obj@inc uses \sseq@tempcount so we need this eval + \fi + \ifnum\sseq@tempcount<\sseq@tempcountb\repeat + +} + +\sseq@DeclareDocumentCommand\classoptions{od()}{% \begingroup - \sseq@xsetthiscall{\classoptions\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}% + \sseq@loadinputline + \sseq@xsetthiscall{\string\classoptions\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}% \IfNoValueT{#1}{\sseq@error@x{cmdoptions-without-options}{\string\classoptions}\sseq@break}% could be warning - \IfNoValueT{#2}{\sseq@break}% \sseq@options@firstpassmode \the\sseq@sseqstyle \the\sseq@classstyle @@ -456,25 +574,31 @@ \let\sseq@processlabels\sseq@processlabels@default % Don't double dip on labels from the scope or classstyle \sseq@processoptions{class}{#1}% Outputs result into \sseq@savedoptioncode % - \sseq@parsecoord\coord{#2}{\string\classoptions}% + \IfNoValueTF{#2}{ + \def\sseq@coord{\lastclass0} + }{ + \def\sseq@coord{#2} + } + \sseq@parsecoord\coord{\sseq@coord}{\string\classoptions}% % \sseq@processlabels % \let\partialcoord\coord@partial + \edef\sseq@classnum{\sseq@obj@ifdef{class.\coord.num}{\sseq@obj{class.\coord.num}}{0}} \@ifundefined{sseq@class@page}{% \@ifundefined{sseq@gen}{ \@ifundefined{sseq@thepage}{ - \edef\sseq@gen{\sseq@obj{class.\coord.num}} + \let\sseq@gen\sseq@classnum }{ \sseq@obj@pagetogen{class.\coord}{\sseq@thepage} % stores in \sseq@gen } \let\sseq@genmax\sseq@gen }{ \ifnum\sseq@gen<\z@ - \edef\sseq@gen{\the\numexpr\sseq@obj{class.\coord.num}+\sseq@gen+1} + \edef\sseq@gen{\the\numexpr\sseq@classnum+\sseq@gen+1} \fi \@ifundefined{sseq@genmax}{\let\sseq@genmax\sseq@gen}{ - \edef\sseq@genmax{\the\numexpr\sseq@obj{class.\coord.num}+\sseq@genmax+1} + \edef\sseq@genmax{\the\numexpr\sseq@classnum+\sseq@genmax+1} } } }{ @@ -482,7 +606,7 @@ \sseq@class@getgen{\sseq@class@page} \@ifundefined{sseq@class@pagemax}{ % If no max is present, apply options to all pages starting at specified minimum - \edef\sseq@genmax{\sseq@obj{class.\coord.num}}% + \let\sseq@genmax\sseq@classnum% \let\sseq@class@pagemax\sseq@infinity % ensure if "page" is defined, "pagemax" is defined too }{ \let\sseq@genmin\sseq@gen @@ -494,7 +618,7 @@ \edef\sseq@class@pagemax{\the\numexpr\sseq@class@pagemax+\@ne} } \ifnum\sseq@gen=\m@ne - \edef\sseq@gen{\sseq@obj{class.\coord.num}} + \let\sseq@gen\sseq@classnum \fi \edef\classname{class.\coord[\sseq@gen]} \ifsseq@keepchanges\else @@ -552,6 +676,10 @@ \sseq@cleanup@obj{\classname.labelnodes} \sseq@classoptions@obj@addto@withpagerange{\classname.labelnodes}{\sseq@classlabelnodes} \fi + \ifx\sseq@familylist\pgfutil@empty\else + \sseq@cleanup@obj{\classname.familylist} + \sseq@classoptions@obj@addto@withpagerange{\classname.familylist}{\sseq@familylist} + \fi \@ifundefined{sseq@tempoffset}{}{ \sseq@cleanup@obj{\classname.offset} \tikz@scan@one@point\sseq@setoffset\sseq@tempoffset @@ -586,7 +714,7 @@ } \def\sseq@class@getgen#1{ \bgroup - \ifnum\sseq@obj{class.\coord.num}>\z@ + \ifnum\sseq@classnum>\z@ \sseq@eval{\unexpanded{\sseq@obj@pagetogen{class.\coord}}{#1}} % stores in \sseq@gen \else \def\sseq@gen{0} @@ -594,8 +722,9 @@ \sseq@smuggle@macro\sseq@gen \egroup } -\sseq@DeclareDocumentCommand\replaceclass{or()}{% +\sseq@DeclareDocumentCommand\replaceclass{od()}{% \begingroup + \sseq@loadinputline \sseq@xsetthiscall{\string\replaceclass\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}} \sseq@options@firstpassmode \the\sseq@sseqstyle @@ -606,10 +735,15 @@ \sseq@processoptions{class}{#1}% Outputs result into \sseq@savedoptioncode }% % - \sseq@parsecoord\coord{#2}{\string\replaceclass} + \IfNoValueTF{#2}{ + \def\sseq@coord{\lastclass0} + }{ + \def\sseq@coord{#2} + } + \sseq@parsecoord\coord{\sseq@coord}{\string\classoptions}% \sseq@processlabels % - \sseq@ifundefcoord\coord{\sseq@error@x{replaceclass-no-class}{\coordname}\sseq@break}{} + \sseq@obj@ifundef{class.\coord.num}{\sseq@error@x{replaceclass-no-class}{\coordname}\sseq@break}{} \sseq@ifdead\coord{}{\sseq@error@x{replaceclass-not-dead-yet}{\coordname}\sseq@break} \ifsseq@keepchanges\else \ifnum\the\numexpr\sseq@obj{class.\coord[\sseq@obj{class.\coord.num}].page}<\sseq@thepagecount\else @@ -647,13 +781,20 @@ \fi \edef\classname{class.\coord[\sseq@obj{class.\coord.num}]} % + \sseq@obj@xodef{\classname.familylist}{\sseq@familylist} \sseq@obj@xdef{\classname.page}{\sseq@infinity} \sseq@obj@xodef{\classname.options}{\sseq@savedoptioncode} - \sseq@obj@xodef{\classname.nodetext}{\sseq@classnodetext} - \sseq@obj@xodef{\classname.nodetext.options}{\sseq@classnodetextoptions} + \ifx\sseq@classnodetext\pgfutil@empty\else + \sseq@obj@xodef{\classname.nodetext}{\sseq@classnodetext} + \fi + \ifx\sseq@classnodetextoptions\pgfutil@empty\else + \sseq@obj@xodef{\classname.nodetext.options}{\sseq@classnodetextoptions} + \fi \sseq@obj@xodef{\classname.labelnodes}{\sseq@classlabelnodes} \sseq@obj@gdef{\classname.dependencies}{} - \sseq@obj@xdef{\classname.needstikz}{\ifsseq@needstikz\@nx\sseq@needstikztrue\fi} + \ifsseq@needstikz + \sseq@obj@xdef{\classname.needstikz}{\sseq@needstikztrue} + \fi \@ifundefined{sseq@tempoffset}{}{\tikz@scan@one@point\sseq@setoffset\sseq@tempoffset} % \sseq@breakpoint @@ -666,8 +807,12 @@ \ifnum\sseq@obj{#1[\sseq@gen].page}=\sseq@thepagecount \sseq@thispagetrue \fi - \sseq@gsetthiscall{class #1} - \sseq@class@drawnode{#1[\sseq@gen]} + \sseq@drawtrue + \sseq@obj{#1[\sseq@gen].familylist} + \ifsseq@draw + \sseq@gsetthiscall{class #1} + \sseq@class@drawnode{#1[\sseq@gen]} + \fi \fi \egroup } @@ -690,25 +835,76 @@ \egroup } %%% -%%% \d and \doptions +%%% \kill, \d and \doptions %%% -\sseq@DeclareDocumentCommand\d{oU(r()d()}{% - \sseq@d@{d}{#1}{#2}{#3}{#4}% -} -\sseq@DeclareDocumentCommand\doptions{oU(r()d()}{% +% Because \kill doesn't take options, there's no need to use \sseq@DeclareDocumentCommand for the outer command. +% Rather than use \sseq@DeclareDocumentCommand with no arguments, we just do the normal stuff that \sseq@DeclareDocumentCommand would do, +% Then call \sseq@d@grabpage, the command that is responsible for handling the strange syntax of the page argument for \d. +\protected\def\sseq@kill{% \begingroup - \IfNoValueT{#1}{ - \sseq@xsetthiscall{\@xp\string\csname#1\endcsname\unexpanded{#2(#3)}\IfNoValueF{#4}{\unexpanded{(#4)}}}% - \sseq@error@x{cmdoptions-without-options}{\string\doptions}\sseq@break % could be warning - } - \sseq@d@{doptions}{#1}{#2}{#3}{#4}% + \sseq@setinputline % These two lines normally would happen inside of \sseq@DeclareDocumentCommand. + \sseq@loadinputline + \sseq@d@grabpage\sseq@kill@ +} + +% Now we need to parse a potential coordinate. +\sseq@DeclareDocumentCommandAs\sseq@kill@\kill {d()} { + \sseq@xsetthiscall{\string\kill\unexpanded\@xp{\sseq@dpage}\IfNoValueF{#1}{(#1)}}% + \sseq@parsecoord\coordinate{\IfNoValueTF{#1}{\lastclass}{#1}}{}% + \sseq@ifintexpr{\sseq@dpage}{% + \sseq@tempcount=\numexpr\sseq@dpage\relax % this is a convenient way to get rid of spaces because #3 has to be a number + }{% + \sseq@error@x{d-invalid-page}{\unexpanded\@xp{\sseq@dpage}}\sseq@break% + }% + \sseq@d@setpageminrec{class.\coordinate}{\the\sseq@tempcount}{coordinate}% automatically handles \sseq@cleanup@obj \sseq@breakpoint \endgroup } -\def\sseq@d@#1#2#3#4#5{% + +% \sseq@d@grabpage is defined in sseqparsers. +\sseq@DeclareDocumentCommand\d{o}{% + \begingroup + \sseq@loadinputline + \def\sseq@dtype{d} + \def\sseq@d@theoptions{#1} + \sseq@d@grabpage\sseq@d@ +} + +\sseq@DeclareDocumentCommand\doptions{o}{% \begingroup + \sseq@loadinputline + \def\sseq@dtype{doptions} + \def\sseq@d@theoptions{#1} + \sseq@d@grabpage\sseq@d@ +} + +\def\sseq@d@{ + \ifsseq@tempif + \csname sseq@\sseq@dtype @grabcoord\@xp\endcsname + \else + \sseq@eval{\@nx\sseq@d@main{\sseq@dtype}{\unexpanded\@xp{\sseq@d@theoptions}}{\sseq@dpage}{\sseq@NoValue}{\sseq@NoValue}} + \sseq@breakpoint + \endgroup + \fi +} + +\sseq@DeclareDocumentCommandAs\sseq@d@grabcoord\d{d()d()}{ + \sseq@eval{\@nx\sseq@d@main{\sseq@dtype}{\unexpanded\@xp{\sseq@d@theoptions}}{\sseq@dpage}}{#1}{#2} + \sseq@breakpoint + \endgroup +} + +\sseq@DeclareDocumentCommandAs\sseq@doptions@grabcoord\doptions{d()d()}{ + \sseq@eval{\@nx\sseq@d@main{\sseq@dtype}{\unexpanded\@xp{\sseq@d@theoptions}}{\sseq@dpage}}{#1}{#2} + \sseq@breakpoint + \endgroup +} + + +\def\sseq@d@main#1#2#3#4#5{% \sseq@options@firstpassmode + \def\sseq@edgetype{differential} \the\sseq@sseqstyle \the\sseq@edgestyle \the\sseq@differentialstyle @@ -717,16 +913,15 @@ \IfNoValueF{#2}{ \sseq@processoptions{differential}{#2}% Outputs result into \sseq@savedoptioncode } - \sseq@xsetthiscall{\@xp\string\csname#1\endcsname\IfNoValueF{#2}{\unexpanded{[#2]}}\unexpanded{#3(#4)}\IfNoValueF{#5}{\unexpanded{(#5)}}}% + \sseq@xsetthiscall{\@xp\string\csname#1\endcsname\IfNoValueF{#2}{\unexpanded{[#2]}}\unexpanded{#3}\IfNoValueF{#4}{\unexpanded{(#4)}}\IfNoValueF{#5}{\unexpanded{(#5)}}}% \sseq@ifintexpr{#3}{% \sseq@tempcount=\numexpr#3\relax % this is a convenient way to get rid of spaces because #3 has to be a number }{% \sseq@error@n{d-invalid-page}{#3}\sseq@break% }% - \@xp\sseq@dparsecoord\@xp{\the\sseq@tempcount}{#4}{#5}% + \sseq@eval{\@nx\sseq@dparsecoord{\the\sseq@tempcount}{\IfNoValueTF{#4}{\lastclass0}{\unexpanded{#4}}}{\unexpanded{#5}}} \sseq@eval{\unexpanded{\csname sseq@d@#1\endcsname{#2}}{\the\sseq@tempcount}}% \sseq@breakpoint - \endgroup } % #1 -- options @@ -736,9 +931,9 @@ \sseq@d@setpageminrec{class.\source}{#2}{source}% automatically handles \sseq@cleanup@obj \sseq@d@setpageminrec{class.\target}{#2}{target} % - \ifsseq@drawdifferential + \ifsseq@drawdifferential % TODO: probably should get rid of invisible now that we have \kill... + \sseq@obj@xodef{d.#2\source\target.familylist}{\sseq@familylist} \sseq@obj@gdef{d.#2\source\target.page}{#2} - \sseq@obj@gdef{d.#2\source\target.style}{}% \sseq@obj@xdef{d.#2\source\target.source}{\source} \sseq@obj@xdef{d.#2\source\target.target}{\target} \sseq@obj@xdef{d.#2\source\target.options}{\ifsseq@needstikz\@nx\sseq@needstikztrue\fi\unexpanded\@xp{\sseq@savedoptioncode}} @@ -759,6 +954,8 @@ }% \fi % + \sseq@cleanup@obj{d.#2\source\target.familylist} + \sseq@obj@xoaddto{d.#2\source\target.familylist}{\sseq@familylist} \sseq@cleanup@obj{d.#2\source\target.options} \sseq@obj@xoaddto{d.#2\source\target.options}{\sseq@savedoptioncode} } @@ -823,9 +1020,9 @@ \let\sseq@possibleperiod\empty \let\sseq@possibleperiodb\empty \sseq@obj@xdef{\sseq@classgenname.deathlocation}{% - on input line \the\inputlineno\sseq@error@inforeachloop + on input line \sseq@inputline\sseq@error@inforeachloop } - \sseq@obj@xdef{\sseq@classgenname.deathline}{\the\inputlineno} + \sseq@obj@xdef{\sseq@classgenname.deathline}{\sseq@inputline} \sseq@tempiffalse \edef\sseq@temp{\the\sseq@foreachcall} \ifx\sseq@temp\pgfutil@empty\else\sseq@tempiftrue\fi @@ -843,7 +1040,7 @@ \def\sseq@preparestacktrace{ \def\foreach{\@nx\foreach} \edef\sseq@temp@i{\unexpanded\@xpthree{\sseq@obj{\sseq@deadclass@genname.deathline}}} - \edef\sseq@temp@ii{\the\inputlineno} + \edef\sseq@temp@ii{\sseq@inputline} \ifx\sseq@temp@i\sseq@temp@ii \sseq@temptoks\@xpthree{\sseq@obj{\sseq@deadclass@genname.deathinfo} (in the same \foreach loop)} \else @@ -860,11 +1057,17 @@ \fi } \def\sseq@differential@draw@ifpage#1{ - \ifnum\sseq@thepagecount=\z@ - \sseq@drawdifferential{#1} - \else - \ifnum\sseq@obj{#1.page}=\sseq@thepagecount\relax + \sseq@drawtrue + \sseq@obj{#1.familylist} + \ifsseq@draw + \ifnum\sseq@thepagecount=\z@ \sseq@drawdifferential{#1} + \else + \ifnum\sseq@obj{#1.page}>\sseq@thepagemm\relax + \ifnum\sseq@obj{#1.page}<\sseq@thepagemaxpp\relax + \sseq@drawdifferential{#1} + \fi + \fi \fi \fi } @@ -880,19 +1083,39 @@ %%% %%% \structline and \structlineoptions %%% -\sseq@DeclareDocumentCommand\structline{or()r()}{% + +\sseq@DeclareDocumentCommand\structline{od()}{% \begingroup - \sseq@xsetthiscall{\string\structline\IfNoValueF{#1}{\unexpanded{[#1]}}\unexpanded{(#2)(#3)}}% - \sseq@structline@main{structline}{#1}{#2}{#3}% + \sseq@loadinputline + \IfNoValueTF{#2}{ + \sseq@structline@main{structline}{#1}{#2}{#2} + }{ + \def\next{\sseq@structline@@{structline}{#1}{#2}}% + \@xptwo\next\sseq@trimleadingspaces + } } -\sseq@DeclareDocumentCommand\structlineoptions{or()r()}{% +\sseq@DeclareDocumentCommand\structlineoptions{od()}{% \begingroup - \sseq@xsetthiscall{\string\structlineoptions\IfNoValueF{#1}{\unexpanded{[#1]}}\unexpanded{(#2)(#3)}}% - \IfNoValueT{#1}{\sseq@error@x{cmdoptions-without-options}{\string\structlineoptions}\sseq@break@withcleanup} - \sseq@structline@main{structlineoptions}{#1}{#2}{#3}% - \sseq@breakpoint\@gobble\endgroup + \sseq@loadinputline + \IfNoValueTF{#2}{ + \sseq@structline@main{structlineoptions}{#1}{#2}{#2} + }{ + \def\next{\sseq@structlineoptions@@{structlineoptions}{#1}{#2}}% + \@xptwo\next\sseq@trimleadingspaces + } +} + +\sseq@DeclareDocumentCommandAs\sseq@structline@@\structline{mmmd()}{% + \sseq@structline@main{#1}{#2}{#3}{#4} } -\def\sseq@structline@main#1#2#3#4{% + +\sseq@DeclareDocumentCommandAs\sseq@structlineoptions@@\structlineoptions{mmmd()}{% + \sseq@structline@main{#1}{#2}{#3}{#4} +} + +\def\sseq@structline@main#1#2#3#4{ + \sseq@xsetthiscall{\string\structline\IfNoValueF{#2}{\unexpanded{[#2]}}\IfNoValueF{#3}{\unexpanded{(#3)}\IfNoValueF{#4}{\unexpanded{(#4)}}}}% + \def\sseq@edgetype{structline} \sseq@options@firstpassmode \the\sseq@sseqstyle \the\sseq@edgestyle @@ -902,8 +1125,38 @@ \IfNoValueF{#2}{% \sseq@processoptions{struct line}{#2}% Outputs result into \sseq@savedoptioncode }% - \sseq@parsecoord\source{#3}{source of structure line}% - \sseq@parsecoord\target{#4}{target of structure line}% + \def\sourcename{#3}% + \def\targetname{#4}% + \IfNoValueTF{#3}{% + \def\sourcename{\lastclass1}% + \def\targetname{\lastclass}% + }{% + \IfNoValueT{#4}{% + \def\targetname{\lastclass}% + }% + }% + \sseq@parsecoord\source{\sourcename}{source of structure line}% + \sseq@parsecoord\target{\targetname}{target of structure line}% + \ifnum\xsource>\xtarget\relax + \sseq@parsedcoords@swap\source\target + \else + \ifnum\xsource=\xtarget\relax + \ifnum\ysource>\ytarget\relax + \sseq@parsedcoords@swap\source\target + \else + \ifnum\ysource=\ytarget\relax + \ifnum\nsource>\ntarget\relax + \sseq@parsedcoords@swap\source\target + \else + \ifnum\nsource=\ntarget\relax + \sseq@error{structline-source-target-equal}% + \@xp\sseq@break\romannumeral-`0 + \fi + \fi + \fi + \fi + \fi + \fi \@ifundefined{sseq@structline@page}{%this is repeated in circleclasses \def\sseq@pagemin{0} \ifnum\sseq@obj{class.\source.num}>\z@ @@ -938,17 +1191,22 @@ \sseq@cleanup@obj{structline.\source\target.num} \sseq@obj@inc{structline.\source\target.num} }{ + \sseq@cleanup@obj{structline.\source\target.num} \sseq@obj@gdef{structline.\source\target.num}{0} \sseq@savedpaths@addstructline{structline.\source\target} } \edef\sseq@structlinename{structline.\source\target[\sseq@obj{structline.\source\target.num}]} + % The following cleanup call is needed to prevent a glitch where if a \structline is made inside of a temporary sseqpage environment, then later attempts + % to put a structline throw a "structline already exists" error + \sseq@cleanup@obj{\sseq@structlinename.page} \sseq@obj@xdef{\sseq@structlinename.page}{\sseq@infinity} \sseq@obj@xdef{\sseq@structlinename.pagemin}{\sseq@pagemin} \sseq@obj@xdef{\sseq@structlinename.source}{\source} \sseq@obj@xdef{\sseq@structlinename.target}{\target} - \sseq@cleanup@obj{structline.\source\target.num} \sseq@class@adddependence{class.\source}{\sseq@structlinename}% If the source or target is already dead, this will set structlinename.page \sseq@class@adddependence{class.\target}{\sseq@structlinename} + \sseq@obj@xodef{\sseq@structlinename.familylist}{\sseq@familylist} + \sseq@cleanup@obj{\sseq@structlinename.options} \sseq@obj@xdef{\sseq@structlinename.options}{\ifsseq@needstikz\@nx\sseq@needstikztrue\fi\unexpanded\@xp{\sseq@savedoptioncode}} } \def\sseq@structline@structlineoptions{ @@ -980,20 +1238,24 @@ \advance\sseq@tempcount\@ne \edef\sseq@structlinename{structline.\source\target[\the\sseq@tempcount]} \sseq@cleanup@obj{\sseq@structlinename.options} + \sseq@cleanup@obj{\sseq@structlinename.familylist} \ifsseq@needstikz \sseq@obj@gaddto{\sseq@structlinename.options}{\sseq@needstikztrue} \fi \ifnum\sseq@tempcount=\sseq@gen\relax \@ifundefined{sseq@structline@page}{}{ \edef\sseq@savedoptioncode{\@nx\ifnum\sseq@thepagecount>\sseq@structline@page\relax\unexpanded\@xp{\sseq@savedoptioncode}\@nx\fi} + \edef\sseq@familylist{\@nx\ifnum\sseq@thepagecount>\sseq@structline@page\relax\unexpanded\@xp{\sseq@familylist}\@nx\fi} } \fi \ifnum\sseq@tempcount=\sseq@genmax\relax \@ifundefined{sseq@structline@pagemax}{}{ \edef\sseq@savedoptioncode{\@nx\ifnum\sseq@thepagecount<\sseq@structline@pagemax\relax\unexpanded\@xp{\sseq@savedoptioncode}\@nx\fi} + \edef\sseq@familylist{\@nx\ifnum\sseq@thepagecount<\sseq@structline@pagemax\relax\unexpanded\@xp{\sseq@familylist}\@nx\fi} } \fi \sseq@obj@xoaddto{\sseq@structlinename.options}{\sseq@savedoptioncode} + \sseq@obj@xoaddto{\sseq@structlinename.familylist}{\sseq@familylist} \ifnum\sseq@tempcount<\sseq@genmax\repeat } \def\sseq@structline@getgen#1{ @@ -1032,7 +1294,11 @@ \bgroup \ifnum\sseq@thepagecount=\z@ \ifnum\sseq@obj{#1[0].pagemin}=\z@ - \sseq@structline@draw{#1[0]} + \sseq@drawtrue + \sseq@obj{#1[0].familylist} + \ifsseq@draw + \sseq@structline@draw{#1[0]} + \fi \fi \else \sseq@obj@pagetogen{#1}{\sseq@thepage} % sets \sseq@gen @@ -1041,7 +1307,11 @@ \sseq@thispagetrue \fi \ifnum\sseq@obj{#1[\sseq@gen].pagemin}<\sseq@thepagecount - \sseq@structline@draw{#1[\sseq@gen]} + \sseq@drawtrue + \sseq@obj{#1[\sseq@gen].familylist} + \ifsseq@draw + \sseq@structline@draw{#1[\sseq@gen]} + \fi \fi \fi \fi @@ -1052,11 +1322,10 @@ - - \newcount\sseq@circleclassuid \sseq@DeclareDocumentCommand\circleclasses{or()r()}{ \begingroup + \sseq@loadinputline \def\sseq@keysfortikzprim{} \IfNoValueF{#1}{ \sseq@processoptions{fit}{#1} @@ -1089,6 +1358,7 @@ % % \sseq@obj@xodef{\circleclassobjname.options}{\sseq@savedoptioncode} + \sseq@obj@xodef{\circleclassobjname.familylist}{\sseq@familylist} \sseq@obj@xodef{\circleclassobjname.tikzprimoptions}{\sseq@keysfortikzprim} \sseq@obj@xdef{\circleclassobjname.fitnodes}{\@nx\tikz@lib@fit{(sseq{\coordanopar})(sseq{\coordbnopar})\sseq@fitalso}} %\edef\temp{\@nx\sseq@circleclass@draw{\coorda@internalname}{\coordb@internalname}{\unexpanded\@xp{\sseq@savedoptioncode}}} @@ -1112,12 +1382,115 @@ \fi \def\sseq@circleclass@draw@ifpage#1#2#3{ - \ifnum\sseq@thepagecount<\numexpr\sseq@obj{#1.page}+\@ne - \ifnum\sseq@obj{#1.page}=\sseq@thepagecount - \sseq@thispagetrue - \fi - \ifnum\sseq@obj{#1.pagemin}<\sseq@thepagecount - \sseq@circleclass@draw{#1}{#2}{#3} + \sseq@drawtrue + \sseq@obj{#1.familylist} + \ifsseq@draw + \ifnum\sseq@thepagecount<\numexpr\sseq@obj{#1.page}+\@ne + \ifnum\sseq@obj{#1.page}=\sseq@thepagecount + \sseq@thispagetrue + \fi + \ifnum\sseq@obj{#1.pagemin}<\sseq@thepagecount + \sseq@circleclass@draw{#1}{#2}{#3} + \fi \fi \fi -}
\ No newline at end of file +} + +%% +%% Labels +%% +%% This code is called from the key value handler, but it has more to do with the code in this file so I am putting it here. Search in sseqkeys.code.tex for "Labels" +%% + +\def\sseq@processlabels@default{% + \global\let\sseq@classnodetext\pgfutil@empty + \global\let\sseq@classnodetextoptions\pgfutil@empty + \global\let\sseq@classlabelnodes\pgfutil@empty +} +\let\sseq@processlabels\sseq@processlabels@default + +% I can't remember why we need to defer this. If at some point I figure this out, I should explain why here and in the definition of \class... +\def\sseq@handleclassquotes@inner#1#2{% + \begingroup\pgfscope + \def\sseq@classquotes@smugglehook{} + \def\sseq@classquotes@smugglehook@inner{} + \sseq@options@firstpassmode + \sseq@thesseqstyle + \sseq@thelabelstyle + \sseq@theclasslabelstyle + \the\sseq@scope@toks + \sseq@options@normalmode + \sseq@processoptions{class/label}{#2}% + \sseq@classlabeltextfn{#1}% labeltextfn is a private handler, classlabeltextfn is exposed via "class label handler" + \ifsseq@classlabel + \sseq@options@firstpassmode + \the\sseq@outerclasslabelstyle + \sseq@x@addto@macro\sseq@classlabelnodes{% + \@nx\sseq@drawlabel{% + \sseq@maybemathswitch\unexpanded\@xp{\processedlabel}\sseq@maybemathswitch}% + {% This is setup to prevent a bug where \classoptions and class label style don't work correctly together + \the\sseq@sseqstyle\@nx\the\sseq@sseqstyle@page + \the\sseq@labelstyle\@nx\the\sseq@labelstyle@page + \the\sseq@classlabelstyle\@nx\the\sseq@classlabelstyle@page + \sseq@theouterclasslabelstyle + \@nx\sseq@collections@labels@hook + \@nx\sseq@collections@classlabels@hook + \@nx\sseq@collections@outerclasslabels@hook + \unexpanded\@xp{\sseq@savedoptioncode}% + }% + }% + \else + \let\sseq@classquotes@smugglehook\sseq@classquotes@smugglehook@inner + \sseq@options@firstpassmode + \the\sseq@innerclasslabelstyle + \sseq@options@normalmode + \sseq@protectedeval{\@nx\pgfqkeys{/sseqpages/class/label}{#2}}% + \sseq@protected@xdef\sseq@classnodetext{\sseq@maybemathswitch\processedlabel\sseq@maybemathswitch}% + \xdef\sseq@classnodetextoptions{% + %\unexpanded{\def\pgfkeysdefaultpath{/sseqpages/class/node texts/}}% + \sseq@thelabelstyle\sseq@theclasslabelstyle\sseq@theinnerclasslabelstyle + \@nx\sseq@collections@labels@hook + \@nx\sseq@collections@classlabels@hook + \@nx\sseq@collections@innerclasslabels@hook + \unexpanded\@xp{\sseq@savedoptioncode}% + }% + \fi + \@xp\endpgfscope\@xp\endgroup + \sseq@classquotes@smugglehook +} + +\def\sseq@handleedgequotes#1#2{% We use this via \let\tikz@quotes@as\sseq@handleedgequotes + /utils/exec={% so it's called inside \pgfkeysalso{stuff}. Need to surround with /utils/exec={} to get out. + \let\sseq@savedoptioncode@save\sseq@savedoptioncode + \sseq@processoptions{label}{#2} + \sseq@needstikztrue + \let\sseq@temp\sseq@savedoptioncode + \let\sseq@savedoptioncode\sseq@savedoptioncode@save + \sseq@e@addto@options{ + \@nx\tikzset{ + every to/.append style={ + edge node={ + node [/sseqpages/label, + /utils/exec={ + \let\@nx\sseq@tikz@transform@save\@nx\tikz@transform + \let\@nx\tikz@transform\relax + \@nx\sseq@thelabelstyle + \@nx\sseq@collections@labels@hook + \@nx\sseq@theedgelabelstyle + \@nx\sseq@collections@edgelabels@hook + \@xp\@nx\csname sseq@the\sseq@edgetype labelstyle\endcsname + \@xp\@nx\csname sseq@collections@\sseq@edgetype labels@hook\endcsname + \unexpanded\@xp{\sseq@temp} + \ifsseq@rotatelabels\iftikz@fullytransformed\else\@nx\tikz@fullytransformedtrue\@nx\tikz@addtransform{\@nx\pgftransformresetnontranslations\@nx\sseq@globalrotatetransform}\fi\fi + \unexpanded\@xp{\sseq@edgeoptionhook} % this is just to make description work + \let\@nx\tikz@transform\@nx\sseq@tikz@transform@save + } + ]{\sseq@labeltextfn{#1}} + } + } + } + } + } +} + + diff --git a/Master/texmf-dist/tex/latex/spectralsequences/sseqmessages.code.tex b/Master/texmf-dist/tex/latex/spectralsequences/sseqmessages.code.tex index c8fbbb1eb75..899a425a3c4 100644 --- a/Master/texmf-dist/tex/latex/spectralsequences/sseqmessages.code.tex +++ b/Master/texmf-dist/tex/latex/spectralsequences/sseqmessages.code.tex @@ -1,8 +1,8 @@ %% -%% Package: spectralsequences.sty version 1.0 +%% Package: spectralsequences v1.1.0 %% Author: Hood Chatham %% Email: hood@mit.edu -%% Date: 2017-06-18 +%% Date: 2017-08-02 %% License: Latex Project Public License %% %% File: sseqmessages.code.tex @@ -43,7 +43,7 @@ %% %% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %% ! -%% ! sseqpages error: "index-too-large" +%% ! spectralsequences error: "index-too-large" %% ! %% ! Index '-3' provided for target of structure line is too large -- only 1 %% ! classes exist at position (32,8). @@ -55,7 +55,7 @@ %% ! \towergroupb (8*\n ,4*\n ) % Produced by \sseq@printstacktrace %% ! \foreach \n in {2,3,4} %% ! -%% ! See the sseqpages documentation for further information. +%% ! See the spectralsequences documentation for further information. %% ! %% ! Type <return> to continue. %% !............................................... @@ -66,6 +66,16 @@ % Stack, thiscall, foreachcall. % Here we record what the user has said (as best we can tell) \newtoks\sseq@thiscalltoks + +% These guys are set up because I want \sseq@DeclareDocumentCommandAs@setinputline to work +% but I want the definition of \sseq@inputline to be local, and it would be really bad to +% open a group inside of sseq@DeclareDocumentCommandAs that has to be closed in the code. +% So what I do is globally put it into \sseq@globalinputline using \sseq@setinputline +% and then after starting the group at the beginning of the actual macro body, +% call \sseq@loadinputline +\def\sseq@setinputline{\xdef\sseq@globalinputline{\the\inputlineno}} +\def\sseq@loadinputline{\let\sseq@inputline\sseq@globalinputline} + \def\sseq@thiscall{\the\sseq@thiscalltoks} \def\sseq@setthiscall#1{\sseq@seterrorannotation{call}\sseq@thiscalltoks{#1}} \def\sseq@esetthiscall#1{\sseq@seterrorannotation{call}\sseq@eval{\sseq@thiscalltoks{#1}}} @@ -85,7 +95,9 @@ \ifx\sseq@temp\pgfutil@empty\else \edef\sseq@restofstacktrace{\unexpanded{\\\ \ \ }\@nx\sseq@stack@unexpanded{\the\sseq@topofstacktrace}\unexpanded\@xp{\sseq@restofstacktrace}} \fi - \sseq@topofstacktrace{#1} + \sseq@eval{\sseq@topofstacktrace{\unexpanded{#1}\sseq@possibleoninputlinedash}} + \let\sseq@possibleoninputlinedash\empty + \let\sseq@possibleoninputlinepar\empty } \def\sseq@opushstacktrace#1{\@xp\sseq@pushstacktrace\@xp{#1}} \def\sseq@stack@unexpanded#1{\@nx\sseq@stack@unexpanded\unexpanded{{#1}}} @@ -116,11 +128,14 @@ \sseq@seterrorannotation{aftercall} - -\def\sseq@error@inforeachloop{\sseq@possibleperiod} -\def\sseq@error@inforeachloop@active{\sseq@possiblecomma in \foreach block with variable values:\sseq@for@printvars\sseq@possibleperiodb} +\def\sseq@inputline{\the\inputlineno} +\def\sseq@error@inforeachloop{\sseq@possibleoninputlinepar\sseq@possibleperiod} +\def\sseq@error@inforeachloop@active{\sseq@possiblecomma in loop with variable values:\sseq@for@printvars\sseq@possibleperiodb} \def\sseq@error@setup@errorinfo{}% Changed during \foreach and user commands +\def\sseq@possibleoninputlinepar{ (on input line \sseq@inputline)} % let this to a no-op at beginning of usermacros +\def\sseq@possibleoninputlinedash{ -- on input line \sseq@inputline} + \def\sseq@possiblecomma{,\space} \def\sseq@possibleperiod{.} \def\sseq@possibleperiodb{.} @@ -151,7 +166,7 @@ \sseq@error@hook } -\def\sseq@error@setup@noinfo {\bgroup\def\foreach{\@nx\foreach}\let\sseq@stack@unexpanded\unexpanded\def\sseq@error@annotation{}\sseq@error@hook} +\def\sseq@error@setup@noinfo{\bgroup\def\foreach{\@nx\foreach}\let\sseq@stack@unexpanded\unexpanded\def\sseq@error@annotation{}\sseq@error@hook} \let\sseq@error@setup\sseq@error@setup@noinfo \def\sseq@error@cleanup{\egroup\sseq@errortrue} % If the error was thrown in NewDocumentCommand, we need to process it. Just used in sseqmacromakers. @@ -195,10 +210,11 @@ \def\sseq@atbeginforeach@msgsetup{% \let\protect\empty % prevent issues if protected variables like \xmax are used as the loop max + \let\sseq@error@setup@errorinfo\sseq@error@setup@errorinfo@active \let\sseq@error@build@foreachvarsinfo\sseq@error@build@foreachvarsinfo@active % Install stack annotation \let\sseq@error@inforeachloop\sseq@error@inforeachloop@active % install message indicating foreach variable values \let\sseq@error@setup\sseq@error@setup@withinfo - \sseq@foreachcall{\foreach} % Stack gets pushed at the beginning of the body of the foreach loop once we know what the call looks like + \sseq@foreachcall\@xp{\string\foreach} % Stack gets pushed at the beginning of the body of the foreach loop once we know what the call looks like } @@ -219,6 +235,18 @@ \fi } +%% +%% \sseq@checkend +%% +\def\sseq@checkend#1{ + \def\sseq@tempa{#1} + \ifx\sseq@tempa\@currenvir\else % mismatch + \sseq@error@n{endenv-mismatch}{#1} + \csname end\@currenvir\endcsname % run the \end code for the correct environment + \def\@currenvir{#1} % Prevent \@checkend from throwing a second redundant error + \@xp\sseq@break % don't run the code \end for this environment + \fi +} @@ -232,21 +260,21 @@ \ExplSyntaxOn \char_set_catcode_space:N\ % Needed to make pretocmd work -- there are always spaces after every command, and they need to be retokenized as spaces -\def\sseqerrortowarning#1{ \msg_redirect_name:nnn { sseqpages } { #1 } { warning } } - -\def\sseq@error {\msg_error:nn {sseqpages}} -\def\sseq@error@n {\msg_error:nnn {sseqpages}} -\def\sseq@error@nn {\msg_error:nnnn {sseqpages}} -\def\sseq@error@nnn {\msg_error:nnnnn {sseqpages}} -\def\sseq@error@nnnn{\msg_error:nnnnnn{sseqpages}} -\def\sseq@error@x {\msg_error:nnx {sseqpages}} -\def\sseq@error@xx {\msg_error:nnxx {sseqpages}} -\def\sseq@error@xxx {\msg_error:nnxxx {sseqpages}} -\def\sseq@error@xxxx{\msg_error:nnxxxx{sseqpages}} -\def\sseq@warning {\msg_warning:nn{sseqpages}} - -\def\sseq@newerror#1#2{\msg_new:nnn{sseqpages}{#1}{#2}} -\def\sseq@newerror@internal#1#2{\msg_new:nnn{sseqpages}{#1}{Internal error: #2 \sseq@contactpackageauthor}} +\def\sseqerrortowarning#1{ \msg_redirect_name:nnn { spectralsequences } { #1 } { warning } } + +\def\sseq@error {\msg_error:nn {spectralsequences}} +\def\sseq@error@n {\msg_error:nnn {spectralsequences}} +\def\sseq@error@nn {\msg_error:nnnn {spectralsequences}} +\def\sseq@error@nnn {\msg_error:nnnnn {spectralsequences}} +\def\sseq@error@nnnn{\msg_error:nnnnnn{spectralsequences}} +\def\sseq@error@x {\msg_error:nnx {spectralsequences}} +\def\sseq@error@xx {\msg_error:nnxx {spectralsequences}} +\def\sseq@error@xxx {\msg_error:nnxxx {spectralsequences}} +\def\sseq@error@xxxx{\msg_error:nnxxxx{spectralsequences}} +\def\sseq@warning {\msg_warning:nn{spectralsequences}} + +\def\sseq@newerror#1#2{\msg_new:nnn{spectralsequences}{#1}{#2}} +\def\sseq@newerror@internal#1#2{\msg_new:nnn{spectralsequences}{#1}{Internal error: #2 \sseq@contactpackageauthor}} \edef\sseq@contactpackageauthor{Contact package author \sseq@authorname\space at \sseq@authoremail.} @@ -269,7 +297,7 @@ \sseq@newerror@internal{msg-patch-failed}{Failed to patch the latex 3 message system. The errors will not be as expressive.} \def\sseq@msgpatchfailed{ - \msg_error:nn{sseqpages}{msg-patch-failed} + \msg_error:nn{spectralsequences}{msg-patch-failed} \def\sseq@installmsghooks{} \sseq@break } @@ -307,20 +335,20 @@ %% %% \@ifpackagelater{tikz}{2015/07/08}{ - \sseq@newerror@internal{pgfkeys-patch-failed}{Failed to patch the key value system. Setting all commands to do nothing and quitting. Your copy of tikz is newer than the version sseqpages was designed for and seems to be incompatible with core features.} - \sseq@newerror@internal{fit-patch-failed}{Failed to patch fit. \@nx\circleclasses won't work. Your copy of tikz is newer than the version sseqpages was designed for and seems to be incompatible with \string\circleclasses.} - \sseq@newerror@internal{foreach-patch-failed}{Failed to patch \string\foreach. The errors sseqpages provides will be less comprehensive. Your copy of tikz is newer than the version sseqpages was designed for and seems to be incompatible with parts of the error handling system.} + \sseq@newerror@internal{pgfkeys-patch-failed}{Failed to patch the key value system. Setting all commands to do nothing and quitting. Your copy of tikz is newer than the version spectralsequences was designed for and seems to be incompatible with core features.} + \sseq@newerror@internal{fit-patch-failed}{Failed to patch fit. \@nx\circleclasses won't work. Your copy of tikz is newer than the version spectralsequences was designed for and seems to be incompatible with \string\circleclasses.} + \sseq@newerror@internal{foreach-patch-failed}{Failed to patch \string\foreach. The errors spectralsequences provides will be less comprehensive. Your copy of tikz is newer than the version spectralsequences was designed for and seems to be incompatible with parts of the error handling system.} \sseq@newerror@internal{circleclasses-not-provided}{\@nx\circleclasses won't work because your copy of tikz is too new. Instead I'm doing nothing.} }{ - \sseq@newerror{pgfkeys-patch-failed}{Failed to patch the key value system. Setting all commands to do nothing and quitting. Your copy of tikz is older than the version sseqpages was designed for and seems to be incompatible with core features. Update tikz!} - \sseq@newerror{fit-patch-failed}{Failed to patch fit. \@nx\circleclasses won't work. Your copy of tikz is older than the version sseqpages was designed for and seems to be incompatible with \string\circleclasses. Update tikz!} - \sseq@newerror{foreach-patch-failed}{Failed to patch \string\foreach. The errors sseqpages provides will be less comprehensive. Your copy of tikz is older than the version sseqpages was designed for and seems to be incompatible with parts of the error handling system.} + \sseq@newerror{pgfkeys-patch-failed}{Failed to patch the key value system. Setting all commands to do nothing and quitting. Your copy of tikz is older than the version spectralsequences was designed for and seems to be incompatible with core features. Update tikz!} + \sseq@newerror{fit-patch-failed}{Failed to patch fit. \@nx\circleclasses won't work. Your copy of tikz is older than the version spectralsequences was designed for and seems to be incompatible with \string\circleclasses. Update tikz!} + \sseq@newerror{foreach-patch-failed}{Failed to patch \string\foreach. The errors spectralsequences provides will be less comprehensive. Your copy of tikz is older than the version spectralsequences was designed for and seems to be incompatible with parts of the error handling system.} \sseq@newerror{circleclasses-not-provided}{\@nx\circleclasses won't work because your copy of tikz is too old. Instead I'm doing nothing. Update tikz!} } \def\sseq@pgfkeyspatchfailed { - \msg_critical:nn { sseqpages } { pgfkeys-patch-failed } + \msg_critical:nn { spectralsequences } { pgfkeys-patch-failed } } @@ -332,10 +360,20 @@ %% %% +%% loadstore +%% +%% +\sseq@newerror@internal{illegal-add-background-mode}{\string#1 occurred in background mode.} + + + +%% +%% %% macromakers %% %% -\sseq@newerror{won't-override-builtin}{Macro '#1' is a sseqpages builtin and I won't override it. Try a different name.} +\sseq@newerror@internal{U-xparse-incompatible}{The 'U' argument type is incompatible with the current version of xparse.} +\sseq@newerror{won't-override-builtin}{Macro '#1' is a spectralsequences builtin and I won't override it. Try a different name.} \sseq@newerror{usermacro-not-free}{Macro '#1' has already been defined using \string\DeclareSseqCommand, \string\NewSseqCommand, \string\DeclareSseqGroup, or \string\NewSseqGroup. I am overriding it. If this is what you intended, you should either use \@nx\DeclareSseqGroup or \string\DeclareSseqCommand, which won't complain.} \sseq@newerror{macro-patch-failed}{Failed to patch macro '#1'. This is probably some annoying catcode issue. Try \@nx\tracingpatches to see more information about why the patch failed.} @@ -357,10 +395,10 @@ If you need to have this many classes in this position, you can make your own class pattern with \string\sseqnewclasspattern, but you might want to consider alternatives like using one class to represent multiple generators in some way -- it is hard to make a diagram look good with large numbers of classes in one position.% } -\sseq@newerror{invalid-coordinate}{Invalid #1coordinate\sseq@printerrortype.} -\sseq@newerror{no-classes}{No classes yet exist in #1.} -\sseq@newerror{index-too-large}{Index '#1' provided\sseq@printerrortype\ is too large -- only #2 classes exist at position #3.} -\sseq@newerror{undefined-tag}{Index '#1' provided\sseq@printerrortype\ is not a valid integer expression or known tag in position #2.} +\sseq@newerror{invalid-coordinate}{Invalid #1coordinate\sseq@printforerrortype.} +\sseq@newerror{no-classes}{No classes yet exist in #1\sseq@printerrortype{, the }.} +\sseq@newerror{index-too-large}{Index '#1' provided\sseq@printforerrortype\ is too large -- only #2 classes exist at position #3.} +\sseq@newerror{undefined-tag}{Index '#1' provided\sseq@printforerrortype\ is not a valid integer expression or known tag in position #2.} \sseq@newerror{class-no-tag}{The class #1 has no tag so I cannot get it.} \sseq@newerror{class-extra-coords}{Too many coordinates. Ignoring the extra ones.} @@ -378,13 +416,17 @@ \sseq@newerror{anchor-ignored} {The coordinate #1 is not a class, but it has an anchor '#3'. Ignoring the anchor and treating it as the literal position #2.} \sseq@newerror{invalid-tikz-coord}{The coordinate #1 does not refer to a tikz class but its #2 coordinate is not valid \string\pgfmathparse\ input.} - %% %% -%% loadstore +%% foreach %% %% -\sseq@newerror{illegal-add-background-mode}{\string#1 occurred in background mode.} % Should be impossible to trigger +\sseq@newerror{DoUntil-no-bound}{You used #1 but specified neither an x range nor a y range.} +\sseq@newerror{DoUntil-no-progress}{You used #1 but the loop body you provided seems to be making no progress towards the boundary.} +\sseq@newerror{Do-invalid-int-expr}{Argument "#2" to #1 is not a valid integer expression.} + + + %% %% @@ -416,12 +458,20 @@ You can only use '#1' as an option for tikz primitives, not for \@nx\class, \@nx\replaceclass, \@nx\classoptions, \@nx\d, \@nx\doptions, \@nx\structline, or \@nx\structlineoptions.% } +\sseq@newerror{invalid-intexpr}{The value '#2' provided for key '#1' is not a valid integer expression.} +\sseq@newerror{invalid-positive-intexpr}{The value '#2' provided for key '#1' does not evaluate to a positive integer.} +\sseq@newerror{invalid-dimenexpr}{The value '#2' provided for key '#1' is not a valid dimension expression.} +\sseq@newerror{invalid-color}{The value '#2' provided for key '#1' is not a valid color or color expression.} +\sseq@newerror{invalid-axis-type}{The value '#1' provided for '\sseq@axistypekey{#2}' is not valid. Valid values for '\sseq@axistypekey{#2}' are: \sseq@validaxestypes} + \sseq@newerror{det-one-after-scale}{You cannot use the option '#1\ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text\else=\pgfkeyscurrentvalue\fi' as a global option after using 'xscale', 'yscale', or 'scale'. Please move '#1\ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text\else=\pgfkeyscurrentvalue\fi' before any scaling options.} +\sseq@newerror{invalid-scale}{You said '#1scale=#2' as a global option, but '#2' is not a valid pgf math expression.} +\sseq@newerror{unit-scale}{You said '#1scale=#2' as a global option, but '#2' is not a scalar.} \sseq@newerror{negative-scale}{You said '#1scale=#2' as a global option, but scaling by negative numbers is not allowed as a global option. Instead, please use the option '#1mirror', and then scale by the absolute value.} \sseq@newerror{illegal-transform}{% You said '#1\ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text\else=\pgfkeyscurrentvalue\fi', but - no coordinate transforms are allowed in the body of sseqpages or sseqdata other than shifts by unit-free integers + no coordinate transforms are allowed in the body of sseqpage or sseqdata other than shifts by unit-free integers except as options for tikz primitives or for scopes that only contain tikz primitives. If you need a coordinate transformation, first use the option 'standard parse'.% } @@ -451,6 +501,7 @@ %% %% +\sseq@newerror{endenv-mismatch}{\string\begin {\@currenvir }\@currenvline \space ended by \string\end {#1}. I'm going to run the code for \string\end{\@currenvir} instead.} \sseq@newerror{env-inside-tikz}{#1 environment started inside tikz.} \sseq@newerror{env-inside-sseq}{#1 environment started inside other sseq environment.} \sseq@newerror{env-data-no-name}{Every 'sseqdata' environment must have a name. Specify one by saying 'name=your sseq name'.} @@ -462,7 +513,10 @@ \sseq@newerror{no-range}{Empty spectral sequence. For every spectral sequence you must either specify both the "x range" and "y range" or include at least one \string\class.} % maybe warning? -\sseq@newerror{index-larger-than-stack}{Index #1 is larger than the current stack depth #2.} +\sseq@newerror{range-overflow}{The #1 range #2 is too large. The maximum #1 range to fit on the page with the current #1scale and plot options is #1max - #1min = #3. The maximum #1scale possible with the current #1range is #4. Either change the scale or the range as appropriate.} +\sseq@newerror{range-super-overflow}{The #1 range #2 is too large. The maximum range possible is #1max - #1min = 16383 because of internal limitations of etex. } + +\sseq@newerror{index-out-of-bounds}{Index #1 is greater than or equal to the current stack depth #2. Valid indices must be strictly less than the stack depth.} \sseq@newerror{incomplete-tikz}{Incomplete tikz expression. What I have so far is #1 and I am stopping because I ran into #2. You probably forgot a semicolon.} @@ -477,7 +531,6 @@ \sseq@newerror{doptions-invisible}{Cannot add options to invisible differential.} \sseq@newerror{doptions-no-effect-on-this-page}{Adding an option to a differential on page #1 when the current page is \sseq@thepage\ and the 'keep changes' option is not present has no effect.} - \sseq@newerror{class-tag-already-defined}{A class with tag '#1' is already defined in position #2. Overwriting it.} % warning \sseq@newerror{replaceclass-not-dead-yet}{I cannot replace the class at #1 because it seems to be alive and well.} @@ -503,6 +556,7 @@ \sseq@newerror{structline-no-page-max}{You cannot provide \@nx\structline with the option "page=min--max", only with "page=min".} %warning \sseq@newerror{structline-already-exists}{Cannot add a structline from #1 to #2 because such a structline already exists.} \sseq@newerror{structline-stillborn}{Structline dies before it is born. Perhaps you meant to specify a different source or target?} +\sseq@newerror{structline-source-target-equal}{The source and target of a \@nx\structline cannot be equal.} \ExplSyntaxOff diff --git a/Master/texmf-dist/tex/latex/spectralsequences/sseqparsers.code.tex b/Master/texmf-dist/tex/latex/spectralsequences/sseqparsers.code.tex index cbce7c25492..f1804243fe5 100644 --- a/Master/texmf-dist/tex/latex/spectralsequences/sseqparsers.code.tex +++ b/Master/texmf-dist/tex/latex/spectralsequences/sseqparsers.code.tex @@ -1,8 +1,8 @@ %% -%% Package: spectralsequences.sty version 1.0 +%% Package: spectralsequences v1.1.0 %% Author: Hood Chatham %% Email: hood@mit.edu -%% Date: 2017-06-18 +%% Date: 2017-08-02 %% License: Latex Project Public License %% %% File: sseqparsers.code.tex @@ -11,11 +11,32 @@ %% ExplSyntaxOn for this whole file! \ExplSyntaxOn +\let\sseq@NoValue\c__xparse_no_value_tl +\protected\def\sseqparseint#1#2{ + \sseq@ifintexpr{#2+0}{ % +0 here to prevent \lastx from freaking out if it's at the end of #2. + \edef#1{\the\numexpr#2\relax} + }{ + \sseq@error{invalid-int-expr} + } +} + +% WARNING: doesn't work =( +\def\sseq@ifint#1{ + \ifcat$\romannumeral0#1$ + \prg_return_true: + \else + \ifcat$\romannumeral-0#1$ + \prg_return_true: + \else + \prg_return_false: + \fi + \fi +} % Prevent \protect from causing trouble for \pgfmathparse \let\sseq@pgfmathparse@orig\pgfmathparse -\def\sseq@pgfmathparse#1{\let\@@protect\protect\def\protect{}\sseq@pgfmathparse@orig{#1}\restore@protect} +\protected\def\sseq@pgfmathparse#1{\let\@@protect\protect\def\protect{}\sseq@pgfmathparse@orig{#1}\restore@protect} %%% ifpgfmathexpr @@ -24,17 +45,20 @@ % #3 -- false case % This tests true if \pgfmathparse{#1} throws an error or not. Luckily, \pgfmathparse pipes its errors through \pgfmath@error so this is easy. \def\sseq@ifpgfmathexpr#1{ - \bgroup + \begingroup \let\protect\pgfutil@empty \global\sseq@gtempiftrue - \def\pgfmath@error##1##2{\global\sseq@gtempiffalse} + \def\pgfmath@error##1##2{\global\sseq@gtempiffalse\sseq@closegroups\sseq@break} + \def\sseq@groupflag{} \pgfmathparse{#1} + \global\let\ifpgfmathunitsdeclared\ifpgfmathunitsdeclared \ifpgfmathunitsdeclared \xdef\sseq@mathresult{\pgfmathresult pt} \else \xdef\sseq@mathresult{\pgfmathresult} \fi - \egroup + \endgroup + \sseq@breakpoint \ifsseq@gtempif \@xp\@firstoftwo \else @@ -42,6 +66,8 @@ \fi } +\def\sseq@closegroups{\ifx\sseq@groupflag\empty\endgroup\@xp\sseq@closegroups\fi} + % Test if single token input is a digit \def\sseq@ifdigit#1{ @@ -75,21 +101,13 @@ % so we make spaces into catcode other and use \scantokens \def\sseq@ifintexpr#1{% \bgroup - \char_set_catcode_other:N \ % \sseq@tempcount\z@ - \makeatletter - \scantokens{\sseq@ifintexpr@first{needsint}#1\sseq@nil}% + \sseq@ifintexpr@{needsint}#1\sseq@nil% \@xp\egroup\next } -\@xp\let\@xp\sseq@otherspace\c_catcode_other_space_tl % This has to be a let, no idea why -%\def\sseq@ifintexpr#1{\@firstoftwo} - -% Gobble the space of catcode other that scantokens inserts after \sseq@ifintexpr@first -\def\sseq@ifintexpr@first#1#2{\sseq@ifintexpr@{#2}} % We need to use \futurelet so that we can detect open braces even when they only surround one token like {1} -% so we have to store the state in \sseq@ifintexpr@state - +% also we use it to detect spaces. Store the state in \sseq@ifintexpr@state first. \def\sseq@ifintexpr@#1{\def\sseq@ifintexpr@state{#1}\futurelet\testtok\sseq@ifintexpr@@} \def\sseq@ifintexpr@@{% \ifx\testtok\bgroup% @@ -98,12 +116,10 @@ \ifx\testtok\sseq@nil \@xp\let\@xp\next\csname sseq@ifintexpr@@\sseq@ifintexpr@state @done\endcsname \else - % Even though I \let \sseq@otherspace to a space of catcode other up there, - % I still need this freaking expandafter here. God only knows why. Figured this out by trial and error. % We need to check here for a space because \string<space> produces NO OUTPUT regardless of the catcode of the space. - % This fucks over \sseq@ifintexpr@@@ real hard because it doesn't expect \string#1 to produce no characters. - \@xp\ifx\sseq@otherspace\testtok - \def\next{\sseq@ifintexpr@next{~}\@xp\next\@gobble} + % This messes up \sseq@ifintexpr@@@ because it doesn't expect \string#1 to produce no characters. + \@xp\ifx\space\testtok + \def\next{\sseq@ifintexpr@next{\space}\@xp\next\romannumeral-`0} \else \let\next\sseq@ifintexpr@@@ \fi @@ -116,28 +132,24 @@ \ifcat$\@xp\@gobble\string#1$% \@xp\sseq@ifintexpr@@@@\@xp#1 \else - % scantokens puts an extra space character after control sequences, so to give them the best shot at working, eat that space character + % This is a macro, so fexpand it % Then use f expansion. - \@xp\@xp\@xp\sseq@ifintexpr@@@fexpcs\@xp\@xp\@xp#1\@xp\@gobble + \@xp\sseq@ifintexpr@@@fexpcs\@xp#1 \fi } -% Unfortunately, if we have a macro that takes an argument inside another macro that takes an argument, this will fail (the inside macro will get a space) but such is life. \def\sseq@ifintexpr@@@fexpcs{\exp_last_unbraced:Nf\sseq@ifintexpr@@@fexpcs@} \def\sseq@ifintexpr@@@fexpcs@{\futurelet\testtok\sseq@ifintexpr@@@fexpcs@@} \def\sseq@ifintexpr@@@fexpcs@@{ \ifx\testtok\bgroup - \@xp\sseq@ifintexpr@false + \@xp\sseq@ifintexpr@false % We already tested for groups above, so we need to check if this expanded to a group \else - \@xp\sseq@ifintexpr@@@@ + \@xp\sseq@ifintexpr@@@@ % If it's still a control sequence, then this will fail in the \pgfutil@ifundefined step \fi } -%\exp_last_unbraced:Nf\sseq@ifintexpr@@ - - % We can't just use \futurelet because "\let\testtok(" makes \testtok unexpandable % (I guess that makes sense, but why is it that I need \@xp\ifx\otherspace above if I've also \let\otherspace to a character? Mysterious...), % so then "\csname hello\testtok\endcsname" is an error. This indexes into our state machine, @@ -161,7 +173,9 @@ \ifx#1/% \sseq@ifintexpr@next{*/} \else - \pgfutil@ifundefined{sseq@ifintexpr@@\sseq@ifintexpr@state @#1}% + % This extra \string here is so that if a control sequence fexpanded and still gave a control sequence, + % we don't get a missing \endcsname error here, it just returns false + \pgfutil@ifundefined{sseq@ifintexpr@@\sseq@ifintexpr@state @\string#1}% {\let\next\sseq@ifintexpr@false}% {\sseq@ifintexpr@next{#1}}% \fi @@ -173,11 +187,9 @@ \next } -% This has to eat the space -%\bgroup\lccode`\*=`\ \lowercase{\egroup - \def\sseq@ifintexpr@true#1\sseq@nil{\ifnum\sseq@tempcount=\z@ \let\next\@firstoftwo\else\let\next\@secondoftwo\fi} - \def\sseq@ifintexpr@false#1\sseq@nil{\let\next\@secondoftwo} -%} +\def\sseq@ifintexpr@true#1\sseq@nil{\ifnum\sseq@tempcount=\z@ \let\next\@firstoftwo\else\let\next\@secondoftwo\fi} +\def\sseq@ifintexpr@false#1\sseq@nil{\let\next\@secondoftwo} + \def\sseq@makeifint#1#2#3{\@xp\def\csname sseq@ifintexpr@@#1@#2\endcsname{#3}} \def\sseq@ifintexpr@next#1{\@xp\let\@xp\next\csname sseq@ifintexpr@@\sseq@ifintexpr@state @#1\endcsname} @@ -220,6 +232,95 @@ \sseq@makeifint{nointallowed}{\space}{\sseq@ifintexpr@{nointallowed}} %% +%% This parser defines the syntax for the page argument of \d. +%% +\def\sseq@d@grabpage#1{ + \let\sseq@grabdpage@return#1 + \futurelet\testtok\sseq@grabdpage@ +} + +\def\sseq@grabdpage@{ + \sseq@tempiftrue + \ifx\testtok\bgroup + \let\next\sseq@grabdpage@group + \else + \def\sseq@dpage{} + \let\next\sseq@grabdpage@norm + \fi + \next +} + +\def\sseq@grabdpage@group#1{\def\sseq@dpage{#1}\sseq@grabdpage@return} + +\def\sseq@grabdpage@norm{ + \futurelet\testtok\sseq@grabdpage@norm@ +} + +\def\sseq@grabdpage@norm@{ + \let\next\sseq@grabdpage@token + \ifx\testtok\bgroup + \sseq@tempiffalse + \let\next\sseq@grabdpage@return + \else + \ifx\testtok\par + \sseq@tempiffalse + \let\next\sseq@grabdpage@return + \else + \ifx\testtok( + \let\next\sseq@grabdpage@return + \else + \@xp\ifx\space\testtok + \let\next\sseq@grabdpage@space + \fi + \fi + \fi + \fi + \next +} + +\def\sseq@grabdpage@space{\sseq@d@addto@macro\sseq@dpage{~}\@xp\sseq@grabdpage@norm\romannumeral-`0} + +\def\sseq@grabdpage@token#1{ + \ifcat$\@xp\@gobble\string#1$% + \sseq@d@addto@macro\sseq@dpage{#1} + \@xp\sseq@grabdpage@norm + \else + \ifx#1\end + \sseq@tempiffalse + \@xp\sseq@grabdpage@return\@xp#1\romannumeral-`0 + \else + \ifx#1\begin + \sseq@tempiffalse + \@xp\sseq@grabdpage@return\@xp#1\romannumeral-`0 + \else + \@xp\sseq@grabdpage@token@fexpcs\@xp#1\romannumeral-`0 + \fi + \fi + \fi +} + +\def\sseq@grabdpage@token@fexpcs{\exp_last_unbraced:Nf\sseq@grabdpage@token@fexpcs@} +\def\sseq@grabdpage@token@fexpcs@{\futurelet\testtok\sseq@grabdpage@token@fexpcs@@} +\def\sseq@grabdpage@token@fexpcs@@{ + \ifx\testtok\bgroup + \sseq@tempiffalse + \@xp\sseq@grabdpage@return + \else + \@xp\sseq@grabdpage@token@fexpcs@@@ + \fi +} +\def\sseq@grabdpage@token@fexpcs@@@#1{ + \ifcat$\@xp\@gobble\string#1$% + \sseq@d@addto@macro\sseq@dpage{#1} + \@xp\sseq@grabdpage@norm + \else + \sseq@tempiffalse + \@xp\sseq@grabdpage@return + \fi +} + + +%% %% %% New Class Pattern %% @@ -354,11 +455,6 @@ %% %% %%%%%% %%%%%% -% Only works for full coordinates. Used for error checking in \replaceclass and \d. -\def\sseq@ifundefcoord{\@xp\sseq@ifundefcoord@} -\def\sseq@ifundefcoord@(#1){% - \sseq@obj@ifundef{class.(#1).num}% -} \def\sseq@ifdead#1{\ifnum\sseq@obj{class.#1[\sseq@obj{class.#1.num}].page}<\sseq@infinitycount\@xp\@firstoftwo\else\@xp\@secondoftwo\fi} @@ -378,7 +474,8 @@ % inside of an hbox. \def\sseq@errortype{} -\def\sseq@printerrortype{\@xp\sseq@ifempty\@xp{\sseq@errortype}{}{~ for ~ \sseq@errortype}} +\def\sseq@printerrortype#1{\@xp\sseq@ifempty\@xp{\sseq@errortype}{}{#1 \sseq@errortype}} +\def\sseq@printforerrortype{\sseq@printerrortype{~for~}} %% Pulls off x,y and evaluates them, puts n or empty into a separate variable. % #1 -- a coordinate of the form {x,y} or {x,y,stuff} @@ -390,7 +487,7 @@ \pgfutil@in@ \sseq@protecterror { #1 } \ifpgfutil@in@ \bgroup - \sseq@restorefont + \sseq@restorefont % This prevents "Missing character" stuff from being written to the log. \let\sseq@protecterror\relax \setbox0=\hbox{#1} % Trigger the error message \egroup @@ -498,8 +595,11 @@ \ifx\sseq@index\pgfutil@empty \@xp\sseq@parsecoord@index \fi + % TODO: clean this up a bit? it's pretty ad-hoc. + % Whenever you update this, make sure to update sseq@paredcoords@swap below too. \@xp\let\csname x\sseq@macroname#1\endcsname\sseq@xcoord \@xp\let\csname y\sseq@macroname#1\endcsname\sseq@ycoord + \@xp\let\csname n\sseq@macroname#1\endcsname\sseq@index \@xp\let\csname \sseq@macroname#1@partial\endcsname\sseq@xycoord \edef#1{(\sseq@xycoord,\sseq@index)}% \@xp\edef\csname\sseq@macroname#1nopar\endcsname{\sseq@xycoord,\sseq@index} @@ -508,6 +608,26 @@ \@xp\edef\csname\sseq@macroname#1@internalname\endcsname{sseq{\sseq@xycoord,\sseq@index}}% } +% #1 & #2 -- the two base commands that were handed to \sseq@parsecoord to swap. +% This is only used in \structline to normalize the name of structure lines, so that sseqpages knows what you are talking about +% if you say \structline(coorda)(coordb) and then later \structline(coordb)(coorda) +\cs_new:Npn \sseq_swapmacros:NN #1#2 { + \let\sseq@temp#1 \let#1#2 \let#2\sseq@temp +} +\cs_generate_variant:Nn \sseq_swapmacros:NN { cc } + +\def\sseq@parsedcoords@swap#1#2{ + \sseq_swapmacros:cc { x\sseq@macroname#1 } { x\sseq@macroname#2 } + \sseq_swapmacros:cc { y\sseq@macroname#1 } { y\sseq@macroname#2 } + \sseq_swapmacros:cc { n\sseq@macroname#1 } { n\sseq@macroname#2 } + \sseq_swapmacros:cc { \sseq@macroname#1@partial } { \sseq@macroname#2@partial } + \sseq_swapmacros:NN #1 #2 + \sseq_swapmacros:cc { \sseq@macroname#1nopar } { \sseq@macroname#2nopar } + \sseq_swapmacros:cc { \sseq@macroname#1name } { \sseq@macroname#2name } + \sseq_swapmacros:cc { \sseq@macroname#1nameunbraced } { \sseq@macroname#2nameunbraced } + \sseq_swapmacros:cc { \sseq@macroname#1@internalname } { \sseq@macroname#2@internalname } +} + % EXPOSE: a wrapper around \sseq@parsecoord. Use full name of coordinate to avoid name class with sseq@parsecoord. \sseq@DeclareDocumentCommand \parsecoordinate { m r() }{% \sseq@parsecoord{#1}{#2}{call of \string\parsecoord}% @@ -522,7 +642,7 @@ \let\partialcoord\sseq@xycoord \let\xcoord\sseq@xcoord \let\ycoord\sseq@ycoord - \edef\nodenum{\sseq@obj@ifundef{partcoord.(\partialcoord).numnodespp}{1}{\sseq@obj{partcoord.(\partialcoord).numnodespp}}}% + \edef\nodenum{\sseq@obj@ifundef{partcoord.(\partialcoord).numnodes}{1}{\the\numexpr\sseq@obj{partcoord.(\partialcoord).numnodes}+1}}% \edef\coordnopar{\xcoord,\ycoord,\nodenum} \edef\coord{(\coordnopar)}% } @@ -540,7 +660,7 @@ \@xp\pgfkeys@spdef\@xp\sseq@rawsindex\@xp{\sseq@rawsindex} \edef\sseq@rawtindex{\@xp\sseq@dparsecoord@getyindex\@xp{\sseq@restcoord}}% \@xp\pgfkeys@spdef\@xp\sseq@rawtindex\@xp{\sseq@rawtindex} - % +% \let\sseq@rawindex\sseq@rawsindex \def\sseq@errortype{source ~ of ~ differential} \@xp\sseq@parsecoord@index % the \@xp is needed so that \sseq@break inside of parsecoordindex works properly. @@ -553,6 +673,11 @@ \fi \fi \let\sourcecoord\sseq@xycoord +% + \let\xsource\sseq@xcoord + \let\ysource\sseq@ycoord + \let\nsource\sseq@index +% \edef\source{(\sseq@xycoord,\sseq@index)}% \ifx\sourcename\undefined \edef\sourcename{(\sseq@xycoord\ifx\sseq@rawindex\pgfutil@empty\else,\sseq@rawindex\fi)} @@ -565,6 +690,9 @@ \sseq@parsecoord@index \let\targetcoord\sseq@xycoord \edef\target{(\sseq@xycoord,\sseq@index)}% + \let\xtarget\sseq@xcoord + \let\ytarget\sseq@ycoord + \let\ntarget\sseq@index \edef\targetname{(\sseq@xycoord\ifx\sseq@rawindex\pgfutil@empty\else,\sseq@rawindex\fi)} }{ \ifx\sseq@rawtindex\pgfutil@empty\else @@ -587,7 +715,7 @@ \def\sseq@differential@gettarget@#1#2,#3\sseq@nil{\the\numexpr#2+\sseq@targetx{#1}\relax,\the\numexpr#3+\sseq@targety{#1}\relax} \def\sseq@getfirsttwoelts#1,#2,#3\sseq@nil{#1,#2} -\def\sseq@getdtarget#1#2#3{\sseq@eval{\edef\@nx#1{\@nx\sseq@differential@gettarget{#2}{\sseq@getfirsttwoelts#3,,\sseq@nil}}}} +\protected\def\sseq@getdtarget#1#2#3{\sseq@eval{\edef\@nx#1{\@nx\sseq@differential@gettarget{#2}{\sseq@getfirsttwoelts#3,,\sseq@nil}}}} % Takes a comma separated list that can be empty, have one element, or two elements, returns first element (or empty if list is empty). \def\sseq@dparsecoord@getxindex#1{\sseq@dparsecoord@getxindex@#1,\sseq@nil} @@ -600,14 +728,15 @@ }% } -\def\sseq@parsecoordinate#1#2{% +% EXPOSE: a wrapper around \sseq@parsecoord. +\sseq@DeclareDocumentCommand\parsecoordinate { m r() }{% \sseq@parsecoord{#1}{#2}{call of \string\parsecoord}% } -% EXPOSE: a wrapper around \sseq@parsecoord. Use full name of coordinate to avoid name class with sseq@parsecoord. -\sseq@DeclareDocumentCommand \parsedifferential { m r() }{% - \sseq@dparsecoord{#1}{#2}{call of \string\parsecoord}% +% EXPOSE: a wrapper around \sseq@dparsecoord. +\sseq@DeclareDocumentCommand \parsedifferential { m r() d() }{% + \sseq@dparsecoord{#1}{#2}{#3}% } % Expandable coordinate parsing for \isalive. @@ -659,29 +788,32 @@ %%% The Stack %%% -\sseq@addtostorelistlet\sseq@stacktop\relax -\def\sseq@stackitem#1#2#3{\csname sseq.\sseq@thename.stack.#1.#3\endcsname} % gobble #2 which we added in for the error message -\def\sseq@getstackentry#1{ - \exp_args:No\sseq@getstackentry@{\sseq@stacktop}{#1}{#1} % Second copy of #1 for error message +% This maybe should be moved into sseqmain.code.tex... +\sseq@addtostorelist\sseq@stacktop{} +\def\sseq@stackitem#1#2{\csname sseq.\sseq@thename.stack.#1.#2\endcsname} % gobble #2 which we added in for the error message +\def\sseq@getstackentry#1#2{ + \ifnum#1<\sseq@stackdepth + \exp_args:No\sseq@getstackentry@{\sseq@stacktop}{#1}{#2} + \else + \sseq@protecterror{\sseq@error@xx{index-out-of-bounds}{#1}{\the\sseq@stackdepth}} + \fi } \def\sseq@getstackentry@#1#2{ \ifnum#2=\z@\@xp\@firstoftwo\else\@xp\@secondoftwo\fi - {\sseq@stackitem{#1}} - {\@ifundefined{sseq.\sseq@thename.stack.#1.next}{\sseq@getstackentry@indextoolarge}{ - \exp_args:Nf\sseq@getstackentry@{\csname sseq.\sseq@thename.stack.#1.next\@xp\endcsname\@xp}\@xp{\the\numexpr#2-1} - }} + { \sseq@stackitem{#1} } + { \exp_args:Nco\sseq@getstackentry@ { sseq.\sseq@thename.stack.#1.next } { \the\numexpr#2-1 } } } -\def\sseq@getstackentry@indextoolarge#1{\sseq@protecterror{\sseq@error@xx{index-larger-than-stack}{#1}{\the\sseq@stackdepth}}} -\def\sseq@pushstack(#1){ +\protected\def\sseq@pushstack(#1){ \bgroup \sseq@parsecoord\temp{#1}{} \sseq@pushstack@\temp \egroup } +% Note that \class directly calls pushstack@ to avoid reparsing the coordinate \def\sseq@pushstack@{\@xp\sseq@pushstack@@} \def\sseq@pushstack@@(#1,#2,#3){ @@ -696,11 +828,11 @@ \newcount\sseq@userstacksavecount -\def\sseq@savestack{ +\protected\def\sseq@savestack{ \global\advance\sseq@userstacksavecount\@ne \sseq@savestack@name{usersave@\the\sseq@userstacksavecount} } -\def\sseq@restorestack{ +\protected\def\sseq@restorestack{ \sseq@restorestack@name{usersave@\the\sseq@userstacksavecount} \global\advance\sseq@userstacksavecount\m@ne } @@ -714,17 +846,19 @@ % if #1 consists of a single nonnegative integer then -0#1 will be turned into some nonpositive integer % and romannumeral produces no output when handed a nonpositive integer, so the result will be empty. % If #1 has any nonnumerical tokens or is negative, there will be left over stuff. + % + % We also have to subtract off \sseq@x so that this behaves correctly inside of a scope (the \lastx value should be unshifted) \@xp\sseq@ifempty\@xp{\romannumeral-0#1}{ - \sseq@getstackentry{#1}{lastx} + \the\numexpr\sseq@getstackentry{#1}{lastx}-\sseq@x\relax }{ - \sseq@getstackentry{0}{lastx}#1 % #1 isn't a number so put it back + \the\numexpr\sseq@getstackentry{0}{lastx}-\sseq@x\relax#1 % #1 isn't a number so put it back } } \def\sseq@lasty#1{ \@xp\sseq@ifempty\@xp{\romannumeral-0#1}{ - \sseq@getstackentry{#1}{lasty} + \the\numexpr\sseq@getstackentry{#1}{lasty}-\sseq@y\relax }{ - \sseq@getstackentry{0}{lasty}#1 % #1 isn't a number so put it back + \the\numexpr\sseq@getstackentry{0}{lasty}-\sseq@y\relax#1 % #1 isn't a number so put it back } } @@ -737,16 +871,22 @@ } -\def\sseq@nameclass#1(#2){ +\sseq@DeclareDocumentCommand\nameclass {mr()} { \bgroup + \sseq@setthiscall{\sseq@nameclass#1(#2)} + \let\sseq@possibleoninputlinepar\empty \sseq@parsecoord\coord{#2}{} \sseq@cleanup@obj{class.namedclass.#1} \sseq@obj@xdef{class.namedclass.#1}{\coordnopar} + \sseq@breakpoint \egroup } -\def\sseq@tagclass#1(#2){% +\sseq@DeclareDocumentCommand\tagclass{mr()}{ \bgroup + \sseq@setthiscall{\tagclass#1(#2)} + \let\sseq@possibleoninputlinepar\empty + \def\sseq@class@tag{#1} \sseq@parsecoord\coord{#2}{}% \sseq@obj@ifdef{partcoord.(\sseq@xycoord).tag.\sseq@class@tagprefix\sseq@class@tag}{% \sseq@error@nn{class-tag-already-defined}{\sseq@class@tagprefix\sseq@class@tag}{(\sseq@xycoord)}% could be warning @@ -755,23 +895,59 @@ \sseq@obj@xdef{class.\coord.tag}{\sseq@class@tagprefix\sseq@class@tag}% \sseq@cleanup@obj{partcoord.(\sseq@xycoord).tag.\sseq@class@tagprefix\sseq@class@tag}% \sseq@obj@xdef{partcoord.(\sseq@xycoord).tag.\sseq@class@tagprefix\sseq@class@tag}{\sseq@index}% + \sseq@breakpoint \egroup } -\def\sseq@gettag#1(#2){ +\sseq@DeclareDocumentCommand\gettag{mr()}{ \bgroup + \sseq@setthiscall{\gettag#1(#2)} + \let\sseq@possibleoninputlinepar\empty \sseq@parsecoord\coord{#2}{} \sseq@obj@ifdef{class.\coord.tag}{ \xdef#1{\sseq@obj{class.\coord.tag}} }{ \sseq@error@n{class-no-tag}{(#2)} } + \sseq@breakpoint \egroup } +\prg_new_conditional:Npnn \sseq_if_out_of_bounds:n #1 { T , F , TF } { + \bgroup + \sseq@tempiftrue + \sseq@parsecoord\coord{#1}{} + \@gobbletwo\sseq@breakpoint\sseq@tempiffalse % this executes \sseq@tempiffalse if we broke, otherwise it gets gobbled + \ifsseq@tempif + \sseq_if_out_of_bounds_noparse:nnTF { \xcoord } { \ycoord }{\egroup\prg_return_true:}{\egroup\prg_return_false:} + \else + \egroup + \prg_return_false + \fi +} +% For internal use b/c it's faster not to call \sseq@parsecoord +% There's no noticeable performance boost though... =( +\prg_new_conditional:Npnn \sseq_if_out_of_bounds_noparse:nn #1#2 {TF} { + \sseq@tempiftrue + \ifnum#1<\sseq@xmaxpp\relax\ifnum#1>\sseq@xminmm\relax\ifnum#2<\sseq@ymaxpp\relax\ifnum#2>\sseq@yminmm\relax + \sseq@tempiffalse + \fi\fi\fi\fi + \ifsseq@tempif + \prg_return_true: + \else + \prg_return_false: + \fi +} +\sseq@DeclareDocumentCommand \IfOutOfBoundsTF { r() } { \sseq_if_out_of_bounds:nTF { #1 } } +\sseq@DeclareDocumentCommand \IfOutOfBoundsT { r() } { \sseq_if_out_of_bounds:nT { #1 } } +\sseq@DeclareDocumentCommand \IfOutOfBoundsF { r() } { \sseq_if_out_of_bounds:nF { #1 } } +\sseq@DeclareDocumentCommand \IfInBoundsTF { r() mm } { \sseq_if_out_of_bounds:nTF { #1 } { #3 } { #2 } } +\sseq@DeclareDocumentCommand \IfInBoundsT { r() } { \sseq_if_out_of_bounds:nF { #1 } } +\sseq@DeclareDocumentCommand \IfInBoundsF { r() } { \sseq_if_out_of_bounds:nT { #1 } } + %%%%%% %%% @@ -788,7 +964,7 @@ } \def\sseq@modtikzcommands@#1{% \ifx#1\sseq@nil\else - \edef#1{\@xp\@nx\csname\sseq@macroname#1\space\endcsname\@nx#1}% + \protected\edef#1{\@xp\@nx\csname\sseq@macroname#1\space\endcsname\@nx#1}% \@xp\let\csname\sseq@macroname#1\space\endcsname\sseq@defer@tikzcommand % This is just for error reporting so that it will say "Paragraph ended before \draw was complete" \@xp\sseq@modtikzcommands@ \fi @@ -797,6 +973,8 @@ \def\sseq@defer@tikzcommand#1{% \begingroup \let\sseq@isaliveprotect\sseq@isaliveprotect@protect + \sseq@setinputline + \sseq@loadinputline \sseq@callas{#1}% \gdef\sseq@thepathsofar{#1[/utils/exec={\sseq@thesseqstyle\sseq@thetikzprimitivestyle\the\sseq@scope@toks\sseq@savedoptioncode}]}% \xdef\sseq@whattheusersaid{\string#1} @@ -836,7 +1014,7 @@ \def\sseq@defer@tikzcommand@option[#1]{% \sseq@processoptions{tikz ~ primitives}{#1}% \ifx\sseq@savedoptioncode\pgfutil@empty\else - \sseq@x@addto@macro\sseq@thepathsofar{[/utils/exec={\unexpanded\@xp{\sseq@savedoptioncode}}]}% + \sseq@x@addto@macro\sseq@thepathsofar{[/utils/exec={\unexpanded\@xp{\@xp\sseq@options@bothpassmode\sseq@savedoptioncode}}]}% \fi \sseq@g@addto@macro\sseq@whattheusersaid{[#1]} \sseq@defer@tikzcommand@ @@ -927,14 +1105,14 @@ \sseq@defer@tikzcommand@finish@ } -% If the expression was incomplete, we'll jump here +% If the expression was incomplete, we'll jump here to avoid adding the semicolon to the error printout \def\sseq@defer@tikzcommand@finish@{ \sseq@g@addto@macro\sseq@thepathsofar{;} \global\sseq@thiscalltoks\@xp{\sseq@whattheusersaid} \ifx\sseq@pageconstraint\sseq@pageconstraint@true - \sseq@savedpaths@xadd{\unexpanded\@xp{\sseq@thepathsofar}}% + \sseq@savedpaths@xaddtikzpath{\unexpanded\@xp{\sseq@thepathsofar}}% \else - \sseq@savedpaths@xadd{% + \sseq@savedpaths@xaddtikzpath{% \@nx\sseq@tikzcommand@conditionaldraw{\unexpanded\@xp{\sseq@thepathsofar}}{\unexpanded\@xp{\sseq@pageconstraint}} }% \fi @@ -1151,7 +1329,6 @@ } -%TODO: fix this... \def\sseq@updatepageconstraintrange{% \sseq@protected@edef\sseq@pageconstraint{% (\unexpanded\@xp{\sseq@pageconstraint})&&(\temp<=\page \ifx\tempmax\empty\else&&\page<=\tempmax\fi)% @@ -1262,17 +1439,6 @@ \sseqnormalizemonomial@testend } -% This is supposed to take a space out of the input stream. For some reason \futurelet grabs it even though it's not supposed to... -% Make sure braces go around argument, except that if they go around \sseq@nil, \futurelet will grab the the open brace and not see -% the \sseq@nil. So we use a full expansion and don't put braces around \sseq@nil if that's our argument. -% MOTHERFUCKING SPACES. -\def\sseqnormalizemonomial@id#1{ - \ifx\sseq@nil#1 - \@xp\@firstoftwo - \else - \@xp\@secondoftwo - \fi{\@nx\sseq@nil}{{#1}} -} \def\sseqnormalizemonomial@testend{ \ifx\testtok\sseq@nil @@ -1281,12 +1447,8 @@ \egroup \let\next\@gobble \else - \@xp\ifx\space\testtok % not sure why I have to test for spaces like this -- figured it out with trial and error, like in \ifintexpr - % I'm not really sure why a space can show up here, but it crashes the macro and we don't care about spaces. - % I can't \@gobble the space because it will ignore it and take the next argument. What I can do is \@firstofone it away, but that deletes braces - % and in our case it's safe to put in extra braces but not to delete them. So I have \sseqnormalizemonomial@id... - % LaTeX is really really weird. - \def\next{\@xp\futurelet\@xp\testtok\@xp\sseqnormalizemonomial@testend\romannumeral-`0\sseqnormalizemonomial@id} + \@xp\ifx\space\testtok + \def\next{\@xp\futurelet\@xp\testtok\@xp\sseqnormalizemonomial@testend\romannumeral-`0} \else \let\next\sseqnormalizemonomial@ \fi |