texlive[44639] Master: spectralsequences (19jun17)

commits+karl at tug.org commits+karl at tug.org
Mon Jun 19 23:07:41 CEST 2017


Revision: 44639
          http://tug.org/svn/texlive?view=revision&revision=44639
Author:   karl
Date:     2017-06-19 23:07:40 +0200 (Mon, 19 Jun 2017)
Log Message:
-----------
spectralsequences (19jun17)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/spectralsequences/
    trunk/Master/texmf-dist/doc/latex/spectralsequences/README
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KRHFPSS.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/
    trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/pgfmanual-en-macros.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanualpreamble.tex
    trunk/Master/texmf-dist/tex/latex/spectralsequences/
    trunk/Master/texmf-dist/tex/latex/spectralsequences/spectralsequences.sty
    trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqcheckdefinitions.code.tex
    trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqdrawing.code.tex
    trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqforeach.code.tex
    trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqkeys.code.tex
    trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqloadstore.code.tex
    trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmacromakers.code.tex
    trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex
    trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmessages.code.tex
    trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqparsers.code.tex
    trunk/Master/tlpkg/tlpsrc/spectralsequences.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/README	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/README	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,8 @@
+Package: spectralsequences version 1.0
+Author: Hood Chatham
+Email: hood at 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 at 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


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/README
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,82 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% 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,
+%%    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 {} {
+    \class(0,0)
+    \foreach\i in {1,...,11}{
+        \class(0,\i)
+        \structline(0,\i-1,-1)(0,\i,-1)
+    }
+}
+\NewSseqGroup\hvee {} {
+    \tower(0,0)
+    \foreach\i in {1,...,11}{
+        \class(\i,\i)
+        \structline(\i-1,\i-1,-1)(\i,\i,-1)
+    }
+}
+
+\begin{document}
+\begin{sseqdata}[
+    name=A1 May,
+    x range={0}{10}, y range={0}{10},
+    degree={-1}{1},
+    classes={fill, tooltip = {(\xcoord,\ycoord)}},
+    class labels={below=3pt},
+    run off differentials= ->,
+    no orphan edges,
+]
+\foreach\i in {0,1,2}{
+    \begin{scope}[xshift=4*\i,yshift=2*\i,tag prefix=\i.]
+    \hvee[tag=id](0,0)
+    \hvee[tag=h0h1](1,2)
+    \hvee[tag=h20](2,1)
+    \foreach\j in {1,...,10}{
+        \d1(2,\j,h20,h0h1)
+    }
+    \foreach\j in {1,...,10}{
+        \d1(2+\j,1+\j,h20,h0h1)
+    }
+    \end{scope}
+}
+
+
+\foreach\i in {0,...,7}{
+    \d2(4+\i,2+\i,1.id,0.id)
+}
+\class(12,6)
+\d2(12,6,,1)
+
+%\classoptions["h_0"](0,1)
+\classoptions["h_1"](1,1)
+\classoptions["h_{20}"](2,1)
+\classoptions["h_{20}^2"](4,2)
+\classoptions["h_{20}^3"](6,3)
+\classoptions["h_{20}^4"](8,4)
+\classoptions["h_{20}^5"](10,5)
+
+\doptions[shorten >=3pt]1(10,10,2.h20,2.h0h1)
+\end{sseqdata}
+
+\printpage[name=A1 May,page=1]
+\newpage
+\printpage[name=A1 May,page=2]
+\newpage
+\begin{sseqpage}[name=A1 May,page=3]
+\classoptions["h_0h_{20}^2"](4,3,1.id)
+\end{sseqpage}
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,74 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: example_EO2_3.tex
+%%
+%%    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
+%%    E_* --> H^*( G ; E_* ) is induced by the trace map E_n --> EO_n, so all of these classes are permanent cycles. They are hard to compute and we don't draw them.
+%%    We also have classes \alpha and \beta coming from the stabilizer action, which are the images of \alpha_1 and \beta_1 in the ANSS.
+%%    By looking at cobar representatives, we can see that v*\beta_1 is the image of \beta_{3/3}.
+%%    Thus, the Toda differential in the ANSS d_3(\beta_{3/3}) = \alpha \beta^3 forces also that d_3(v) = \alpha \beta^2. Likewise, the Toda "Kudo" differential
+%%    d_9( \alpha \beta_{3/3}^2 ) = \beta^7 gives us upon dividing by \beta twice that d_9(\alpha v^2) = \beta^5. At this point, there are no possible differentials.
+%%    We see that v^3 survives so EO_n* is 72 = 2p^2(p-1)^2 periodic.  The picture is exactly the same at other odd primes. At 2, this degenerates to the
+%%    HFPSS for KO = KU^{hC_2} (see example_KUHFPSS).
+%%
+
+\documentclass{article}
+\usepackage{spectralsequences}
+\usepackage[landscape,margin=0cm,top=2cm]{geometry}
+
+\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)}}
+]
+\foreach \v in {0,...,8}{
+    \foreach \b in {0,...,11}{
+        \foreach \a in {0,1}{
+            \class(3*\a + 10*\b+24*\v,\a+2*\b)
+            \ifnum\b>0\relax
+                \structline(3*\a+10*\b-10+24*\v,\a+2*\b-2) (3*\a + 10*\b+24*\v,\a+2*\b)
+            \fi
+        }
+        \structline(10*\b+24*\v,2*\b)(3 + 10*\b + 24*\v,2*\b+1)
+        \ifnum \v = \numexpr\v/3*3\relax
+
+        \else
+            \ifnum\b<9\relax
+                \d5(10*\b+24*\v,2*\b)
+            \fi
+        \fi
+    }
+}
+
+% v^2ab^2 is in degree 2*24 + 3 + 2*10 = 71, 5
+% b^{pn+1} = b^{7} is in degree 7*10 = 70,14
+\foreach \v in {2,5}{
+    \foreach \b in {0,...,6}{
+        \d9(\v*24 + 3 +10*\b,1+2*\b)
+    }
+}
+\end{sseqdata}
+\printpage[name=EO(2),page=0]
+\newpage
+\printpage[name=EO(2),page=5]
+\newpage
+\printpage[name=EO(2),page=9]
+\newpage
+\begin{sseqpage}[name=EO(2),page=10]
+\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)
+\end{sseqpage}
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,330 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: example_KF3n.tex
+%%
+%%   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
+%%   spectral sequence, because it handles the badness of integral Kunneth for us too.
+%%
+
+\documentclass{article}
+\usepackage[margin=0.2in,top=0.4in,landscape]{geometry}
+\usepackage{spectralsequences}
+\usepackage{amssymb}
+\def\Z{\mathbb{Z}}
+\begin{document}
+\sseqset{
+    cohomological Serre grading,
+    title={Page \page},
+    class placement transform={scale=3, rotate=90},
+    class pattern=linear,
+    classes={draw=none},
+    class label handler = {\sseqnormalizemonomial{#1}},
+    bocksteinSS/.style={
+        page=0, y range={-1}{0},
+        no differentials, no labels, no y ticks, no title,
+        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),
+    x range={0}{8}, xscale=2.2, yscale=1.5,
+    x label={$H^*(K(\Z/3,2),\Z/3)$},
+    y label={$H^*(K(\Z/3,1),\Z/3)$},
+    right clip padding=20pt, x axis gap=20pt,
+]
+\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 } 
+\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)
+}
+
+\class(9,0)\class(9,0)
+\class(9,1)
+\class(9,2)
+\class(9,3)
+\class(9,4)
+\class(9,5)
+
+\class(10,0)\class(10,0)\class(10,0)
+\class(10,2)\class(10,2)
+\class(10,4)\class(10,4)
+
+\class(11,0)\class(11,0)
+\class(11,2)
+
+\class(12,0)
+\class(13,0)
+\class(14,0)
+\class(15,0)
+%\class["(\beta\iota_2)^2"](6,0)
+
+
+\d2(0,1) %d2(a)=i
+
+
+
+\d3(0,2) %d3(x) = b(i)
+\d2(0,3) % d2(ax) = ix
+\d3(0,4) % d2(x^2) = xb(i)
+\d2(0,5) % d2(ax^2) = ix^2
+%\d7
+
+
+\d2(2,1) % d2(ai) = i^2
+\d2(2,3) % d2(axi) = xi^2
+\d2(2,5) % d2(ax^2i)=x^2i^2)
+
+\d2(3,1) % d2(abi)=ib(i)
+\d2(3,3)
+\d2(3,5)
+
+\d2(4,1) % d2(ai^2)=i^3
+\d2(4,3)
+\d2(4,5)
+
+\d2(5,1,,1) %d2(ai_2bi_2) = i_2^2 bi_2
+\d2(5,3,,1)
+\d2(5,5,,1)
+
+\d2(6,1,,1) %d2(ai_2^3) = i_2^4
+\d2(6,3,,1)
+\d2(6,5,,1)
+
+\d2(7,1,1)  % d2(ai_2^2bi_2) = i_2^3 bi_2
+\d2(7,3,1)
+\d2(7,5,1)
+
+\d2(7,1,2) % d2(aP^1bi_2) = i_2 P^1bi_2
+\d2(7,3,2)
+\d2(7,5,2)
+
+\d3(7,2,2) % d3(x P^1bi_2) = bi_2 P^1bi_2
+\d3(7,4,2)
+
+\d2(8,1,1,2) % d2(a i_2^4) = i_2^5
+\d2(8,3,1,2)
+\d2(8,5,1,2)
+
+\d2(8,1,2,2) % d2(a bP^1bi_2) = i_2 bP^1bi_2
+\d2(8,3,2,2)
+\d2(8,5,2,2)
+
+\d3(8,2,2) % d3(x bP^1bi_2) = bi_2 bP^1bi_2
+\d3(8,4,2)
+
+
+\d5(3,4,,2) % d5(x^2i_2) = bP^1bi_2 -- Kudo differential
+
+\d7(0,6,,2) % d7(x^3) = P^1bi_2
+\d7(2,6,,2)
+\d7(3,6,,3)
+\d7(4,6,,2)
+\d7(5,6)
+\d7(6,6)
+\d7(7,6,1)
+\d7(7,6,2)
+\d7(8,6,1)
+\d7(8,6,2)
+
+
+\end{sseqdata}
+
+\printpage[name=K(Z/3;2),page=2]
+\newpage
+\printpage[name=K(Z/3;2),page=3]
+\newpage
+\printpage[name=K(Z/3;2),page=5]
+\newpage
+\printpage[name=K(Z/3;2),page=6]
+\newpage
+\printpage[name=K(Z/3;2),page=7]
+\newpage
+
+\begin{sseqpage}[
+    name=K(Z/3;2), bocksteinSS,
+    x axis extend end = 30pt, y axis gap=30pt,
+]
+\begin{scope}[background]
+\node[anchor=west] at (-2,0) { H^*(K(\Z/3,2),\Z/3)};
+\node[anchor=west] at (-2,-1) { H^*(K(\Z/3,2),\Z)};
+\end{scope}
+
+\draw[->]  (2,0) to[bend left=30, "\beta^1"] (3,0);
+\draw[->]  (4,0) to[bend left=30, "\beta^1"{pos = 0.55}] (5,0);
+\draw[->]  (6,0) to[bend right=30, "\beta^2"'] (7,0,1);
+\draw[->]  (7,0,2) to[bend left=30, "\beta^1"] (8,0,2);
+\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^2\}"](5,-1)
+\class["\Z/9\{\beta\iota_2^3\}"](7,-1)
+\class["\Z/3\{\beta P^1\iota_2\}"](8,-1)
+\end{sseqpage}
+
+
+\newpage
+\begin{sseqdata}[name=K(Z/3;3),xscale=2.2,yscale=1.7,y axis gap=40pt,x axis gap=30pt, x range={0}{9},
+    x label={$H^*(K(\Z/3,2),\Z/3)$},
+    y label={$H^*(K(\Z/3,1),\Z/3)$}
+]
+
+\foreach \x/\ymax/\xlabel in { 0/6/1, 3/6/\iota_3, 4/3/{{\beta\iota_3}} }
+\foreach \y/\ylabel in { 0/1, 2/\iota_2, 3/{{\beta\iota_2}}, 4/\iota_2^2, 5/\iota_2{\beta\iota_2}, 6/\iota_2^3 } {
+    \class["\ylabel\xlabel"](\x,\y)
+}
+
+\sseqset{class label handler = {}}
+
+\class["P^1\beta\iota_2"](0,7)
+\class["\iota_2^2\beta\iota_2"](0,7)
+\class["\beta P^1\beta\iota_2"](0,8)
+\class["\iota_2^4"](0,8)
+
+
+\class["P^1\iota_3"](7,0)
+\class["\iota_3\beta\iota_3"](7,0)
+\class["\beta P^1\iota_3"](8,0)
+\class["(\beta\iota_3)^2"](8,0)
+\class["P^1\beta\iota_3"](8,0)
+\class["\beta P^1\beta\iota_3"](9,0)
+
+
+\d3(0,2)
+\d4(0,3)
+\d3(0,4)
+\d3(0,5)
+\d7(0,6,,1)
+\d3(0,7,2)
+\d8(0,7,1,3)
+\d3(0,8,2)
+\d9(0,8,1)
+\d5(3,4,,1)
+
+\d3(4,2,,2)
+\d4(4,3,,2)
+\end{sseqdata}
+
+\printpage[name=K(Z/3;3),page=3]
+\newpage
+\printpage[name=K(Z/3;3),page=4]
+\newpage
+\printpage[name=K(Z/3;3),page=5]
+\newpage
+\printpage[name=K(Z/3;3),page=7]
+\newpage
+\printpage[name=K(Z/3;3),page=9]
+\newpage
+
+\begin{sseqpage}[ name=K(Z/3;3), bocksteinSS ]
+\begin{scope}[background]
+\node[anchor=west] at (-2.2,0) { H^*(K(\Z/3,3),\Z/3)};
+\node[anchor=west] at (-2.2,-1) { H^*(K(\Z/3,3),\Z)};
+\end{scope}
+
+\draw[->]  (3,0) to[bend left=30, "\beta^1"] (4,0);
+\draw[->]  (7,0,1) to[bend right=30, "\beta^1"' {pos=0.6}] (8,0,1);
+\draw[->] (7,0,2) to[bend left=30, "\beta^1" {pos=0.43}] (8,0,2);
+\draw[->] (8,0,3) to[bend left=30, "\beta^1"{pos=0.37}] (9,0);
+
+\class["\Z\{1\}"](0,-1)
+\class["\Z/3\{\beta\iota_3\}"](4,-1)
+\class["\Z/3\{\beta P^1\iota_3\}"](8,-1)
+\class["\Z/3\{\beta(\iota_3\beta\iota_3)\}"](8,-1)
+\class["\Z/3\{\beta P^1\beta\iota_3\}"](9,-1)
+\end{sseqpage}
+
+
+
+\begin{sseqdata}[name=K(Z/3;4),
+    xscale=2,yscale=1.5,y axis gap=20pt,x axis gap=30pt, x range={0}{10},
+    x label = {$H^*(K(\Z/3,3),\Z/3)$},
+    y label = {$H^*(K(\Z/3,4),\Z/3)$},
+    class label handler = {}
+]
+
+\class["1"](0,0)
+\class["\iota_3"](0,3)
+\class["\beta\iota_3"](0,4)
+\class["P^1\iota_3"](0,7)
+\class["\beta P^1\iota_3"](0,8)
+\class["\iota_3\beta\iota_3"](0,7)
+\class["(\beta\iota_3)^2"](0,8)
+\class["P^1\beta\iota_3"](0,8)
+\class["\beta P^1\beta\iota_3"](0,9)
+
+
+\class["\iota_4"](4,0)
+\class["\iota_3\iota_4"](4,3)
+\class["\beta\iota_3\iota_4"](4,4)
+
+\class["\beta\iota_4"](5,0)
+\class["\iota_3\beta\iota_4"](5,3)
+\class["\beta\iota_3\beta\iota_4"](5,4)
+
+\class["\iota_4^2"](8,0)
+\class["P^1\iota_4"](8,0)
+
+\class["\iota_4 \beta\iota_4"](9,0)
+\class["P^1\beta\iota_4"](9,0)
+\class["\beta P^1\iota_4"](9,0)
+
+\class["\beta P^1\beta\iota_4"](10,0)
+
+\d4(0,3) % d4(i_3) = i_4
+\d4(0,7,2)
+\d4(4,3,,1)
+\d4(5,3,,1)
+
+\d5(0,4)
+
+\d8(0,7,1,2)
+
+\d9(0,8,1,2)
+\d5(0,8,2)
+\d9(0,8,3,3)
+\d10(0,9)
+
+%\d
+\end{sseqdata}
+
+\printpage[name=K(Z/3;4),page=4]
+\newpage
+\printpage[name=K(Z/3;4),page=5]
+\newpage
+\printpage[name=K(Z/3;4),page=8]
+\newpage
+\printpage[name=K(Z/3;4),page=9]
+\newpage
+\printpage[name=K(Z/3;4),page=10]
+\newpage
+
+\begin{sseqpage}[ name=K(Z/3;4), bocksteinSS, yscale=1.3 ]
+\begin{scope}[background]
+\node[anchor=west] at (-2.2,0) { H^*(K(\Z/3,4),\Z/3)};
+\node[anchor=west] at (-2.2,-1) { H^*(K(\Z/3,4),\Z)};
+\end{scope}
+
+\draw[->] (4,0)   to[bend left=30,  "\beta^1"] (5,0);
+\draw[->] (8,0,1) to[bend right=30, "\beta^1"' {pos=0.6}] (9,0,1);
+\draw[->] (8,0,2) to[bend left=30,  "\beta^1" {pos=0.6}]   (9,0,3);
+\draw[->] (9,0,2) to[ "\beta^1"] (10,0);
+
+\class["\Z\{1\}"](0,-1)
+\class["\Z/3\{\beta\iota_4\}"](5,-1)
+\class["\Z/3\{\beta P^1\iota_4\}"](9,-1)
+\class["\Z/3\{\beta(\iota_4^2)\}"](9,-1)
+\class["\Z/3\{\beta P^1\beta\iota_4\}"](10,-1)
+\end{sseqpage}
+
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KRHFPSS.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KRHFPSS.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KRHFPSS.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KRHFPSS.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KRHFPSS.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,92 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: example_KUHFPSS.tex
+%%
+%%    I think this is one of Eric Peterson's favorite spectral sequences, and his enthusiasm for it has rubbed off on me a bit.
+%%    Here our group is C_2 which acts on the periodicity element by -1, so again we have a norm element v in degree 2|G| = 4.
+%%    There are easier ways to understand this, but I explained the EO_3 one in terms of the comparison map from the ANSS,
+%%    and that's interesting here too. In the ANSS at 2, there is a differential d3(\alpha_3) = \alpha_1^4. Here a cobar calculation
+%%    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. 
+%%    In particular, it's not even connective.
+%%
+
+\documentclass{article}
+\usepackage[landscape,margin=2cm]{geometry}
+\usepackage{spectralsequences}
+\begin{document}
+\sseqset{
+    Z2class/.sseq style={circle,inner sep=0.3ex,fill=black},
+    Zclass/.sseq style={fill=none,draw,inner sep=0.6ex},
+    2Zclass/.sseq style={fill=none,rectangle,draw,inner sep=0.6ex,outer sep=0.5ex}
+}
+\begin{sseqdata}[
+    name=KRHFPSS,
+    x range={-12}{14},
+    y range={0}{10},
+    y axis style=center,
+    y axis gap=0.425cm,
+    tick step=4,
+    classes=Z2class,
+    differentials=->,
+    degree={-1}{#1-1},
+    scale=0.85,
+    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,
+]
+
+\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);
+
+\pgfmathsetmacro\xitstart{int(int(\xmin/8)*8-16)}
+\pgfmathsetmacro\xitgap{int(\xitstart+4)}
+\pgfmathsetmacro\xitend{int(\xmax+2)}
+\pgfmathsetmacro\xmaxpp{int(\xmax+2)}
+
+\foreach \x in {\xitstart,\xitgap,...,\xitend} {
+    \class[Zclass](\x,0)
+    \foreach \z in {0,...,\xmaxpp} {
+        \class(\x+\z+1,\z+1)
+        \structline(\x+\z,\z)(\x+\z+1,\z+1)
+    }
+}
+
+\pgfmathsetmacro\xitstart{int(\xitgap)}
+\pgfmathsetmacro\xitgap{int(\xitstart+8)}
+
+\foreach \x in {\xitstart,\xitgap,...,\xitend} {
+    \foreach\z in {0,...,\xmax}{
+        \d4(\x+\z,\z)
+    }
+    \replaceclass[2Zclass](\x,0)
+}
+\end{sseqdata}
+\printpage[name=KRHFPSS,page=0]
+\newpage
+\printpage[name=KRHFPSS,page=5]
+
+
+\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;
+\foreach \z in {2,6}{
+    \doptions[draw=none]4(-\z-1,\z-1)
+    \structlineoptions[draw=none](-\z-1,\z-1)(-\z,\z)
+    \structlineoptions[draw=none](-\z-3,\z+1)(-\z-2,\z+2)
+    \replaceclass(-\z-2,\z+2)
+}
+\structlineoptions[draw=none](-3,1)(-2,2)
+\end{sseqpage}
+\newpage
+\printpage[name=KRHFPSS,page=5]
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,139 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: example_KZ3.tex
+%%
+%%    This was one of the first spectral sequences I ever worked out (probably after the one for loops S^n), in the summer of 2013 with Kevin Donoghue.
+%%
+
+\documentclass{article}
+\usepackage[landscape,margin=0.5cm,top=2cm]{geometry}
+\usepackage[]{sseqpages}
+\usepackage{amssymb}
+\def\Z{\mathbb{Z}}
+% Last time test: 1.1 sec
+\begin{document}
+\def\column#1[#2]{\foreach \y in {0,...,6} {\class[#2](#1,2*\y)}}
+\sseqset{classes={draw=none}}
+\begin{sseqdata}[
+    name={K(Z,3)},
+    x range={0}{12},
+    y range={0}{10},
+    cohomological Serre grading,
+    differentials={->},
+    labels=below,
+    xscale=1.8,
+    y axis gap=0.7cm,
+    math nodes,
+    x axis extend end=0.8cm,
+    this page cycles=red,
+    title=\textup{Serre SS Page \page{}},
+    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\}"]
+
+
+\foreach\y in {1,...,6} {\d["\cdot \y"']3(0,2*\y)}
+\replaceclass["\Z/3"](3,4)
+\replaceclass["\Z/5"](3,8)
+
+
+\column6["\Z/2"]
+\d3(3,2)
+\d3(3,6)
+\d3(3,10)
+\replaceclass["\Z/2"](3,6)
+\replaceclass["\Z/3"](3,10)
+\column8["\Z/3"]
+\d5(3,4)
+\d5(3,10)
+\column9["\Z/2"]
+\d3(6,2)
+\d3(6,6)
+\d3(6,10)
+\column10["\Z/2"]
+\d7(3,6)
+\column11["\Z/3"]
+\d3(8,2)
+\d3(8,4)
+\d3(8,8)
+\d3(8,10)
+\column12["\Z/2\oplus\Z/5"]
+\column13["\Z/2"]
+\column15["\Z/2\oplus\Z/2\oplus\Z/5"]
+\d3(9,2)
+\d3(9,6)
+\d3(9,10)
+\d3(10,2)
+\d3(10,6)
+\d3(10,10)
+\d3(10,12)
+\d3(12,2)
+\d3(12,4)
+\d3(12,6)
+\d3(12,8)
+\d3(12,10)
+\d3(12,4)
+\replaceclass["\Z/5"](12,0)
+\replaceclass["\Z/5"](12,4)
+\replaceclass["\Z/5"](12,8)
+\d9(3,8)
+
+
+\replaceclass["\Z/5"](12,10)
+\replaceclass["\Z/2"](15,0)
+\replaceclass["\Z/2\oplus\Z/2"](15,4)
+
+\d5(10,4)
+
+\class["\Z/3"](16,0)
+\class["\Z/3"](16,6)
+\d5(11,4)
+\d5(11,10)
+
+\class["\Z/2"] (17,0)
+
+\class["\Z/2"](17,8)
+
+\d5(12,12)
+
+\class["\Z/2"](19,0)
+\d9(10,8)
+
+\class["\Z/5"](23,0)
+\d11(12,10)
+
+\replaceclass["\Z/6"](16,0)
+\d13(3,12)
+
+%\replaceclass["\Z/6"](21,0)
+%\d13(8,12)
+\class["\Z/3"](24,0)
+\d13(11,12)
+\end{sseqdata}
+
+
+\printpage[name={K(Z,3)}, page=0,no differentials]
+\newpage
+\printpage[name={K(Z,3)}, page=0]
+\newpage
+\printpage[name={K(Z,3)}, page=3]
+\newpage
+\printpage[name={K(Z,3)}, page=5]
+\newpage
+\printpage[name={K(Z,3)}, page=7]
+\newpage
+\printpage[name={K(Z,3)}, page=9]
+\newpage
+\printpage[name={K(Z,3)}, page=11]
+\newpage
+\printpage[name={K(Z,3)}, page=12]
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,88 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% 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.
+%%
+
+\documentclass{article}
+\usepackage{spectralsequences}
+\usepackage[landscape]{geometry}
+\begin{document}
+% tower definitions
+\NewSseqCommand\alphaclass{d()}{
+    \IfNoValueTF{#1}{}{\pushstack(#1)}
+    \class(\lastx+3,\lasty+1)
+    \structline(\lastclass)(\lastclass1)
+}
+
+\NewSseqCommand\betaclass{d()}{
+    \IfNoValueTF{#1}{}{\pushstack(#1)}
+    \class(\lastx+7,\lasty+1)
+    \structline(\lastclass)(\lastclass1)
+}
+
+\begin{sseqpage}[
+    Adams grading,
+    classes = { tooltip = {(\xcoord,\ycoord)} },
+    class labels = above left,
+    label distance=3pt,
+    differentials={-{>[width=4]}, target anchor=-60},
+    y range={0}{10},
+    x range={0}{45},
+    x tick step=5,
+    xscale=0.375
+]
+\class[rectangle,fill,inner sep=3pt](0,0)
+
+\class["\alpha_1"](3,1) \structline(0,0)(3,1)
+\class["\alpha_2"](7,1)
+\class[circlen=2,"\alpha_{3/2}"](11,1)
+\class["\alpha_4"](15,1)
+\class["\alpha_5"](19,1)
+\class[circlen=2,"\alpha_{6/2}"](23,1)
+\class["\alpha_7"](27,1)
+\class["\alpha_8"](31,1)
+\class[circlen=3,"\alpha_{9/3}"](35,1)
+\class["\alpha_{10}"](39,1)
+\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)
+
+% tower off of beta_1
+\alphaclass(10,2)\betaclass
+\alphaclass\betaclass
+\alphaclass\betaclass
+\alphaclass\betaclass
+
+% tower off of beta_2
+\alphaclass(26,2)\betaclass
+\alphaclass\betaclass
+\alphaclass
+
+
+% tower off of beta_3/3
+\alphaclass(34,2)\betaclass
+\alphaclass\betaclass
+
+% tower off of beta_3
+\class[fill,circlen=2](45,3) \structline(42,2,-1)(45,3,-1)
+\betaclass
+
+% d5s
+\d5(34,2)
+\d5(44,4)
+\end{sseqpage}
+
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,359 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at 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


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,79 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at 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


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,139 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: example_endofVFoS.tex
+%%
+%%   This is the drawing that got me started making the package. To this day, I don't know what it is. I copied it from Matt Ando's handwritten notes on
+%%   Haynes 1990(?) class on Vector Fields on Spheres. It's on the very last page of the second part of the notes, so it must have been the last day of class.
+%%   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}
+\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)}}
+\begin{document}
+\begin{sseqdata}[
+    name=mysseq,
+    x range={1}{25},
+    y range={0}{19},
+    homological Serre grading,
+    classes=fill,
+    permanent classes={circle,red},
+    transient cycles={black},
+    differentials={blue},
+    grid = go,
+    scale=0.9
+]
+
+\foreach \x in {1,3,5,...,35} {\class(\x,0)}
+
+\row{1}
+\row{2}
+\row{3}
+
+\foreach \y in {7,15,23}{
+    \row{\y}
+    \row{\y+1}
+    \twoptrow{\y+2}
+    \row{\y+3}
+    \row{\y+4}
+}
+
+\foreach \x in {9,13,...,25}{
+    \d2(\x,0)
+%
+    \foreach \y in {7,15}{
+        \d2 (\x,\y)
+        \d2 (\x,\y+1,,2)
+        \d2 (\x,\y+2,1,)
+    }
+}
+
+
+
+\foreach \x in {4,8,...,24}{
+    \d2 (\x,1)
+    \d2 (\x,2)
+    \foreach \y in {7,15}{
+         \d2 (\x,\y+1,,2)
+        \d2 (\x,\y+2,1,)
+        \d2 (\x,\y+3)
+    }
+}
+
+
+\foreach \x in {4,8,..., 24,28}
+    \foreach \y in {7,15}{
+        \d3 (\x+2,\y,,1)
+        \d3 (\x,\y+2,2,)
+}
+
+\foreach \x in {11,19,27}{
+    \d4(\x,0)
+}
+
+\foreach \x in {12,20,28}
+    \foreach \y in {7,15}{
+        \d5(\x,\y)
+}
+
+
+
+\foreach \x in {10,18,26,34}{
+    \d7(\x,1)
+    \d7(\x-1,2)
+    \d7(\x-2,3,,2)
+
+    \foreach \y in {9,17}{
+        \d7(\x,\y,1)
+        \d7(\x-1,\y+1)
+        \d7(\x-2,\y+2,,2)
+    }
+}
+
+\d9(15,0)
+\d9(14,1,,2)
+\d10(13,2)
+
+\d8(23,0)
+\d8(22,1)
+\foreach \x in {23,31} {
+    \d8(\x-2,2,,2)
+    \d9(\x-3,3)
+}
+\foreach \x in {16,24,32} {
+    \d9(\x,7)
+    \d8(\x-2,9,1,)
+    \d8(\x-3,10,,2)
+    \d9(\x-4,11)
+}
+\end{sseqdata}
+
+
+\printpage[name=mysseq, page=0]
+\newpage
+\printpage[name=mysseq, page=2]
+\newpage
+\printpage[name=mysseq, page=3]
+
+\newpage
+\printpage[name=mysseq, page=4]
+\newpage
+\printpage[name=mysseq, page=5]
+\newpage
+\printpage[name=mysseq, page=7]
+\newpage
+\printpage[name=mysseq, page=8]
+\newpage
+\printpage[name=mysseq, page=9]
+\newpage
+\printpage[name=mysseq, page=10]
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,126 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% 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. 
+%%    Thanks to Antonio Ruiz for suggesting it.
+%%
+
+\documentclass{article}
+\usepackage[landscape,margin=1cm,top=2cm]{geometry}
+\usepackage{spectralsequences}
+\usepackage{amssymb}
+\def\Z{\mathbb{Z}}
+
+\begin{document}
+\sseqset{
+    0/.sseq style={"0",draw=none},
+    homological Serre grading,
+    classes={draw=none,inner sep=0.2em},
+    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
+]
+\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;
+}
+\end{scope}
+
+\class["\Z"](0,0)
+\foreach\x in {1,3,...,9}{
+    \class["\Z_2"](\x,0)
+}
+\foreach \x in {2,4,...,8}{
+    \class[0](\x,0)
+}
+\foreach\y in {1,3,...,9}{
+    \pgfmathparse{9-\y}
+    \let\xmax\pgfmathresult
+    \foreach\x in {0,...,\xmax}{
+        \class["\Z_2"](\x,\y)
+    }
+}
+
+\foreach \y in {2,4,...,8}{
+    \pgfmathparse{9-\y}
+    \let\xmax\pgfmathresult
+    \foreach\x in {0,...,\xmax}{
+        \class[0](\x,\y)
+    }
+}
+
+\foreach \x in {3,5,...,9}{
+    \d2(\x,0)
+}
+
+\d3(4,1)
+\d3(6,1)
+\d3(8,1)
+\d3(4,3)
+\d3(6,3)
+\d3(4,5)
+\end{sseqdata}
+\printpage[name=hatcherex1,page=0]
+
+\begin{sseqdata}[
+    name=hatcherex2,
+    yscale=0.6,
+    x axis gap=0.3cm,
+]
+
+\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;
+}
+\end{scope}
+
+
+\foreach\x in {0,2,...,8}{
+    \class["\Z"](\x,0)
+}
+\foreach \x in {1,3,...,9}{
+    \class[0](\x,0)
+}
+\foreach\y in {1,3,...,9}{
+    \pgfmathparse{9-\y}
+    \let\xmax\pgfmathresult
+    \foreach\x in {0,...,\xmax}{
+        \pgfmathparse{int(mod(\x,2))}
+        \ifnum\pgfmathresult=0\relax
+            \class["\Z_2"](\x,\y)
+        \else
+            \class[0](\x,\y)
+        \fi
+    }
+}
+
+\d2(2,0)
+\foreach \x in {4,6,...,8}{
+    \foreach\r in {2,4,...,\x}{
+        \d\r(\x,0)
+        \replaceclass["\Z"](\x,0)
+    }
+}
+
+\foreach \y in {2,4,...,8}{
+    \pgfmathparse{9-\y}
+    \let\xmax\pgfmathresult
+    \foreach\x in {0,...,\xmax}{
+        \class[0](\x,\y)
+    }
+}
+
+\end{sseqdata}
+\printpage[name=hatcherex2,page=0]
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,129 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at 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


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,292 @@
+%%
+%% Package: sseqpages.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: example_tmfass.tex
+%%
+%%    From "The Homotopy Groups of tmf and of its Localizations" http://math.mit.edu/conferences/talbot/2007/tmfproc/Chapter16/TmfHomotopy.pdf
+%%    This file has really bad performance.
+%%
+
+
+% 9.8 sec
+
+% 1.7 seconds to set up
+% 1.8 seconds to draw the classes
+% 2.1 seconds to draw the edges
+% --> ~5.7 seconds to draw page 0.
+
+% edge drawing time:
+%   1.0s to calculate but discard without off page handling
+%   0.6s to deal with off-page edges
+%   0.3s to draw
+
+% 17 seconds to draw all pages =(
+% 17 ~~ 1.7s setup + 5 page * 3 s/pp
+%
+% 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}
+
+\begin{document}
+
+\NewSseqGroup\tower {} {% 25
+    \class(0,0)
+    \foreach \y in {1,...,22}{
+        \class(0,\y)
+        \structline(0,\y-1,-1) (0,\y,-1)
+    }
+}
+
+\NewSseqGroup\towergroup {} {%9 + 25 = 36
+    \tower(0,0)
+    \class(1,1)
+    \class(3,1)
+    \class(2,2)
+    \class(3,2)
+    \class(3,3)
+    \class(6,2)
+    \structline(3,1,-1)(3,2,-1)
+    \structline(3,2,-1)(3,3,-1)
+    \structline(0,0,-1)(1,1,-1)
+    \structline(1,1,-1)(2,2,-1)
+    \structline(2,2,-1)(3,3,-1)
+    \structline(0,0,-1)(3,1,-1)
+    \structline(3,1,-1)(6,2,-1)
+    \structline(0,1,-1)(3,2,-1)
+    \structline(0,2,-1)(3,3,-1)
+}
+
+
+\NewSseqGroup\towergroupa {} {%25*2+9+21 = 80
+    \towergroup(0,0)
+    \tower(4,-1)
+%
+    \class(6,0)
+    \class(6,1)
+    \class(7,-1)
+    \class(7,0)
+    \class(7,1)
+    \class(9,0)
+    \class(9,1)
+    \class(9,2)
+    \class(10,0)
+    \class(10,1)
+    \class(12,0)
+    \class(12,1)
+    \class(12,2)
+    \class(13,1)
+    \structline(6,0,-1)(6,1,-1)
+    \structline(6,1,-1)(6,2,-1)
+    \structline(7,-1,-1)(7,0,-1)
+    \structline(7,0,-1)(7,1,-1)
+    \structline(9,0,-1)(9,1,-1)
+    \structline(9,1,-1)(9,2,-1)
+    \structline(10,0,-1)(10,1,-1)
+    \structline(12,0,-1)(12,1,-1)
+    \structline(12,1,-1)(12,2,-1)
+%
+    \structline(4,-1,-1)(7,0,-1)
+    \structline(4,0,-1)(7,1,-1)
+    \structline(6,0,-1)(9,1,-1)
+    \structline(6,1,-1)(9,2,-1)
+    \structline(6,0,-1)(7,1,-1)
+    \structline(7,-1,-1)(10,0,-1)
+    \structline(7,0,-1)(10,1,-1)
+    \structline(9,0,-1)(12,1,-1)
+    \structline(9,1,-1)(12,2,-1)
+    \structline(9,0,-1)(10,1,-1)
+    \structline(10,0,-1)(13,1,-1)
+    \structline(12,0,-1)(13,1,-1)
+%
+    \d2(4,-1,-1,-1)
+    \d2(4,0,-1,-1)
+    \d2(4,1,-1,-1)
+    \d2(7,-1,-1,-1)
+    \d2(7,0,-1,-1)
+    \d2(10,0,-1,-1)
+}
+
+\NewSseqGroup\towergroupb {} {%80 + 25 + 15 = 120
+    \towergroupa(0,0)
+    \tower(8,-2)
+    \class(10,-1)
+    \class(11,-1)
+    \class(10,-2)
+    \class(9,-3)
+    \class(11,-2)
+    \structline(8,-2)(11,-1)
+    \structline(11,-1)(10,-2)
+    \structline(10,-2)(9,-3)
+    \structline(11,-2)(11,-1)
+
+    \class(13,-1)
+    \class(13,0)
+    \class(14,-2)
+    \class(15,0)
+    \class(16,-1)\class(16,-1)
+    \class(16,0)
+    \class(16,1)
+    \class(17,0)
+    \class(18,0)
+    \class(18,1)
+    \class(19,-1)
+    \structline(10,-1,-1)(10,0,-1)
+    \structline(13,0,-1)(13,1,-1)
+    \structline(13,-1,-1)(13,0,-1)
+    \structline(16,0,-1)(16,1,-1)
+    \structline(16,-1,-2)(16,0,-1)
+    \structline(16,-1,-1)(16,0,-1)
+
+    \structline(10,-1,-1)(13,0,-1)
+    \structline(13,-1,-1)(16,0,-1)
+    \structline(13,0,-1)(16,1,-1)
+    \structline(15,0,-1)(18,1,-1)
+    \structline(15,0,-1)(16,1,-1)
+    \structline(16,-1,-1)(17,0,-1)
+    \structline(17,0,-1)(18,1,-1)
+    \structline(18,1,-1)(18,0,-1)
+    \d2(10,-1,-1,-1)
+    \d2(13,-1,-1,-1)
+    \d2(13,0,-1,-1)
+    \d3(14,-2,-1,-1)
+    \d2(19,-1,-1,-1)
+}
+
+\begin{sseqdata}[
+    x range={0}{50},
+    y range={0}{20},
+    x tick step=2,
+    Adams grading,
+    classes={fill,inner sep=0.3ex,tooltip={(\xcoord,\ycoord)}},
+    differentials={->,blue},
+    struct lines=red, %no struct lines, no differentials,
+    yscale=0.6, xscale=0.5,
+    x axis extend end=0.2cm,
+    name=tmfass,
+    grid=go,
+    run off differentials=->
+]
+
+\towergroup(0,0) % 36
+
+\class(8,3)\class(9,4)
+\structline(8,3)(9,4)
+\towergroupa(8,4) % 80
+
+\foreach \n in {2,3,4}{
+    \towergroupb(8*\n,4*\n) % 120
+}
+
+\foreach \n in {1,2,3,4}{
+    \begin{scope}[xshift=8*\n,yshift=4*\n]
+    \class(8,3)
+    \class(9,4)
+    \structline(8,3,-1)(9,4,-1)
+    \d3(9,0,-1,-1)
+    \d3(10,1,-1,-1)
+    \end{scope}
+}
+
+
+\foreach \n in {1,2,3,5,6,7}{
+    \class(35+2*\n,7+\n)
+}
+
+%\d2(18,4)
+\d3(24,6)
+
+\class(36,9)
+\d2(36,9)
+\d4(37,8)
+\d4(45,12)
+
+
+\class(44,13)
+\d2(44,13)
+\class(45,9)
+\class(47,10)
+\class(49,11)
+\d4(49,11,,1)
+\d4(49,11,,2)
+\replaceclass(48,15,1)
+\towergroupb(40,20)
+\towergroup(48,8)
+\foreach \n in {0,...,5}{
+    \class(40+2*\n,8+\n)
+}
+
+\d3(42,9)
+\d4(44,10)
+\d4(47,16)
+\d2(48,8)
+\d4(48,9)
+\d3(49,9,,2)
+\d3(50,13)
+\class(50,10)
+\d4(50,10,1)
+\d4(50,10,2)
+\replaceclass[offset={(0,0)}](50,10)
+\class(51,12)
+\d4(51,12)
+\class(52,17)
+\d2(52,17)
+
+\foreach \n in {0,4,8}{
+    \d3(32+2*\n,10+\n,1)
+    \d4(31+2*\n,8+\n)
+}
+\end{sseqdata}
+
+
+\printpage[name=tmfass,page=0]
+%\end{document}
+
+
+\printpage[name=tmfass,page=2]
+
+\printpage[name=tmfass,page=3]
+
+\printpage[name=tmfass,page=4]
+
+\begin{sseqpage}[name=tmfass,page=5,class labels={below=0.2em},tikz primitives=dashed]
+\classoptions["\eta" {right=0.1em}](1,1)
+\classoptions["\nu" below right](3,1)
+\classoptions["\epsilon"](8,3)
+\classoptions["c_4+\epsilon" left](8,4)
+\classoptions["2c_6"](12,6)
+\classoptions["\kappa"](14,4)
+\classoptions["c_4^2"](16,8)
+\classoptions["\overline\kappa"](20,4)
+\classoptions["8\Delta"](24,7)
+\classoptions["\eta\Delta"](25,5)
+\classoptions["2\nu\Delta"](27,6)
+\classoptions["c_4\Delta+q" left](32,7,1)
+\classoptions["q"](32,7,2)
+\classoptions["\overline\kappa^2"](40,8)
+\classoptions["4\Delta^2"](48,10)
+\draw(6,2)--(9,4);
+\draw(21,5)--(22,8);
+\draw[bend left=20] (25,5) to (28,8);
+\draw (27,6) -- (28,8);
+\draw(32,7,1)--(33,9);
+\draw[bend right=10](32,7,2) to (35,10);
+\draw(34,8) -- (35,10);
+\draw(39,9)--(40,11,2);
+\draw(39,9)--(42,12);
+\draw(40,8)--(40,11,2);
+\draw(40,11,1)--(41,13);
+\draw(40,8)--(41,10) -- (42,12);
+\draw(45,9)--(46,11);
+\draw(48,15,1)--(48,16,1);
+\draw[bend right=20] (48,15,1) to (49,17);
+\structline[black](50,10,2)(51,11)
+\end{sseqpage}
+
+\end{document}
+


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,242 @@
+%%
+%% Package: sseqpages.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: example_tmfmayss.tex
+%%
+%%    I got this from Mike Hill's note: https://pdfs.semanticscholar.org/ddbb/8d584e4e81a71400088117b16cd241238c6c.pdf
+%%
+
+
+
+\documentclass{article}
+\usepackage[landscape,left=1cm]{geometry}
+\usepackage{spectralsequences}
+\begin{document}
+\sseqset{htwostructstyle/.sseq style = {gray,very thin, run off=-}}
+%\pgfkeys{/sseqpages/struct line/htwostructstyle/.show code}
+
+
+\NewSseqCommand\twods{ O{} U( r() m m }{
+    \def\temp{#1,#2,#3,#4,#5}
+    \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
+%
+    \circleclasses[ differential style, #1,
+           name path = circ, 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)
+%
+    \path(target1)--(target2)
+                coordinate[midway](midpt);% put a coordinate in the center of the two classes
+    \path[name path = lin] (source) -- (midpt);% save path from start to midpoint
+%
+    % draw line in "differential style" from start to intersection point of circ and lin
+    \draw[ differential style, #1, page constraint= { \page == #2 },
+           name intersections = { of = circ and lin } ]
+                (source) -- (intersection-1);
+}
+
+
+\NewSseqCommand \tower { O{} d() } {
+    \IfNoValueF{#2}{
+        \pushstack(#2)
+    }
+    \savestack
+    \edef\towermax{\the\numexpr9-\lasty0}
+    \begin{scope}[#1]
+    \foreach\i in {1,...,\towermax}{
+        \class(\lastx,\lasty+1)
+        \structline(\lastclass1)(\lastclass)
+    }
+    \end{scope}
+    \restorestack
+}
+
+\NewSseqCommand\honetower {O{}} {
+    \savestack
+    \begin{scope}[#1]
+    \edef\towermax{\the\numexpr9-\lasty0}
+    \foreach\i in {1,...,\towermax}{
+        \class(\lastx+1,\lasty+1)
+        \structline(\lastclass1)(\lastclass)
+    }
+    \end{scope}
+    \restorestack
+}
+
+\NewSseqCommand\htwo { O{} d()  } {
+    \IfNoValueF{#2}{
+        \pushstack(#2)
+    }
+    \class[#1](\lastx+3,\lasty+1)
+    \structline[htwostructstyle](\lastclass1)(\lastclass)
+}
+
+\NewSseqCommand \htwotower { O{} d() } {
+    \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}{
+        \class(\lastx,\lasty+1)
+        \structline(\lastclass1)(\lastclass)
+        \structline[htwostructstyle](\lastx-3,\lasty-1,\thetag)(\lastclass)
+    }
+    \restorestack
+    \end{scope}
+}
+
+
+\NewSseqCommand\dtower {u(u)} {
+    \foreach\i in {0,...,10}{
+        \d[yshift=\i]#1(#2)
+    }
+}
+
+\begin{sseqdata}[name=tmfmayss,y range={0}{8}, x range={0}{25}, classes=fill, class labels={below=3pt},degree={-1}{1},differentials=blue,
+    class pattern=linear, classes={ tooltip = {(\xcoord,\ycoord)} }, xscale=0.8,
+    title = {Page \page},
+    run off differentials = ->
+]
+\class[tag= h0^i](0,0) \tower[tag=h0^i]
+\honetower \classoptions["h_1"](1,1)
+
+\htwotower[tag=h0^i h2]
+\classoptions["h_2"](3,1)
+\htwotower[tag=h0^i h2^2]
+\htwotower[tag=h0^i h2^3]
+\htwotower[tag=h0^i h2^4]
+\htwotower[tag=h0^i h2^5]
+\htwotower[tag=h0^i h2^6]
+\htwotower[tag=h0^i h2^7]
+\htwotower[tag=h0^i h2^8]
+\htwo%\htwotower[tag=h0^i h2^9]
+
+
+\class["b_{20}",name=b20,tag=h1^i b20](4,2)
+\tagclass{h0^i b20}(4,2)
+\honetower[tag=h1^i b20]
+\tower[tag=h0^i b20]
+\class["x_7",tag=h0^i x7,name=x7](7,2) \honetower
+\htwotower[tag=h0^i x7](b20)
+\structline(\lastclass)(x7) % h0 x7 = h2 b20
+
+
+\class["b_{21}", tag=h0^i b21,name=b21](10,2)
+\honetower[tag=h1^i b21]
+%\structline(\lastclass)(h2^2 b20) % h2 (h0 x7) = h2 (h2 b20)
+
+\htwotower[tag=h0^i b21](x7)
+\structline(b21)(\lastclass)
+
+
+
+\htwotower[tag=h0^i h2 b21](b21)
+\htwotower[tag=h0^i h2^2 b21]
+\htwotower[tag=h0^i h2^3 b21]
+\htwotower[tag=h0^i h2^4 b21]
+\htwotower[tag=h0^i h2^5 b21]
+\htwotower[tag=h0^i h2^6 b21]
+
+\class["b_{30}",tag=h1^i b30](12,2)
+\tagclass{h0^i b30}(12,2)
+\tower[tag=h0^i b30]\honetower[tag=h1^i b30]
+\htwotower[tag=h0^i h2 b30]
+\htwotower[tag=h0^i h2^2 b30]
+\htwotower[tag=h0^i h2^3 b30]
+\htwotower[tag=h0^i h2^4 b30]
+\htwotower[tag=h0^i h2^5 b30]
+
+
+
+%
+
+\class[tag=h0^i x7^2](14,4)
+\classoptions["x_7^2",page=0--3](\lastclass)
+\classoptions["d",page=4--100](\lastclass)
+\tower[tag=h0^i x7^2] \honetower
+
+\htwotower[tag=h0^i h2 x7^2]
+\htwotower[tag=h0^i h2^2 x7^2]
+\htwotower[tag=h0^i h2^3 x7^2]
+\htwotower[tag=h0^i h2^4 x7^2]
+\htwo%\htwotower[tag=h0^i h2^5 x7^2]
+
+
+\class["b_{20}^2",tag=h0^i b_{20}^2](8,4)
+\tower[tag=h0^i b_{20}^2]
+\honetower
+\htwotower[tag=h0^i h2 b_{20}^2]
+\htwotower[tag=h0^i h2^2 b_{20}^2]
+\htwotower[tag=h0^i h2^3 b_{20}^2]
+\htwotower[tag=h0^i h2^4 b_{20}^2]
+\htwo%\htwotower[tag=h0^i h2^5, b_{20}^2]
+
+\class[tag=h0^i b21^2](20,4)
+\classoptions["b_{21}^2",page=0--3](\lastclass)
+\classoptions["g",page=4--100](\lastclass)
+\honetower
+\tower[tag=h0^i b21^2]
+
+\htwotower[tag=h0^i h2 b21^2]
+\htwotower[tag=h0^i h2^2 b21^2]
+
+\class["b_{30}^2",tag=h0^i b30^2](24,4)
+\tower[tag=h0^i b30^2]
+\honetower
+\htwotower
+%\htwotower[tag=h0^i h2^3 b21^2]
+
+
+
+\twods3(4,2,-1){1}{2} % d3(b20) = h1^3 + h0^2 h2
+\replaceclass[offset={(0,0)}](3,3)
+\structline(3,2)(3,3)
+\structline(2,2)(3,3)
+\structline[htwostructstyle](0,2)(3,3)
+
+\foreach\y in {3,...,8} {\d3(4,\y,-1,-1)} % d3( h0^i b20 ) = h0^{2+i} h2
+\foreach\n in {3,...,8} {\d3(2+\n,\n,h1^i b20,1)} % d3(h1^i b20) = h1^{3+i}
+\foreach \y in {2,...,8} {\d3(7,\y,h0^i x7,h0^i h2^2)}
+
+\foreach \y in {2,...,8} {\d3(10,\y,h0^i b21,h0^i h2^3)}
+
+\foreach \y in {3,...,8} {\d3(13,\y,  h0^i h2 b21  ,h0^i h2^4)}
+\foreach \y in {3,...,7} {\d3(16,\y+1,h0^i h2^2 b21,h0^i h2^5)}
+\foreach \y in {3,...,6} {\d3(19,\y+2,h0^i h2^3 b21,h0^i h2^6)}
+\foreach \y in {3,...,5} {\d3(22,\y+3,h0^i h2^4 b21,h0^i h2^7)}
+\foreach \y in {3,...,4} {\d3(25,\y+4,h0^i h2^5 b21,h0^i h2^8)}
+
+\foreach \n in {0,...,6} {\d3(12+\n,2+\n,h1^i b30,h1^i b21)}
+
+\foreach \n in {0,...,4} {\d5(24,4+\n,-1,-1)}
+
+
+\classoptions[page=4--100,"c_0"](8,3)
+\classoptions[page=4--100,"a"](12,3)
+\classoptions[page=4--100,"b"](15,3)
+
+
+
+\end{sseqdata}
+\printpage[name=tmfmayss,page=2]
+\newpage
+\printpage[name=tmfmayss,page=3]
+\newpage
+\printpage[name=tmfmayss,page=5]
+\newpage
+\printpage[name=tmfmayss,page=8,title={Page $\infty$}]
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/pgfmanual-en-macros.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/pgfmanual-en-macros.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/pgfmanual-en-macros.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,1762 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+% $Header: /cvsroot/pgf/pgf/doc/generic/pgf/macros/pgfmanual-en-macros.tex,v 1.81 2014/03/20 10:07:44 tantau Exp $
+
+
+\providecommand\href[2]{\texttt{#1}}
+\providecommand\hypertarget[2]{\texttt{#1}}
+\providecommand\hyperlink[2]{\texttt{#1}}
+
+
+\colorlet{examplefill}{yellow!80!black}
+\definecolor{graphicbackground}{rgb}{0.96,0.96,0.8}
+\definecolor{codebackground}{rgb}{0.9,0.9,1}
+
+\newenvironment{pgfmanualentry}{\list{}{\leftmargin=2em\itemindent-\leftmargin\def\makelabel##1{\hss##1}}}{\endlist}
+\newcommand\pgfmanualentryheadline[1]{\itemsep=0pt\parskip=0pt{\raggedright\item\strut{#1}\par}\topsep=0pt}
+\newcommand\pgfmanualbody{\parskip3pt}
+
+\let\origtexttt=\texttt
+\def\texttt#1{{\def\textunderscore{\char`\_}\def\textbraceleft{\char`\{}\def\textbraceright{\char`\}}\origtexttt{#1}}}
+\def\exclamationmarktext{!}
+\def\atmarktext{@}
+
+{
+  \catcode`\|=12
+  \gdef\pgfmanualnormalbar{|}
+  \catcode`\|=13
+  \AtBeginDocument{\gdef|{\ifmmode\pgfmanualnormalbar\else\expandafter\verb\expandafter|\fi}}
+}
+
+
+
+\newenvironment{pgflayout}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      \texttt{\string\pgfpagesuselayout\char`\{\declare{#1}\char`\}}\oarg{options}%
+    }
+    \index{#1@\protect\texttt{#1} layout}%
+    \index{Page layouts!#1@\protect\texttt{#1}}%
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+
+\newenvironment{command}[1]{
+  \begin{pgfmanualentry}
+    \extractcommand#1\@@
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\makeatletter
+
+\def\includeluadocumentationof#1{
+  \directlua{require 'pgf.manual.DocumentParser'}
+  \directlua{pgf.manual.DocumentParser.include '#1'}
+}
+
+\newenvironment{luageneric}[4]{
+  \pgfmanualentry
+    \pgfmanualentryheadline{#4 \texttt{#1\declare{#2}}#3}
+    \index{#2@\protect\texttt{#2} (Lua)}%
+    \def\temp{#1}
+    \ifx\temp\pgfutil at empty\else
+      \index{#1@\protect\texttt{#1}!#2@\protect\texttt{#2} (Lua)}%
+    \fi
+  \pgfmanualbody
+}{\endpgfmanualentry}
+
+\newenvironment{luatable}[3]{
+  \medskip
+  \luageneric{#1}{#2}{ (declared in \texttt{#3})}{\textbf{Lua table}}
+}{\endluageneric}
+
+\newenvironment{luafield}[1]{
+  \pgfmanualentry
+    \pgfmanualentryheadline{Field \texttt{\declare{#1}}}
+  \pgfmanualbody
+}{\endpgfmanualentry}
+
+
+\newenvironment{lualibrary}[1]{
+  \pgfmanualentry
+  \pgfmanualentryheadline{%
+    \pgfmanualpdflabel{#1}{}%
+    \textbf{Graph Drawing Library} \texttt{\declare{#1}}%
+  }
+    \index{#1@\protect\texttt{#1} graph drawing library}%
+    \index{Libraries!#1@\protect\texttt{#1}}%
+    \index{Graph drawing libraries!#1@\protect\texttt{#1}}%
+    \vskip.25em
+    {\ttfamily\char`\\usegdlibrary\char`\{\declare{#1}\char`\}\space\space \char`\%\space\space  \LaTeX\space and plain \TeX}\\
+    {\ttfamily\char`\\usegdlibrary[\declare{#1}]\space \char`\%\space\space Con\TeX t}\smallskip\par
+    \pgfmanualbody
+}{\endpgfmanualentry}
+
+\newenvironment{luadeclare}[4]{
+  \pgfmanualentry
+  \def\manual at temp@default{#3}%
+  \def\manual at temp@initial{#4}%
+  \def\manual at temp@{#3#4}%
+  \pgfmanualentryheadline{%
+    \pgfmanualpdflabel{#1}{}%
+    {\ttfamily/graph
+      drawing/\declare{#1}\opt{=}}\opt{#2}\hfill%
+    \ifx\manual at temp@\pgfutil at empty\else%
+    (\ifx\manual at temp@default\pgfutil at empty\else%
+    default {\ttfamily #3}\ifx\manual at temp@initial\pgfutil at empty\else, \fi%
+    \fi%
+    \ifx\manual at temp@initial\pgfutil at empty\else%
+    initially {\ttfamily #4}%
+    \fi%
+    )\fi%
+  }%
+  \index{#1@\protect\texttt{#1} key}%
+  \pgfmanualbody
+  \gdef\myname{#1}%
+%  \keyalias{tikz}
+%  \keyalias{tikz/graphs}
+}{\endpgfmanualentry}
+
+\newenvironment{luadeclarestyle}[4]{
+  \pgfmanualentry
+  \def\manual at temp@para{#2}%
+  \def\manual at temp@default{#3}%
+  \def\manual at temp@initial{#4}%
+  \def\manual at temp@{#3#4}%
+  \pgfmanualentryheadline{%
+    \pgfmanualpdflabel{#1}{}%
+    {\ttfamily/graph drawing/\declare{#1}}\ifx\manual at temp@para\pgfutil at empty\else\opt{\texttt=}\opt{#2}\fi\hfill%
+    (style\ifx\manual at temp@\pgfutil at empty\else, %
+    \ifx\manual at temp@default\pgfutil at empty\else%
+    default {\ttfamily #3}\ifx\manual at temp@initial\pgfutil at empty\else, \fi%
+    \fi%
+    \ifx\manual at temp@initial\pgfutil at empty\else%
+    initially {\ttfamily #4}%
+    \fi%
+    \fi)%
+  }%
+  \index{#1@\protect\texttt{#1} key}%
+  \pgfmanualbody%
+  \gdef\myname{#1}%
+%  \keyalias{tikz}
+%  \keyalias{tikz/graphs}
+}{\endpgfmanualentry}
+
+\newenvironment{luanamespace}[2]{
+  \luageneric{#1}{#2}{}{\textbf{Lua namespace}}
+}{\endluageneric}
+
+\newenvironment{luafiledescription}[1]{}{}
+
+\newenvironment{luacommand}[4]{
+  \hypertarget{pgf/lua/#1}{\luageneric{#2}{#3}{\texttt{(#4)}}{\texttt{function}}}
+}{\endluageneric}
+
+\newenvironment{luaparameters}{\par\emph{Parameters:}%
+  \parametercount=0\relax%
+  \let\item=\parameteritem%
+  \let\list=\restorelist%
+}
+{\par
+}
+
+\newenvironment{luareturns}{\par\emph{Returns:}%
+  \parametercount=0\relax%
+  \let\item=\parameteritem%
+  \let\list=\restorelist%
+}
+{\par
+}
+
+\newcount\parametercount
+
+\newenvironment{parameterdescription}{\unskip%
+  \parametercount=0\relax%
+  \let\item=\parameteritem%
+  \let\list=\restorelist%
+}
+{\par
+}
+\let\saveditemcommand=\item
+\let\savedlistcommand=\list
+\def\denselist#1#2{\savedlistcommand{#1}{#2}\parskip0pt\itemsep0pt}
+\def\restorelist{\let\item=\saveditemcommand\denselist}
+\def\parameteritem{\pgfutil at ifnextchar[\parameteritem@{}}%}
+\def\parameteritem@[#1]{\advance\parametercount by1\relax\hskip0.15em plus 1em\emph{\the\parametercount.}\kern1ex\def\test{#1}\ifx\test\pgfutil at empty\else#1\kern.5em\fi}
+
+\makeatother
+\newenvironment{commandlist}[1]{%
+  \begin{pgfmanualentry}
+  \foreach \xx in {#1} {%
+    \expandafter\extractcommand\xx\@@
+  }%
+  \pgfmanualbody
+}{%
+  \end{pgfmanualentry}
+}%
+\makeatletter
+
+% \begin{internallist}[register]{\pgf at xa}
+% \end{internallist}
+%
+% \begin{internallist}[register]{\pgf at xa,\pgf at xb}
+% \end{internallist}
+\newenvironment{internallist}[2][register]{%
+  \begin{pgfmanualentry}
+  \foreach \xx in {#2} {%
+    \expandafter\extractinternalcommand\expandafter{\xx}{#1}%
+  }%
+  \pgfmanualbody
+}{%
+  \end{pgfmanualentry}
+}%
+\def\extractinternalcommand#1#2{%
+  \removeats{#1}%
+  \pgfmanualentryheadline{%
+    \pgfmanualpdflabel{\textbackslash\strippedat}{}%
+    Internal #2 \declare{\texttt{\string#1}}}%
+  \index{Internals!\strippedat @\protect\myprintocmmand{\strippedat}}%
+  \index{\strippedat @\protect\myprintocmmand{\strippedat}}%
+}
+
+%% MW: START MATH MACROS
+\def\mvar#1{{\ifmmode\textrm{\textit{#1}}\else\rmfamily\textit{#1}\fi}}
+
+\makeatletter
+
+\def\extractmathfunctionname#1{\extractmathfunctionname@#1(,)\tmpa\tmpb}
+\def\extractmathfunctionname@#1(#2)#3\tmpb{\def\mathname{#1}}
+
+\makeatother
+
+\newenvironment{math-function}[1]{
+  \def\mathdefaultname{#1}
+  \extractmathfunctionname{#1}
+  \edef\mathurl{{math:\mathname}}\expandafter\hypertarget\expandafter{\mathurl}{}%
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{\texttt{#1}}%
+    \index{\mathname @\protect\texttt{\mathname} math function}%
+    \index{Math functions!\mathname @\protect\texttt{\mathname}}%
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\def\pgfmanualemptytext{}
+\def\pgfmanualvbarvbar{\char`\|\char`\|}
+
+\newenvironment{math-operator}[4][]{%
+  \begin{pgfmanualentry}
+  \csname math#3operator\endcsname{#2}{#4}
+  \def\mathtest{#4}%
+  \ifx\mathtest\pgfmanualemptytext%
+    \def\mathtype{(#3 operator)}
+  \else%
+    \def\mathtype{(#3 operator; uses the \texttt{#4} function)}
+  \fi%
+  \pgfmanualentryheadline{\mathexample\hfill\mathtype}%
+  \def\mathtest{#1}%
+  \ifx\mathtest\pgfmanualemptytext%
+    \index{#2@\protect\texttt{#2} #3 math operator}%
+    \index{Math operators!#2@\protect\texttt{#2}}%
+  \fi%
+  \pgfmanualbody
+}
+{\end{pgfmanualentry}}
+
+\newenvironment{math-operators}[5][]{%
+  \begin{pgfmanualentry}
+  \csname math#4operator\endcsname{#2}{#3}
+  \def\mathtest{#5}%
+  \ifx\mathtest\pgfmanualemptytext%
+    \def\mathtype{(#4 operators)}
+  \else%
+    \def\mathtype{(#4 operators; use the \texttt{#5} function)}
+  \fi%
+  \pgfmanualentryheadline{\mathexample\hfill\mathtype}%
+  \def\mathtest{#1}%
+  \ifx\mathtest\pgfmanualemptytext%
+    \index{#2#3@\protect\texttt{#2\protect\ #3} #4 math operators}%
+    \index{Math operators!#2#3@\protect\texttt{#2\protect\ #3}}%
+  \fi%
+  \pgfmanualbody
+}
+{\end{pgfmanualentry}}
+
+\def\mathinfixoperator#1#2{%
+  \def\mathoperator{\texttt{#1}}%
+  \def\mathexample{\mvar{x}\space\texttt{#1}\space\mvar{y}}%
+}
+
+\def\mathprefixoperator#1#2{%
+  \def\mathoperator{\texttt{#1}}%
+  \def\mathexample{\texttt{#1}\mvar{x}}%
+}
+
+\def\mathpostfixoperator#1#2{%
+  \def\mathoperator{\texttt{#1}}
+  \def\mathexample{\mvar{x}\texttt{#1}}%
+}
+
+\def\mathgroupoperator#1#2{%
+  \def\mathoperator{\texttt{#1\ #2}}%
+  \def\mathexample{\texttt{#1}\mvar{x}\texttt{#2}}%
+}
+
+\expandafter\let\csname matharray accessoperator\endcsname=\mathgroupoperator
+\expandafter\let\csname matharrayoperator\endcsname=\mathgroupoperator
+
+\def\mathconditionaloperator#1#2{%
+  \def\mathoperator{#1\space#2}
+  \def\mathexample{\mvar{x}\ \texttt{#1}\ \mvar{y}\ {\texttt{#2}}\ \mvar{z}}
+}
+
+\newcommand\mathcommand[1][\mathdefaultname]{%
+  \expandafter\makemathcommand#1(\empty)\stop%
+  \expandafter\extractcommand\mathcommandname\@@%
+  \medskip
+}
+\makeatletter
+
+\def\makemathcommand#1(#2)#3\stop{%
+  \expandafter\def\expandafter\mathcommandname\expandafter{\csname pgfmath#1\endcsname}%
+  \ifx#2\empty%
+  \else%
+    \@makemathcommand#2,\stop,
+  \fi}
+\def\@makemathcommand#1,{%
+  \ifx#1\stop%
+  \else%
+    \expandafter\def\expandafter\mathcommandname\expandafter{\mathcommandname{\ttfamily\char`\{#1\char`\}}}%
+    \expandafter\@makemathcommand%
+  \fi}
+\makeatother
+
+\def\calcname{\textsc{calc}}
+
+\newenvironment{math-keyword}[1]{
+  \extracttikzmathkeyword#1@
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{\texttt{\color{red}\mathname}\mathrest}%
+    \index{\mathname @\protect\texttt{\mathname} tikz math function}%
+    \index{TikZ math functions!\mathname @\protect\texttt{\mathname}}%
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\def\extracttikzmathkeyword#1#2@{%
+  \def\mathname{#1}%
+  \def\mathrest{#2}%
+}
+
+%% MW: END MATH MACROS
+
+
+\def\extractcommand#1#2\@@{%
+  \removeats{#1}%
+  \pgfmanualentryheadline{%
+    \pgfmanualpdflabel{\textbackslash\strippedat}{}%
+    \declare{\texttt{\string#1}}#2%
+  }%
+  \index{\strippedat @\protect\myprintocmmand{\strippedat}}
+}
+
+\def\luaextractcommand#1#2\relax{%
+  \declare{\texttt{\string#1}}#2\par%
+%  \removeats{#1}%
+ % \index{\strippedat @\protect\myprintocmmand{\strippedat}}
+ % \pgfmanualpdflabel{\textbackslash\strippedat}{}%
+}
+
+
+% \begin{environment}{{name}\marg{arguments}}
+\renewenvironment{environment}[1]{
+  \begin{pgfmanualentry}
+    \extractenvironement#1\@@
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\def\extractenvironement#1#2\@@{%
+  \pgfmanualentryheadline{%
+    \pgfmanualpdflabel{#1}{}%
+    {\ttfamily\char`\\begin\char`\{\declare{#1}\char`\}}#2%
+  }%
+  \pgfmanualentryheadline{{\ttfamily\ \ }\meta{environment contents}}%
+  \pgfmanualentryheadline{{\ttfamily\char`\\end\char`\{\declare{#1}\char`\}}}%
+  \index{#1@\protect\texttt{#1} environment}%
+  \index{Environments!#1@\protect\texttt{#1}}
+}
+
+
+\newenvironment{plainenvironment}[1]{
+  \begin{pgfmanualentry}
+    \extractplainenvironement#1\@@
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\def\extractplainenvironement#1#2\@@{%
+  \pgfmanualentryheadline{{\ttfamily\declare{\char`\\#1}}#2}%
+  \pgfmanualentryheadline{{\ttfamily\ \ }\meta{environment contents}}%
+  \pgfmanualentryheadline{{\ttfamily\declare{\char`\\end#1}}}%
+  \index{#1@\protect\texttt{#1} environment}%
+  \index{Environments!#1@\protect\texttt{#1}}%
+}
+
+
+\newenvironment{contextenvironment}[1]{
+  \begin{pgfmanualentry}
+    \extractcontextenvironement#1\@@
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\def\extractcontextenvironement#1#2\@@{%
+  \pgfmanualentryheadline{{\ttfamily\declare{\char`\\start#1}}#2}%
+  \pgfmanualentryheadline{{\ttfamily\ \ }\meta{environment contents}}%
+  \pgfmanualentryheadline{{\ttfamily\declare{\char`\\stop#1}}}%
+  \index{#1@\protect\texttt{#1} environment}%
+  \index{Environments!#1@\protect\texttt{#1}}}
+
+
+\newenvironment{shape}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      \textbf{Shape} {\ttfamily\declare{#1}}%
+    }%
+    \index{#1@\protect\texttt{#1} shape}%
+    \index{Shapes!#1@\protect\texttt{#1}}
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{pictype}[2]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      \textbf{Pic type} {\ttfamily\declare{#1}#2}%
+    }%
+    \index{#1@\protect\texttt{#1} pic type}%
+    \index{Pic Types!#1@\protect\texttt{#1}}
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{shading}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      \textbf{Shading} {\ttfamily\declare{#1}}}%
+    \index{#1@\protect\texttt{#1} shading}%
+    \index{Shadings!#1@\protect\texttt{#1}}
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+
+\newenvironment{graph}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      \textbf{Graph} {\ttfamily\declare{#1}}}%
+    \index{#1@\protect\texttt{#1} graph}%
+    \index{Graphs!#1@\protect\texttt{#1}}
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{gdalgorithm}[2]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      \textbf{Layout} {\ttfamily/graph drawing/\declare{#1}\opt{=}}\opt{\meta{options}}}%
+    \index{#1@\protect\texttt{#1} layout}%
+    \index{Layouts!#1@\protect\texttt{#1}}%
+    \foreach \algo in {#2}
+    {\edef\marshal{\noexpand\index{#2@\noexpand\protect\noexpand\texttt{#2} algorithm}}\marshal}%
+    \index{Graph drawing layouts!#1@\protect\texttt{#1}}
+    \item{\small alias {\ttfamily/tikz/#1}}\par
+    \item{\small alias {\ttfamily/tikz/graphs/#1}}\par
+    \item{\small Employs {\ttfamily algorithm=#2}}\par
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{dataformat}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      \textbf{Format} {\ttfamily\declare{#1}}}%
+    \index{#1@\protect\texttt{#1} format}%
+    \index{Formats!#1@\protect\texttt{#1}}
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{stylesheet}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      \textbf{Style sheet} {\ttfamily\declare{#1}}}%
+    \index{#1@\protect\texttt{#1} style sheet}%
+    \index{Style sheets!#1@\protect\texttt{#1}}
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{handler}[1]{
+  \begin{pgfmanualentry}
+    \extracthandler#1\@nil%
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\def\gobble#1{}
+\def\extracthandler#1#2\@nil{%
+  \pgfmanualentryheadline{%
+    \pgfmanualpdflabel{/handlers/#1}{}%
+    \textbf{Key handler} \meta{key}{\ttfamily/\declare{#1}}#2}%
+  \index{\gobble#1@\protect\texttt{#1} handler}%
+  \index{Key handlers!#1@\protect\texttt{#1}}
+}
+
+
+\makeatletter
+
+
+\newenvironment{stylekey}[1]{
+  \begin{pgfmanualentry}
+    \def\extrakeytext{style, }
+    \extractkey#1\@nil%
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\def\choicesep{$\vert$}%
+\def\choicearg#1{\texttt{#1}}
+
+\newif\iffirstchoice
+
+% \mchoice{choice1,choice2,choice3}
+\newcommand\mchoice[1]{%
+  \begingroup
+  \firstchoicetrue
+  \foreach \mchoice@ in {#1} {%
+    \iffirstchoice
+      \global\firstchoicefalse
+    \else
+      \choicesep
+    \fi
+    \choicearg{\mchoice@}%
+  }%
+  \endgroup
+}%
+
+% \begin{key}{/path/x=value}
+% \begin{key}{/path/x=value (initially XXX)}
+% \begin{key}{/path/x=value (default XXX)}
+\newenvironment{key}[1]{
+  \begin{pgfmanualentry}
+    \def\extrakeytext{}
+    %\def\altpath{\emph{\color{gray}or}}%
+    \extractkey#1\@nil%
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+% \insertpathifneeded{a key}{/pgf} -> assign mykey={/pgf/a key}
+% \insertpathifneeded{/tikz/a key}{/pgf} -> assign mykey={/tikz/a key}
+%
+% #1: the key
+% #2: a default path (or empty)
+\def\insertpathifneeded#1#2{%
+  \def\insertpathifneeded@@{#2}%
+  \ifx\insertpathifneeded@@\empty
+    \def\mykey{#1}%
+  \else
+    \insertpathifneeded@#2\@nil
+    \ifpgfutil at in@
+      \def\mykey{#2/#1}%
+    \else
+      \def\mykey{#1}%
+    \fi
+  \fi
+}%
+\def\insertpathifneeded@#1#2\@nil{%
+  \def\insertpathifneeded@@{#1}%
+  \def\insertpathifneeded@@@{/}%
+  \ifx\insertpathifneeded@@\insertpathifneeded@@@
+    \pgfutil at in@true
+  \else
+    \pgfutil at in@false
+  \fi
+}%
+
+% \begin{keylist}[default path]
+%   {/path/option 1=value,/path/option 2=value2}
+% \end{keylist}
+\newenvironment{keylist}[2][]{%
+  \begin{pgfmanualentry}
+    \def\extrakeytext{}%
+  \foreach \xx in {#2} {%
+    \expandafter\insertpathifneeded\expandafter{\xx}{#1}%
+    \expandafter\extractkey\mykey\@nil%
+  }%
+  \pgfmanualbody
+}{%
+  \end{pgfmanualentry}
+}%
+
+\def\extractkey#1\@nil{%
+  \pgfutil at in@={#1}%
+  \ifpgfutil at in@%
+    \extractkeyequal#1\@nil
+  \else%
+    \pgfutil at in@{(initial}{#1}%
+    \ifpgfutil at in@%
+      \extractequalinitial#1\@nil%
+    \else
+      \pgfmanualentryheadline{%
+      \def\mykey{#1}%
+      \def\mypath{}%
+      \gdef\myname{}%
+      \firsttimetrue%
+      \pgfmanualdecomposecount=0\relax%
+      \decompose#1/\nil%
+        {\ttfamily\declare{#1}}\hfill(\extrakeytext no value)}%
+    \fi
+  \fi%
+}
+
+\def\extractkeyequal#1=#2\@nil{%
+  \pgfutil at in@{(default}{#2}%
+  \ifpgfutil at in@%
+    \extractdefault{#1}#2\@nil%
+  \else%
+    \pgfutil at in@{(initial}{#2}%
+    \ifpgfutil at in@%
+      \extractinitial{#1}#2\@nil%
+    \else
+      \pgfmanualentryheadline{%
+        \def\mykey{#1}%
+        \def\mypath{}%
+        \gdef\myname{}%
+        \firsttimetrue%
+        \pgfmanualdecomposecount=0\relax%
+        \decompose#1/\nil%
+        {\ttfamily\declare{#1}=}#2\hfill(\extrakeytext no default)}%
+    \fi%
+  \fi%
+}
+
+\def\extractdefault#1#2(default #3)\@nil{%
+  \pgfmanualentryheadline{%
+    \def\mykey{#1}%
+    \def\mypath{}%
+    \gdef\myname{}%
+    \firsttimetrue%
+    \pgfmanualdecomposecount=0\relax%
+    \decompose#1/\nil%
+    {\ttfamily\declare{#1}\opt{=}}\opt{#2}\hfill (\extrakeytext default {\ttfamily#3})}%
+}
+
+\def\extractinitial#1#2(initially #3)\@nil{%
+  \pgfmanualentryheadline{%
+    \def\mykey{#1}%
+    \def\mypath{}%
+    \gdef\myname{}%
+    \firsttimetrue%
+    \pgfmanualdecomposecount=0\relax%
+    \decompose#1/\nil%
+    {\ttfamily\declare{#1}=}#2\hfill (\extrakeytext no default, initially {\ttfamily#3})}%
+}
+
+\def\extractequalinitial#1 (initially #2)\@nil{%
+  \pgfmanualentryheadline{%
+    \def\mykey{#1}%
+    \def\mypath{}%
+    \gdef\myname{}%
+    \firsttimetrue%
+    \pgfmanualdecomposecount=0\relax%
+    \decompose#1/\nil%
+    {\ttfamily\declare{#1}}\hfill (\extrakeytext initially {\ttfamily#2})}%
+}
+
+% Introduces a key alias '/#1/<name of current key>'
+% to be used inside of \begin{key} ... \end{key}
+\def\keyalias#1{\vspace{-3pt}\item{\small alias {\ttfamily/#1/\myname}}\vspace{-2pt}\par
+  \pgfmanualpdflabel{/#1/\myname}{}%
+}
+
+\newif\iffirsttime
+\newcount\pgfmanualdecomposecount
+
+\makeatother
+
+\def\decompose/#1/#2\nil{%
+  \def\test{#2}%
+  \ifx\test\empty%
+    % aha.
+    \index{#1@\protect\texttt{#1} key}%
+    \index{\mypath#1@\protect\texttt{#1}}%
+    \gdef\myname{#1}%
+    \pgfmanualpdflabel{#1}{}
+  \else%
+    \advance\pgfmanualdecomposecount by1\relax%
+    \ifnum\pgfmanualdecomposecount>2\relax%
+      \decomposetoodeep#1/#2\nil%
+    \else%
+      \iffirsttime%
+        \begingroup%
+          % also make a pdf link anchor with full key path.
+          \def\hyperlabelwithoutslash##1/\nil{%
+            \pgfmanualpdflabel{##1}{}%
+          }%
+          \hyperlabelwithoutslash/#1/#2\nil%
+        \endgroup%
+        \def\mypath{#1@\protect\texttt{/#1/}!}%
+        \firsttimefalse%
+      \else%
+        \expandafter\def\expandafter\mypath\expandafter{\mypath#1@\protect\texttt{#1/}!}%
+      \fi%
+      \def\firsttime{}%
+      \decompose/#2\nil%
+    \fi%
+  \fi%
+}
+
+\def\decomposetoodeep#1/#2/\nil{%
+  % avoid too-deep nesting in index
+  \index{#1/#2@\protect\texttt{#1/#2} key}%
+  \index{\mypath#1/#2@\protect\texttt{#1/#2}}%
+  \decomposefindlast/#1/#2/\nil%
+}
+\makeatletter
+\def\decomposefindlast/#1/#2\nil{%
+  \def\test{#2}%
+  \ifx\test\pgfutil at empty%
+    \gdef\myname{#1}%
+  \else%
+    \decomposefindlast/#2\nil%
+  \fi%
+}
+\makeatother
+\def\indexkey#1{%
+  \def\mypath{}%
+  \decompose#1/\nil%
+}
+
+\newenvironment{predefinedmethod}[1]{
+  \begin{pgfmanualentry}
+    \extractpredefinedmethod#1\@nil
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+\def\extractpredefinedmethod#1(#2)\@nil{%
+  \pgfmanualentryheadline{%
+    \pgfmanualpdflabel{#1}{}%
+    Method \declare{\ttfamily #1}\texttt(#2\texttt) \hfill(predefined for all classes)}
+  \index{#1@\protect\texttt{#1} method}%
+  \index{Methods!#1@\protect\texttt{#1}}
+}
+
+
+\newenvironment{ooclass}[1]{
+  \begin{pgfmanualentry}
+    \def\currentclass{#1}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      \textbf{Class} \declare{\texttt{#1}}}
+    \index{#1@\protect\texttt{#1} class}%
+    \index{Class #1 at Class \protect\texttt{#1}}%
+    \index{Classes!#1@\protect\texttt{#1}}
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{method}[1]{
+  \begin{pgfmanualentry}
+    \extractmethod#1\@nil
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+\def\extractmethod#1(#2)\@nil{%
+  \def\test{#1}
+  \ifx\test\currentclass
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      Constructor \declare{\ttfamily #1}\texttt(#2\texttt)}
+  \else
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      Method \declare{\ttfamily #1}\texttt(#2\texttt)}
+  \fi
+  \index{#1@\protect\texttt{#1} method}%
+  \index{Methods!#1@\protect\texttt{#1}}
+  \index{Class \currentclass!#1@\protect\texttt{#1}}%
+}
+
+\newenvironment{attribute}[1]{
+  \begin{pgfmanualentry}
+    \extractattribute#1\@nil
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+\def\extractattribute#1=#2;\@nil{%
+  \def\test{#2}%
+  \ifx\test\@empty
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      Private attribute \declare{\ttfamily #1} \hfill (initially empty)}
+  \else
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      Private attribute \declare{\ttfamily #1} \hfill (initially {\ttfamily #2})}
+  \fi
+  \index{#1@\protect\texttt{#1} attribute}%
+  \index{Attributes!#1@\protect\texttt{#1}}
+  \index{Class \currentclass!#1@\protect\texttt{#1}}%
+}
+
+
+
+\newenvironment{predefinednode}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      \textbf{Predefined node} {\ttfamily\declare{#1}}}%
+    \index{#1@\protect\texttt{#1} node}%
+    \index{Predefined node!#1@\protect\texttt{#1}}
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{coordinatesystem}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      \textbf{Coordinate system} {\ttfamily\declare{#1}}}%
+    \index{#1@\protect\texttt{#1} coordinate system}%
+    \index{Coordinate systems!#1@\protect\texttt{#1}}
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{snake}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{\textbf{Snake} {\ttfamily\declare{#1}}}%
+    \index{#1@\protect\texttt{#1} snake}%
+    \index{Snakes!#1@\protect\texttt{#1}}
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{decoration}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{\textbf{Decoration} {\ttfamily\declare{#1}}}%
+    \index{#1@\protect\texttt{#1} decoration}%
+    \index{Decorations!#1@\protect\texttt{#1}}
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+
+\def\pgfmanualbar{\char`\|}
+\makeatletter
+\newenvironment{pathoperation}[3][]{
+  \begin{pgfmanualentry}
+    \def\pgfmanualtest{#1}%
+    \pgfmanualentryheadline{%
+      \ifx\pgfmanualtest\@empty%
+        \pgfmanualpdflabel{#2}{}%
+      \fi%
+      \textcolor{gray}{{\ttfamily\char`\\path}\
+        \ \dots}
+      \declare{\texttt{\noligs{#2}}}#3\ \textcolor{gray}{\dots\texttt{;}}}%
+    \ifx\pgfmanualtest\@empty%
+      \index{#2@\protect\texttt{#2} path operation}%
+      \index{Path operations!#2@\protect\texttt{#2}}%
+    \fi%
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+\newenvironment{datavisualizationoperation}[3][]{
+  \begin{pgfmanualentry}
+    \def\pgfmanualtest{#1}%
+    \pgfmanualentryheadline{%
+      \ifx\pgfmanualtest\@empty%
+        \pgfmanualpdflabel{#2}{}%
+      \fi%
+      \textcolor{gray}{{\ttfamily\char`\\datavisualization}\
+        \ \dots}
+      \declare{\texttt{\noligs{#2}}}#3\ \textcolor{gray}{\dots\texttt{;}}}%
+    \ifx\pgfmanualtest\@empty%
+      \index{#2@\protect\texttt{#2} (data visualization)}%
+      \index{Data visualization!#2@\protect\texttt{#2}}%
+    \fi%
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+\makeatother
+
+\def\doublebs{\texttt{\char`\\\char`\\}}
+
+
+\newenvironment{package}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      {\ttfamily\char`\\usepackage\char`\{\declare{#1}\char`\}\space\space \char`\%\space\space  \LaTeX}}
+    \index{#1@\protect\texttt{#1} package}%
+    \index{Packages and files!#1@\protect\texttt{#1}}%
+    \pgfmanualentryheadline{{\ttfamily\char`\\input \declare{#1}.tex\space\space\space \char`\%\space\space  plain \TeX}}
+    \pgfmanualentryheadline{{\ttfamily\char`\\usemodule[\declare{#1}]\space\space \char`\%\space\space  Con\TeX t}}
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+
+\newenvironment{pgfmodule}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      {\ttfamily\char`\\usepgfmodule\char`\{\declare{#1}\char`\}\space\space\space
+        \char`\%\space\space  \LaTeX\space and plain \TeX\space and pure pgf}}
+    \index{#1@\protect\texttt{#1} module}%
+    \index{Modules!#1@\protect\texttt{#1}}%
+    \pgfmanualentryheadline{{\ttfamily\char`\\usepgfmodule[\declare{#1}]\space\space \char`\%\space\space  Con\TeX t\space and pure pgf}}
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{pgflibrary}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      \textbf{\tikzname\ Library} \texttt{\declare{#1}}}
+    \index{#1@\protect\texttt{#1} library}%
+    \index{Libraries!#1@\protect\texttt{#1}}%
+    \vskip.25em%
+    {{\ttfamily\char`\\usepgflibrary\char`\{\declare{#1}\char`\}\space\space\space
+        \char`\%\space\space  \LaTeX\space and plain \TeX\space and pure pgf}}\\
+    {{\ttfamily\char`\\usepgflibrary[\declare{#1}]\space\space \char`\%\space\space  Con\TeX t\space and pure pgf}}\\
+    {{\ttfamily\char`\\usetikzlibrary\char`\{\declare{#1}\char`\}\space\space
+        \char`\%\space\space  \LaTeX\space and plain \TeX\space when using \tikzname}}\\
+    {{\ttfamily\char`\\usetikzlibrary[\declare{#1}]\space
+        \char`\%\space\space  Con\TeX t\space when using \tikzname}}\\[.5em]
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{purepgflibrary}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      \textbf{{\small PGF} Library} \texttt{\declare{#1}}}
+    \index{#1@\protect\texttt{#1} library}%
+    \index{Libraries!#1@\protect\texttt{#1}}%
+    \vskip.25em%
+    {{\ttfamily\char`\\usepgflibrary\char`\{\declare{#1}\char`\}\space\space\space
+        \char`\%\space\space  \LaTeX\space and plain \TeX}}\\
+    {{\ttfamily\char`\\usepgflibrary[\declare{#1}]\space\space \char`\%\space\space  Con\TeX t}}\\[.5em]
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{tikzlibrary}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{%
+      \pgfmanualpdflabel{#1}{}%
+      \textbf{\tikzname\ Library} \texttt{\declare{#1}}}
+    \index{#1@\protect\texttt{#1} library}%
+    \index{Libraries!#1@\protect\texttt{#1}}%
+    \vskip.25em%
+    {{\ttfamily\char`\\usetikzlibrary\char`\{\declare{#1}\char`\}\space\space \char`\%\space\space  \LaTeX\space and plain \TeX}}\\
+    {{\ttfamily\char`\\usetikzlibrary[\declare{#1}]\space \char`\%\space\space Con\TeX t}}\\[.5em]
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+
+
+\newenvironment{filedescription}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{File {\ttfamily\declare{#1}}}%
+    \index{#1@\protect\texttt{#1} file}%
+    \index{Packages and files!#1@\protect\texttt{#1}}%
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+
+\newenvironment{packageoption}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{{\ttfamily\char`\\usepackage[\declare{#1}]\char`\{pgf\char`\}}}
+    \index{#1@\protect\texttt{#1} package option}%
+    \index{Package options for \textsc{pgf}!#1@\protect\texttt{#1}}%
+    \pgfmanualbody
+}
+{
+  \end{pgfmanualentry}
+}
+
+
+
+\newcommand\opt[1]{{\color{black!50!green}#1}}
+\newcommand\ooarg[1]{{\ttfamily[}\meta{#1}{\ttfamily]}}
+
+\def\opt{\afterassignment\pgfmanualopt\let\next=}
+\def\pgfmanualopt{\ifx\next\bgroup\bgroup\color{black!50!green}\else{\color{black!50!green}\next}\fi}
+
+
+
+\def\beamer{\textsc{beamer}}
+\def\pdf{\textsc{pdf}}
+\def\eps{\texttt{eps}}
+\def\pgfname{\textsc{pgf}}
+\def\tikzname{Ti\emph{k}Z}
+\def\pstricks{\textsc{pstricks}}
+\def\prosper{\textsc{prosper}}
+\def\seminar{\textsc{seminar}}
+\def\texpower{\textsc{texpower}}
+\def\foils{\textsc{foils}}
+
+{
+  \makeatletter
+  \global\let\myempty=\@empty
+  \global\let\mygobble=\@gobble
+  \catcode`\@=12
+  \gdef\getridofats#1@#2\relax{%
+    \def\getridtest{#2}%
+    \ifx\getridtest\myempty%
+      \expandafter\def\expandafter\strippedat\expandafter{\strippedat#1}
+    \else%
+      \expandafter\def\expandafter\strippedat\expandafter{\strippedat#1\protect\printanat}
+      \getridofats#2\relax%
+    \fi%
+  }
+
+  \gdef\removeats#1{%
+    \let\strippedat\myempty%
+    \edef\strippedtext{\stripcommand#1}%
+    \expandafter\getridofats\strippedtext @\relax%
+  }
+
+  \gdef\stripcommand#1{\expandafter\mygobble\string#1}
+}
+
+\def\printanat{\char`\@}
+
+\def\declare{\afterassignment\pgfmanualdeclare\let\next=}
+\def\pgfmanualdeclare{\ifx\next\bgroup\bgroup\color{red!75!black}\else{\color{red!75!black}\next}\fi}
+
+
+\let\textoken=\command
+\let\endtextoken=\endcommand
+
+\def\myprintocmmand#1{\texttt{\char`\\#1}}
+
+\def\example{\par\smallskip\noindent\textit{Example: }}
+\def\themeauthor{\par\smallskip\noindent\textit{Theme author: }}
+
+
+\def\indexoption#1{%
+  \index{#1@\protect\texttt{#1} option}%
+  \index{Graphic options and styles!#1@\protect\texttt{#1}}%
+}
+
+\def\itemcalendaroption#1{\item \declare{\texttt{#1}}%
+  \index{#1@\protect\texttt{#1} date test}%
+  \index{Date tests!#1@\protect\texttt{#1}}%
+}
+
+
+
+\def\class#1{\list{}{\leftmargin=2em\itemindent-\leftmargin\def\makelabel##1{\hss##1}}%
+\extractclass#1@\par\topsep=0pt}
+\def\endclass{\endlist}
+\def\extractclass#1#2@{%
+\item{{{\ttfamily\char`\\documentclass}#2{\ttfamily\char`\{\declare{#1}\char`\}}}}%
+  \index{#1@\protect\texttt{#1} class}%
+  \index{Classes!#1@\protect\texttt{#1}}}
+
+\def\partname{Part}
+
+\makeatletter
+\def\index at prologue{\section*{Index}\addcontentsline{toc}{section}{Index}
+  This index only contains automatically generated entries. A good
+  index should also contain carefully selected keywords. This index is
+  not a good index.
+  \bigskip
+}
+\c at IndexColumns=2
+  \def\theindex{\@restonecoltrue
+    \columnseprule \z@  \columnsep 29\p@
+    \twocolumn[\index at prologue]%
+       \parindent -30pt
+       \columnsep 15pt
+       \parskip 0pt plus 1pt
+       \leftskip 30pt
+       \rightskip 0pt plus 2cm
+       \small
+       \def\@idxitem{\par}%
+    \let\item\@idxitem \ignorespaces}
+  \def\endtheindex{\onecolumn}
+\def\noindexing{\let\index=\@gobble}
+
+
+\newenvironment{arrowtipsimple}[1]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{\textbf{Arrow Tip Kind} {\ttfamily#1}}
+    \index{#1@\protect\texttt{#1} arrow tip}%
+    \index{Arrow tips!#1@\protect\texttt{#1}}%
+    \def\currentarrowtype{#1}
+    \pgfmanualbody}
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{arrowtip}[4]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{\textbf{Arrow Tip Kind} {\ttfamily#1}}
+    \index{#1@\protect\texttt{#1} arrow tip}%
+    \index{Arrow tips!#1@\protect\texttt{#1}}%
+    \pgfmanualbody
+    \def\currentarrowtype{#1}
+    \begin{minipage}[t]{10.25cm}
+      #2
+    \end{minipage}\hskip5mm\begin{minipage}[t]{4.75cm}
+      \leavevmode\vskip-2em
+    \tikz{
+      \draw [black!50,line width=5mm,-{#1[#3,color=black]}] (-4,0) -- (0,0);
+      \foreach \action in {#4}
+      { \expandafter\processaction\action\relax }
+    }
+    \end{minipage}\par\smallskip
+  }
+{
+  \end{pgfmanualentry}
+}
+
+\newenvironment{arrowcap}[5]{
+  \begin{pgfmanualentry}
+    \pgfmanualentryheadline{\textbf{Arrow Tip Kind} {\ttfamily#1}}
+    \index{#1@\protect\texttt{#1} arrow tip}%
+    \index{Arrow tips!#1@\protect\texttt{#1}}%
+    \pgfmanualbody
+    \def\currentarrowtype{#1}
+    \begin{minipage}[t]{10.25cm}
+      #2
+    \end{minipage}\hskip5mm\begin{minipage}[t]{4.75cm}
+      \leavevmode\vskip-2em
+    \tikz{
+      \path [tips, line width=10mm,-{#1[#3,color=black]}] (-4,0) -- (0,0);
+      \draw [line width=10mm,black!50] (-3,0) -- (#5,0);
+      \foreach \action in {#4}
+      { \expandafter\processaction\action\relax }
+    }
+    \end{minipage}\par\smallskip
+  }
+{
+  \end{pgfmanualentry}
+}
+
+\def\processaction#1=#2\relax{
+  \expandafter\let\expandafter\pgf at temp\csname manual at action@#1\endcsname
+  \ifx\pgf at temp\relax\else
+    \pgf at temp#2/0/\relax
+  \fi
+}
+\def\manual at action@length#1/#2/#3\relax{%
+  \draw [red,|<->|,semithick,xshift=#2] ([yshift=4pt]current bounding
+  box.north -| -#1,0) coordinate (last length) -- node
+  [above=-2pt] {|length|} ++(#1,0);
+}
+\def\manual at action@width#1/#2/#3\relax{%
+  \draw [overlay, red,|<->|,semithick] (.5,-#1/2) -- node [below,sloped] {|width|} (.5,#1/2);
+}
+\def\manual at action@inset#1/#2/#3\relax{%
+  \draw [red,|<->|,semithick,xshift=#2] ([yshift=-4pt]current bounding
+  box.south -| last length) -- node [below] {|inset|} ++(#1,0);
+}
+
+\newenvironment{arrowexamples}
+{\begin{tabbing}
+    \hbox to \dimexpr\linewidth-5.5cm\relax{\emph{Appearance of the below at line width} \hfil} \=
+     \hbox to 1.9cm{\emph{0.4pt}\hfil} \= \hbox to 2cm{\emph{0.8pt}\hfil} \= \emph{1.6pt} \\
+  }
+{\end{tabbing}\vskip-1em}
+
+\newenvironment{arrowcapexamples}
+{\begin{tabbing}
+    \hbox to \dimexpr\linewidth-5.5cm\relax{\emph{Appearance of the below at line width} \hfil} \=
+     \hbox to 1.9cm{\emph{1ex}\hfil} \= \hbox to 2cm{\emph{1em}\hfil} \\
+  }
+{\end{tabbing}\vskip-1em}
+
+\def\arrowcapexample#1[#2]{\def\temp{#1}\ifx\temp\pgfutil at empty\arrowcapexample@\currentarrowtype[{#2}]\else\arrowcapexample@#1[{#2}]\fi}
+\def\arrowcapexample@#1[#2]{%
+  {\sfcode`\.1000\small\texttt{#1[#2]}} \>
+  \kern-.5ex\tikz [baseline,>={#1[#2]}] \draw [line
+  width=1ex,->] (0,.5ex) -- (2em,.5ex);  \>
+  \kern-.5em\tikz [baseline,>={#1[#2]}] \draw [line
+  width=1em,->] (0,.5ex) -- (2em,.5ex);  \\
+}
+
+\def\arrowexample#1[#2]{\def\temp{#1}\ifx\temp\pgfutil at empty\arrowexample@\currentarrowtype[{#2}]\else\arrowexample@#1[{#2}]\fi}
+\def\arrowexample@#1[#2]{%
+  {\sfcode`\.1000\small\texttt{#1[#2]}} \>
+  \tikz [baseline,>={#1[#2]}] \draw [line
+  width=0.4pt,->] (0,.5ex) -- (2em,.5ex); thin \>
+  \tikz [baseline,>={#1[#2]}] \draw [line
+  width=0.8pt,->] (0,.5ex) -- (2em,.5ex); \textbf{thick} \>
+  \tikz [baseline,>={#1[#2]}] \draw [line
+  width=1.6pt,->] (0,.5ex) -- (3em,.5ex); \\
+}
+\def\arrowexampledup[#1]{\arrowexample[{#1] \currentarrowtype[}]}
+\def\arrowexampledupdot[#1]{\arrowexample[{#1] . \currentarrowtype[}]}
+
+\def\arrowexampledouble#1[#2]{\def\temp{#1}\ifx\temp\pgfutil at empty\arrowexampledouble@\currentarrowtype[{#2}]\else\arrowexampledouble@#1[{#2}]\fi}
+\def\arrowexampledouble@#1[#2]{%
+  {\sfcode`\.1000\small\texttt{#1[#2]} on double line} \>
+  \tikz [baseline,>={#1[#2]}]
+    \draw [double equal sign distance,line width=0.4pt,->] (0,.5ex) -- (2em,.5ex); thin \>
+  \tikz [baseline,>={#1[#2]}]
+    \draw [double equal sign distance,line width=0.8pt,->] (0,.5ex) -- (2em,.5ex); \textbf{thick} \>
+  \tikz [baseline,>={#1[#2]}]
+    \draw [double equal sign distance, line width=1.6pt,->] (0,.5ex) -- (3em,.5ex); \\
+}
+
+
+
+\newcommand\symarrow[1]{%
+  \index{#1@\protect\texttt{#1} arrow tip}%
+  \index{Arrow tips!#1@\protect\texttt{#1}}%
+  \texttt{#1}& yields thick
+  \begin{tikzpicture}[arrows={#1-#1},thick,baseline]
+    \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+    \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+    \draw (0pt,.5ex) -- (1cm,.5ex);
+  \end{tikzpicture} and thin
+  \begin{tikzpicture}[arrows={#1-#1},thin,baseline]
+    \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+    \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+    \draw (0pt,.5ex) -- (1cm,.5ex);
+  \end{tikzpicture}
+}
+\newcommand\symarrowdouble[1]{%
+  \index{#1@\protect\texttt{#1} arrow tip}%
+  \index{Arrow tips!#1@\protect\texttt{#1}}%
+  \texttt{#1}& yields thick
+  \begin{tikzpicture}[arrows={#1-#1},thick,baseline]
+    \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+    \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+    \draw (0pt,.5ex) -- (1cm,.5ex);
+  \end{tikzpicture}
+  and thin
+  \begin{tikzpicture}[arrows={#1-#1},thin,baseline]
+    \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+    \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+    \draw (0pt,.5ex) -- (1cm,.5ex);
+  \end{tikzpicture}, double
+  \begin{tikzpicture}[arrows={#1-#1},thick,baseline]
+    \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+    \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+    \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
+  \end{tikzpicture} and
+  \begin{tikzpicture}[arrows={#1-#1},thin,baseline]
+    \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+    \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+    \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
+  \end{tikzpicture}
+}
+
+\newcommand\sarrow[2]{%
+  \index{#1@\protect\texttt{#1} arrow tip}%
+  \index{Arrow tips!#1@\protect\texttt{#1}}%
+  \index{#2@\protect\texttt{#2} arrow tip}%
+  \index{Arrow tips!#2@\protect\texttt{#2}}%
+  \texttt{#1-#2}& yields thick
+  \begin{tikzpicture}[arrows={#1-#2},thick,baseline]
+    \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+    \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+    \draw (0pt,.5ex) -- (1cm,.5ex);
+  \end{tikzpicture} and thin
+  \begin{tikzpicture}[arrows={#1-#2},thin,baseline]
+    \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+    \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+    \draw (0pt,.5ex) -- (1cm,.5ex);
+  \end{tikzpicture}
+}
+
+\newcommand\sarrowdouble[2]{%
+  \index{#1@\protect\texttt{#1} arrow tip}%
+  \index{Arrow tips!#1@\protect\texttt{#1}}%
+  \index{#2@\protect\texttt{#2} arrow tip}%
+  \index{Arrow tips!#2@\protect\texttt{#2}}%
+  \texttt{#1-#2}& yields thick
+  \begin{tikzpicture}[arrows={#1-#2},thick,baseline]
+    \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+    \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+    \draw (0pt,.5ex) -- (1cm,.5ex);
+  \end{tikzpicture} and thin
+  \begin{tikzpicture}[arrows={#1-#2},thin,baseline]
+    \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+    \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+    \draw (0pt,.5ex) -- (1cm,.5ex);
+  \end{tikzpicture}, double
+  \begin{tikzpicture}[arrows={#1-#2},thick,baseline]
+    \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+    \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+    \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
+  \end{tikzpicture} and
+  \begin{tikzpicture}[arrows={#1-#2},thin,baseline]
+    \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+    \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+    \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
+  \end{tikzpicture}
+}
+
+\newcommand\carrow[1]{%
+  \index{#1@\protect\texttt{#1} arrow tip}%
+  \index{Arrow tips!#1@\protect\texttt{#1}}%
+  \texttt{#1}& yields for line width 1ex
+  \begin{tikzpicture}[arrows={#1-#1},line width=1ex,baseline]
+    \useasboundingbox (-1mm,-0.5ex) rectangle (1.6cm,2ex);
+    \fill [black!15] (1.5cm,-.5ex) rectangle (1.6cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+    \draw (0pt,.5ex) -- (1.5cm,.5ex);
+  \end{tikzpicture}
+}
+\def\myvbar{\char`\|}
+\newcommand\plotmarkentry[1]{%
+  \index{#1@\protect\texttt{#1} plot mark}%
+  \index{Plot marks!#1@\protect\texttt{#1}}
+  \texttt{\char`\\pgfuseplotmark\char`\{\declare{\noligs{#1}}\char`\}} &
+  \tikz\draw[color=black!25] plot[mark=#1,mark options={fill=examplefill,draw=black}] coordinates{(0,0) (.5,0.2) (1,0) (1.5,0.2)};\\
+}
+\newcommand\plotmarkentrytikz[1]{%
+  \index{#1@\protect\texttt{#1} plot mark}%
+  \index{Plot marks!#1@\protect\texttt{#1}}
+  \texttt{mark=\declare{\noligs{#1}}} & \tikz\draw[color=black!25]
+  plot[mark=#1,mark options={fill=examplefill,draw=black}]
+    coordinates {(0,0) (.5,0.2) (1,0) (1.5,0.2)};\\
+}
+
+
+
+\ifx\scantokens\@undefined
+  \PackageError{pgfmanual-macros}{You need to use extended latex
+    (elatex) or (pdfelatex) to process this document}{}
+\fi
+
+\begingroup
+\catcode`|=0
+\catcode`[= 1
+\catcode`]=2
+\catcode`\{=12
+\catcode `\}=12
+\catcode`\\=12 |gdef|find at example#1\end{codeexample}[|endofcodeexample[#1]]
+|endgroup
+
+% define \returntospace.
+%
+% It should define NEWLINE as {}, spaces and tabs as \space.
+\begingroup
+\catcode`\^=7
+\catcode`\^^M=13
+\catcode`\^^I=13
+\catcode`\ =13%
+\gdef\returntospace{\catcode`\ =13\def {\space}\catcode`\^^I=13\def^^I{\space}}
+\gdef\showreturn{\show^^M}
+\endgroup
+
+\begingroup
+\catcode`\%=13
+\catcode`\^^M=13
+\gdef\commenthandler{\catcode`\%=13\def%{\@gobble at till@return}}
+\gdef\@gobble at till@return#1^^M{}
+\gdef\@gobble at till@return at ignore#1^^M{\ignorespaces}
+\gdef\typesetcomment{\catcode`\%=13\def%{\@typeset at till@return}}
+\gdef\@typeset at till@return#1^^M{{\def%{\char`\%}\textsl{\char`\%#1}}\par}
+\endgroup
+
+% Define tab-implementation functions
+%   \codeexample at tabinit@replacementchars@
+% and
+%   \codeexample at tabinit@catcode@
+%
+% They should ONLY be used in case that tab replacement is active.
+%
+% This here is merely a preparation step.
+%
+% Idea:
+% \codeexample at tabinit@catcode@ will make TAB active
+% and
+% \codeexample at tabinit@replacementchars@ will insert as many spaces as
+% /codeexample/tabsize contains.
+{
+\catcode`\^^I=13
+% ATTENTION: do NOT use tabs in these definitions!!
+\gdef\codeexample at tabinit@replacementchars@{%
+ \begingroup
+ \count0=\pgfkeysvalueof{/codeexample/tabsize}\relax
+ \toks0={}%
+ \loop
+ \ifnum\count0>0
+  \advance\count0 by-1
+  \toks0=\expandafter{\the\toks0\ }%
+ \repeat
+ \xdef\codeexample at tabinit@replacementchars@@{\the\toks0}%
+ \endgroup
+ \let^^I=\codeexample at tabinit@replacementchars@@
+}%
+\gdef\codeexample at tabinit@catcode@{\catcode`\^^I=13}%
+}%
+
+% Called after any options have been set. It assigns
+%   \codeexample at tabinit@catcode
+% and
+%   \codeexample at tabinit@replacementchars
+% which are used inside of
+%\begin{codeexample}
+% ...
+%\end{codeexample}
+%
+% \codeexample at tabinit@catcode  is either \relax or it makes tab
+% active.
+%
+% \codeexample at tabinit@replacementchars is either \relax or it inserts
+% a proper replacement sequence for tabs (as many spaces as
+% configured)
+\def\codeexample at tabinit{%
+  \ifnum\pgfkeysvalueof{/codeexample/tabsize}=0\relax
+    \let\codeexample at tabinit@replacementchars=\relax
+    \let\codeexample at tabinit@catcode=\relax
+  \else
+    \let\codeexample at tabinit@catcode=\codeexample at tabinit@catcode@
+    \let\codeexample at tabinit@replacementchars=\codeexample at tabinit@replacementchars@
+  \fi
+}
+
+\newif\ifpgfmanualtikzsyntaxhilighting
+
+\pgfqkeys{/codeexample}{%
+  width/.code=  {\setlength\codeexamplewidth{#1}},
+  graphic/.code=  {\colorlet{graphicbackground}{#1}},
+  code/.code=  {\colorlet{codebackground}{#1}},
+  execute code/.is if=code at execute,
+  code only/.code=  {\code at executefalse},
+  pre/.store in=\code at pre,
+  post/.store in=\code at post,
+  % #1 is the *complete* environment contents as it shall be
+  % typeset. In particular, the catcodes are NOT the normal ones.
+  typeset listing/.code=  {#1},
+  render instead/.store in=\code at render,
+  vbox/.code=  {\def\code at pre{\vbox\bgroup\setlength{\hsize}{\linewidth-6pt}}\def\code at post{\egroup}},
+  ignorespaces/.code=  {\let\@gobble at till@return=\@gobble at till@return at ignore},
+  leave comments/.code=  {\def\code at catcode@hook{\catcode`\%=12}\let\commenthandler=\relax\let\typesetcomment=\relax},
+  tabsize/.initial=0,% FIXME : this here is merely used for indentation. It is just a TAB REPLACEMENT.
+  every codeexample/.style={width=4cm+7pt, tikz syntax=true},
+  from file/.code={\codeexamplefromfiletrue\def\codeexamplesource{#1}},
+  tikz syntax/.is if=pgfmanualtikzsyntaxhilighting,
+}
+
+
+\newread\examplesource
+
+
+% Opening, reading and closing the results file
+
+\def\opensource#1{
+  \immediate\openin\examplesource=#1
+}
+\def\do at codeexamplefromfile{%
+  \immediate\openin\examplesource\expandafter{\codeexamplesource}%
+  \def\examplelines{}%
+  \readexamplelines
+  \closein\examplesource
+  \expandafter\endofcodeexample\expandafter{\examplelines}%
+}
+
+\def\readexamplelines{
+  \ifeof\examplesource%
+  \else
+    \immediate\read\examplesource to \exampleline
+    \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\examplelines\expandafter\expandafter\expandafter{\expandafter\examplelines\exampleline}
+    \expandafter\readexamplelines%
+  \fi
+}
+
+\let\code at pre\pgfutil at empty
+\let\code at post\pgfutil at empty
+\let\code at render\pgfutil at empty
+\def\code at catcode@hook{}
+
+\newif\ifcodeexamplefromfile
+\newdimen\codeexamplewidth
+\newif\ifcode at execute
+\newbox\codeexamplebox
+\def\codeexample[#1]{%
+  \begingroup%
+  \code at executetrue
+  \pgfqkeys{/codeexample}{every codeexample,#1}%
+  \pgfmanualswitchoncolors%
+  \ifcodeexamplefromfile\begingroup\fi
+  \codeexample at tabinit% assigns \codeexample at tabinit@[catcode,replacementchars]
+  \parindent0pt
+  \begingroup%
+  \par%
+  \medskip%
+  \let\do\@makeother%
+  \dospecials%
+  \obeylines%
+  \@vobeyspaces%
+  \catcode`\%=13%
+  \catcode`\^^M=13%
+  \code at catcode@hook%
+  \codeexample at tabinit@catcode
+  \relax%
+  \ifcodeexamplefromfile%
+    \expandafter\do at codeexamplefromfile%
+  \else%
+    \expandafter\find at example%
+  \fi}
+\def\endofcodeexample#1{%
+  \endgroup%
+  \ifcode at execute%
+    \setbox\codeexamplebox=\hbox{%
+      \ifx\code at render\pgfutil at empty%
+      {%
+        {%
+          \returntospace%
+          \commenthandler%
+          \xdef\code at temp{#1}% removes returns and comments
+        }%
+        \catcode`\^^M=9%
+        \colorbox{graphicbackground}{\color{black}\ignorespaces%
+          \code at pre\expandafter\scantokens\expandafter{\code at temp\ignorespaces}\code at post\ignorespaces}%
+      }%
+      \else%
+        \colorbox{graphicbackground}{\color{black}\ignorespaces%
+          \code at render}%
+      \fi%
+    }%
+    \ifdim\wd\codeexamplebox>\codeexamplewidth%
+      \def\code at start{\par}%
+      \def\code at flushstart{}\def\code at flushend{}%
+      \def\code at mid{\parskip2pt\par\noindent}%
+      \def\code at width{\linewidth-6pt}%
+      \def\code at end{}%
+    \else%
+      \def\code at start{%
+        \linewidth=\textwidth%
+        \parshape \@ne 0pt \linewidth
+        \leavevmode%
+        \hbox\bgroup}%
+      \def\code at flushstart{\hfill}%
+      \def\code at flushend{\hbox{}}%
+      \def\code at mid{\hskip6pt}%
+      \def\code at width{\linewidth-12pt-\codeexamplewidth}%
+      \def\code at end{\egroup}%
+    \fi%
+    \code at start%
+    \noindent%
+    \begin{minipage}[t]{\codeexamplewidth}\raggedright
+      \hrule width0pt%
+      \footnotesize\vskip-1em%
+      \code at flushstart\box\codeexamplebox\code at flushend%
+      \vskip-1ex
+      \leavevmode%
+    \end{minipage}%
+  \else%
+    \def\code at mid{\par}
+    \def\code at width{\linewidth-6pt}
+    \def\code at end{}
+  \fi%
+  \code at mid%
+  \colorbox{codebackground}{%
+    \pgfkeysvalueof{/codeexample/prettyprint/base color}%
+    \begin{minipage}[t]{\code at width}%
+      {%
+        \let\do\@makeother
+        \dospecials
+        \frenchspacing\@vobeyspaces
+        \normalfont\ttfamily\footnotesize
+        \typesetcomment%
+        \codeexample at tabinit@replacementchars
+        \@tempswafalse
+        \def\par{%
+          \if at tempswa
+          \leavevmode \null \@@par\penalty\interlinepenalty
+          \else
+          \@tempswatrue
+          \ifhmode\@@par\penalty\interlinepenalty\fi
+          \fi}%
+        \obeylines
+        \everypar \expandafter{\the\everypar \unpenalty}%
+        \pgfkeysvalueof{/codeexample/typeset listing/. at cmd}{#1}\pgfeov
+      }
+    \end{minipage}}%
+  \code at end%
+  \par%
+  \medskip
+  \endcodeexample\endgroup
+}
+
+\def\endcodeexample{\endgroup}
+
+
+\makeatother
+
+\usepackage{pgfmanual}
+
+
+% autoxref is now always on
+
+% \makeatletter
+% % \pgfautoxrefs will be defined by 'make dist'
+% \pgfutil at ifundefined{pgfautoxrefs}{%
+%   \renewcommand\pgfmanualpdflabel[3][]{#3}% NO-OP
+%   \def\pgfmanualpdfref#1#2{#2}%
+%   \pgfkeys{
+%     /pdflinks/codeexample links=false,% DISABLED.
+%   }%
+% }{}
+% \makeatother
+
+\newdimen\pgfmanualcslinkpreskip
+
+% Styling of the pretty printer
+\pgfkeys{
+  /codeexample/syntax hilighting/.style={
+    /codeexample/prettyprint/key name/.code={\textcolor{keycolor}{\pgfmanualpdfref{##1}{\noligs{##1}}}},
+    /codeexample/prettyprint/key name with handler/.code 2 args={\textcolor{keycolor}{\pgfmanualpdfref{##1}{\noligs{##1}}}/\textcolor{blue!70!black}{\pgfmanualpdfref{/handlers/##2}{\noligs{##2}}}},
+    /codeexample/prettyprint/key value display only/.code={\textcolor{keycolor}{{\itshape{\let\pgfmanualwordstartup\relax\pgfmanualprettyprintcode{##1}}}}},
+    /codeexample/prettyprint/cs/.code={\textcolor{cscolor}{\pgfmanualcslinkpreskip4.25pt\pgfmanualpdfref{##1}{\noligs{##1}}}},
+    /codeexample/prettyprint/cs with args/.code 2 args={\textcolor{black}{\pgfmanualcslinkpreskip4.25pt\pgfmanualpdfref{##1}{\noligs{##1}}}\{\textcolor{black}{\pgfmanualprettyprintcode{##2}}\pgfmanualclosebrace},
+    /codeexample/prettyprint/cs arguments/pgfkeys/.initial=1,
+    /codeexample/prettyprint/cs/pgfkeys/.code 2 args={\textcolor{black}{\pgfmanualcslinkpreskip4.25pt\pgfmanualpdfref{##1}{\noligs{##1}}}\{\textcolor{black}{\pgfmanualprettyprintpgfkeys{##2}}\pgfmanualclosebrace},
+    /codeexample/prettyprint/cs arguments/begin/.initial=1,
+    /codeexample/prettyprint/cs/begin/.code 2 args={\textcolor{black}{##1}\{\textcolor{cscolor}{\pgfmanualpdfref{##2}{\noligs{##2}}}\pgfmanualclosebrace},
+    /codeexample/prettyprint/cs arguments/end/.initial=1,
+    /codeexample/prettyprint/cs/end/.code 2 args={\textcolor{black}{##1}\{\textcolor{cscolor}{\pgfmanualpdfref{##2}{\noligs{##2}}}\pgfmanualclosebrace},
+    /codeexample/prettyprint/word/.code={\pgfmanualwordstartup{\begingroup\pgfkeyssetvalue{/pdflinks/search key prefixes in}{}\pgfmanualpdfref{##1}{\noligs{##1}}\endgroup}},
+    /codeexample/prettyprint/point/.code={\textcolor{pointcolor}{\noligs{##1}}},%
+    /codeexample/prettyprint/point with cs/.code 2 args={\textcolor{pointcolor}{(\pgfmanualpdfref{##1}{\noligs{##1}}:\noligs{##2}}},%
+    /codeexample/prettyprint/comment font=\itshape,
+    /codeexample/prettyprint/base color/.initial=\color{basecolor},
+    /pdflinks/render hyperlink/.code={%
+      {\setbox0=\hbox{##1}%
+        \rlap{{\color{linkcolor}\dimen0\wd0\advance\dimen0by-\pgfmanualcslinkpreskip\hskip\pgfmanualcslinkpreskip\vrule width\dimen0 height-1pt depth1.6pt}}%
+        \box0%
+      }%
+    }
+  },/codeexample/syntax hilighting
+}
+
+\colorlet{keycolor}{black}
+\colorlet{cscolor}{black}
+\colorlet{pointcolor}{black}
+\colorlet{basecolor}{black}
+\colorlet{linkcolor}{black!8}
+
+\def\pgfmanualswitchoncolors{%
+  \colorlet{keycolor}{green!50!black}%
+  \colorlet{cscolor}{blue!70!black}
+  \colorlet{pointcolor}{violet}
+  \colorlet{basecolor}{black!55}
+  \colorlet{linkcolor}{white}
+}
+
+\makeatletter
+
+\def\pgfmanualwordstartup{\textcolor{black}}
+
+\def\noligs#1{\pgfmanualnoligs#1\kern0pt--\pgf at stop}%
+\def\pgfmanualnoligs#1--{%
+  \pgfutil at ifnextchar\pgf at stop{#1\pgfutil at gobble}{#1-\kern0pt-\kern0pt\pgfmanualnoligs}%
+}
+\makeatother
+
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: "beameruserguide"
+%%% End:


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/pgfmanual-en-macros.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.pdf	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.pdf	2017-06-19 21:07:40 UTC (rev 44639)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,1836 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: spectralsequencesmanual.tex
+%%
+%%   Manual content
+%%
+
+%
+% TODO:
+%  explain / cross reference examples folder?
+%
+
+
+
+\input spectralsequencesmanualpreamble
+
+
+\begin{document}
+\newgeometry{margin = 4cm,nohead}
+\begin{titlepage}
+\title{\sseqpages}
+\author{Hood Chatham\\\mailtoHC}
+\date{\version\\\today}
+ \maketitle \thispagestyle{empty}
+
+\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.
+
+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.
+\end{abstract}
+\end{titlepage}
+
+\restoregeometry
+\stepcounter{page}
+\newpage
+\thispagestyle{empty} % Should the table of contents have a page number?
+\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.
+
+Here is a basic example:
+\begin{codeexample}[width = 9cm]
+\begin{sseqdata}[ name = ex1, scale = 0.6,
+                  cohomological Serre grading ]
+\class(0,0)
+\class(0,2)
+\class(3,0)
+\class(3,2)
+\d3(0,2)
+\end{sseqdata}
+\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.
+
+\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.}
+
+\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.
+\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.
+\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.
+\end{command}
+
+
+\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.
+\begin{codeexample}[]
+\begin{sseqpage}[ no axes, ymirror, yscale = 0.8 ]
+\class(0,0)
+\class(1,0) \class(1,0)
+\class(0,1) \class(0,1) \class(0,1)
+\class(1,1) \class(1,1) \class(1,1) \class(1,1)
+\class(0,2) \class(0,2) \class(0,2) \class(0,2) \class(0,2)
+\class(1,2) \class(1,2) \class(1,2) \class(1,2) \class(1,2) \class(1,2)
+\end{sseqpage}
+\end{codeexample}
+
+The effect of the |\class| command is to print a \tikzpkg\ node on a range of pages. Any option that would work for a \tikzpkg\ |\node| command will also work in the same way for the |\class|, |\replaceclass|, and |\classoptions| commands.
+
+If a class is the source or the target of a differential on a certain page, then the page of the class is set to that page, and the class is only rendered on pages up to that number:
+\begin{codeexample}[width = 8cm]
+\begin{sseqdata}[ name = class example,
+                  Adams grading,
+                  yscale = 0.53 ]
+\class(1,0)
+\class(0,2)
+\class(0,3)
+\d2(1,0)
+\end{sseqdata}
+\printpage[ name = class example, page = 2 ]
+\quad
+\printpage[ name = class example, page = 3 ]
+\end{codeexample}
+
+See the \pgfmanualpdfref{class options}{class options} section for a list of the sort of options available for classes.
+\end{command}
+
+\begin{commandlist}{{\replaceclass\ooptions\parargthreeopt{x}{y}{n}},\replaceclass\ooptions\pararg{classname}}
+After a class is the source or target of a differential, it disappears on the next page. However, some differentials are not injective or not surjective. Using the command |\replaceclass| causes a new symbol to appear on the page after a class supported or accepted a differential (or both). 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.
+\begin{codeexample}[]
+\begin{sseqdata}[name = replace class example, Adams grading, classes = {draw = none } ]
+\class["\mathbb{Z}"](0,3)
+\class["\mathbb{Z}"](1,1)
+\class["\mathbb{Z}"](1,0)
+\d["\cdot 2"]2(1,1)
+\replaceclass["\mathbb{Z}/2"](0,3)
+\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 = 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)
+\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.
+
+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.
+\begin{codeexample}[width = 6cm]
+\begin{sseqdata}[ name = class options example,
+                  classes = fill ]
+\class(2,1)
+\foreach \x in {0,...,2} \foreach \y in {0,1} {
+    \class(\x,\y)
+}
+\end{sseqdata}
+\begin{sseqpage}[ name = class options example,
+                  right clip padding = 0.6cm ]
+\classoptions[red](2,1,2) % Only is red on this page!
+\node[ background, text width = 10em ] at (0.3,-2.2)
+    {\textup{The red class is the problem}};
+\end{sseqpage}
+\end{codeexample}
+Another reason to use this is to give a label to one instance of a class that shows up in a loop or a command defined using |\NewSseqGroup|:
+\begin{codeexample}[width = 6cm]
+\NewSseqGroup\mygroup {} {
+    \class(0,0)
+    \class(0,1)
+    \class(0,2)
+    \class(1,1)
+    \class(2,2)
+    \structline(0,0)(0,1)
+    \structline(0,1)(0,2)
+    \structline(0,0)(1,1)
+    \structline(1,1)(2,2)
+}
+\begin{sseqpage}[ classes = fill, class labels = { left = 0.3em } ]
+\mygroup(0,0)
+\mygroup(1,2)
+\classoptions["2"](0,1)
+\classoptions["\eta"](1,1)
+\end{sseqpage}
+\end{codeexample}
+See the \pgfmanualpdfref{class options}{class options} section for a list of the sort of options available for classes.
+\end{commandlist}
+
+\begin{commandlist}{
+    {\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.
+
+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.
+\begin{codeexample}[width = 7.5cm]
+\begin{sseqdata}[ name = d example, degree = {-1}{#1},
+                  struct lines = blue, yscale = 1.3 ]
+\class(0,2)
+\class(1,2)
+\class(1,1)
+\class(1,0)
+\structline(1,2)(0,2)
+\structline(1,2)(1,1)
+\structline(1,1)(1,0)
+\d2(1,0)
+\end{sseqdata}
+\printpage[ name = d example, page = 2 ]
+\hskip0.3cm
+\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:
+|\d\meta{page}\pars{\meta{x},\meta{y}\opt{,\sourcen,\targetn}}|
+\begin{codeexample}[width = 7.5cm]
+\begin{sseqpage}[ Adams grading, yscale = 0.8 ]
+\class(1,0) \class(1,0)
+\class(0,2) \class(0,2)
+\d2(1,0,1,2)
+\class(2,0) \class(2,0)
+\class(1,2)
+\d2(2,0,2)
+\class(3,0)
+\class(2,2) \class(2,2)
+\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.
+\begin{codeexample}[width = 7.5cm]
+\begin{sseqpage}[ Adams grading, yscale = 0.65 ]
+\class(1,0)
+\class(0,2) \class(0,2)
+\d[blue]2(1,0,-1,-1)
+\class(1,0)
+\class(0,2)
+\d[orange]2(1,0,-1,-1)
+\class(1,0)
+\d[red]2(1,0,-1,-2)
+\end{sseqpage}
+\end{codeexample}
+\end{commandlist}
+
+\begin{commandlist}{
+    {\doptions\moptions\meta{page}\pars{\meta{x},\meta{y}\opt{,\sourcen,\targetn}}},
+    {\doptions\moptions\meta{page}\pars{\sourcename\opt{,\targetn}}},
+    {\doptions\moptions\meta{page}\pars{\sourcecoord}\pars{\targetcoord}}%
+}
+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.
+
+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]
+\DeclareSseqGroup\tower {} {
+    \class(0,0)
+    \foreach \y in {1,...,5} {
+        \class(0,\y)
+        \structline(\lastclass1)(\lastclass)
+    }
+    \class(0,2)
+    \structline(0,1,-1)(\lastclass)
+    \structline(\lastclass)(0,3,-1)
+}
+\begin{sseqdata}[ name = structline example,
+                  classes = { circle, fill },
+                  Adams grading, no axes,
+                  yscale = 1.39 ]
+\class(1,1) \class(1,2)
+\class(2,3) \class(2,3) \class(2,5)
+\tower[classes = blue](0,0)
+\tower[struct lines = dashed,orange](1,0)
+\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]
+\end{codeexample}
+\end{command}
+
+\begin{command}{\structlineoptions\moptions\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}
+
+\begin{command}{\circleclasses\ooptions\pars{\sourcecoord}\pars{\targetcoord}}
+This command is a lot like |\structline| except that it puts a circle around the classes instead of connecting them with a line. It might take a certain amount of fiddling with options to get |\circleclasses| to produce good results. There is no |\circleclassesoptions| command because it doesn't seem necessary and (more importantly) I didn't feel like making one. Maybe someday I'll put one in.
+\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:
+\begin{codeexample}[]
+\begin{sseqdata}[ name = tikz example, Adams grading, math nodes = false,
+                  tikz primitives = { blue, font = \tiny, <- }, circle classes = tikz primitive style,
+                  x range = {0}{2}, x axis extend end = 2em ]
+\class(0,0)
+\class(1,0)
+\class(0,2)
+\d2(1,0)
+\end{sseqdata}
+
+\begin{sseqpage}[ name = tikz example ]
+\circleclasses[ name path = myellipse, inner sep = 3pt, ellipse ratio = 1.6 ] (1,0) (0,2)
+\path[ name path = myline ] (1.3,1.25) -- (0.6,1);
+\draw[ name intersections = { of = myellipse and myline } ]
+      (intersection-1) to (1.3,1.25) node[ right, text width = 1.6cm ] {Consider this differential};
+\end{sseqpage} \qquad
+
+\begin{sseqpage}[ name = tikz example ]
+\draw[ xshift = 1 ] (0,0) to (0.6,0.2) node[ right, text width = 1.1cm ] {This is the source};
+\draw[ yshift = 2 ] (0,0) to (0.6,0.2) node[ right, text width = 1.1cm ] {This is the target};
+\end{sseqpage} \qquad
+
+\begin{sseqpage}[ page = 3, name = tikz example ]
+\circleclasses[ name path = myellipse, inner sep = 3pt, ellipse ratio = 1.6 ] (1,0)(0,2)
+\node[ right, font = \tiny ] at (1.2,1.2) {Now it's gone!};
+\end{sseqpage}
+\end{codeexample}
+\end{commandlist}
+
+
+\section{Options for the main commands}
+\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:
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ cohomological Serre grading, yscale = 0.45 ]
+\foreach \x in {0,1} \foreach \y in {0,1} {
+    \begin{scope}[ xshift = \x, yshift = \y ]
+    \class(2,0)
+    \class(0,1)
+    \d2(0,1)
+    \end{scope}
+}
+\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:
+\begin{codeexample}[code only,width = 6cm]
+\NewSseqGroup\examplegroup {} {
+    \class(2,0)
+    \class(0,1)
+    \d2(0,1)
+}
+\begin{sseqpage}
+\examplegroup(0,0)
+\examplegroup(0,1)
+\examplegroup(1,0)
+\examplegroup(1,1)
+\end{sseqpage}
+\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.
+\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.
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ classes = {fill,inner sep = 0.4em},
+                  no axes, scale = 1.3 ]
+\class[red](0,0)
+\class[blue](1,0)
+\class[green](2,0)
+\class[cyan](0,1)
+\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[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.
+
+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]
+\begin{sseqpage}[ classes = { minimum width = width("a") + 0.5em }, no axes ]
+\class["a"](0,0)
+\class["a",red](1,0)
+\class["a" black,red](2,0)
+\class["b" above](0,1)
+\class["b" {below right,yshift = 0.1cm}](1,1)
+\class["a" {above right = {1em}}](2,1)
+\end{sseqpage}
+\end{codeexample}
+You can adjust the default behavior of class labels using the |labels| style option or its relatives |class labels|, |inner class labels| or |outer class labels|.
+Note that it is also possible to give a label to a |\node| this way, although the behavior is slightly different. In particular, the label defaults to the |above| position instead of going in the |\node| text by default. Also, this won't respect the various label style options like |labels|, etc.
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ no axes ]
+\class(0,0)
+\class(2,0)
+\node[circle,fill,"a"] at (1,0) {};
+\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{codeexample}[width = 6cm]
+\begin{sseqpage}[ Adams grading, yscale = 0.63 ]
+\class(0,0)
+\class(0,1)
+\class(0,2)
+\structline["a"' blue](0,0)(0,1)
+\class(1,0)
+\class(1,1)
+\structline["b"](1,0)(1,1)
+\d[ "\cdot 2" { pos = 0.7, yshift = -5pt } ] 2 (1,0)
+\end{sseqpage}
+\end{codeexample}
+You can use the style options |labels|, |edge labels|, |differential labels|, and |struct line labels| to adjust the styling of edge labels. For instance, if you would prefer for the labels to default to the left hand side of the edge rather than the right hand side, you could say |edge labels = {auto = left}|.
+You can also use quotes to label edges drawn with \tikzpkg\ primitives:
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ yscale = 0.58, no axes ]
+\class(0,0)
+\class(1,1)
+\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}.
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ no axes, background color = graphicbackground ]
+\foreach \x in {0,1,2} \foreach \y in {0,1} {
+    \class(\x,\y)
+}
+\structline["a" red](0,0)(0,1)
+\structline["a'"'blue,"b"{yshift = 1em}](1,0)(1,1)
+\structline["c" description](2,0)(2,1)
+\end{sseqpage}
+\end{codeexample}
+\end{manualentry}
+
+
+
+\subsection{Options for \sectionstring\class}\pgfmanualpdflabel{class options}{}
+Because the main job of the |\class| command is to print a \tikzpkg\ |\node| on the appropriate pages of the spectral sequence, most options that would work for a \tikzpkg\ node also work for the commands |\class|, |\replaceclass|, and |\classoptions|. Here are a few that you might care about:
+\begin{manualentry}{A \tikzpkg\ shape}
+If you give the name of a \tikzpkg\ shape, the class node will be of that shape. The standard \tikzpkg\ shapes are |circle| and |rectangle|. \sseqpages\ defines two new shapes:
+\begin{key}{circlen = \meta{n}}
+This draws $n$ concentric circles. It's intended for indicating a $\mathbb{Z}/p^n$ summand. For large values of $n$ the result isn't all that appealing.
+\begin{codeexample}[]
+\begin{sseqpage}[ no axes ]
+\class[circlen = 2](0,0)
+\class[circlen = 2,fill](1,0)
+\class[circlen = 3](0,1)
+\class[circlen = 4](1,1)
+\end{sseqpage}
+\end{codeexample}
+\end{key}
+
+\begin{keylist}{newellipse,ellipse ratio = \meta{ratio}}
+This shape is used for |\circleclasses|. It's a variant on the |ellipse| shape that gives more control over the ellipse's aspect ratio.
+\end{keylist}
+
+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 },
+                  yscale = 1.63 ]
+\class(0,0)
+\class[isosceles triangle](2,0)
+\class[rectangle](1,0)
+\class[diamond](0,1)
+\class[semicircle](1,1)
+\class[regular polygon, regular polygon sides = 5](2,2)
+\class[regular polygon, regular polygon sides = 6](2,2)
+\class[regular polygon, regular polygon sides = 7](2,2)
+\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.
+\end{manualentry}
+
+\begin{keylist}{minimum width = \meta{dimension}, minimum height = \meta{dimension}, minimum size = \meta{dimension}, inner sep = \meta{dimension}, outer sep = \meta{dimension}}
+These options control the size of a node. This is typically useful to make the size of nodes consistent independent of the size of their label text.  For instance:
+\begin{codeexample}[width = 5cm]
+\begin{sseqdata}[ name = minimum width example, no axes, yscale = 0.8 ]
+\class["ab"](0,0)
+\class["a"](0,1)
+\class(0,2)
+\end{sseqdata}
+\printpage[ name = minimum width example ]
+\printpage[ name = minimum width example,
+  change classes = { blue, minimum width = width("ab") + 0.5em } ]
+\end{codeexample}
+\end{keylist}
+
+\begin{key}{class:name = \meta{node name}}
+The |\class| command makes a \tikzpkg\ node on appropriate pages. You can refer to this node using \tikzpkg\ commands by using coordinates. Using the |class:name| option, you can give the node a second shorter name. One potential benefit to this is that it is immune to coordinate transformations. For example, in the following code, |xshift| does not apply to the nodes specified by |(id)| and |(eta)| but does apply to the coordinate specified by |(1,1)|:
+
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}
+\class[class:name = id](0,0)
+\class[class:name = eta](1,1)
+\class(2,1)
+\draw[xshift = 1] (id) -- (eta);
+\draw[xshift = 1,blue] (id) -- (1,1);
+\end{sseqpage}
+\end{codeexample}
+\end{key}
+
+\begin{key}{tag = \meta{tag}}
+This key adds a tag to the current class. Tags are used for identifying which of multiple classes in the same position you are referring to. They are useful when you have groups of related classes and want a family of differentials connecting them.  For instance:
+\begin{codeexample}[width = 8cm]
+\DeclareSseqGroup\tower {} {
+    \class(0,0)
+    \foreach \i in {1,...,11} {
+        \class(0,\i)
+        \structline(0,\i-1,-1)(0,\i,-1)
+    }
+}
+\NewSseqGroup\hvee {} {
+    \tower(0,0)
+    \foreach \i in {1,...,11} {
+        \class(\i,\i)
+        \structline(\i-1,\i-1,-1)(\i,\i,-1)
+    }
+}
+\begin{sseqpage}[ degree = {-1}{1}, yscale = 1.1,
+                  x range = {0}{5}, y range = {0}{5} ]
+\tower(3,0)
+\hvee[tag = id](0,0)
+\hvee[tag = h21](4,2)
+\foreach \n in {0,...,5} {
+    \d2(4+\n,2+\n,h21,id)
+}
+\end{sseqpage}
+\end{codeexample}
+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}{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]
+\begin{sseqdata}[ name = offset example,
+    xscale = 0.7,
+    Adams grading,
+    class placement transform = {scale = 1.8} ]
+\class(0,1)
+\class(0,2)\class(0,2)
+\draw(0,1)--(0,2);
+\class(1,0)
+\d2(1,0,,1)
+\d2(1,0,,2)
+\replaceclass(0,2)
+\end{sseqdata}
+\printpage[name = offset example, page=2]
+\printpage[name = offset example, page=3]
+\begin{sseqpage}[name = offset example, page=3]
+\classoptions[offset = {(0,0)}](0,2)
+\end{sseqpage}
+\end{codeexample}
+\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.
+
+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}[]
+\begin{sseqpage}[classes = {tooltip = {(\xcoord,\ycoord)}}]
+\class(0,0)
+\class(0,1)
+\class(1,0)
+\class(1,1)
+\end{sseqpage}
+\end{codeexample}
+
+There's another example at the beginning of the section on the \hyperref[sec:class stack]{class stack}.
+\end{key}
+
+\begin{keylist}{class:page = \meta{page}\opt{-{}-\meta{page max}},generation = \meta{generation}\opt{-{}-\meta{generation max}}}
+These options only work in |\classoptions|. The |page| option gives a range of pages for which the options apply to. If only one page is specified, it is the minimum page and the option applies to all larger pages.
+\begin{codeexample}[width = 6cm]
+\begin{sseqdata}[ name = page_example, no axes,
+    title = \page, title style = {yshift = -0.5cm} ]
+\class(0,0)
+\classoptions[class:page = {2--3},fill,blue](0,0)
+\end{sseqdata}
+
+\printpage[ name = page_example, page = 1 ] \qquad
+\printpage[ name = page_example, page = 2 ] \qquad
+\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.
+\begin{codeexample}[]
+\begin{sseqdata}[ name = page_example2, Adams grading, xscale = 0.6, yscale = 0.5 ]
+\class(0,2)\class(1,0)
+\d2(1,0)
+\replaceclass(1,0)
+\class(0,3)
+\d3(1,0)
+\replaceclass(1,0)
+\classoptions[fill,red](1,0) % (a) applies to most recent (last) generation.
+\end{sseqdata}
+
+\printpage[ name = page_example2, page = 1 ] % generation 0 of (1,0), not styled
+\quad
+\begin{sseqpage}[ name = page_example2, page = 1, keep changes ]
+\classoptions[fill,blue](1,0) % (b) applies to the generation present on page 1, that is, generation 0.
+\end{sseqpage} \quad
+
+% generation 0 of (1,0), so class is blue from (b)
+\printpage[ name = page_example2, page = 2 ] \quad
+
+% generation 1 of (1,0), class is not styled
+\printpage[ name = page_example2, page = 3 ] \quad
+
+% generation 2 of (1,0), class is red from (a)
+\printpage[ name = page_example2, page = 4 ]
+\end{codeexample}
+
+\begin{codeexample}[]
+\begin{sseqdata}[ name = page_example2, Adams grading,update existing ]
+% (c) applies to all generations, overwrites (b) and (a):
+\classoptions[fill, red, generation = 0 ---- -1](1,0)
+\end{sseqdata}
+
+\printpage[ name = page_example2, page = 1 ]% generation 0 of (1,0), so class is red
+\quad
+\begin{sseqpage}[ name = page_example2, page = 1, keep changes ]
+\classoptions[fill,blue](1,0) % (d) applies to the generation present on page 1, that is, generation 0.
+\end{sseqpage} \quad
+
+% generation 0 of (1,0), class is blue from (d)
+\printpage[ name = page_example2,page = 2 ] \quad
+
+% generation 1 of (1,0), class is red from (c)
+\printpage[ name = page_example2, page = 3 ]
+\quad
+\printpage[ name = page_example2, page = 4 ] % generation 2 of (1,0), class is red from (c)
+\end{codeexample}
+\end{keylist}
+
+\begin{commandlist}{\xcoord,\ycoord}
+These commands represent the $\mathtt{x}$ and $\mathtt{y}$ coordinate of the current class when used in class options. The only use I have for them is in the |tooltip| option, but maybe there is some other purpose for them.
+\end{commandlist}
+
+
+\subsection{Options for \sectionstring\d\ and \sectionstring\structline}
+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|:
+\begin{codeexample}[width = 4cm]
+\begin{sseqpage}[ no axes, yscale = 1.24 ]
+\foreach \x in {0,1} \foreach \y in {0,1} {
+    \class(\x,\y)
+}
+\structline(0,0)(0,1)
+\structline[ source anchor = north west, target anchor = -30 ](1,0)(1,1)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+
+
+\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.
+\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:
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ no axes, yscale = 1.6 ]
+\foreach \x in {0,1,2} \foreach \y in {0,1} {
+    \class(\x,\y)
+}
+\structline[densely dotted](0,0)(0,1)
+\structline[dashed,red, "a"](1,0)(1,1)
+\structline[dash dot,red, "a" black](2,0)(2,1)
+\end{sseqpage}
+\end{codeexample}
+%
+\end{manualentry}
+
+\begin{keylist}{bend left = \meta{angle}, bend right = \meta{angle}, *in = \meta{anchor}, *out = \meta{anchor}}
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[no axes,yscale = 1.6]
+\foreach \x in {0,1,2} \foreach \y in {0,1} {
+    \class(\x,\y)
+}
+\structline[bend left = 20](0,0)(0,1)
+\structline[bend right = 20](1,0)(1,1)
+\structline[in = 20,out = north](2,0)(2,1)
+\end{sseqpage}
+\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}{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:
+
+\begin{codeexample}[width = 7.6cm]
+\begin{sseqdata}[ name = structpage example,
+                  title = \page, yscale = 0.53 ]
+\class(0,2)
+\class(0,4)
+\class(1,0)
+\class(1,1)
+\d2(1,0)(0,2)
+\d3(1,1)(0,4)
+\replaceclass(1,0)
+\replaceclass(1,1)
+\structline(1,0)(1,1)
+\end{sseqdata}
+\printpage[name = structpage example,page = 3]
+\qquad
+\printpage[name = structpage example,page = 4]
+\end{codeexample}
+
+By specifying a page number, you can adjust which page the |\structline| starts on:
+
+\begin{codeexample}[]
+\begin{sseqdata}[ name = structpage example2, title = \page, yscale = 0.5 ]
+\class(0,2)
+\class(0,4)
+\class(1,0)
+\class(1,1)
+\d2(1,0)(0,2)
+\d3(1,1)(0,4)
+\replaceclass(1,0)
+\replaceclass(1,1)
+\structline[structline:page = 2](1,0)(1,1)
+\end{sseqdata}
+\printpage[name = structpage example2,page = 1]
+\qquad
+\printpage[name = structpage example2,page = 2]
+\qquad
+\printpage[name = structpage example2,page = 3]
+\qquad
+\printpage[name = structpage example2,page = 4]
+\end{codeexample}
+
+Similarly, for |\structlineoptions| you can specify a minimum page on which to apply the options, or a range of pages.
+\end{key}
+
+\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.
+\begin{codeexample}[]
+\begin{sseqpage}[Adams grading,axes gap = 0.7cm]
+\class(0,2)
+\class(1,0)
+% Fit in the label x and also a symmetric invisible label to maintain symmetry
+\d["x"{name = x},"x"'{name = x',opacity = 0}]2(1,0)
+\circleclasses[fit = (x)(x'),rounded rectangle](1,0)(0,2)
+\end{sseqpage}
+\end{codeexample}
+\end{key}
+
+\begin{key}{rounded rectangle}
+You can put a shape as an option and it will change the shape of the node drawn by |\circleclasses|. Any shape will do, but I think that an |ellipse| or |rounded rectangle| are the only particularly appealing options.
+\end{key}
+
+\begin{key}{ellipse ratio = \meta{ratio} (initially 1.2)}
+By default, the shape drawn by |\circleclasses| is a ``newelipse'' which is a custom defined shape that respects the option |elipse ratio| which roughly controls how long and skinny versus short and fat the ellipse is. If you find that the ellipse is too long, try a larger value of this option, and conversely if it's too fat try a smaller value. If no value is satisfactory, try out the |rounded rectangle| shape. (This is stolen from the following stack exchange answer: \url{https://tex.stackexchange.com/a/24621}.)
+\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.
+\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.
+\end{key}
+
+\subsection{Options for \tikzpkg\space 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:
+\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 clipping is inserted (unless the |no clip| key is used).
+
+\item All foreground elements (classes, differentials, structlines, and normal \tikzpkg\space 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.
+\begin{codeexample}[]
+\begin{sseqpage}[no ticks,yscale = 0.9,math nodes = false]
+\class(0,0)
+\class(1,1)
+\begin{scope}[background]
+\draw(0.1,0.1)--(1.1,1.1);
+\end{scope}
+\node[background] at (0.5,-1) {not clipped};
+\node at (0.5,-0.4) {clipped};
+\end{sseqpage}
+\end{codeexample}
+Here is an example where \tikzpkg\ labels with the |background| key are used to add labels and a grid. Note that this styling is easier to make using the |title|, |x label|, |y label|, and |grid| options.
+\begin{codeexample}[]
+\begin{sseqdata}[ name = tikz background example, cohomological Serre grading, classes = fill ]
+\begin{scope}[background]
+\node at (\xmax/2,\ymax+1.2) {\textup{Page \page}};
+\node at (\xmax/2,-1.7) {H^*(B)};
+\node[rotate = 90] at (-1.5,\ymax/2) {H^*(F)};
+\draw[step = 1cm, gray, very thin] (\xmin-0.5,\ymin-0.5) grid (\xmax+0.4,\ymax+0.5);
+\end{scope}
+\class(0,0)
+\class(3,0)
+\class(0,2)
+\class(3,2)
+\d3(0,2)
+\end{sseqdata}
+\printpage[name = tikz background example, page = 2]
+\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|:
+\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 } ]
+\class(0,0)
+\class(3,0)
+\class(0,2)
+\class(3,2)
+\d3(0,2)
+\end{sseqdata}
+\printpage[name = tikz background example2, page = 2]
+\printpage[name = tikz background example2, page = 3]
+\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.
+\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.
+
+\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
+$$|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}|}|$$
+Writing
+$$|\draw[||page constraint = ||{\isalive(1,0)(2,2)}](1,0)|\texttt{-{}-}|(2,2);|$$
+is the same as |\structline(1,0)(2,2)|, except that you can't later use |\structlineoptions| on it (and it won't have the |struct lines| style applied).
+\end{commandlist}
+\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.
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ differentials = blue, yscale = 0.65, no axes ]
+\class(0,2)
+\class(1,0)
+% This will be styled as if it were a differential
+\draw[differential style] (1,0) -- (0,2);
+\end{sseqpage}
+\end{codeexample}
+See |\getdtarget| for a more natural example.
+\end{keylist}
+
+
+
+\section{Miscellaneous commands}
+\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.
+
+You can also use |\sseqset| to create styles to be used in spectral sequences.
+\begin{keylist}{
+    .global sseq style = \meta{keys},
+    .global sseq append style = \meta{keys},
+    .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.
+\begin{codeexample}[width=6cm]
+\sseqset{
+    mysseq/.style = {
+        Adams grading, title = Page \page,
+        x range = {0}{4}, y range = {0}{2},
+        xscale = 0.5, yscale = 1.35
+    },
+    htwostruct/.sseq style = { gray, thin }
+}
+\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(3,1)(3,2) \structline(3,2)(3,3)
+\structline[htwostruct](0,0)(3,1)
+\structline[htwostruct](0,1)(3,2)
+\structline[htwostruct](0,2)(3,3)
+\end{sseqpage}
+\end{codeexample}
+\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.
+\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$
+\end{codeexample}
+\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.
+
+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]
+\DeclareDocumentCommand\demo{ O{} r() }
+    {  \#1 = \textcolor{purple}{\{#1\}};
+       \#2 = \textcolor{purple}{\{#2\}} }
+\hbox{\demo[key = value](x,y)}
+\bigskip
+\hbox{\demo(1,2,3)}
+\end{codeexample}
+% TODO: explain what u does better
+If you want to separate out the coordinates into different arguments, you can use |O{}u(u,u)|. The argument type |u| stands for ``until'' and scans up until the next instance of the given character. So in this case, |#1| is of argument type |O| which is an option list, |#2| corresponds to the |u(| which is a throw-away argument, then |#3| corresponds to |u,| and contains the $\mathtt{x}$ coordinate, and |#4| corresponds to |u)| and contains the $\mathtt{y}$ coordinate. Note however that this will not match balanced parenthetical expressions.
+\begin{codeexample}[width = 6.5cm,vbox]
+\DeclareDocumentCommand\demo{ O{} u( u, u)}
+    {  \#1 = \textcolor{purple}{\{#1\}};
+       \#3 = \textcolor{purple}{\{#3\}};
+       \#4 = \textcolor{purple}{\{#4\}}  }
+\hbox{\demo[hi](x,y)}
+\bigskip
+\hbox{\demo(1,2)}
+\bigskip
+\hbox{\demo((1+1)*2,2)}
+\bigskip
+\hbox{\demo(1,(1+1)*2)} % uh-oh -- *2) is left off!
+\end{codeexample}
+You can specify an optional argument delimited by parentheses using |d()|. Use the commands |\IfNoValueTF|, |\IfNoValueT|, and |\IfNoValueF| to test whether the user provided a value.
+\begin{codeexample}[width = 6.5cm,vbox]
+\DeclareDocumentCommand\demo{ O{} d() } {
+       \#1 = \textcolor{purple}{\{#1\}};
+       \#2 = \textcolor{purple}{
+              \{\IfNoValueTF{#2}{no value}{#2}\} }
+}
+\hbox{\demo[hi](x,y)}
+\bigskip
+\hbox{\demo[options]}
+\bigskip
+\hbox{\demo(1,2)}
+\bigskip
+\hbox{\demo}
+\end{codeexample}
+An example where this is actually useful:
+\begin{codeexample}[width = 6.5cm]
+\DeclareSseqCommand\etaclass{ O{} d() }{
+    \IfNoValueF{#2}{ \pushstack(#2) }
+    \class[#1] (\lastx+1, \lasty+1)
+    \structline (\lastclass) (\lastclass1)
+}
+\begin{sseqpage}[ classes = fill, yscale = 0.55 ]
+\class(0,0)
+\class(0,1)
+\etaclass\etaclass
+\etaclass[blue](0,0)\etaclass
+\end{sseqpage}
+\end{codeexample}
+
+
+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.
+\begin{codeexample}[width = 7cm,vbox]
+\DeclareDocumentCommand {\demo} { O{} U( r() }
+    {  \#1 = \textcolor{purple}{\{#1\}};
+       \#2 = \textcolor{purple}{\{#2\}};
+       \#3 = \textcolor{purple}{\{#3\}}  }
+\hbox{\demo[opts]page(x,y)}
+\bigskip
+\hbox{\demo5(x,y)}
+\end{codeexample}
+
+The |\structline| and |\changeclasses| commands have argument specification |O{}r()r()|.
+\begin{codeexample}[width = 7cm,vbox]
+\DeclareDocumentCommand\demo{ O{} r() r() }
+    {  \#1 = \textcolor{purple}{\{#1\}};
+       \#2 = \textcolor{purple}{\{#2\}};
+       \#3 = \textcolor{purple}{\{#3\}}  }
+\hbox{\demo[hi](x,y)(x',y')}
+\bigskip
+\hbox{\demo(x,y,2)(x',y',-1)}
+\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{codeexample}[width = 8cm]
+\DeclareSseqGroup\tower {m} {
+    \class(0,0)
+    \foreach \n in {1,...,#1} {
+        \class(0,\n)
+        \structline(0,\n-1)(0,\n)
+    }
+}
+\begin{sseqpage}
+\tower[orange](0,0){4}
+\tower[red](1,1){2}
+\end{sseqpage}
+\end{codeexample}
+\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:
+\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
+%
+    \circleclasses[ cc:differential style, #1,
+           name path = circ, 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)
+%
+    \path(target1)--(target2)
+                coordinate[midway](midpt);% put a coordinate in the center of the two classes
+    \path[name path = lin] (source) -- (midpt);% save path from start to midpoint
+%
+    % draw line in "differential style" from start to intersection point of circ and lin
+    \draw[ cc:differential style, #1, page constraint= { \page == #2 },
+           name intersections = { of = circ and lin } ]
+                (source) -- (intersection-1);
+}
+\begin{sseqdata}[ name = cathex, Adams grading, differentials = { blue } ]
+\class(0,2)
+\class(0,2)
+\class(1,0)\class(1,0)
+
+\twods2(1,0,-1){1}{2}
+\end{sseqdata}
+\printpage[ name = cathex, page = 1 ]
+\qquad
+\printpage[ name = cathex, page = 2 ]
+\qquad
+\printpage[ name = cathex, page = 3 ]
+\end{codeexample}
+\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.
+\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}}
+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)
+    }
+    \end{scope}
+    \restorestack
+}
+\DeclareSseqCommand \htwotower { O{} d() } {
+    \IfNoValueF{#2}{
+        \pushstack(#2)
+    }
+    \begin{scope}[#1]
+    \gettag\thetag(\lastclass)
+    \class(\lastx+3,\lasty+1)
+    \structline[gray](\lastclass)(\lastclass1)
+    \savestack
+    \foreach\i in {1,...,7}{
+        \class(\lastx,\lasty+1)
+        \structline(\lastclass1)(\lastclass)
+        \structline[gray](\lastx-3,\lasty-1,\thetag)(\lastclass)
+    }
+    \restorestack
+    \end{scope}
+}
+\begin{sseqpage}[ y range = {0}{6}, x tick step = 3,
+    xscale=0.6, yscale=1.3 ]
+\class(0,2) \class(0,3) \class(3,2)
+\class[tag=h_0^i](0,0)
+\tower[tag=h_0^i]
+\class(0,2) \class(0,1)
+
+\htwotower[tag=h_2 h_0^i](0,0)
+\htwotower[tag=h_2 h_0^i]
+\end{sseqpage}
+\end{codeexample}
+\end{command}
+
+
+\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 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
+\end{commandlist}
+
+
+\begin{command}{\pushstack\pararg{coordinate}}
+This adds a class to the top of the stack. The coordinate is specified using the same syntax as a coordinate for |\structline| or |\replaceclass|.
+\end{command}
+
+\begin{commandlist}{\savestack,\restorestack}
+This saves and reverts the stack. Saves nest. Most frequently, you will want to use these at the start and end of a command.
+\end{commandlist}
+
+
+\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:
+\begin{codeexample}[width = 8cm]
+\begin{sseqdata}[ name = stylesex ]
+\class(0,0)\class(1,1)
+\end{sseqdata}
+\begin{sseqpage}[ name = stylesex,
+                  classes = { fill, blue },
+                  title = change new classes ]
+\class(0,1)\class(1,0)
+\end{sseqpage}
+\quad
+\begin{sseqpage}[ name = stylesex,
+                  change classes = { fill, blue },
+                  title = change old classes ]
+\class(0,1)\class(1,0)
+\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.
+
+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]
+\begin{sseqpage}[ classes = { blue, fill },
+   title style = { align = center, text width = 2.4cm },
+   title = { everything is orange } ]
+\begin{scope}[orange]
+\class(0,0) \class(0,1)
+\structline(0,0)(0,1)
+\end{scope}
+\end{sseqpage}
+
+\begin{sseqpage}[ classes = { blue, fill },
+   title style = { align = center, text width = 2.4cm },
+   title = { only structline is orange } ]
+\begin{scope}[ sseq = orange ]
+\class(0,0) \class(0,1)
+\structline(0,0)(0,1)
+\end{scope}
+\end{sseqpage}
+\end{codeexample}
+
+
+Throughout, ``class'' and ``cycle'' are synonyms.
+\begin{stylekeylist}{sseqs, change sseqs,sseq,change sseq}
+This passes options to all features in all future spectral sequences in the current scope. Note that for many global options you can set a default directly by saying |\sseqset{key = \marg{value}}| and this is in some cases preferable.
+
+\begin{codeexample}[width = 7cm]
+% Applies to both of the following sseqs:
+\sseqset{ sseqs = { blue, scale = 0.5 } }%
+\begin{sseqpage}
+\foreach \x in {0,1}
+\foreach \y in {0,1,2} {
+    \class(\x,\y)
+}
+\end{sseqpage}
+\begin{sseqpage}[ Adams grading, classes = fill ]
+\foreach \x in {0,1,2}
+\foreach \y in {0,1,2} {
+    \class(\x,\y)
+}
+\d2(1,0)
+\d2(2,0)
+\end{sseqpage}
+\end{codeexample}
+\end{stylekeylist}
+
+\begin{stylekeylist}{classes, cycles,change classes,change cycles}
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ classes = { blue, fill, minimum width = 0.5em },
+                  scale = 0.5, x tick step = 2, y tick step = 2 ]
+\class(0,0)
+\class(2,2)
+\end{sseqpage}
+\end{codeexample}
+\end{stylekeylist}
+
+
+\begin{stylekeylist}{permanent classes, permanent cycles, change permanent classes, change permanent cycles}
+These options change the appearance of all permanent cycles (e.g., those classes which never support or are hit by a differential). For instance, we can circle the permanent cycles automatically. In the following example, note that because |permanent cycles| is more specific than |classes|, the |permanent cycles = {draw}| command takes precedence over the |classes = {draw = none}| command and the permanent cycle nodes are drawn.
+\begin{codeexample}[width = 6.5cm]
+\begin{sseqpage}[ cohomological Serre grading,
+                  classes = { draw = none },
+                  permanent cycles = {draw} ]
+\foreach \x in {0,2} \foreach \y in {0,1} {
+    \class["\mathbb{Z}"](\x,\y)
+}
+\d2(0,1)
+\end{sseqpage}
+\end{codeexample}
+\end{stylekeylist}
+
+\begin{stylekeylist}{transient classes, transient cycles,change transient classes,change transient cycles}
+These options change the appearance of all transient cycles (e.g., those classes which eventually support or are hit by a differential). Again, this takes precedence over the |classes| option.
+\begin{codeexample}[width = 6.5cm]
+\begin{sseqpage}[ cohomological Serre grading,
+                  classes = { draw = none },
+                  transient cycles = red ]
+\foreach \x in {0,2} \foreach \y in {0,1} {
+    \class["\mathbb{Z}"](\x,\y)
+}
+\d2(0,1)
+\end{sseqpage}
+\end{codeexample}
+\end{stylekeylist}
+
+\begin{stylekeylist}{this page classes, this page cycles, change this page classes,change this page cycles}
+These options change the appearance of all cycles which support or are hit by a differential on this page. Any class that is hit on the current page is also a transient cycle, and so |this page classes| takes precedence over |transient cycles|
+\begin{codeexample}[width = 6cm]
+\begin{sseqdata}[ name = this page cycles example, Adams grading,
+                  transient cycles = { red, fill }, this page cycles = { blue } ]
+\class(0,0)
+\class(0,2) \class(1,0)
+\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 = 3 ]
+\end{codeexample}
+\end{stylekeylist}
+
+\begin{stylekeylist}{edges,differentials,struct lines, change edges, change differentials, change struct lines}
+The |edges| key applies to both differentials and structure lines. The |differentials| and |struct lines| keys both take precedence over |edges|.
+\end{stylekeylist}
+
+\begin{stylekeylist}{this page struct lines, change this page struct lines}
+This style applies to structure lines whose source or target is hit on the current page. It takes precedence over |struct lines|.
+\end{stylekeylist}
+
+\begin{stylekeylist}{tikz primitives,change tikz primitives}
+Applies to all \tikzpkg\space 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.
+\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 },
+    outer class labels = { red },
+    inner class labels = { blue } ]
+\class["a", "b" above](0,0)
+\class["a", "c" right](1,0)
+\end{sseqpage}
+\end{codeexample}
+\end{stylekeylist}
+
+\begin{stylekeylist}{edge labels,differential labels,struct line labels,
+                change edge labels,change differential labels,change struct line labels}
+
+\end{stylekeylist}
+
+
+\subsection{Style-like options}
+The options are not styles, but can be modified in the same set of places (namely, anywhere):
+
+\begin{keylist}{label distance = \meta{dimension}}
+This sets the default distance from a class to an outer label. There are also variants like |above label distance| corresponding to |above|, |below|, |left|, |right|, |above left|, |above right|, |below left|, and |below right|.
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ label distance = 0.3em,
+                  right label distance = 0em,
+                  no axes,yscale = 1.25 ]
+\class["a" above](0,0)
+\class["b" above right](0,1)
+\class["c" right](1,0)
+\class["c" {right = 1em}](1,1)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+
+\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.
+
+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 ]
+\class(0,0)
+\class(3,0) \class(0,3)
+\structline(0,0)(3,0)
+\structline[red](0,0)(0,3)
+\structline[blue](3,0)(0,3)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+
+\begin{key}{class label handler = \meta{function}}
+\declarecustomhandler{class label handler}{\codehandler}
+The value of |class label handler| is a function that is applied to all labels before displaying them. It should put its output into |\processedlabel|.
+This is intended to help with code reusability. Because these handlers may crash or have annoying side-effects on some input, you may want to toggle the value of this command on and off. To turn this off for the rest of the current spectral sequence you can say |\sseqset{class label handler = {}}|. You can also use the |class label handler| key in a \scopeenv.
+
+The main function \sseqpages\ provides for use here is |\sseqnormalizemonomial{#1}|. This makes it convenient to translate expressions with polynomial labels. You can write your own handlers if your \TeX\ programming skills are sufficient. Let me know if there are any other functions that you want here, and if you implement them yourself, please send me your implementation.
+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["1+1"](0,0)
+\class["1+2*(1+3*(4-1))"](1,1)
+\end{sseqpage}
+\end{codeexample}
+Here's an example using |\sseqnormalizepolynomial|:
+\begin{codeexample}[width = 6cm]
+\NewSseqGroup \test {m} {
+    \class["1#1"](0,0)
+    \class["\alpha#1"](0,1)
+    \class["y#1"](1,0)
+    \class["\alpha y#1"](1,1)
+}
+\begin{sseqpage}[
+    class label handler = { \sseqnormalizemonomial{#1} },
+    classes = { draw = none }, class labels = { font = \small } ]
+\test{}
+\test[red](2,0){y^2}
+\test[orange](2,2){\alpha^2y^2}
+\test[blue](0,2){\alpha^2}
+\end{sseqpage}
+\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.
+\begin{codeexample}[width=8cm]
+\begin{sseqpage}[
+  xscale = 1.4,
+  classes = { draw = none },
+  class label handler = {\sseqnormalizemonomial{#1}} ]
+
+\foreach \x/\xlabel in
+  { 0/1, 2/\iota_2, 3/{{Sq^1\iota_2}}, 4/\iota_2^2 }
+\foreach \y/\ylabel in
+  { 0/1, 1/\alpha, 2/x, 3/\alpha x, 4/x^2 }
+{
+    \class["\ylabel\xlabel"] (\x,\y)
+}
+\end{sseqpage}
+\end{codeexample}
+\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.
+\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.
+\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.
+\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.
+
+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]
+% equivalent to degree = {#1}{1-#1}:
+\begin{sseqpage}[ cohomological Serre grading ]
+\class(0,1)
+\class(2,0)
+\d2(0,1)
+\end{sseqpage}
+\end{codeexample}
+\begin{codeexample}[width = 6cm]
+% equivalent to degree = {-#1}{#1-1}:
+\begin{sseqpage}[ homological Serre grading ]
+\class(0,1)
+\class(2,0)
+\d2(2,0)
+\end{sseqpage}
+\end{codeexample}
+\begin{codeexample}[width = 6cm]
+% equivalent to degree = {-1}{#1-1}:
+\begin{sseqpage}[ Adams grading ]
+\class(0,2)
+\class(1,0)
+\d2(1,0)
+\end{sseqpage}
+\end{codeexample}
+\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.
+\begin{codeexample}[code only]
+\begin{sseqdata}[ name = laxdegree, Adams grading ]
+\class(0,2)
+\class(1,0)
+\d3(1,0)(0,2) % Error: differential does not respect grading.
+              % Target should be in position (0,3) but instead it is (0,2)...
+\end{sseqdata}
+\end{codeexample}
+
+\begin{codeexample}[]
+\begin{sseqdata}[ name = laxdegree, Adams grading, lax degree, yscale = 0.6 ]
+\class(0,2)
+\class(1,0)
+\d3(1,0)(0,2) % No error because degree checking is off
+\end{sseqdata}
+\printpage[ name = laxdegree, page = 3 ]
+\end{codeexample}
+\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.
+\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:
+\begin{codeexample}[]
+\begin{sseqdata}[ name = keep changes example, Adams grading, y range = {0}{3} ]
+\class(0,0)
+\class(1,0)
+\end{sseqdata}
+
+\begin{sseqpage}[ name = keep changes example, sseq = orange ]
+\class(0,2)
+\class(1,2)
+\classoptions[orange](1,0)
+\d2(1,0)
+\end{sseqpage} \qquad
+
+\printpage[ name = keep changes example, page = 2 ] \qquad
+
+\begin{sseqpage}[ name = keep changes example, sseq = blue, keep changes ]
+\class(0,3)
+\class(1,3)
+\classoptions[blue](1,0)
+\d3(1,0)
+\end{sseqpage} \qquad
+
+\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.
+\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}
+The option |no struct lines| suppresses all of the structure lines on the current page, whereas the option |draw struct lines| causes the page appropriate structure lines to be drawn.
+\end{keylist}
+
+\begin{keylist}{no orphan edges,draw orphan edges}
+An edge is an ``orphan'' if both its source and target lie off the page. By default these are drawn, but with the option |no orphan edges| they are not. If the option |no orphan edges| has been set, |draw orphan edges| undoes it.
+\begin{codeexample}[width = 9cm]
+\begin{sseqdata}[
+    name = orphan edges example,
+    cohomological Serre grading,
+    x range = {0}{2}, y range = {0}{2} ]
+\class(0,3) \class(3,1)
+\d3(0,3)
+\class(2,1) \class(4,0)
+\d2(2,1)
+\end{sseqdata}
+\printpage[ name = orphan edges example ]
+\quad
+\printpage[ name = orphan edges example,
+            no orphan edges ]
+\end{codeexample}
+\end{keylist}
+
+
+\begin{key}{class pattern = \meta{class pattern name} (initially standard)}
+This key specifies the arrangement of multiple classes at the same coordinate. The default value is |standard|.
+\begin{codeexample}[width = 5cm]
+\begin{sseqdata}[ name = class pattern example, no axes, ymirror ]
+\class(0,0)
+\class(1,0) \class(1,0)
+\class(0,1) \class(0,1) \class(0,1)
+\class(1,1) \class(1,1) \class(1,1) \class(1,1)
+\class(0,2) \class(0,2) \class(0,2) \class(0,2) \class(0,2)
+\class(1,2) \class(1,2) \class(1,2) \class(1,2) \class(1,2) \class(1,2)
+\end{sseqdata}
+
+\printpage[ name = class pattern example, class pattern = standard ]
+\printpage[ name = class pattern example, change classes = blue,
+    class pattern = linear, class placement transform = { rotate = 45 } ]
+\end{codeexample}
+
+You can add new class patterns using |\sseqnewclasspattern|:
+\begin{command}{\sseqnewclasspattern\marg{class pattern name}\marg{offsets}}
+Creates a new class pattern. For example, the |linear| class pattern is created using the command:
+\begin{codeexample}[code only]
+\sseqnewclasspattern{linear}{
+    (0,0);
+    (-0.13,0)(0.13,0);
+    (-0.2,0)(0,0)(0.2,0);
+    (-0.3,0)(-0.1,0)(0.1,0)(0.3,0);
+    (-0.4,0)(-0.2,0)(0,0)(0.2,0)(0.4,0);
+    (-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.
+\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.
+\begin{codeexample}[width = 5cm]
+\begin{sseqpage}[ class placement transform = { xscale = 3 },
+                  class pattern = linear,
+                  classes = { draw = none },
+                  xscale = 2, x axis extend end = 0.7cm ]
+\class["\mathbb{Z}"](0,0)
+\class["\mathbb{Z}/2"](1,1)
+\class["\mathbb{Z}/3"](1,1)
+\end{sseqpage}
+\end{codeexample}
+\begin{codeexample}[width = 5cm]
+\begin{sseqpage}[ class placement transform = { rotate = 40 },
+                  cohomological Serre grading, scale = 0.65,
+                  classes = fill, differentials = blue ]
+\class(0,0)
+\class(0,2)\class(0,2)
+\class[red](3,0)\class[green](3,0)\class[blue](3,0)
+
+\d3(0,2,1,2)
+\d3(0,2,-1,-1)
+\draw[->,red](3,0,1)--(0,0);
+\end{sseqpage}
+\end{codeexample}
+With multiple large class names, the best option is to arrange the classes vertically:
+\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 },
+    right clip padding = 20pt, top clip padding = 20pt,
+    x axis gap = 30pt, y axis gap = 20pt ]
+\class["\iota_3\beta\iota_3"](7,0)
+\class["P^1\iota_3"](7,0)
+
+\class["\iota_2\iota_3\beta\iota_3"](7,2)
+\class["\iota_2P^1\iota_3"](7,2)
+
+\class["(\beta\iota_3)^2"](8,0)
+\class["P^1\beta\iota_3"](8,0)
+\class["\beta P^1\iota_3"](8,0)
+
+\class["\iota_2(\beta\iota_3)^2"](8,2)
+\class["\iota_2P^1\beta\iota_3"](8,2)
+\class["\iota_2\beta P^1\iota_3"](8,2)
+\end{sseqpage}
+\end{codeexample}
+\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.
+\end{key}
+
+
+
+\subsection{Global Coordinate Transformations}
+Of the normal \tikzpkg\ coordinate transformations, only the following can be applied to a sseq diagram:
+\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.
+\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}
+\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.
+\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{codeexample}[vbox]
+\begin{sseqdata}[ name = grid example, scale = 0.8 ]
+\class(0,0)
+\class(3,0)
+\class(2,1)\class(2,1)
+\class(1,2)\class(1,2)\class(1,2)
+\class(0,3)
+\class(3,3)
+\end{sseqdata}
+\hbox{
+\printpage[ name = grid example, grid = chess ]
+\qquad
+\printpage[ name = grid example, grid = crossword ]
+\qquad
+\printpage[ name = grid example, grid = dots ]
+}
+\vskip20pt
+\hbox{
+\printpage[ name = grid example, grid = go ]
+\qquad
+\printpage[ name = grid example, grid = none ]
+}
+\end{codeexample}
+It is possible to make your own grid style by defining the command |\sseq at grid@yourgridname| to draw a grid.
+\end{key}
+
+\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}
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ title = { An example }, yscale = 0.5,
+    x label = { x axis label },
+    y label = { y axis label },
+    label style = { blue, font = \small },
+    x label style = { yshift = 5pt },
+    ]
+\class(0,0)
+\class(2,2)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+
+
+\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|).
+\begin{codeexample}[width = 5.7cm]
+\begin{sseqpage}[ no x ticks, x range = {0}{3} ]
+\begin{scope}[ background ]
+    \node at (0,\ymin - 1) {0};
+    % \vphantom is fragile so we have to throw in an extra \protect
+    \node at (1,\ymin - 1) {\protect\vphantom{2}n};
+\foreach \n in {2,..., \xmax}{
+    \node at (\n,\ymin - 1) {\n n};
+}
+\end{scope}
+\class(0,0)
+\class(3,2)
+\end{sseqpage}
+\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{stylekeylist}{x tick style,y tick style,tick style}
+Change the tick style:
+\begin{codeexample}[width = 7cm]
+\begin{sseqpage}[ tick style = { blue, font = \tiny } ]
+\class(0,0) \class(2,1)
+\end{sseqpage}
+\end{codeexample}
+\end{stylekeylist}
+
+\begin{keylist}{x tick handler = \meta{function} (initially \#1), y tick handler = \meta{function} (initially \#1), tick handler = \meta{function} (initially \#1)}
+\declarecustomhandler{x tick handler}{\codehandler}
+\declarecustomhandler{y tick handler}{\codehandler}
+\declarecustomhandler{tick handler}{\codehandler}
+The value for |x tick handler| should be a function that takes in the current $\mathtt{x}$ value and outputs the appropriate tick. Correspondingly with |y tick handler|. The |tick handler| key sets both.
+\begin{codeexample}[width = 7cm]
+\begin{sseqpage}[ x range = {0}{4}, yscale = 1.78,
+    x tick handler = {
+        \ifnum#1 = 0\relax
+            0
+        \else
+            \ifnum#1 = 1\relax
+                % \vphantom is fragile so we \protect it
+                \protect\vphantom{2}n
+            \else
+                #1n
+            \fi
+        \fi
+    }
+]
+\class(0,0)
+\class(4,2)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+
+\needspace{5\baselineskip}
+\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?
+\end{keylist}
+
+\parskip=0pt
+\begin{keylist}{x axis origin = \meta{x value} (initially 0), y axis origin = \meta{y value} (initially 0)}
+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)}
+\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)}
+\end{keylist}
+
+\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 at savedpaths@add{\pgfsetpath\sseq at theclippath\pgfusepath{draw}}
+\end{scope}
+\catcode`\| = 12
+\begin{scope}[background,|-|,blue]
+% clip gap
+\draw[shift = {(\sseq at xmax+0.8,-\sseq at xaxisgap)}] (0,0)--(0,\sseq at xclip@axisgap);
+\draw[shift = {(-\sseq at yaxisgap,\sseq at ymax+0.8)}] (0,0)--(\sseq at yclip@axisgap,0);
+\draw[distance label,shift = {(\sseq at xmax+0.8,-\sseq at xaxisgap+\sseq at xclip@axisgap/2)}] (0,0) -- (2,0)
+node[description, right] {x axis\\ clip gap};
+\draw[distance label,shift = {(-\sseq at yaxisgap+\sseq at yclip@axisgap/2,\sseq at 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 at xmax cm + \sseq at xaxis@end at extend,\sseq at ymin cm-\sseq at xaxisgap-0.3cm)}] (0,0)--(\sseq at clip@padding at right,0);
+\draw[shift = {(\sseq at xmin cm -\sseq at yaxisgap-0.3cm,\sseq at ymax cm+\sseq at yaxis@end at extend)}] (0,0)--(0,\sseq at clip@padding at top);
+\draw[distance label, shift = {(\sseq at xmax cm + \sseq at xaxis@end at extend+\sseq at clip@padding at right/2,\sseq at ymin cm-\sseq at xaxisgap-0.3cm)}] (0,0) .. controls (0,-0.7) ..(1.5,-0.7)
+node[description, right] {right clip\\ padding};
+\draw[distance label, shift = {(\sseq at xmin cm -\sseq at yaxisgap-0.3cm,\sseq at ymax cm+\sseq at yaxis@end at extend+\sseq at clip@padding at top/2)}] (0,0) -- (-2,0)
+node[description, left] {top clip\\ padding};
+
+% extend start axis
+\draw[shift = {(\sseq at xmin-\sseq at yaxisgap-0.02cm,\sseq at ymin-\sseq at xaxisgap+0.1cm)}] (0,0) -- (-\sseq at xaxis@start at extend, 0);
+\draw[shift = {(\sseq at xmin-\sseq at yaxisgap+0.1cm,\sseq at ymin-\sseq at xaxisgap-0.02cm)}] (0,0) -- (0, -\sseq at yaxis@start at extend);
+\draw[distance label,shift = {(\sseq at xmin-\sseq at yaxisgap-0.02cm-\sseq at xaxis@start at extend/2,\sseq at ymin-\sseq at xaxisgap+0.1cm)}] (0,0) .. controls (0,0.5) .. (-1,0.5)
+node[description, left]{x axis\\ extend start};
+\draw[distance label,shift = {(\sseq at xmin-\sseq at yaxisgap+0.1cm,\sseq at ymin-\sseq at xaxisgap-0.02cm-\sseq at yaxis@start at extend/2)}] (0,0) .. controls (0.5,0) .. (0.5,-1)
+node[description, below]{y axis\\ extend start};
+
+% extend end axis
+\draw[shift = {(\sseq at xmax,\sseq at ymin-\sseq at xaxisgap-0.1cm)}] (0,0)--(\sseq at xaxis@end at extend,0);
+\draw[shift = {(\sseq at xmin cm-\sseq at yaxisgap-0.1cm,\sseq at ymax)}] (0,0)--(0,\sseq at yaxis@end at extend);
+\draw[distance label,shift = {(\sseq at xmax cm+\sseq at xaxis@end at extend/2,\sseq at ymin-\sseq at xaxisgap-0.1cm)}] (0,0) -- (0,-1.5)
+ node[description, below] {x axis\\ extend end};
+\draw[distance label,shift = {(\sseq at xmin cm- \sseq at yaxisgap-0.1cm,\sseq at ymax cm+\sseq at yaxis@end at extend/2)}] (0,0) .. controls (-2,0) .. (-2,-1)
+node[description, below] {y axis\\ extend end};
+
+
+
+% tick gap
+\draw[shift = {(\sseq at xmin+\sseq at xmax/2+0.2,-0.5-\sseq at xaxisgap)}] (0,0)--(0,-\sseq at xlabelgap);
+\draw[shift = {(-0.5-\sseq at yaxisgap,\sseq at ymin+\sseq at ymax/2+0.2)}] (0,0)--(-\sseq at ylabelgap,0);
+\draw[distance label,shift = {(\sseq at xmin+\sseq at xmax/2+0.2,-\sseq at xlabelgap/2-\sseq at xaxisgap)}] (0,0) .. controls (0.5 ,0) .. (0.5,-0.8)
+    node[below,black]{x tick gap};
+\draw[distance label,shift = {(-\sseq at yaxisgap -\sseq at ylabelgap/2,\sseq at ymin+\sseq at 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 at xmax cm+0.17cm,\sseq at ymin cm-\sseq at xaxisgap+0.02cm)}] (0,0) -- (0, \sseq at xaxisgap);
+\draw[shift = {(\sseq at xmin cm-\sseq at yaxisgap+0.02cm,\sseq at ymax  cm+0.17cm)}] (0,0) -- (\sseq at yaxisgap,0);
+\draw[distance label,shift = {(\sseq at xmax cm+0.17cm,\sseq at ymin cm-\sseq at xaxisgap/2+0.02cm)}](0,0) .. controls (2,0) ..  (2,0.5)
+node[above,description]{x axis gap};
+\draw[distance label,shift = {(\sseq at xmin cm-\sseq at yaxisgap/2+0.02cm,\sseq at 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}
+\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.
+\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.
+\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.
+\end{key}
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanualpreamble.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanualpreamble.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanualpreamble.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,505 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: spectralsequencesmanualpreamble.tex
+%%
+%%   Manual preamble
+%%
+
+% TODO: someday I should comment this -- it's a bit of a mess
+
+\documentclass{ltxdoc}
+\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry}
+\usepackage{spectralsequences}
+\usetikzlibrary{shapes.geometric}
+\usepackage{amssymb}
+\usepackage[notmath]{sansmathfonts}
+\usepackage{verbatim}
+\usepackage{needspace}
+\usepackage[documentation]{tcolorbox}
+\usepackage[T1]{fontenc}
+\usepackage{hyperref}
+
+\hypersetup{%
+        colorlinks=true,
+        linkcolor=blue,
+        filecolor=blue,
+        urlcolor=thered,
+        citecolor=blue,
+        pdfborder=0 0 0,
+}
+\usepackage{hyperxmp}
+\makeatletter
+\def\displaycommand#1{\displaycommand@#1\@nil}
+\def\displaycommand@#1#2\@nil{\texttt{\string#1}#2}
+
+% From Christian Feuersänger https://tex.stackexchange.com/a/73103
+\makeatletter          % !!!!
+\input{pgfmanual.code} % This must be exectuted when catcode of @ is letter
+\makeatother           % !!!!
+
+\usepackage{calc} %
+\include{pgfmanual-en-macros} % This must be executed when catcode of @ is other
+
+\makeatletter
+
+\parskip=10pt
+\parindent=0pt
+\MakeShortVerb{\|}
+
+\def\sectionstring{\textbackslash\@xp\@gobble\string}
+
+\def\@gobbletocln#1:{}
+\def\eatclnifpresent#1{%
+    \eatclnifpresent@#1:\nil
+}
+\def\eatclnifpresent@#1:#2\nil{%
+    \ifx$#2$%
+        #1%
+    \else
+        \removecln#2\nil
+    \fi
+}
+\def\removecln#1:\nil{#1}
+
+\def\removenil#1\nil{#1}
+
+\def\pgfmanual at pretty@singlequote{'}
+
+
+
+\def\pulloffstartspaces{\@xp\pulloffstartspaces@\thekey\@nil}
+\def\pulloffstartspaces@#1{%
+    \def\test{#1}%
+    \ifx\test\pgfmanual at pretty@activespace
+        \@xp\def\@xp\leadingtoks\@xp{\leadingtoks\pgfmanual at pretty@space}%
+        \@xp\pulloffstartspaces@
+    \else
+        \ifx#1\@nil
+            \def\thekey{}%
+        \else
+            \@xp\@xp\@xp\pulloffstartspaces@@\@xp\@xp\@xp#1%
+        \fi
+    \fi
+}
+\def\pulloffstartspaces@@#1\@nil{\def\thekey{#1}}
+
+\def\pulloffstartbrace{\@xp\pullofflbrace\thekey\nil\@nil}
+\def\pullofflbrace#1#2\@nil{%
+    \ifx\test\pgfmanual at pretty@lbrace
+        \@xp\def\@xp\leadingtoks\@xp{\leadingtoks\pgfmanual at pretty@lbrace}%
+        \@xp\def\@xp\thekey\@xp{\removenil#2}%
+    \else
+        \@xp\def\@xp\thekey\@xp{\removenil#1#2}%
+    \fi
+}
+
+
+\def\pulloffsinglequote{\@xp\pulloffsinglequote@\thekey\nil\@nil}
+\def\pulloffsinglequote@#1#2\@nil{%
+    \def\test{#1}%
+    \ifx\test\pgfmanual at pretty@singlequote
+        \@xp\def\@xp\leadingtoks\@xp{\leadingtoks\pgfmanual at pretty@singlequote}%
+        \@xp\def\@xp\thekey\@xp{\removenil#2}%
+    \else
+        \def\possiblesinglequote{}%
+        \@xp\def\@xp\thekey\@xp{\removenil#1#2}%
+    \fi
+}
+
+
+
+
+% deletes everything except trailing spaces. For making link underline not include trailing spaces (have to reinsert spaces)
+\def\onlytrailingspaces#1{%
+    \pgfkeys at spdef\temp{#1}%
+    \@xp\def\@xp\temp\@xp##\@xp1\temp{}%
+    \temp#1%
+}
+
+% remove trailing spaces, for making link underline not include trailing spaces
+\def\removetrailingspaces{\@xp\removetrailingspaces@\@xp{\thekey}}
+\def\removetrailingspaces@#1{%
+    \removetrailingspace{#1}%
+    \ifx\possibletrailingspace\empty\else
+        \edef\trailingtoks{\unexpanded\@xp{\possibletrailingspace}\unexpanded\@xp{\trailingtoks}}%
+        \@xp\removetrailingspaces@\@xp{\thekey}%
+    \fi
+}
+
+\bgroup
+\catcode`\Q=3\lccode`\)=`\}\lccode`\~=`\ \lowercase{
+    \gdef\removetrailingspace#1{\removetrailingspace@#1QQ~Q}
+    \gdef\removetrailingspace@#1~Q{\removetrailingspace@@#1}
+    \gdef\removetrailingspace@@#1Q#2Q{\def\thekey{#1}\def\possibletrailingspace{#2}}
+
+    % Remove trailing brace -- so close brace can be colored / styled differently
+    \gdef\removetrailingbrace{\@xp\removetrailingbrace@\thekey QQ)Q}
+    \gdef\removetrailingbrace@#1)Q{\removetrailingbrace@@#1}
+    \gdef\removetrailingbrace@@#1Q#2Q{\def\thekey{#1}\edef\trailingtoks{\unexpanded{#2}\unexpanded\@xp{\trailingtoks}}}
+}
+
+\catcode`\^^M=\active
+    % remove trailing new line -- so we can properly test whether the last nonwhitespace character is a brace
+    \gdef\removetrailingnewline{\@xp\removetrailingnewline@\thekey \nil\nil^^M\nil}%
+    \gdef\removetrailingnewline@#1^^M\nil{\removetrailingnewline@@#1}%
+    \gdef\removetrailingnewline@@#1\nil#2\nil{\def\thekey{#1}\edef\trailingtoks{\unexpanded{#2}\unexpanded\@xp{\trailingtoks}}}%
+\egroup
+
+
+
+% Redefine decompose not to do all that fancy crap -- just print as is. Maybe we should get rid of surrounding spaces here and where we do the ref?
+\def\decompose#1/\nil{%
+    \index{#1@\protect\texttt{#1} key}%
+    \index{\mypath#1@\protect\texttt{#1}}%
+    \pgfmanualpdflabel{#1}{}%
+}
+\let\olddeclare\declare
+\ExplSyntaxOn
+% Get rid of colon so that we can have context based linking -- "page" links to global page, "class:page" prints page and links to the page key in the class section, etc.
+\def\declare#1{%
+    \exp_args:Nf\olddeclare{%
+        \eatclnifpresent{#1}%
+    }%
+}
+\ExplSyntaxOff
+
+%\patchcmd\pgfmanualpdfref{#2}{#2} % If I want it to behave differently for things that aren't links
+\patchcmd\pgfmanualpdfref{\expandafter\pgfmanualpdfref@\expandafter{\pgfmanualpdflabel@@}{#2}} % Fix it so that being a link doesn't change the color
+    {\colorlet{temp}{.}\expandafter\pgfmanualpdfref@\expandafter{\pgfmanualpdflabel@@}{\textcolor{temp}{#2}}}{}{}%
+
+\newenvironment{manualentry}[1]{%
+    \begin{pgfmanualentry}%
+    \pgfmanualentryheadline{#1}%
+    \pgfmanualbody
+}{%
+    \end{pgfmanualentry}%
+}
+
+
+
+\def\removespace#1\space\nil{#1}
+\newenvironment{stylekeylist}[2][]{%
+  \begin{pgfmanualentry}
+    \def\extrakeytext{}%
+  \foreach \xx in {#2} {%
+    \expandafter\extractkey\xx\space= \marg{keys}\@nil%
+    \declareasstyle{\@xp\removespace\mykey\nil}% tells latex not to italicize body
+  }%
+  \pgfmanualbody
+}{%
+  \end{pgfmanualentry}
+}%
+
+% Custom handler for value of key -- instead of italicizing, do what?
+\def\ifcustomhandler#1{%
+    \@xp\pgfkeys at spdef\@xp\test\@xp{#1}%
+    \expandafter\ifx\csname\test @ custom handler\endcsname\relax\@xp\@secondoftwo\else\@xp\@firstoftwo\fi
+}
+\def\customhandler#1{%
+    \@xp\pgfkeys at spdef\@xp\test\@xp{#1}%
+    \csname\test @ custom handler\endcsname{#1}%
+}
+
+\def\declarecustomhandler#1#2{%
+    \immediate\write\@auxout{\@nx\expandafter\gdef\@nx\csname#1@ custom handler\endcsname{\@nx#2}}%
+    \@xp\gdef\csname#1@ custom handler\endcsname{#2}%
+}
+
+\def\declareasstyle#1{\declarecustomhandler{#1}\stylehandler}
+\def\stylehandler#1#2{%
+    \bgroup
+    \let\pgfmanualwordstartup\relax
+    \def\thekey{#2}%
+    \let\leadingtoks\empty
+    \pulloffstartspaces\pulloffstartbrace
+    \textcolor{keycolor}{\leadingtoks}%
+    \@xp\pgfmanualprettyprintpgfkeys\@xp{\thekey}%
+    \egroup
+}
+\def\codehandler#1#2{%
+    \bgroup
+    \def\thekey{#2}%
+    \let\leadingtoks\empty
+    \let\trailingtoks\empty
+    \pulloffstartspaces\pulloffstartbrace
+    \removetrailingspaces\removetrailingnewline
+    \removetrailingspaces\removetrailingbrace
+    \textcolor{keycolor}{\leadingtoks}%
+    \@xp\pgfmanualprettyprintcode\@xp{\thekey}%
+    \textcolor{keycolor}{\trailingtoks}%
+    \egroup
+}
+
+\declarecustomhandler{font}{\codehandler}
+\declarecustomhandler{page constraint}{\codehandler}
+\declarecustomhandler{page constraint}{\codehandler}
+
+\let\pgfmanualpdflabel at opt@old\pgfmanualpdflabel at opt
+\def\pgfmanualpdflabel at opt[#1]#2#3{%
+    \pgfkeys at spdef\temp{#2}%
+    \sseq at eval{\unexpanded{\pgfmanualpdflabel at opt@old[#1]}\unexpanded\@xp{\@xp{\temp}{#3}}}%
+}
+
+\patchcmd\extractkey{\hfill(\extrakeytext no value)}{}{}{\error}
+\patchcmd\extractkey{\def\mykey}{\gdef\mykey}{}{\error}
+\patchcmd\extractkeyequal{\hfill(\extrakeytext no default)}{}{}{\error}
+\patchcmd\extractkeyequal{\def\mykey}{\gdef\mykey}{}{\error}
+\patchcmd\extractinitial{no default, }{}{}{\error}
+\patchcmd\extractinitial{\def\mykey}{\gdef\mykey}{}{\error}
+\patchcmd\extractdefault{\def\mykey}{\gdef\mykey}{}{\error}
+\patchcmd\extractdefault{#2}{{\hskip2pt}#2}{}{\error}
+\patchcmd\extractequalinitial{\def\mykey}{\gdef\mykey}{}{\error}
+\let\extractkey@\extractkey
+\apptocmd\extractkey@{\egroup}{}{\error}
+\def\extractkey{\bgroup\@ifnextchar*{\def\decompose####1\nil{}\relax\extractkey@\@gobble}{\extractkey@}}
+
+\def\pgfmanual at pretty@quote{"}
+\let\pgfmanual at pretty@pgfkeys at loop@\pgfmanual at pretty@pgfkeys at loop
+\def\pgfmanual at pretty@pgfkeys at loop#1{%
+	\def\pgfmanual at loc@TMPa{#1}%
+    \def\pgfmanual at pretty@pgfkeys at loop@NEXT{\pgfmanual at pretty@pgfkeys at loop@{#1}}%
+    \ifx\pgfmanual at loc@TMPa\pgfmanual at pretty@quote%
+        \let\pgfmanual at pretty@pgfkeys at loop@NEXT\pgfmanual at pretty@collectquote
+    \fi
+    \pgfmanual at pretty@pgfkeys at loop@NEXT
+}
+\def\pgfmanual at pretty@collectquote{%
+    \let\pgfmanualprettyprinterhandlecollectedargs=\pgfmanual at pretty@collectargs at finish@collectquote
+    \pgfmanualprettyprintercollectupto"
+    	{\pgfmanual at pretty@collectquote at b}%
+}
+\def\pgfmanual at pretty@collectquote at b{%
+    \let\pgfmanualprettyprinterhandlecollectedargs=\pgfmanual at pretty@collectargs at finish@collectquote at b
+    \pgfmanualprettyprintercollectupto,{%
+        \@xp\afterpgfmanual at pretty@collectquote\temp
+    }%
+}
+
+\def\afterpgfmanual at pretty@collectquotenocomma,{\pgfmanual at pretty@pgfkeys at loop}
+\def\afterpgfmanual at pretty@collectquote{\pgfmanual at pretty@pgfkeys at loop}
+\def\pgfmanual at pretty@collectargs at finish@collectquote#1{\textcolor{keycolor}{\pgfmanualpdfref{""quotes}{"#1"}}}
+\def\pgfmanual at pretty@collectargs at finish@collectquote at b#1{%
+    \edef\temp{\ifpgfmanualprettyprinterfoundterminator,\fi}%
+    \pgfkeys{/codeexample/prettyprint/key name/.code={\textcolor{keycolor}{##1}}}%
+    \def\thekey{#1}%
+    \def\leadingtoks{}\def\trailingtoks{}%
+    \pulloffstartspaces\pulloffsinglequote\pulloffstartspaces\pulloffstartbrace
+    \removetrailingspaces\removetrailingbrace
+    \textcolor{keycolor}{{}\leadingtoks}% {} here to prevent \textcolor from eating initial space
+    \@xp\pgfmanual at pretty@pgfkeys at loop\thekey\pgfmanual at EOI
+    \textcolor{keycolor}{{}\trailingtoks}%
+}
+
+% Don't allow braces in key names
+\patchcmd\pgfmanual at pretty@pgfkeys at collectkey{%
+	\def\pgfmanual at pretty@pgfkeys at collectkey@next{%
+		\pgfmanualprettyprintercollectargcount{1}{\pgfmanual at pretty@pgfkeys at collectkey}%
+		#1%
+	}%
+}{%			
+    \expandafter\pgfmanual at pretty@pgfkeys at processkey\expandafter{\the\toks0 }%
+		#1%
+		\def\pgfmanual at pretty@pgfkeys at collectkey@next{\pgfmanual at pretty@pgfkeys at loop}%
+}{}{\error}
+
+% Redefine point collection to correctly balance the parens
+% Has unfortunate side effect that it now throws an error if parens don't balance.
+\let\pgfmanual at pretty@collectpoint at old\pgfmanual at pretty@collectpoint
+\def\pgfmanual at pretty@collectpoint{\pgfmanual at pretty@collectpoint@(} %)
+\DeclareDocumentCommand\pgfmanual at pretty@collectpoint@{r()}{%
+    \pgfmanualprettyprinterfoundterminatortrue
+	\pgfmanual at pretty@collectargs at finish@collectpoint{#1}%
+	\afterpgfmanual at pretty@collectpoint
+}
+
+
+\pgfqkeys{/codeexample/prettyprint}{
+	cs arguments/meta/.initial=1, % Make \meta work correctly in codeexample
+	cs/meta/.code={\textcolor{black}{\meta{\@gobble#1}}},
+%
+	cs arguments/opt/.initial=1,
+	cs/opt/.code={\opt{\@gobble#1}},
+ %
+    cs arguments/oarg/.initial=1,
+	cs/oarg/.code={\oarg{\@gobble#1}},
+%
+    cs arguments/marg/.initial=1,
+	cs/marg/.code={\marg{\@gobble#1}},
+%
+    cs arguments/pars/.initial=1,
+    cs/pars/.code={\@xp\pars\@xp{\@xp\pgfmanualprettyprintpgfkeys\@xp{\@gobble#1}}},
+    cs arguments/pararg/.initial=1,
+    cs/pararg/.code={\pararg{\@gobble#1}},
+    cs arguments/parargtwo/.initial=2,
+    cs/parargtwo/.code 2 args={\parargtwo{\@gobble#1}{\@gobble#2}},
+%
+    cs arguments/cscolor/.initial=1,
+	cs/cscolor/.code={\textcolor{cscolor}{\@gobble#1}},
+    cs arguments/pointcolor/.initial=1,
+	cs/pointcolor/.code={\textcolor{pointcolor}{\@gobble#1}},
+    %point/.code={\def\temp{#1}\show\temp},
+%
+    cs arguments/sseqset/.initial=1,
+    cs/sseqset/.code 2 args={\textcolor{cscolor}{\string\sseqset}\{\pgfmanualprettyprintpgfkeys{#2}\}},
+%
+    cs arguments/DeclareDocumentCommand/.initial=2,
+    cs/DeclareDocumentCommand/.code={\handlexparsestylecmd#1},
+    cs arguments/NewSseqCommand/.initial=2,
+    cs/NewSseqCommand/.code={\handlexparsestylecmd#1},
+%
+    /pdflinks/internal link prefix=pgf,
+    key value with style detection/.code 2 args={\pgfkeysalso{/codeexample/prettyprint/key value display only={#2}}}, % get rid of bothersome special style handling
+    % handle spaces and colons
+    key name/.code={%
+        \pgfkeys at spdef\temp{#1}%
+        \let\pgfmanual at pretty@pgfkeys at collectkey@keyname\temp
+        \textcolor{keycolor}{%
+            \pgfmanualpdfref{\temp}{%
+                \noligs{\@xp\eatclnifpresent\@xp{\temp}}%
+            }%
+        }%
+        \onlytrailingspaces{#1}%
+    },
+    key value display only/.code={%
+        \sseq at eval{\@nx\pgfutil at in@{/.style}{\pgfmanual at pretty@pgfkeys at collectkey@keyname}}%
+        \ifpgfutil at in@\else
+            \sseq at eval{\@nx\pgfutil at in@{/.sseq style}{\pgfmanual at pretty@pgfkeys at collectkey@keyname}}%
+        \fi
+        \ifpgfutil at in@
+            \def\thekey{#1}%
+            \def\trailingtoks{}%
+            \removetrailingspaces\removetrailingbrace
+            \@xp\stylehandler\@xp{\@xp}\@xp{\thekey}%
+            \textcolor{keycolor}{%
+                \trailingtoks
+            }%
+        \else
+            \ifcustomhandler{\pgfmanual at pretty@pgfkeys at collectkey@keyname}{%
+                \def\thekey{#1}%
+                \def\trailingtoks{}%
+                \removetrailingspaces\removetrailingbrace
+                \@xp\customhandler\@xp{\@xp\pgfmanual at pretty@pgfkeys at collectkey@keyname\@xp}\@xp{\thekey}%
+                \textcolor{keycolor}{%
+                    \trailingtoks
+                }%
+            }{%
+                \textcolor{keycolor}{{\itshape{\let\pgfmanualwordstartup\relax\pgfmanualprettyprintpgfkeys{#1}}}}%
+            }%
+        \fi
+    },
+    point/.code={\pgfutil at in@){#1}\ifpgfutil at in@\prettyprintprocesspoint#1\else \textcolor{pointcolor}{\noligs{#1}}\fi},
+	%/cs/.code={\pgfmanualpdfref{#1}{\textcolor{blue}{#1}}},
+%	/cs with args/.code 2 args={\pgfmanualpdfref{#1}{\textcolor{blue}{#1}}\{\pgfmanualprettyprintcode{#2}\pgfmanualclosebrace},
+    %/colored
+}
+
+\def\handlexparsestylecmd#1#2#3{\pgfkeysvalueof{/codeexample/prettyprint/cs/. at cmd}#1\pgfeov\textcolor{cscolor}{#2}\typesetargspec{#3}}
+\def\typesetargspec#1{\{\textcolor{purple}{#1}\}}
+
+\let\oldtextcolor\textcolor
+\def\textcolorpoint#1{\oldtextcolor{pointcolor}}
+
+
+% Normally the verbatim processes stuff using
+\let\pgfmanual at verb@collect at code\pgfmanual at verb@collect
+\patchcmd\pgfmanual at verb@collect at code{\pgfmanualprettyprintpgfkeys}{\pgfmanualprettyprintcode}{}{\error}
+\let\pgfmanual at verb@code\pgfmanual at verb
+\patchcmd\pgfmanual at verb@code{\begingroup}{\begingroup\let\pgfmanual at verb@collect\pgfmanual at verb@collect at code}{}{\error}
+\def\codeverb|{\pgfmanual at verb@code}
+
+% balance the braces
+\NewDocumentCommand\prettyprintprocesspoint { r() } {%
+    \textcolor{pointcolor}{%
+        \bgroup
+            \let\pgfmanual at pretty@collectpoint\pgfmanual at pretty@collectpoint at old
+            \let\textcolor\textcolorpoint
+            \noligs{(\pgfmanualprettyprintcode{#1})}%
+        \egroup
+    }%
+}
+%\pgfqkeys{/codeexample}{every codeexample/.style={width=6cm}}
+
+
+\pgfqkeys{/sseqpages}{
+    class/class:name/.forward to=/sseqpages/class/name,
+    class/class:page/.forward to=/sseqpages/class/page,
+    struct line/structline:page/.forward to=/sseqpages/struct line/page,
+    fit/cc:differential style/.forward to=/sseqpages/fit/differential style,
+    tikz primitives/cc:differential style/.forward to=/sseqpages/tikz primitives/differential style
+}
+
+
+\def\ooptions{\oarg{options}}
+\def\moptions{|[|\meta{options}|]|}
+\def\sourcecoord{\meta{source coordinate}}
+\def\targetcoord{\meta{target coordinate}}
+\def\sourcen{\meta{source n}}
+\def\targetn{\meta{target n}}
+\def\sourcename{\meta{source name}}
+
+\def\version{version 1.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}
+\def\colormanualurl{http://mirror.ctan.org/macros/latex/required/graphics/color.pdf}
+
+\def\pkg#1{\textsf{\textmd{#1}}}
+\def\sseqpages{\textsc{\pkg{spectralsequences}}}
+\def\sseqpkg{\pkg{sseq}}
+\let\tikzpkg\tikzname
+\def\pgfpkg{\pkg{\textmd{PGF}}}
+\def\tikzcdpkg{\pkg{tikzcd}}
+\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\example#1{\path{example_#1.tex}}
+
+
+% xparse modifications:
+\ExplSyntaxOn
+\cs_set_eq:NN \__xparse_grab_U:w \sseq__xparse_grab_U:w
+\cs_set_eq:NN \__xparse_add_type_U:w \sseq__xparse_add_type_U:w
+\ExplSyntaxOff
+
+\def\@maketitle{%
+ \null\vskip 2em
+  \begin{center}\let\footnote\thanks\sffamily
+    {\huge \@title\par}\vskip 1.5em
+    {\large \parbox{.33\textwidth}{\centering\@author}%
+            \parbox{.33\textwidth}{\centering\@date}}%
+  \vskip2.5em\rule{\textwidth}{.4pt}%
+  \end{center}\par\vskip1.5em}
+\def\abstractname{}
+\def\mailtoHC{\href % some PDF viewers don't like spaces:
+    {mailto:<hood at mit.edu>\%20Hood\%20Chatham?subject=[sseqpages]}
+    {\texttt{hood at mit.edu}}} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanualpreamble.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/spectralsequences/spectralsequences.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/spectralsequences.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/spectralsequences.sty	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,279 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at 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 at draftmode
+\DeclareOption{draft}{\sseq at draftmodetrue}
+\ProcessOptions\relax
+
+\def\sseq at authorname{Hood Chatham}
+\def\sseq at authoremail{hood at mit.edu}
+
+
+%\sseq at draftmodetrue
+
+%%%%%%                                            %%%%%%
+%%                                                    %%
+%%            Declarations and preliminaries          %%
+%%                                                    %%
+%%%%%%                                            %%%%%%
+\newif\ifsseq at inprogress
+
+\newif\ifsseq at hasname
+\newif\ifsseq at updateexisting
+\newif\ifsseq at ispageenv
+\newif\ifsseq at keepchanges
+\newif\ifsseq at keepglobaloptions
+\newif\ifsseq at globaldetone
+
+\newif\ifsseq at needstikz
+\newif\ifsseq at thispage
+\newif\ifsseq at outofrange
+\newif\ifsseq at classlabel
+\newif\ifsseq at draworphanedges
+\newif\ifsseq at drawedge
+\newif\ifsseq at tikzprims@integershift
+\newif\ifsseq at anchor
+\sseq at drawedgetrue
+\sseq at tikzprims@integershifttrue
+
+\newif\ifsseq at patchforeach
+\newif\ifsseq at patchfit
+
+\newif\ifsseq at tempif
+\newif\ifsseq at gtempif
+\newif\ifsseq at error
+
+\newtoks\sseq at temptoks
+\newtoks\sseq at temptoksii
+\newtoks\sseq at scope@toks
+
+\newcount\sseq at thepagecount
+\newcount\sseq at anonsseqcount
+\newcount\sseq at x
+\newcount\sseq at y
+\newcount\sseq at tempcount
+\newcount\sseq at tempcountb
+\newcount\sseq at tempx
+\newcount\sseq at tempy
+\newcount\sseq at tempxb
+\newcount\sseq at tempyb
+
+\newcount\sseq at stackdepth
+
+\newdimen\sseq at tooltip@height
+\newdimen\sseq at tooltip@width
+\newdimen\sseq at gridstrokethickness
+\sseq at 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 at nil{\sseq at thisshouldnthappen@nil unique expansion} % This expansion text should be unique so that \ifx\sseq at nil\othercommand is false.
+\def\sseq at infinity{10000} % Larger than any coordinate anyone will ever use.
+\newcount\sseq at infinitycount
+\sseq at infinitycount=\sseq at infinity\relax
+\def\sseq at macroname{\@xp\@gobble\string}
+\def\sseq at gobble@to at nil#1\sseq at nil{}
+\def\sseq at macrogobble#1->{}
+
+% These are only used by defertikzcommand now
+\def\sseq at callas#1{\def\sseq at callcmd{#1}}
+\def\sseq at call#1{\bgroup\@xp\let\sseq at callcmd#1\@xptwo\egroup\sseq at callcmd}
+
+\def\sseq at getfirstchar#1#2\sseq at nil{#1} % used in shift/checkshift transform
+\def\sseq at smuggle@macro#1#2\egroup{\@xp\egroup\@xp\def\@xp#1\@xp{#1}}
+
+
+\def\sseq at protected@edef{\let\sseq at store@slsl\\\def\\{\protect\\}\let\@@protect \protect \let \protect \@unexpandable at protect \afterassignment \sseq at restore@protect \edef}
+\def\sseq at protected@xdef{\let\sseq at store@slsl\\\def\\{\protect\\}\let\@@protect \protect \let \protect \@unexpandable at protect \afterassignment \sseq at restore@protect \xdef}
+\def\sseq at restore@protect{\let\protect\@@protect\let\\\sseq at store@slsl}
+
+\def\sseq at eval#1{\bgroup\edef\sseq at temp{#1}\@xp\egroup\sseq at temp}% I got this from sseq.sty
+\def\sseq at protectedeval#1{\bgroup\sseq at protected@edef\sseq at temp{#1}\@xp\egroup\sseq at temp}
+\def\sseq at eval@show#1{\bgroup\edef\sseq at temp{#1}\show\sseq at temp\@xp\egroup\sseq at temp}
+\def\sseq at profilenew#1#2{\pgfprofilenew{#1}\pretocmd#2{\pgfprofilestart{#1}}{}{\error}\apptocmd#2{\pgfprofileend{#1}}{}{\error}}
+
+%%%% add to macro commands
+\def\sseq at d@addto at macro#1#2{\@xp\def\@xp#1\@xp{#1#2}}
+\def\sseq at e@addto at macro#1#2{\edef#1{\unexpanded\@xp{#1}#2}} % let #2 be expanded
+\def\sseq at eo@addto at macro#1#2{\edef#1{\unexpanded\@xp{#1}\unexpanded\@xp{#2}}} % let #2 be expanded once
+\def\sseq at g@addto at macro#1#2{\@xp\gdef\@xp#1\@xp{#1#2}}
+\def\sseq at x@addto at macro#1#2{\xdef#1{\unexpanded\@xp{#1}#2}} % let #2 be expanded
+\def\sseq at xprotected@addto at macro#1#2{\sseq at protected@xdef#1{\unexpanded\@xp{#1}#2}}
+
+\def\sseq at d@addto at toks#1#2{#1\@xp{\the#1#2}}
+\def\sseq at e@addto at toks#1#2{\sseq at eval{#1{\the#1#2}}}
+
+\def\sseq at d@addto at temptoks{\sseq at d@addto at toks\sseq at temptoks}
+\def\sseq at e@addto at temptoks{\sseq at e@addto at toks\sseq at temptoks}
+
+
+% Used in sseqkeys to delete spaces from style commands.
+\def\sseq at setmacronospaces#1#2{%
+    \bgroup\catcode`\ =9\relax
+        \scantokens{\@xp\egroup\@xp\def\@xp#1\@xp{\csname #2\endcsname}}%
+}
+
+
+\def\sseq at removeparens{\@xp\sseq at removeparens@}
+\def\sseq at removeparens@(#1){#1}
+
+% Stolen from trimspaces.sty
+\bgroup
+\catcode`\Q=3
+\gdef\sseq at trimspaces#1{%
+  \romannumeral-`\q\sseq at trim@trim@\noexpand#1Q Q%
+}
+\long\gdef\sseq at trim@trim@#1 Q{\sseq at trim@trim@@#1Q}
+\long\gdef\sseq at trim@trim@@#1Q#2{#1}
+\egroup
+\def\sseq at trimleadingspaces{\romannumeral-`q}
+
+\def\sseq at ifempty#1{%
+    \@xp\ifx\@xp\sseq at nil\detokenize{#1}\sseq at nil
+        \@xp\@firstoftwo
+    \else
+        \@xp\@secondoftwo
+    \fi
+}
+
+\def\sseq at ifnil#1{
+    \ifx\sseq at nil#1
+        \@xp\@firstoftwo
+    \else
+        \@xp\@secondoftwo
+    \fi
+}
+
+\let\sseq at breakpoint\relax
+\def\sseq at break#1\sseq at breakpoint{}
+\def\sseq at break@withcleanup#1\sseq at breakpoint#2{}
+
+\def\sseq at breakfi{\fi\sseq at break}
+\def\sseq at breakfifi{\fi\fi\sseq at break}
+\def\sseq at breakfififi{\fi\fi\fi\sseq at break}
+\long\def\sseq at breakdataenv#1\end#2{
+    \def\sseq at tempa{sseqdata}\def\sseq at tempb{#2}\ifx\sseqtempa\sseqtempb
+        \@xp\sseq at breakdataenv@
+    \else
+        \@xp\sseq at breakdataenv
+    \fi
+}
+\def\sseq at breakdataenv@{\let\endsseqdata\sseq at breakendsseqdata\end{sseqdata}}
+
+\long\def\sseq at breakpageenv#1\end#2{
+    \def\sseq at tempa{sseqpage}\def\sseq at tempb{#2}\ifx\sseqtempa\sseqtempb
+        \@xp\sseq at breakpageenv@
+    \else
+        \@xp\sseq at breakpageenv
+    \fi
+}
+\def\sseq at breakpageenv@{\let\endsseqpage\sseq at breakendsseqpage\end{sseqpage}}
+\def\sseq at breakendsseqdata{}
+\def\sseq at breakendsseqpage{}
+
+\def\sseq at 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 at 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 at 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 at patchforeachfalse
+
+\ifsseq at tempif\else % Set to false in checkdefinitions if it failed to patch the key-value system.
+    \sseq at seteverythingtonoops
+    \sseq at 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 at patchforeach
+    \input sseqforeach.code.tex
+\else
+    \def\sseq at 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 at 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}


Property changes on: trunk/Master/texmf-dist/tex/latex/spectralsequences/spectralsequences.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqcheckdefinitions.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqcheckdefinitions.code.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqcheckdefinitions.code.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,170 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: sseqcheckdefinitions.code.tex
+%%
+%%    A few tikz commands are modified in sseqpages. This file checks the definitions of all commands modified. Of course, this is insufficient to ensure that
+%%    the behavior isn't completely wrong, but at least it's a sanity check.
+%%
+
+% TODO: we could recover from failing to patch keys.
+
+\sseq at tempiftrue
+\begingroup
+
+\def\sseq at checkdef#1{\def\sseq at temp{\sseq at checkdef@{#1}}\afterassignment\sseq at temp\@xp\def\csname sseq at check@\sseq at macroname#1\endcsname}
+\def\sseq at checkdef@#1{\@xp\ifx\csname sseq at check@\sseq at macroname#1\endcsname#1\else
+    \sseq at tempiffalse
+\fi}
+
+%%
+%% sseqkeys.code.tex
+%%
+
+
+\sseq at checkdef\pgfkeys at case@one{%
+  \pgfkeysifdefined{\pgfkeyscurrentkey/. at cmd}%
+  {\pgfkeysgetvalue{\pgfkeyscurrentkey/. at cmd}{\pgfkeys at code}%
+   \expandafter\pgfkeys at code\pgfkeyscurrentvalue\pgfeov}
+  {\pgfkeys at case@two}%
+}
+
+\sseq at checkdef\pgfkeys at case@two at extern{%
+  \ifx\pgfkeyscurrentvalue\pgfkeysnovalue at text%
+    \pgfkeysvalueof{\pgfkeyscurrentkey}%
+  \else%
+    \pgfkeyslet{\pgfkeyscurrentkey}\pgfkeyscurrentvalue%
+  \fi%
+}
+
+
+\ifsseq at tempif\else
+    \endgroup
+    \sseq at tempiffalse % We'll throw a critical error in spectralsequences.sty to end input
+    \endinput
+\fi
+%%
+%% sseqdrawing.code.tex
+%%
+
+%from \pgf\frontendlayer\tikz\libraries\tikzlibraryfit.code.tex line 81
+\sseq at checkdef\tikz at lib@fit at scan@handle#1{%
+  \iftikz at shapeborder%
+    % Ok, fit all four external anchors, if they exist
+    \tikz at lib@fit at adjust{\pgfpointanchor{\tikz at shapeborder@name}{west}}%
+    \tikz at lib@fit at adjust{\pgfpointanchor{\tikz at shapeborder@name}{east}}%
+    \tikz at lib@fit at adjust{\pgfpointanchor{\tikz at shapeborder@name}{north}}%
+    \tikz at lib@fit at adjust{\pgfpointanchor{\tikz at shapeborder@name}{south}}%
+  \else%
+    \tikz at lib@fit at adjust{#1}%
+  \fi%
+  \tikz at lib@fit at scan%
+}
+
+% from \pgf\frontendlayer\tikz\tikz.code.tex line 5164
+\sseq at checkdef\tikz at calc@anchor#1.#2\tikz at stop{%
+    \pgfpointanchor{\tikz at pp@name{#1}}{#2}%
+}
+
+\ifsseq at tempif
+    \global\sseq at patchfittrue
+\else
+    \sseq at warning{fit-patch-failed}
+    \global\sseq at patchfitfalse
+\fi
+
+\sseq at tempiftrue
+
+
+%%
+%% sseqforeach.code.tex
+%%
+\sseq at checkdef\pgffor@@vars at opt[#1]{\pgfkeys{/pgf/foreach/.cd,#1}\pgffor at vars}
+
+\sseq at checkdef\pgffor at doloop{%
+  \pgffor at begingroup
+    \edef\pgffor at temp{\expandafter\Pgffor at geT\the\pgffor at iter}%
+    \edef\pgffor at incheck{{.0/}{\pgffor at temp/}}%
+    \expandafter\pgfutil at in@\pgffor at incheck%
+    \ifpgfutil at in@%
+      \expandafter\pgffor at strip\pgffor at temp%
+    \fi%
+    \expandafter\pgfutil at in@\expandafter/\expandafter{\pgffor at var}%
+    \ifpgfutil at in@%
+      \expandafter\def\expandafter\pgffor at valuerest\expandafter{\pgffor at temp//\relax}%
+      \expandafter\pgffor at multiassign\pgffor at var/\pgffor at stop/\pgffor at stop/\relax%
+    \else%
+    	% Convert to alphabetic sequence, if necessary.
+    	\ifpgffor at alphabeticsequence%
+    		\pgffor at makealphabetic\pgffor at temp%
+    		\expandafter\let\pgffor at var=\pgffor at temp%    						
+    	\else%
+    		\expandafter\expandafter\expandafter\def\expandafter\pgffor at var\expandafter{\pgffor at temp}%
+      \fi%
+    \fi%
+    % Insert any context, if any.
+    \ifpgffor at context%
+      \let\pgffor at temp=\pgffor at dots@pre%
+	    \expandafter\pgfutil at append@macrotomacro\expandafter%
+	    	{\expandafter\pgffor at temp\expandafter}\expandafter{\pgffor at var}%
+	    \expandafter\pgfutil at append@macrotomacro\expandafter%
+	    	{\expandafter\pgffor at temp\expandafter}\expandafter{\pgffor at dots@post}%
+	    \expandafter\let\pgffor at var=\pgffor at temp%
+	  \fi%
+	% Perform assignments before loop body.
+	\ifx\pgffor at assign@before at code\pgfutil at empty%
+    \else%
+    	\pgffor at assign@before at code%
+    \fi%
+    %
+    \expandafter\expandafter\expandafter\pgffor at reset@hooks\expandafter\pgffor at beginhook\expandafter\pgffor at body\pgffor at endhook%
+    %
+    % Perform assignments after loop body.
+	  \ifx\pgffor at assign@after at code\pgfutil at empty%
+    \else%
+    	\pgffor at assign@after at code%
+    \fi%
+  \pgffor at endgroup%
+  \pgffor at loop%
+}
+
+\sseq at checkdef\pgffor at invokebody{%
+	\pgffor at begingroup%
+    \expandafter\pgfutil at in@\expandafter/\expandafter{\pgffor at var}%
+    \ifpgfutil at in@%
+      \expandafter\def\expandafter\pgffor at valuerest\expandafter{\pgffor at value//\relax}%
+      \expandafter\pgffor at multiassign\pgffor at var/\pgffor at stop/\pgffor at stop/\relax%
+    \else%
+      \expandafter\expandafter\expandafter\def\expandafter\pgffor at var\expandafter{\pgffor at value}%
+    \fi%
+    % Execute assign once code.
+    \ifx\pgffor at assign@once at code\pgfutil at empty%
+  	\else\pgffor at assign@once at code%
+  	\fi%
+    % Execute assign before code.
+    \ifx\pgffor at assign@before at code\pgfutil at empty%
+    \else\pgffor at assign@before at code%
+    \fi%
+    %
+    \expandafter\expandafter\expandafter\pgffor at reset@hooks\expandafter\pgffor at beginhook\expandafter\pgffor at body\pgffor at endhook%
+    % Execute assign after code.
+    \ifx\pgffor at assign@after at code\pgfutil at empty%
+    \else%
+    	\pgffor at assign@after at code%
+    \fi%
+    %
+  \pgffor at endgroup%
+}
+
+\ifsseq at tempif
+    \global\sseq at patchforeachtrue
+\else
+    \sseq at warning{foreach-patch-failed}
+    \global\sseq at patchforeachfalse
+\fi
+
+\endgroup 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqcheckdefinitions.code.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqdrawing.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqdrawing.code.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqdrawing.code.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,990 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: sseqdrawing.code.tex
+%%
+%%    Defines the macros that draw the features of the spectral sequence (at least, those that aren't drawn by tikz).
+%%    Everything here has to be super optimized, because like 90% of the execution time is in these functions.
+%%    In particular, tikz is a horrible performance hole that must be avoided at all costs. For example, the code
+%%    the code to produce the axis ticks used to use the tikz \node command, and in the file example_KF3n.tex drawing
+%%    the axes ticks was taking about 1/3 of the compile time (a little under 1s out of a 3.2)
+%%
+
+
+
+%%%
+%%% Draw axes and clip
+%%%
+\def\sseq at handlexaxis{
+    \ifsseq at drawxaxis
+        \bgroup
+        \ifsseq at borderxaxis\else
+            \let\sseq at ymin\sseq at yaxisorigin % Warning: this is a stupid, lazy hack.
+        \fi
+        \sseq at drawxaxis
+        \ifsseq at drawxaxisticks
+            \sseq at drawxticks
+        \fi
+        \egroup
+    \fi
+}
+\def\sseq at handleyaxis{
+    \ifsseq at drawyaxis
+        \bgroup
+        \ifsseq at borderyaxis\else
+            \let\sseq at xmin\sseq at xaxisorigin % Warning: this is a stupid, lazy hack.
+        \fi
+        \sseq at drawyaxis
+        \ifsseq at drawyaxisticks
+            \sseq at drawyticks
+        \fi
+        \egroup
+    \fi
+}
+\def\sseq at drawxaxis{
+    \bgroup
+    \pgftransformreset
+    \sseq at globaldetonetransform
+    %
+    \bgroup
+    \pgftransformxshift{\sseq at xaxis@end at extend}\pgftransformyshift{-\sseq at xaxisgap}
+    \sseq at globalscaletransform
+    \pgfpathmoveto{\pgfpoint{\sseq at xmax cm}{\sseq at ymin cm}}
+    \egroup
+    \bgroup
+    \pgftransformxshift{-\sseq at yaxisgap}
+    %\pgftransformxshift{-\sseq at ylabelgap}
+    \pgftransformxshift{-\sseq at xaxis@start at extend}
+    \pgftransformyshift{-\sseq at xaxisgap}
+    \sseq at globalscaletransform
+    \pgfpathlineto{\pgfpoint{\sseq at xmin cm}{\sseq at ymin cm}}
+    \egroup
+    \egroup
+    \pgfusepath{stroke}
+}
+\def\sseq at drawyaxis{
+    \bgroup
+    \pgftransformreset
+    \sseq at globaldetonetransform
+    \bgroup
+    \pgftransformyshift{\sseq at yaxis@end at extend}\pgftransformxshift{-\sseq at yaxisgap}
+    \sseq at globalscaletransform
+    \pgfpathmoveto{\pgfpoint{\sseq at xmin cm}{\sseq at ymax cm}}
+    \egroup
+    \bgroup
+    \pgftransformyshift{-\sseq at xaxisgap}
+    %\pgftransformyshift{-\sseq at xlabelgap}
+    \pgftransformyshift{-\sseq at yaxis@start at extend}
+    \pgftransformxshift{-\sseq at yaxisgap}
+    \sseq at globalscaletransform
+    \pgfpathlineto{\pgfpoint{\sseq at xmin cm}{\sseq at ymin cm}}
+    \egroup
+    \egroup
+    \pgfusepath{stroke}%
+}
+\def\sseq at drawxticks{
+    \sseq at tempy=\sseq at ymin\relax
+    \sseq at tempx=\sseq at xmax\relax
+    \advance\sseq at tempx\@ne\relax
+    \edef\sseq at temp{\the\sseq at tempx}%
+    \sseq at tempx=\sseq at xmin\relax
+    \loop
+        \bgroup
+        \sseq at eval{\@nx\pgftransformshift{\@nx\pgfpoint{\the\sseq at tempx cm}{\the\sseq at tempy cm}}}
+        \pgftransformresetnontranslations
+        \sseq at globaldetonetransform
+        \pgftransformyshift{-\sseq at xlabelgap}\pgftransformyshift{-\sseq at xaxisgap}
+        \pgftransformresetnontranslations
+        \ifsseq at rotatelabels\sseq at globalrotatetransform\fi
+        \sseq at xtickstyle
+        \tikz at options
+        \pgftext{\hbox{$\sseq at xtickfn{\the\sseq at tempx}$}}
+        \egroup
+        \advance\sseq at tempx\sseq at xtickstep\relax
+    \ifnum\sseq at tempx<\sseq at temp\repeat
+}
+\def\sseq at drawyticks{
+    \sseq at tempx=\sseq at xmin\relax
+    \sseq at tempy=\sseq at ymax\relax
+    \advance\sseq at tempy\@ne\relax
+    \edef\sseq at tempmax{\the\sseq at tempy}
+    \sseq at tempy=\sseq at ymin\relax
+    \loop
+        \bgroup
+        \sseq at eval{\@nx\pgftransformshift{\@nx\pgfpoint{\the\sseq at tempx cm}{\the\sseq at tempy cm}}}
+        \pgftransformresetnontranslations
+        \sseq at globaldetonetransform
+        \pgftransformxshift{-\sseq at ylabelgap}\pgftransformxshift{-\sseq at yaxisgap}
+        \pgftransformresetnontranslations
+        \ifsseq at rotatelabels\sseq at globalrotatetransform\fi
+        \sseq at ytickstyle
+        \tikz at options
+        \pgftext{\hbox{$\sseq at ytickfn{\the\sseq at tempy}$}}
+        \egroup
+        \advance\sseq at tempy\sseq at ytickstep\relax
+    \ifnum\sseq at tempy<\sseq at tempmax\repeat
+}
+\def\sseq at setupclip{
+    %\clip(\sseq at xmin-0.4,\sseq at ymin-0.4) rectangle (\sseq at xmax+0.5,\sseq at ymax+0.5);%
+    \ifsseq at clip
+        \ifx\sseq at customclip\pgfutil at empty
+            \bgroup
+            \pgftransformreset
+            \sseq at globaldetonetransform
+            \ifsseq at borderyaxis
+                \def\xmin{\pgftransformxshift{-\sseq at yaxisgap}\pgftransformxshift{\sseq at yclip@axisgap}}
+            \else
+                \def\xmin{\pgftransformxshift{-\sseq at xaxis@start at extend}\pgftransformxshift{-\sseq at clip@padding at left}}
+            \fi
+            \ifsseq at borderxaxis
+                \def\ymin{\pgftransformyshift{-\sseq at xaxisgap}\pgftransformyshift{\sseq at xclip@axisgap}}
+            \else
+                \def\ymin{\pgftransformyshift{-\sseq at yaxis@start at extend}\pgftransformyshift{-\sseq at clip@padding at bottom}}
+            \fi
+            \def\xmax{\pgftransformxshift{\sseq at xaxis@end at extend}\pgftransformxshift{\sseq at clip@padding at right}}
+            \def\ymax{\pgftransformyshift{\sseq at yaxis@end at extend}\pgftransformyshift{\sseq at clip@padding at top}}
+            \bgroup
+            \xmin\ymin\sseq at globalscaletransform
+            \pgfpathmoveto{\pgfpoint{\sseq at xmin cm}{\sseq at ymin cm}}
+            \egroup
+            \bgroup
+            \xmin\ymax\sseq at globalscaletransform
+            \pgfpathlineto{\pgfpoint{\sseq at xmin cm}{\sseq at ymax cm}}
+            \egroup
+            \bgroup
+            \xmax\ymax\sseq at globalscaletransform
+            \pgfpathlineto{\pgfpoint{\sseq at xmax cm}{\sseq at ymax cm}}
+            \egroup
+            \bgroup
+            \xmax\ymin\sseq at globalscaletransform
+            \pgfpathlineto{\pgfpoint{\sseq at xmax cm}{\sseq at ymin cm}}
+            \egroup
+            \egroup
+            \pgfpathclose
+            \pgfgetpath\sseq at theclippath % This stores the clipping so I can find intersections later
+            \pgfusepath{discard}% This has to be after the egroup or else the clipping gets screwed up
+            \bgroup
+                %\sseq at globalscaletransform
+                \pgfpathmoveto{\pgfpoint{\sseq at xmin cm}{\sseq at ymin cm}}
+                \pgfpathlineto{\pgfpoint{\sseq at xmin cm}{\sseq at ymax cm}}
+                \pgfpathlineto{\pgfpoint{\sseq at xmax cm}{\sseq at ymax cm}}
+                \pgfpathlineto{\pgfpoint{\sseq at xmax cm}{\sseq at ymin cm}}
+                \pgfpathclose
+            \egroup
+            \pgfgetpath\sseq at therangepath % Only for deciding whether to draw "tricky edges"
+            \pgfusepath{discard}
+        \else
+            \def\sseq at temp{\path[name path=temp]}
+            \@xptwo\sseq at temp\@xp\@gobble\sseq at customclip
+            \pgfgetpath\sseq at theclippath
+            \let\sseq at theclippath\tikz at intersect@path at name@temp
+        \fi
+    \else
+        \let\sseq at theclippath\relax
+    \fi
+}
+\def\sseq at useclip{\ifx\sseq at theclippath\relax\else\pgfsetpath\sseq at theclippath\pgfusepath{clip}\fi}
+\def\sseq at grid@chess{
+ \bgroup
+ \pgfscope
+ \sseq at useclip
+ \pgflowlevelsynccm
+ \pgfsetlinewidth{1cm}
+ \pgfsetdash{{1cm}{1cm}}{1cm}
+ \pgfsetcolor{lightgray}
+ \pgfpathgrid[stepx=2cm,stepy=2cm]{\pgfpoint{-0.5cm}{-0.5cm}}{\pgfpoint{\sseq at xmax cm+0.499cm}{\sseq at ymax cm+0.499cm}}
+ \pgfusepath{stroke}
+ \endpgfscope
+ \egroup
+}
+\def\sseq at grid@crossword{
+ \bgroup
+ \pgfscope
+ \pgfsetlinewidth{\the\sseq at gridstrokethickness}
+ \sseq at 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
+}
+\def\sseq at grid@go{
+ \bgroup
+ \pgfscope
+ \sseq at useclip
+ \pgfsetlinewidth{\the\sseq at gridstrokethickness}
+ \pgfpathgrid[stepx=1cm,stepy=1cm]{\pgfpoint{-1cm}{-1cm}}{\pgfpoint{\xmax cm+0.5cm}{\ymax cm+0.5cm}}
+ \pgfusepath{stroke}
+ \endpgfscope
+ \egroup
+}
+\def\sseq at grid@none{}
+\def\sseq at grid@dots{
+ \bgroup
+ \pgfscope
+ \pgfgettransform\sseq at savetransform
+ \pgftransformreset
+ \sseq at globalscaletransform
+ \pgfgettransformentries{\sseq at a}{\sseq at b}{\sseq at c}{\sseq at d}{\sseq at u}{\sseq at v}
+ \pgfsettransform\sseq at savetransform
+ \sseq at useclip
+ \pgftransformxshift{-1.5cm}
+ \pgftransformyshift{-0.5cm}
+ \pgfsetdash{{1pt}{\sseq at a*1cm-1pt}}{0.5cm+.5pt}
+ \pgfsetlinewidth{1pt}
+ \sseq at tempy=\sseq at ymin\relax
+ \advance\sseq at tempy\m at ne
+ \loop
+ \advance\sseq at tempy\@ne
+ \pgfpathmoveto{\pgfpoint{\sseq at xmin cm+0.5cm/\sseq at a}{\the\sseq at tempy cm}}
+ \pgfpathlineto{\pgfpoint{\sseq at xmax cm+1.01cm }{\the\sseq at tempy cm}}
+ \ifnum\sseq at tempy<\sseq at 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
+%%%
+%%% Class offsets
+\sseqnewclasspattern{standard}{
+    (0,0);
+    (-0.13,0)(0.13,0);
+    (-0.2,0)(0,0)(0.2,0);
+    (-0.13,-0.13)(0.13,-0.13)(-0.13,0.13)(0.13,0.13);
+    (-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);
+    (-0.2,0)(0,0)(0.2,0);
+    (-0.3,0)(-0.1,0)(0.1,0)(0.3,0);
+    (-0.4,0)(-0.2,0)(0,0)(0.2,0)(0.4,0);
+    (-0.5,0)(-0.3,0)(-0.1,0)(0.1,0)(0.3,0)(0.5,0);
+}
+\def\sseq at offset#1#2{
+    \sseq at eval{\@nx\pgftransformshift{\@nx\pgfpoint{0\csname sseq@\sseq at classpattern xoffset#1/#2\endcsname cm}{0\csname sseq@\sseq at classpattern yoffset#1/#2\endcsname cm}}}
+}
+\def\sseq at class@getparts#1(#2,#3,#4)[#5].{
+    \sseq at seterrorannotation@drawing{#1}{#2}{#3}{#4}{#5}
+    \def\sseq at thisclassname{class.(#2,#3,#4)}
+    \def\sseq at thisnodename{sseq{#2,#3,#4}}
+    \def\sseq at thispos{(#2,#3)}
+    \def\sseq at thisposnum{#4}
+    \def\sseq at thisclassnum{#5}
+}
+
+\def\sseqtooltip#1#2{%
+    \edef\temp{\detokenize\@xpthree{#2}}%
+    \edef\temp{\@xp\sseqtooltip at replaceslashes\@xp{\temp}}%
+    \sseq at eval{\@nx\pdftooltip{\unexpanded{#1}}{\temp}}%
+}
+\bgroup\lccode`\!=`\\\lowercase{\egroup
+\def\sseqtooltip at replaceslashes#1{\sseqtooltip at replaceslashes@#1!\sseq at nil}
+\def\sseqtooltip at replaceslashes@#1!#2{%
+    #1%
+    \ifx\sseq at nil#2\@xp\@gobble\else
+        \@nx\@nx\@nx\textbackslash
+        \@xp\sseqtooltip at replaceslashes@
+    \fi#2%
+}
+}
+
+% #1 -- the name of the node object
+\def\sseq at class@drawnode#1{%
+    \begingroup
+    \sseq at class@getparts#1.
+    \sseq at tempx=\sseq at obj{\sseq at thisclassname.x}\relax
+    \sseq at tempy=\sseq at obj{\sseq at thisclassname.y}\relax
+    \sseq at needstikzfalse
+    \sseq at options@firstpassmode
+        \sseq at thesseqstyle
+        \sseq at theclassstyle
+        \ifnum\sseq at obj{#1.page}=\sseq at infinitycount
+            \sseq at thepermanentcyclestyle
+        \else
+            \sseq at thetransientcyclestyle
+            \ifsseq at thispage
+                \sseq at thethispagecyclestyle
+            \fi
+        \fi
+        \the\sseq at scope@toks
+        \sseq at obj{#1.needstikz}
+%
+    \sseq at outofrangetrue
+    \ifnum\sseq at tempx<\sseq at xmaxpp\relax\ifnum\sseq at tempx>\sseq at xminmm\relax\ifnum\sseq at tempy<\sseq at ymaxpp\relax\ifnum\sseq at tempy>\sseq at yminmm\relax
+        \sseq at outofrangefalse
+        \pgfscope
+        \let\tikz at options\pgfutil at empty
+        \let\tikz at alias=\pgfutil at empty
+        \def\pgfkeysdefaultpath{/sseqpages/class/}
+        \sseq at options@secondpassmode
+            \sseq at thesseqstyle
+            \sseq at theclassstyle
+            \ifnum\sseq at obj{#1.page}=\sseq at infinitycount
+                \sseq at thepermanentcyclestyle
+            \else
+                \sseq at thetransientcyclestyle
+                \ifsseq at thispage
+                    \sseq at thethispagecyclestyle
+                \fi
+            \fi
+            \the\sseq at scope@toks
+            \sseq at obj{#1.options}%
+        \sseq at eval{\@nx\pgftransformshift{\@nx\pgfpoint{\the\sseq at tempx cm}{\the\sseq at tempy cm}}}
+        \sseq at eval{\@nx\pgftransformshift{\@nx\pgfpoint{-\the\sseq at x cm}{-\the\sseq at y cm}}}
+        \iftikz at fullytransformed\pgfgettransform{\savetransform}\fi
+        \pgftransformresetnontranslations
+        \sseq at globalrotatetransform
+        \sseq at classplacementtransform
+        \sseq at obj@ifdef{#1.offset}{\sseq at obj{#1.offset}}{%
+            \sseq at offset{\sseq at thisposnum}{\sseq at obj{partcoord.\sseq at thispos.numnodes}}%
+        }%
+        \iftikz at fullytransformed\pgfsettransform{\savetransform}\else\pgftransformresetnontranslations\ifsseq at rotatelabels\sseq at globalrotatetransform\fi\fi
+        \tikz at options
+        \ifsseq at needstikz
+            \let\sseq at mode\tikz at mode
+            \tikzset{every text node part/.code/.expand once={\sseq at globalrotatetransform\sseq at obj{#1.nodetext.options}}}%
+            \sseq at eval{%
+                \@nx\node[/utils/exec={\let\@nx\tikz at mode\@nx\sseq at mode},
+                    /handlers/first char syntax/the character "/.initial=\@nx\sseq at handlequote
+                ] (\sseq at thisnodename) {\unexpanded\@xpthree{\sseq at obj{#1.nodetext}}}
+                [every text node part/.code={}]
+                \@nx\sseq at obj{#1.labelnodes};
+            }%
+        \else
+            \tikz at node@textfont
+            \edef\sseq at classnodetextoptions{\@xptwo\@nx\sseq at obj{#1.nodetext.options}}
+            \edef\sseq at classnodetext{\@xptwo\@nx\sseq at obj{#1.nodetext}}
+            \sseq at setnodetext
+            \let\tikz at fig@name\sseq at thisnodename
+            \pgfmultipartnode{\tikz at shape}{\tikz at anchor}{\tikz at fig@name}{\sseq at drawnode}%
+            \tikz at alias
+            \sseq at obj{#1.labelnodes}
+        \fi
+        \sseq at obj@ifdef{#1.tooltip}{
+            \pgfpointanchor{\sseq at thisnodename}{west}
+            \pgf at xa=\pgf at x
+            \pgfpointanchor{\sseq at thisnodename}{south}
+            \pgf at ya=\pgf at y
+%
+            \pgf at process{\pgfpointdiff{\pgfpointtransformed{\pgfpointanchor{\sseq at thisnodename}{west}}}{\pgfpointtransformed{\pgfpointanchor{\sseq at thisnodename}{east}}}}
+            \pgf at xb=\pgf at x
+            \pgf at process{\pgfpointdiff{\pgfpointtransformed{\pgfpointanchor{\sseq at thisnodename}{south}}}{\pgfpointtransformed{\pgfpointanchor{\sseq at thisnodename}{north}}}}
+            \pgf at yb=\pgf at y
+%
+            \setbox\tikz at tempbox=\hbox{
+                \pgfinterruptpicture
+                \sseqtooltip{\rule{\pgf at xb}{0pt}\rule{0pt}{\pgf at yb}}{\sseq at obj{#1.tooltip}}
+                \endpgfinterruptpicture
+            }
+            {%
+                \pgftransformshift{\pgfpoint{\pgf at xa}{\pgf at ya}}%
+                \pgfapproximatenonlineartransformation%
+                \pgfqboxsynced{\tikz at tempbox}%
+            }%
+        }{}
+        \endpgfscope
+    \fi\fi\fi\fi
+    \ifsseq at outofrange
+        \sseq at eval{\@nx\pgftransformshift{\@nx\pgfpoint{\the\sseq at tempx cm}{\the\sseq at tempy cm}}}%
+        \sseq at eval{\@nx\pgftransformshift{\@nx\pgfpoint{-\the\sseq at x cm}{-\the\sseq at y cm}}}
+        \pgftransformresetnontranslations
+        \sseq at globalrotatetransform
+        \sseq at classplacementtransform
+        \sseq at offset{\sseq at thisposnum}{\sseq at obj{partcoord.\sseq at thispos.numnodes}}
+        \pgfcoordinate{\sseq at thisnodename}{\pgfpointorigin}%
+    \fi
+    \endgroup
+}
+\def\sseq at setnodetext{%
+    \setbox\pgfnodeparttextbox=\hbox{%
+        \pgfscope%
+        \tikzset{every text node part/.try}%
+        \sseq at classnodetextoptions
+        \ifx\tikz at textopacity\pgfutil at empty%
+        \else%
+         \pgfsetfillopacity{\tikz at textopacity}%
+          \pgfsetstrokeopacity{\tikz at textopacity}%
+        \fi%
+        \pgfinterruptpicture
+      \ifx\tikz at text@width\pgfutil at empty%
+        \tikz at textfont%
+      \else%
+        \begingroup%
+        	\pgfmathsetlength{\pgf at x}{\tikz at text@width}%
+          \pgfutil at minipage[t]{\pgf at x}\leavevmode\hbox{}%
+            \tikz at textfont%
+            \tikz at text@action%
+      \fi%
+        \ifx\tikz at textcolor\pgfutil at empty%
+        \else%
+          \pgfutil at colorlet{.}{\tikz at textcolor}%
+        \fi%
+        \pgfsetcolor{.}%
+          \tikz at atbegin@node%
+          \sseq at classnodetext%
+          \tikz at atend@node%
+           \ifx\tikz at text@width\pgfutil at empty%
+           \else%
+              \pgfutil at endminipage%
+            \endgroup%
+          \fi%
+          \endpgfinterruptpicture
+      \endpgfscope%
+    }%
+    \ifx\tikz at text@width\pgfutil at empty%
+    \else%
+      \pgfmathsetlength{\pgf at x}{\tikz at text@width}%
+      \wd\pgfnodeparttextbox=\pgf at x%
+    \fi%
+    \ifx\tikz at text@height\pgfutil at empty%
+    \else%
+      \pgfmathsetlength{\pgf at x}{\tikz at text@height}%
+      \ht\pgfnodeparttextbox=\pgf at x%
+    \fi%
+    \ifx\tikz at text@depth\pgfutil at empty%
+    \else%
+      \pgfmathsetlength{\pgf at x}{\tikz at text@depth}%
+      \dp\pgfnodeparttextbox=\pgf at x%
+    \fi%
+}
+\def\sseq at drawnode{%
+  \pgfutil at tempdima=\pgflinewidth%
+  {%
+    \tikz at mode%
+    %\iftikz at mode@clip \sseq at error@internal{Clip shouldn't happen here, but this error should be caught earlier}{}\fi %
+    \iftikz at mode@draw%
+        \iftikz at mode@double%
+        % Change line width
+            \begingroup%
+            \pgfsys at beginscope%
+            \tikz at double@setup%
+        \fi%
+    \fi%
+    %
+    % Step 10: Do stroke/fill as needed
+    %
+    \sseq at eval{\noexpand\pgfusepath{%
+        \iftikz at mode@fill fill,\fi%
+        \iftikz at mode@draw draw,\fi%
+    }}%
+    %
+    % Step 11: Double stroke, if necessary
+    %
+    \iftikz at mode@draw%
+        \iftikz at mode@double%
+            \pgfsys at endscope%
+            \endgroup%
+        \fi%
+    \fi
+  }%
+  \global\pgflinewidth=\pgfutil at tempdima%
+}
+
+%%%
+%%% Drawing edges
+%%%
+\def\sseq at ifinrange(#1){\sseq at ifinrange@#1,\sseq at nil}
+\def\sseq at ifinrange@#1,#2,#3\sseq at nil{%
+    \sseq at tempx=#1\relax\sseq at tempy=#2\relax
+    \sseq at outofrangetrue
+    \ifnum\sseq at tempx<\sseq at xmaxpp\relax\ifnum\sseq at tempx>\sseq at xminmm\relax\ifnum\sseq at tempy<\sseq at ymaxpp\relax\ifnum\sseq at tempy>\sseq at yminmm\relax
+    \sseq at outofrangefalse
+    \fi\fi\fi\fi
+    \ifsseq at outofrange
+        \@xp\pgfutil at secondoftwo
+    \else
+        \@xp\pgfutil at firstoftwo
+    \fi
+}
+
+\def\sseq at fullcoord@to at partialcoord(#1){\sseq at fullcoord@to at partialcoord@#1,\@nil}
+\def\sseq at fullcoord@to at partialcoord@#1,#2,#3\@nil{{#1cm}{#2cm}}
+% #1 -- source (full)
+% #2 -- target (full)
+% #3 -- which type of edge (either "structline" or "differential")
+% #4 -- options
+\def\sseq at drawedge(#1)(#2)#3#4{%
+    \begingroup\pgfscope
+    \def\sseq at edgetype{#3}
+    \let\sseq at edgesourceanchor\pgfutil at empty
+    \let\sseq at edgetargetanchor\pgfutil at empty
+%
+    \sseq at needstikzfalse
+    \def\pgfkeysdefaultpath{/sseqpages/#3/}%
+    \sseq at options@bothpassmode
+    \sseq at thesseqstyle
+    \sseq at theedgestyle\csname sseq at the#3style\endcsname\the\sseq at scope@toks
+    #4%
+    \sseq at eval{\@nx\pgftransformshift{\@nx\pgfpoint{-\the\sseq at x cm}{-\the\sseq at y cm}}}%
+    % First calculate actual start and end of the edge
+    \let\tempaf\pgfutil at empty
+    \ifx\sseq at edgesourceanchor\pgfutil at 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 at edgesourceanchor}} % If it has an anchor, use that
+        \let\tempaf\tempa
+    \fi
+    \ifx\sseq at edgetargetanchor\pgfutil at 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 at edgetargetanchor}}% If it has a specified anchor, use that
+    \fi
+    \let\tempbf\tempb
+    \ifx\tempaf\pgfutil at empty%
+        \def\tempaf{\pgfpointshapeborder{sseq{#1}}{\tempb}}%
+    \fi
+%
+    \tikz at options
+    \tikz at mode
+    \def\temparrowstartspec{}%
+    \def\temparrowendspec{}%
+    \pgfcoordinate{tempa}{\tempaf}%
+    \pgfcoordinate{tempb}{\tempbf}%
+    \pgftransformreset
+    \sseq at ifinrange(#1){\sseq at ifinrange(#2){\sseq at outofrangefalse}{\sseq at outofrangetrue}}{\sseq at outofrangetrue}%
+    \ifsseq at outofrange
+        \sseq at handleoffpageedge{#1}{#2}{#3}%
+    \fi
+    \ifsseq at 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}
+        \pgfmathveclen{\pgf at x}{\pgf at y}%
+        \@xp\pgfmathint\@xp{\pgfmathresult}%
+        \ifnum\pgfmathresult<10\relax%%17? % TODO: Fix this predicate
+            \tikzset{every text node part/.append code={\pgfsetcolor{white}}}% I wonder why this is here...
+            \ifx\temparrowstartspec\pgfutil at empty
+            \else
+                \def\temparrowstartspec{\pgfsetarrowsstart{}}%
+            \fi
+            \ifx\temparrowendspec\pgfutil at empty
+            \else
+                \def\temparrowendspec{\pgfsetarrowsend{}}%
+            \fi
+        \fi
+        \ifsseq at needstikz
+            \draw[/sseqpages,
+                /utils/exec={\sseq at thesseqstyle\sseq at theedgestyle\csname sseq at the#3style\endcsname\the\sseq at scope@toks
+                             \temparrowstartspec\temparrowendspec #4}%
+            ]  (tempa) to (tempb);%
+        \else
+            \temparrowstartspec
+            \temparrowendspec
+            \pgfpathmoveto{\pgfpointanchor{tempa}{center}}%
+            \pgfpathlineto{\pgfpointanchor{tempb}{center}}%
+            \sseq at eval{\noexpand\pgfusepath{%
+                \iftikz at mode@fill fill,\fi
+                \iftikz at mode@draw draw,\fi
+            }}%
+        \fi
+    \fi
+    \sseq at breakpoint
+    \endpgfscope\endgroup
+}
+
+% TODO: this macro is super expensive. Make it faster (avoid
+\def\sseq at handleoffpageedge#1#2#3{
+    \pgfpathmoveto{\tempaf}%
+    \pgfpathlineto{\tempbf}%
+    \pgfgetpath\thispath
+    \pgfusepath{discard}%
+    \pgfintersectionofpaths{\pgfsetpath\sseq at theclippath}{\pgfsetpath\thispath}%
+    \ifcase\pgfintersectionsolutions\relax
+        % No intersections, but one or both endpoints may be out of range but still in clipping region due to scaling. Add ellipses as appropriate.
+        \sseq at ifinrange(#1){% If the first endpoint is in range, the second must be out of range b/c sseq at outofrange is true.
+            %\edef\temparrowendspec{\@nx\pgfsetarrowsend{\csname sseq at runoffarrow@end@#3 at spec\endcsname}}
+        }{%
+            \sseq at ifinrange(#2){%
+                \edef\temparrowstartspec{\@nx\pgfsetarrowsstart{\csname sseq at runoffarrow@start@#3 at spec\endcsname}}
+            }{\sseq at drawedge@handletrickyedge}% uh-oh, both ends are out of range
+        }%
+    \or
+        \sseq at ifinrange(#1){% If the startpoint is in range, the intersection must be the end.
+            \def\tempbf{\pgfpointintersectionsolution{1}}
+            \edef\temparrowendspec{\@nx\pgfsetarrowsend{\csname sseq at runoffarrow@end@#3 at spec\endcsname}}
+            \pgfcoordinate{tempb}{\tempbf}
+        }{%
+            \sseq at 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 at runoffarrow@start@#3 at spec\endcsname}}%
+                \pgfcoordinate{tempa}{\tempaf}%
+            }{\sseq at drawedge@handletrickyedge}% Uh-oh, both ends are out of range.
+        }
+    \or% an orphan
+        \ifsseq at draworphanedges
+            \sseq at drawedge@handleorphan
+        \else
+            \sseq at drawedgefalse % Don't draw "orphaned edges"
+        \fi
+    \else
+        \sseq at error{clip-not-convex}%
+        \sseq at breakfifi
+    \fi
+}
+
+\def\sseq at drawedge@handletrickyedge{%
+    \ifsseq at draworphanedges
+        \pgfintersectionofpaths{\pgfsetpath\sseq at therangepath}{\pgfsetpath\thispath}%
+        \ifnum\pgfintersectionsolutions=\z@
+            \sseq at drawedgefalse % don't draw orphan edges that never intersect actual range
+        \else% Now we have to make a line through tempa and tempb long enough so that it intersects the original clip area twice.
+            \pgfmathanglebetweenpoints{\pgfpointanchor{tempa}{center}}{\pgfpointanchor{tempb}{center}}%
+            \edef\tempangle{\pgfmathresult}
+            \pgfpathmoveto{\pgfpointadd{\pgfpointanchor{tempa}{center}}{\pgfpointpolar{\tempangle}{100cm}}}% a really long line
+            \pgfpathlineto{\pgfpointadd{\pgfpointanchor{tempa}{center}}{\pgfpointpolar{\tempangle}{-100cm}}}%
+            \pgfgetpath\thispath
+            \pgfusepath{discard}
+            \pgfintersectionofpaths{\pgfsetpath\sseq at theclippath}{\pgfsetpath\thispath}
+            \sseq at drawedge@handleorphan
+        \fi
+    \else
+        \sseq at drawedgefalse
+    \fi
+}
+
+
+\def\sseq at drawedge@handleorphan{%
+    \def\tempaf{\pgfpointintersectionsolution{1}}%
+    \def\tempbf{\pgfpointintersectionsolution{2}}%
+    \edef\temparrowstartspec{\@nx\pgfsetarrowsstart{\csname sseq at runoffarrow@start@\sseq at edgetype @spec\endcsname}}%
+    \edef\temparrowendspec{\@nx\pgfsetarrowsend{\csname sseq at runoffarrow@end@\sseq at edgetype @spec\endcsname}}%
+    \pgfcoordinate{tempa}{\tempaf}%
+    \pgfcoordinate{tempb}{\tempbf}%
+}
+
+
+%
+% #1 -- first coordinate
+% #2 -- second coordinate
+% #3 -- uid
+\def\sseq at circleclass@draw#1#2#3{
+    \begingroup
+        \pgfmathanglebetweenpoints{\pgfpointanchor{sseq{#2}}{center}}{\pgfpointanchor{sseq{#3}}{center}}
+        \let\tempangle\pgfmathresult
+        \let\tikz at lib@fit at scan@handle\sseq at fit@tikz at lib@fit at scan@handle % install fit modifications.
+        \let\tikz at calc@anchor\sseq at fit@tikz at calc@anchor
+        \sseq at tempiftrue
+        \node[
+            rotate fit=\tempangle,
+            /utils/exec={\sseq at thesseqstyle\sseq at thecircleclassstyle\the\sseq at scope@toks\sseq at savedoptioncode
+                \sseq at obj{#1.options}
+                \sseq at obj{#1.fitnodes}
+                \@xp\pgfkeysalso\@xp{\romannumeral0\sseq at obj{#1.tikzprimoptions}}
+            }
+        ] {};
+    \endgroup
+}
+% Modifies tikz commands \tikz at lib@fit at scan@handle from \pgf\frontendlayer\tikz\libraries\tikzlibraryfit.code.tex line 81 and
+% \tikz at calc@anchor from \pgf\frontendlayer\tikz\tikz.code.tex line 5164
+% make it so that fit silently ignores nodes that are not defined.
+% This is copied with modification from \pgf\frontendlayer\tikz\libraries\tikzlibraryfit.code.tex line 81
+\def\sseq at fit@tikz at lib@fit at scan@handle#1{%
+  \ifsseq at tempif % this has been set in the following macro to be true if there is a node with the given name. If it's not true, ignore this.
+      \iftikz at shapeborder%
+        % Ok, fit all four external anchors, if they exist
+        \tikz at lib@fit at adjust{\pgfpointanchor{\tikz at shapeborder@name}{west}}%
+        \tikz at lib@fit at adjust{\pgfpointanchor{\tikz at shapeborder@name}{east}}%
+        \tikz at lib@fit at adjust{\pgfpointanchor{\tikz at shapeborder@name}{north}}%
+        \tikz at lib@fit at adjust{\pgfpointanchor{\tikz at shapeborder@name}{south}}%
+      \else%
+        \tikz at lib@fit at adjust{#1}%
+      \fi%
+  \fi
+  \sseq at tempiftrue
+  \tikz at lib@fit at scan%
+}
+
+% This is copied with modification from \pgf\frontendlayer\tikz\tikz.code.tex line 5164
+\def\sseq at fit@tikz at calc@anchor#1.#2\tikz at stop{%
+  \pgfutil at ifundefined{pgf at sh@ns@#1}{\sseq at tempiffalse}{%If the node doesn't exist, don't throw an error but record that we should skip it
+    \pgfpointanchor{\tikz at pp@name{#1}}{#2}%
+  }%s
+}
+
+
+%% New shapes and arrows
+%% These use lots of keys with spaces so it's convenient to turn off ExplSyntax.
+
+% Stolen from: https://tex.stackexchange.com/a/24621
+\pgfqkeys{/pgf}{
+    ellipse ratio/.code={\pgfkeyssetvalue{/pgf/ellipse ratio}{#1}},
+    ellipse ratio/.initial=1
+}
+\pgfdeclareshape{newellipse}
+{
+  \inheritsavedanchors[from=ellipse]
+  \inheritanchorborder[from=ellipse]
+  \savedanchor\radius{%
+    %
+    % Caculate ``height radius''
+    %
+    \pgf at y=.5\ht\pgfnodeparttextbox%
+    \advance\pgf at y by.5\dp\pgfnodeparttextbox%
+    \pgfmathsetlength\pgf at yb{\pgfkeysvalueof{/pgf/inner ysep}}%
+    \advance\pgf at y by\pgf at yb%
+    %
+    % Caculate ``width radius''
+    %
+    \pgf at x=.5\wd\pgfnodeparttextbox%
+    \pgfmathsetlength\pgf at xb{\pgfkeysvalueof{/pgf/inner xsep}}%
+    \advance\pgf at x by\pgf at xb%
+    %
+    % Adjust
+    %
+    \pgfkeysgetvalue{/pgf/ellipse ratio}{\ratioscale}
+    \pgfmathsetmacro\widthfactor{sqrt(\ratioscale^2+1)/\ratioscale}
+    \pgfmathsetmacro\heightfactor{sqrt(\ratioscale^2+1)}
+    \pgf at x=\widthfactor\pgf at x%
+    \pgf at y=\heightfactor\pgf at y%
+    %
+    % Adjust height, if necessary
+    %
+    \pgfmathsetlength\pgf at yc{\pgfkeysvalueof{/pgf/minimum height}}%
+    \ifdim\pgf at y<.5\pgf at yc%
+      \pgf at y=.5\pgf at yc%
+    \fi%
+    %
+    % Adjust width, if necessary
+    %
+    \pgfmathsetlength\pgf at xc{\pgfkeysvalueof{/pgf/minimum width}}%
+    \ifdim\pgf at x<.5\pgf at xc%
+      \pgf at x=.5\pgf at xc%
+    \fi%
+    %
+    % Add outer sep
+    %
+    \pgfmathsetlength{\pgf at xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
+    \pgfmathsetlength{\pgf at yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
+    \advance\pgf at x by\pgf at xb%
+    \advance\pgf at y by\pgf at yb%
+  }
+
+  \inheritanchor[from=ellipse]{center}
+  \inheritanchor[from=ellipse]{mid}
+  \inheritanchor[from=ellipse]{base}
+  \inheritanchor[from=ellipse]{north}
+  \inheritanchor[from=ellipse]{south}
+  \inheritanchor[from=ellipse]{west}
+  \inheritanchor[from=ellipse]{mid west}
+  \inheritanchor[from=ellipse]{base west}
+  \inheritanchor[from=ellipse]{north west}
+  \inheritanchor[from=ellipse]{south west}
+  \inheritanchor[from=ellipse]{east}
+  \inheritanchor[from=ellipse]{mid east}
+  \inheritanchor[from=ellipse]{base east}
+  \inheritanchor[from=ellipse]{north east}
+  \inheritanchor[from=ellipse]{south east}
+
+  \inheritbackgroundpath[from=ellipse]
+}
+
+%%
+%%
+%% n concentric circles
+%%
+
+\tikzset{circlen/.code={\def\circlen at n{#1}\pgfkeysalso{shape=circlen at shape}}}
+\pgfdeclareshape{circlen at shape}
+{
+  \savedanchor\centerpoint{%
+    \pgf at x=.5\wd\pgfnodeparttextbox%
+    \pgf at y=.5\ht\pgfnodeparttextbox%
+    \advance\pgf at y by-.5\dp\pgfnodeparttextbox%
+  }
+
+  \saveddimen\radius{%
+    %
+    % Caculate ``height radius''
+    %
+    \pgf at ya=.5\ht\pgfnodeparttextbox%
+    \advance\pgf at ya by.5\dp\pgfnodeparttextbox%
+    \pgfmathsetlength\pgf at yb{\pgfkeysvalueof{/pgf/inner ysep}}%
+    \advance\pgf at ya by\pgf at yb%
+    %
+    % Caculate ``width radius''
+    %
+    \pgf at xa=.5\wd\pgfnodeparttextbox%
+    \pgfmathsetlength\pgf at xb{\pgfkeysvalueof{/pgf/inner xsep}}%
+    \advance\pgf at xa by\pgf at xb%
+    %
+    % Calculate length of radius vector:
+    %
+    \pgf at process{\pgfpointnormalised{\pgfqpoint{\pgf at xa}{\pgf at ya}}}%
+    \ifdim\pgf at x>\pgf at y%
+        \c at pgf@counta=\pgf at x%
+        \ifnum\c at pgf@counta=\z@%
+        \else%
+          \divide\c at pgf@counta by 255\relax%
+          \pgf at xa=16\pgf at xa\relax%
+          \divide\pgf at xa by\c at pgf@counta%
+          \pgf at xa=16\pgf at xa\relax%
+        \fi%
+      \else%
+        \c at pgf@counta=\pgf at y%
+        \ifnum\c at pgf@counta=\z@%
+        \else%
+          \divide\c at pgf@counta by 255\relax%
+          \pgf at ya=16\pgf at ya\relax%
+          \divide\pgf at ya by\c at pgf@counta%
+          \pgf at xa=16\pgf at ya\relax%
+        \fi%
+    \fi%
+    \pgf at x=\pgf at xa%
+    %
+    % If necessary, adjust radius so that the size requirements are
+    % met:
+    %
+    \pgfmathsetlength{\pgf at xb}{\pgfkeysvalueof{/pgf/minimum width}}%
+    \pgfmathsetlength{\pgf at yb}{\pgfkeysvalueof{/pgf/minimum height}}%
+    \ifdim\pgf at x<.5\pgf at xb%
+        \pgf at x=.5\pgf at xb%
+    \fi%
+    \ifdim\pgf at x<.5\pgf at yb%
+        \pgf at x=.5\pgf at yb%
+    \fi%
+    %
+    % Now, add larger of outer sepearations.
+    %
+    \pgfmathsetlength{\pgf at xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
+    \pgfmathsetlength{\pgf at yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
+    \ifdim\pgf at xb<\pgf at yb%
+      \advance\pgf at x by\pgf at yb%
+    \else%
+      \advance\pgf at x by\pgf at xb%
+    \fi%
+    \pgf at xb=2pt
+    \multiply\pgf at xb\circlen at n
+    \advance\pgf at x\pgf at xb
+    \advance\pgf at x-2pt\relax
+  }
+
+  %
+  % Anchors
+  %
+  \anchor{center}{\centerpoint}
+  \anchor{mid}{\centerpoint\pgfmathsetlength\pgf at y{.5ex}}
+  \anchor{base}{\centerpoint\pgf at y=0pt}
+  \anchor{north}{\centerpoint\advance\pgf at y by\radius}
+  \anchor{south}{\centerpoint\advance\pgf at y by-\radius}
+  \anchor{west}{\centerpoint\advance\pgf at x by-\radius}
+  \anchor{east}{\centerpoint\advance\pgf at x by\radius}
+  \anchor{mid west}{\centerpoint\advance\pgf at x by-\radius\pgfmathsetlength\pgf at y{.5ex}}
+  \anchor{mid east}{\centerpoint\advance\pgf at x by\radius\pgfmathsetlength\pgf at y{.5ex}}
+  \anchor{base west}{\centerpoint\advance\pgf at x by-\radius\pgf at y=0pt}
+  \anchor{base east}{\centerpoint\advance\pgf at x by\radius\pgf at y=0pt}
+  \anchor{north west}{
+    \centerpoint
+    \pgf at xa=\radius
+    \advance\pgf at x by-0.707107\pgf at xa
+    \advance\pgf at y by0.707107\pgf at xa
+  }
+  \anchor{south west}{
+    \centerpoint
+    \pgf at xa=\radius
+    \advance\pgf at x by-0.707107\pgf at xa
+    \advance\pgf at y by-0.707107\pgf at xa
+  }
+  \anchor{north east}{
+    \centerpoint
+    \pgf at xa=\radius
+    \advance\pgf at x by0.707107\pgf at xa
+    \advance\pgf at y by0.707107\pgf at xa
+  }
+  \anchor{south east}{
+    \centerpoint
+    \pgf at xa=\radius
+    \advance\pgf at x by0.707107\pgf at xa
+    \advance\pgf at y by-0.707107\pgf at xa
+  }
+  \anchorborder{
+    \pgf at xa=\pgf at x%
+    \pgf at ya=\pgf at y%
+    \edef\pgf at marshal{%
+      \noexpand\pgfpointborderellipse
+      {\noexpand\pgfqpoint{\the\pgf at xa}{\the\pgf at ya}}
+      {\noexpand\pgfqpoint{\radius}{\radius}}%
+    }%
+    \pgf at marshal%
+    \pgf at xa=\pgf at x%
+    \pgf at ya=\pgf at y%
+    \centerpoint%
+    \advance\pgf at x by\pgf at xa%
+    \advance\pgf at y by\pgf at ya%
+  }
+
+  %
+  % Background path
+  %
+  \behindbackgroundpath{
+    \pgfutil at tempdima=\radius%
+    \pgfmathsetlength{\pgf at xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
+    \pgfmathsetlength{\pgf at yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
+    \ifdim\pgf at xb<\pgf at yb%
+      \advance\pgfutil at tempdima by-\pgf at yb%
+    \else%
+      \advance\pgfutil at tempdima by-\pgf at xb%
+    \fi%
+    \sseq at tempcount=\@ne
+    \loop
+    \pgfpathcircle{\centerpoint}{\pgfutil at tempdima}%
+    \advance\pgfutil at tempdima-2pt\relax
+    \advance\sseq at tempcount\@ne
+    \ifnum\sseq at tempcount<\circlen at n \repeat
+    \tikz at mode
+    \sseq at eval{\noexpand\pgfusepath{
+        \iftikz at mode@draw draw,\fi
+    }}
+  }
+  \backgroundpath{%
+    \pgfutil at tempdima=\radius%
+    \pgfmathsetlength{\pgf at xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
+    \pgfmathsetlength{\pgf at yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
+    \ifdim\pgf at xb<\pgf at yb%
+      \advance\pgfutil at tempdima by-\pgf at yb%
+    \else%
+      \advance\pgfutil at tempdima by-\pgf at xb%
+    \fi%
+    \advance\pgfutil at tempdima2pt\relax
+    \pgfutil at tempdimb=-2pt\relax
+    \multiply\pgfutil at tempdimb\circlen at n
+    \advance\pgfutil at tempdima\pgfutil at tempdimb\relax
+    \pgfpathcircle{\centerpoint}{\pgfutil at tempdima}
+  }
+}
+
+
+
+% For out of bounds edges:
+
+\pgfdeclarearrow{
+    name = ...,
+    parameters = { \the\pgfarrowlength\the\pgflinewidth},
+    setup code = {
+        % The different end values:
+        \pgfarrowssetlineend{-\pgfarrowlength}
+        \pgfarrowssetbackend{-0.6\pgfarrowlength}
+        % The hull
+        \pgfarrowshullpoint{-\pgfarrowlength}{0pt}
+        \pgfarrowshullpoint{\pgfarrowlength}{0pt}
+        % Saves: Only the length:
+        \pgfarrowssavethe\pgfarrowlength
+        \pgfarrowssavethe\pgflinewidth
+    },
+    drawing code = {
+        \pgfpathcircle{\pgfpoint{-0.7\pgfarrowlength}{0pt}}{1.5\pgflinewidth}
+        \pgfpathcircle{\pgfpoint{-0.4\pgfarrowlength}{0pt}}{1.5\pgflinewidth}
+        \pgfpathcircle{\pgfpoint{-0.1\pgfarrowlength}{0pt}}{1.5\pgflinewidth}
+        \pgfpathclose
+        \pgfusepathqfill
+    },
+    defaults = { length = 0.3cm }
+} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqdrawing.code.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqforeach.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqforeach.code.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqforeach.code.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,88 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: sseqforeach.code.tex
+%%
+%%    Patches the \foreach command to obtain better error reporting
+%%
+
+
+% All of this \foreach stuff is defined by tikz in the file /pgf/utilities/pgffor.code.tex
+
+\def\sseq at for@nopatch{\sseq at error{foreach-patch-failed}\def\sseq at patchfor{}\endinput}
+
+\newtoks\sseq at foreachcall
+
+\def\sseq at for@vars{}
+\def\sseq at for@savemacro#1{\sseq at d@addto at macro\sseq at for@vars{\sseq at for@vars at do#1}}
+\def\sseq at for@vars at do#1{; \string#1 = #1}
+\def\sseq at for@vars at donx#1{; \string#1= #1}
+\ExplSyntaxOn
+\def\sseq at for@printvars{\ifx\sseq at for@vars\pgfutil at empty\else\exp_last_unbraced:Nf\@gobble\sseq at for@vars\fi}
+\ExplSyntaxOff
+
+
+\def\sseq at patchfor{%
+    \let\pgffor at atbeginforeach\sseq at pgffor@atbeginforeach
+    \let\pgffor@@vars at opt\sseq at pgffor@@vars at opt
+}
+\def\sseq at pgffor@modify#1{%
+    \@xp\let\csname sseq@\sseq at macroname#1\endcsname #1%
+    \eappto\sseq at patchfor{\let\@nx#1 \@xp\@nx\csname sseq@\sseq at macroname#1\endcsname}%
+}
+
+
+
+\def\sseq at pgffor@recordarg#1#2{
+    \sseq at pgffor@modify#1
+    \@xp\pretocmd\csname sseq@\sseq at macroname#1\endcsname{\sseq at foreachcall\@xp{\the\sseq at foreachcall#2}}{}{\sseq at for@nopatch}
+}
+\def\sseq at pgffor@erecordarg#1#2{
+    \sseq at pgffor@modify#1
+    \@xp\pretocmd\csname sseq@\sseq at macroname#1\endcsname{\sseq at eval{\sseq at foreachcall{\the\sseq at foreachcall#2}}}{}{\sseq at for@nopatch}
+}
+
+
+
+\bgroup\lccode`\*=`\#\lowercase{\egroup
+
+
+\def\sseq at pgffor@atbeginforeach{%
+    \begingroup %
+    \sseq at atbeginforeach@msgsetup
+    % \pgffor at macro@list calls \pgffor at normal@list, so we need to mark that the list has already been added to foreachcall.
+    \sseq at tempiftrue
+}
+
+% Modify the foreach argument parser commands to put the call into \sseq at foreachcall and to tell us what the variables are
+\def\sseq at pgffor@@vars at opt[#1]{\sseq at foreachcall\@xp{\the\sseq at foreachcall#1}\pgfkeys{/sseqpages/foreach/.cd,#1}\pgffor at vars}
+
+\sseq at pgffor@recordarg\pgffor@@vars{*1}
+\pretocmd\sseq at pgffor@@vars{\sseq at for@savemacro*1}{}{\sseq at for@nopatch}
+
+\sseq at pgffor@recordarg\pgffor@@vars at slash@gobble{/}
+\sseq at pgffor@recordarg\pgffor at macro@list{in *1}
+\pretocmd\sseq at pgffor@macro at list{\sseq at tempiffalse}{}{\sseq at for@nopatch}% Don't add this again in  \pgffor at normal@lis
+
+\sseq at pgffor@modify\pgffor at normal@list
+% Add list to argument if it wasn't a macro
+\pretocmd\sseq at pgffor@normal at list{\ifsseq at tempif\sseq at foreachcall\@xp{\the\sseq at foreachcall in {*1}}\fi\sseq at tempiftrue}{}{\sseq at for@nopatch}
+
+\sseq at pgffor@recordarg\pgffor at collectforeach@macro{\foreach}
+\sseq at pgffor@recordarg\pgffor at collectforeach@normal{\foreach}
+
+\sseq at pgffor@modify\pgffor at iterate
+\pretocmd\sseq at pgffor@iterate{\sseq at opushstacktrace{\the\sseq at foreachcall}\sseq at thiscalltoks\@xp{\the\sseq at foreachcall}}{}{\sseq at for@nopatch}
+
+\sseq at pgffor@modify\pgffor at doloop
+\sseq at pgffor@modify\pgffor at invokebody
+\patchcmd\sseq at pgffor@doloop{\pgffor at begingroup}{\pgffor at begingroup\sseq at xsetlastcall{\the\sseq at foreachcall}}{}{\sseq at for@nopatch}
+\patchcmd\sseq at pgffor@invokebody{\pgffor at begingroup}{\pgffor at begingroup\sseq at xsetlastcall{\the\sseq at foreachcall}}{}{\sseq at for@nopatch}
+}
+
+%TODO: also hook \pgffor at assign@parse, \pgffor at remember@parse, \pgffor at count@parse.
+


Property changes on: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqforeach.code.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqkeys.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqkeys.code.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqkeys.code.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,1667 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: sseqkeys.code.tex
+%% Exposes: \sseqset
+%%
+%%       Sets up the keys for sseqpages. There are a lot of them...
+%%
+
+
+
+\def\sseq at pgfqkeysdirlist#1#2{%
+    \sseq at temptoks{#2}%
+    \sseq at pgfqkeysdirlist@#1,\sseq at nil
+}
+
+\def\sseq at pgfqkeysdirlist@#1,{%
+    \sseq at eval{\@nx\pgfqkeys{#1}{\the\sseq at temptoks}}%
+    \@ifnextchar\sseq at nil{\@gobble}{\sseq at pgfqkeysdirlist@}%
+}
+
+%%%% Interface macros:
+% These are the things that are used outside of this section:
+\let\sseq at pgfkeys@error at save\pgfkeys at error
+\pgfkeys{/sseqpages/userstyles/.unknown/.code={\sseq at passoptionto{\sseq at sseqsetdirectory}}}
+\def\sseqset#1{\pgfqkeys{/sseqpages/userstyles}{#1}}
+
+\def\sseq at sseqsetdirectory{/sseqpages/global/default}
+
+\def\sseq at set{\pgfqkeys{/sseqpages}}
+
+%%%
+%%%   Local Keys
+%%%
+
+% This is where and how we are going to store the results of our local options. Note that definitions need to be local to allow recursion.
+\def\sseq at savedoptioncode{}
+\def\sseq at d@addto at options{\sseq at d@addto at macro\sseq at savedoptioncode}
+\def\sseq at e@addto at options{\sseq at e@addto at macro\sseq at savedoptioncode}
+
+% #1 -- name of key
+% #2 -- options
+% This is the main way that we use options. (We also use \pgfqkeys{/sseqpages/global} and some similar things)
+% Dumps out code that the option indexes into \sseq at savedoptioncode
+% This is because \pgfkeys has a high performance cost, so instead of using \pgfkeys once per page,
+% we use this once when putting together the spectral sequence and save the result.
+\def\sseq at processoptions#1#2{%
+    \def\sseq at savedoptioncode{}%
+    \sseq at protectedeval{\@nx % TODO: get rid of this protectedeval
+        \pgfqkeys{/sseqpages/#1}{#2}
+    }%
+}
+
+% First pass versus second pass:
+% Lots of options mainly do stuff on the drawing run, but still need to warn the sseq setup algorithms that they're around
+% 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 at x by 2 on it's first pass and
+% applies a coordinate transfrom by 2cm on the second pass.
+
+% normal mode does the firstpass options now and saves the secondpass options in \sseq at savedoptioncode for later use.
+% firstpass mode does the firstpass options and throws away the secondpass options.
+% secondpass mode throws away the firstpass options and does the secondpass options NOW
+% bothpass mode does both firstpass and secondpass options NOW
+% We spend the vast majority of our time in normal mode.
+
+\def\sseq at options@use#1{#1}
+\def\sseq at options@normalmode{\let\sseq at options@firstpass\sseq at options@use\let\sseq at options@secondpass\sseq at d@addto at options}
+\def\sseq at options@firstpassmode{\let\sseq at options@firstpass\sseq at options@use\let\sseq at options@secondpass\@gobble}
+\def\sseq at options@secondpassmode{\let\sseq at options@firstpass\@gobble\let\sseq at options@secondpass\sseq at options@use}
+\def\sseq at options@bothpassmode{\let\sseq at options@firstpass\sseq at options@use\let\sseq at options@secondpass\sseq at options@use}
+\sseq at options@normalmode
+
+\pgfqkeys{/handlers}{
+    .sseq @ first pass code/.code={
+        \pgfkeysalso{\pgfkeyscurrentpath/.code={\sseq at options@firstpass{#1}}}
+    },
+    .sseq @ first pass append code/.code={
+        \pgfkeysalso{\pgfkeyscurrentpath/.append code={\sseq at options@firstpass{#1}}}
+    },
+    .sseq @ second pass code/.code={
+        \pgfkeysalso{\pgfkeyscurrentpath/.code={\sseq at options@secondpass{#1}}}
+    },
+    .sseq @ second pass append code/.code={
+        \pgfkeysalso{\pgfkeyscurrentpath/.append code={\sseq at options@secondpass{#1}}}
+    },
+    .sseq @ second pass store in/.code={
+        \pgfkeysalso{\pgfkeyscurrentpath/.code={\sseq at options@secondpass{\def#1{##1}}}}
+    },
+    .sseq @ code/.code 2 args={
+        \pgfkeysalso{\pgfkeyscurrentpath/.code={\sseq at options@firstpass{#1}}}
+        \pgfkeysalso{\pgfkeyscurrentpath/.append code={\sseq at options@secondpass{#1}}}
+    },
+    .sseq @ transform/.code={
+        \sseq at keys@lastpart
+        \edef\sseq at temppath{\pgfkeyscurrentpath/\sseq at temp}
+        \pgfkeysalso{\sseq at temppath/.code/.expanded={\@nx\sseq at checktransform{\sseq at temp}\unexpanded{{##1}}}}
+        \pgfkeysalso{\sseq at temppath/.sseq @ second pass append code/.expanded={\@nx\sseq at pgfkeysdocommand{\sseq at temp}\unexpanded{{##1}}}}%
+    },
+    .sseq @ stdparse do transform/.code={
+        \sseq at keys@lastpart
+        \edef\sseq at temppath{\pgfkeyscurrentpath/\sseq at temp}
+        \ifx\pgfkeyscurrentvalue\pgfkeysnovalue at text
+            \pgfkeysalso{\sseq at temppath/.code/.expanded={\@nx\sseq at standardparse\@nx\sseq at options@secondpass{\@nx\sseq at pgfkeysdocommand{\sseq at temp}\unexpanded{{##1}}}}}
+        \else
+            \pgfkeysalso{\sseq at temppath/.code/.expanded={\@nx\sseq at standardparse\@nx\sseq at options@secondpass{\@nx\sseq at pgfkeysdocommand{\sseq at temp}{#1}}}s}
+        \fi
+    },
+    .sseq @ illegal/.code={
+        \sseq at keys@lastpart
+        \edef\sseq at temppath{\pgfkeyscurrentpath/\sseq at temp}
+        \pgfkeysalso{\sseq at temppath/.code/.expanded={\@nx\sseq at error@n{option-illegal}{\sseq at temp}}}
+    },
+    .sseq @ illegal as global/.code={
+        \sseq at keys@lastpart
+        \pgfkeysalso{/sseqpages/global/\sseq at temp/.code/.expanded={\@nx\sseq at error@n{option-illegal-as-global}{\sseq at temp}}}
+    },
+    .sseq @ global only/.code={
+        \sseq at keys@lastpart
+        \pgfkeysalso{/sseqpages/\sseq at temp/.code/.expanded={\@nx\sseq at error@n{option-global-only}{\sseq at temp}}}
+    }
+}
+
+
+%%% Some easy internal macros
+
+% This is for .unknown handlers. Try same key in different directory #1.
+\def\sseq at passoptionto#1{\sseq at eval{\@nx\pgfqkeys{#1}{\pgfkeyscurrentname={\unexpanded\@xp{\pgfkeyscurrentvalue}}}}}
+
+\def\sseq at pgfkeysdocommand#1#2{
+    \sseq at tempiffalse
+    \sseq at pgfkeysdocommand@try{/tikz/#1}{#2}
+    \sseq at pgfkeysdocommand@try{/pgf/#1}{#2}
+    % is this really an internal error? Maybe we should have failed earlier?
+    \ifsseq at tempif\else\sseq at error@internal at nn{do-command-failed}{#1}{#2}\fi
+}
+
+\def\sseq at pgfkeysdocommand@try#1#2{
+    \ifsseq at tempif\else
+        \pgfkeysifdefined{#1/. at cmd}{
+            \sseq at tempiftrue
+            \pgfkeysgetvalue{#1/. at cmd}{\pgfkeys at code}%
+            \pgfkeys at code#2\pgfeov
+        }{
+            \pgfkeysifdefined{#1}{
+                \sseq at tempiftrue
+                \pgfkeyssetvalue{#1}{#2}
+            }{}
+        }
+    \fi
+}
+
+%%%
+% Our main unknown option handler
+% This is copied from the standard tikz .unknown handler, but instead of running the code it stores it in \sseq at savedoptioncode.
+% When it tries the key in /tikz and in /pgf it also recursively expands \pgfkeysalso's.
+
+\def\sseq at keys@unknown at error@normal{\sseq at error{unknown-key}} % a hook so we can turn off errors if we like
+\let\sseq at keys@unknown at error\sseq at keys@unknown at error@normal % This is used in .sseq style
+\let\sseq at add@tikzkey at to@options\sseq at e@addto at options % another hook for .sseq style
+
+\def\sseq at keys@unknown{%
+    \let\tikz at key\pgfkeyscurrentname
+    \sseq at keys@try at addtooptions{/sseqpages/userstyles,/tikz,/pgf}{}{%
+        \@xp\pgfutil at in@\@xp!\@xp{\tikz at key}%
+        \ifpgfutil at in@%
+          % this is a color!
+            \sseq at keys@unknown at handlecolor
+        \else%
+          \pgfutil at doifcolorelse{\tikz at key}%
+          {%
+            \sseq at keys@unknown at handlecolor
+          }%
+          {%
+            % Ok, second chance: This might be an arrow specification:
+            \@xp\pgfutil at in@\@xp-\@xp{\tikz at key}%
+            \ifpgfutil at in@%
+              % Ah, an arrow spec!
+              \sseq at add@tikzkey at to@options{\@nx\tikz at processarrows{\tikz at key}}%
+            \else%
+              % Ok, third chance: A shape!
+              \@xp\ifx\csname pgf at sh@s@\tikz at key\endcsname\relax%
+                    \sseq at keys@unknown at error%
+              \else%
+                \sseq at add@tikzkey at to@options{\def\@nx\tikz at shape{\tikz at key}}%
+              \fi%
+            \fi%
+          }%
+      \fi%
+    }%
+}
+
+\def\sseq at keys@unknown at handlecolor{%
+  \sseq at add@tikzkey at to@options{\@nx\tikz at addoption{\@nx\tikz at compat@color at set{\tikz at key}}}%
+  \sseq at add@tikzkey at to@options{\def\@nx\tikz at textcolor{\tikz at key}}%
+}
+
+%%% \sseq at keys@try at addtooptions
+% #1 -- a comma separated list of directories
+% #2 -- success code
+% #3 -- failure code
+%
+% This is for the main .unknown handler and for \sseq at addstylecodetooptions (which pretends to be \pgfkeys executed in a directory with only a .unknown)
+% Tries to run the current key (\pgfkeyscurrentname=\pgfkeyscurrentvalue) in each of the directories in turn.
+% If it finds the key in one of the directories, recursively expand the \pgfkeysalso in the code,
+% add the final result to \sseq at savedoptioncode, and run success code. Otherwise run failure code.
+%
+% The goal is to avoid storing any commands that require the use of pgfkeys.
+% This is only a partial solution, because it misses \tikzset, \pfgqkeys, etc.
+% \pgfkeysalso is particularly dangerous though because we might not remember what directory it was supposed to happen in.
+% In order to get the recursive expansion of \pgfkeysalso's we need to modify the pgfkeys algorithm so that it
+% passes control back to \sseq at keys@addtooptions at checkalso when it's done.
+% Modifies tikz commands \pgfkeys at case@one and \pgfkeys at case@two at extern from file /pgf/utilities/pgfkeys.code.tex lines 352 and 365
+\def\sseq at keys@try at addtooptions#1{%
+    \sseq at keys@try at addtooptions@#1,\sseq at nil
+}
+\def\sseq at keys@try at addtooptions@#1,{%
+    \bgroup
+    \def\pgfkeysdefaultpath{#1/}%
+    \def\next{\egroup\@ifnextchar\sseq at nil{\@xp\@secondoftwo\@gobble}{\sseq at keys@try at addtooptions@}}%
+    \pgfkeysifdefined{#1/\pgfkeyscurrentname/. at cmd}{%
+        \ifx\pgfkeyscurrentvalue\pgfkeysnovalue at text% Hmm... no value
+          \pgfkeysifdefined{#1/\pgfkeyscurrentname/. at def}%
+          {\pgfkeysgetvalue{#1/\pgfkeyscurrentname/. at def}{\pgfkeyscurrentvalue}}
+          {}% no default, so leave it
+        \fi%
+        \pgfkeysgetvalue{#1/\pgfkeyscurrentname/. at cmd}{\pgfkeys at code}%
+        \sseq at eval{\@nx\sseq at keys@addtooptions at checkalso{\unexpanded\@xptwo{\@xp\pgfkeys at code\pgfkeyscurrentvalue\pgfeov}}}%
+        \sseq at smuggle@macro\sseq at savedoptioncode
+        \egroup
+        \def\next{\@xp\@firstoftwo\sseq at gobble@to at nil}%
+    }{%
+        \pgfkeysifdefined{#1/\pgfkeyscurrentname}{%
+            \egroup
+            \sseq at add@tikzkey at to@options{\@nx\pgfkeyssetvalue{#1/\pgfkeyscurrentname}{\unexpanded\@xp{\pgfkeyscurrentvalue}}}%
+            \def\next{\@xp\@firstoftwo\sseq at gobble@to at nil}%
+        }{}%
+    }%
+    \next
+}
+
+\def\sseq at keys@addtooptions at checkalso#1{%
+    \let\pgfkeys at case@one\sseq at pgfkeys@case at one@store
+    \let\pgfkeys at case@two at extern\sseq at pgfkeys@case at two@extern at store
+    \sseq at keys@addtooptions at checkalso@#1\pgfkeysalso\sseq at nil
+}
+\def\sseq at keys@addtooptions at checkalso@#1\pgfkeysalso#2{%
+    \sseq at add@tikzkey at to@options{\unexpanded{#1}}%
+    \ifx\sseq at nil#2%
+        \let\pgfkeys at case@one\sseq at pgfkeys@case at one@save
+        \let\pgfkeys at case@two at extern\sseq at pgfkeys@case at two@extern at save
+    \else
+        \pgfkeysalso{#2}%
+        \@xp\sseq at keys@addtooptions at checkalso@
+    \fi
+}
+
+\let\sseq at pgfkeys@case at one@save\pgfkeys at case@one
+\let\sseq at pgfkeys@case at two@extern at save\pgfkeys at case@two at extern
+\def\sseq at pgfkeys@case at one@store{%
+    \pgfkeysifdefined{\pgfkeyscurrentkey/. at cmd}{%
+        \pgfkeysgetvalue{\pgfkeyscurrentkey/. at cmd}{\pgfkeys at code}%
+        % The following line is the only change, it used to be \@xp\pgfkeys at code\pgfkeyscurrentvalue\pgfeov which would just run the code.
+        % Instead we recursively expand the \pgfkeysalso's and then store in it \sseq at savedoptioncode
+        \sseq at eval{\@nx\sseq at keys@addtooptions at checkalso{\unexpanded\@xptwo{\@xp\pgfkeys at code\pgfkeyscurrentvalue\pgfeov}}}%
+    }{\pgfkeys at case@two}%
+}
+\def\sseq at pgfkeys@case at two@extern at store{%
+  \ifx\pgfkeyscurrentvalue\pgfkeysnovalue at text%
+    \pgfkeysvalueof{\pgfkeyscurrentkey}% this probably isn't a real case
+  \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 at savedoptioncode
+    \sseq at add@tikzkey at to@options{\@nx\pgfkeyssetvalue{\pgfkeyscurrentkey}{\unexpanded\@xp{\pgfkeyscurrentvalue}}}%
+  \fi%
+}
+
+\pgfkeys{%
+    /sseqpages/.is family,
+    /sseqpages/.unknown/.code={\sseq at keys@unknown},
+%
+    /sseqpages/class/.unknown/.code={%
+        \expandafter\ifx\csname pgf at sh@s@\pgfkeyscurrentname\endcsname\relax % is it the name of a shape?
+            \sseq at passoptionto{/sseqpages}%
+        \else
+            \sseq at e@addto at options{\def\@nx\tikz at shape{\pgfkeyscurrentname}}% if so, store it
+        \fi
+    },
+    /sseqpages/.is family,
+    /sseqpages/scope/.is family,
+    /sseqpages/scope/.unknown/.code={\sseq at passoptionto{/sseqpages}},
+    /sseqpages/class/.is family,
+    /sseqpages/class/label/.is family,
+    /sseqpages/class/label/.unknown/.code={\sseq at keys@unknown},
+    /sseqpages/class/node texts/.is family,
+    /sseqpages/class/node texts/.unknown/.code={\sseq at passoptionto{/tikz}},
+    /sseqpages/differential/.is family,
+    /sseqpages/differential/.unknown/.code={\sseq at passoptionto{/sseqpages}},
+    /sseqpages/struct line/.is family,
+    /sseqpages/struct line/.unknown/.code={\sseq at passoptionto{/sseqpages}},
+    /sseqpages/label/.is family,
+    /sseqpages/label/.unknown/.code={\sseq at keys@unknown},
+    /sseqpages/tikz primitives/.is family,
+    /sseqpages/tikz primitives/.unknown/.code={\sseq at keys@unknown},
+    % One off directories
+    /sseqpages/fit/.unknown/.code={\sseq at passoptionto{/sseqpages}},
+    /sseqpages/foreach/.unknown/.code={\sseq at passoptionto{/pgf/foreach}},
+    /sseqpages/class placement/.unknown/.code={\sseq at passoptionto{/tikz}}
+}
+
+\pgfqkeys{/sseqpages/class}{shape/.code={\edef\tikz at shape{\pgfkeyscurrentname}}} % shape=whatever shape passing
+
+\pgfqkeys{/sseqpages/class/label}{% maybe implement multipart node labels this way? No way!
+    node/.sseq @ first pass code={\sseq at classlabelfalse},
+    inside/.sseq @ first pass code={\sseq at classlabelfalse}
+}
+
+%% label directions
+\def\sseq at labeldirectionlist{\\{above}\\{below}\\{left}\\{right}\\{above left}\\{above right}\\{below left}\\{below right}}
+\def\sseq at setlabeldirectionkeys#1{
+    \@ifnextchar[{\sseq at setlabeldirectionkeys@{#1}}{\sseq at setlabeldirectionkeys@{#1}[/.code]}%]
+}
+\def\sseq at setlabeldirectionkeys@#1[#2]#3{
+    \def\sseq at temp##1{#3}
+    \sseq at temptoks{}
+    \def\\##1{
+        \sseq at eval{\sseq at temptoks{\the\sseq at temptoks##1#2={\unexpanded\@xp{\sseq at temp{##1}}},}}
+    }
+    \sseq at labeldirectionlist
+    \sseq at eval{\@nx\pgfqkeys{#1}{\the\sseq at temptoks}}
+}
+
+\def\\#1{\@xp\sseq at addtostorelist\csname sseq at default@#1 at distance\endcsname{1ex}}
+\sseq at labeldirectionlist
+\def\sseq at defaultlabeldistance#1{\@xp\csname sseq at default@#1 at distance\endcsname}
+\def\sseq at setdefaultlabeldistance#1#2{\sseq at savedpaths@add{\@xp\gdef\csname sseq at default@#1 at distance\endcsname{#2}}}
+\def\sseq at setdefaultlabeldistances#1{\def\\##1{\sseq at setdefaultlabeldistance{##1}{#1}}\sseq at labeldirectionlist}
+
+
+
+\sseq at setlabeldirectionkeys{/sseqpages/class/label}[/.sseq @ first pass code]
+    {\sseq at classlabeltrue\def\sseq at class@labelposition at name{#1}\def\sseq at class@labelposition at distance{##1}}
+\sseq at setlabeldirectionkeys{/sseqpages/class/label}[/.sseq @ second pass append code]{\sseq at class@positionlabel{#1}{##1}}
+\sseq at setlabeldirectionkeys{/sseqpages/class/label}[/.default]{\sseq at defaultlabeldistance{#1}}
+\sseq at setlabeldirectionkeys{/sseqpages/global/class/label}[/.default]{\sseq at defaultlabeldistance{#1}}
+
+\sseq at setlabeldirectionkeys{/sseqpages/global}[ label distance/.code]{\sseq at setdefaultlabeldistance{#1}{##1}}
+\sseq at setlabeldirectionkeys{/sseqpages}[ label distance/.code]{\sseq at setdefaultlabeldistance{#1}{##1}}
+
+\sseq at pgfqkeysdirlist{/sseqpages/global,/sseqpages}{
+    label distance/.code={\sseq at setdefaultlabeldistances{#1}}
+}
+
+\def\sseq at class@positionlabel#1#2{\sseq at pgfkeysdocommand{#1}{#2}}
+
+
+
+\sseq at addtostorelist\sseq at classlabeltextfn{} % \sseq at classlabeltextfn is public via "class label handler"
+\let\sseq at classlabeltextfn@default\@gobble
+\def\sseq at labeltextfn#1{#1} % labeltextfn is private
+\def\sseq at labeltextfn@rotatescale#1{%
+    \@nx\ifmmode
+        \@nx\scalebox{\sseq at labletext@scale at factor}{\@nx\rotatebox{\sseq at labletext@rotate at angle}{$#1$}}%
+    \@nx\else
+        \@nx\scalebox{\sseq at labletext@scale at factor}{\@nx\rotatebox{\sseq at labletext@rotate at angle}{#1}}%
+    \@nx\fi
+}
+\def\sseq at labletext@rotate at angle{0}
+\def\sseq at labletext@scale at factor{1}
+
+\bgroup\lccode`8=`p\lccode`9=`t\lowercase{\egroup
+\def\sseq at eatpt#189{#1}
+}
+
+\sseq at pgfqkeysdirlist{/sseqpages/label,/sseqpages/class/label}{
+    rotate/.code={%
+        \let\sseq at labeltextfn\sseq at labeltextfn@rotatescale
+        \edef\sseq at labletext@rotate at angle{\@xp\sseq at eatpt\the\dimexpr\sseq at labletext@rotate at angle pt+#1pt}%
+    },
+    scale/.code={%
+        \let\sseq at labeltextfn\sseq at labeltextfn@rotatescale
+        \edef\sseq at labletext@scale at factor{\@xp\sseq at eatpt\the\dimexpr\sseq at labletext@scale at factor pt*#1}%
+    },
+%    shift/.sseq @ second pass code={\pgfkeysalso{xshift=\sseq at shift@getx#1}\pgfkeysalso{yshift=\sseq at shift@gety#1}}
+}
+
+
+\pgfqkeys{/sseqpages/global}{
+    background color/.initial=white
+}
+\pgfqkeys{/sseqpages/label}{
+    description/.code={%
+        \edef\sseq at edgeoptionhook{\@nx\pgfkeys{/tikz/fill=\pgfkeysvalueof{/sseqpages/global/background color}}}%
+    },
+    description/.sseq @ second pass append code={%
+        \pgfkeysalso{/tikz/anchor=center}%
+    }
+}
+
+\def\sseq at edgeoptionhook{}% This is just to make description work.
+
+%% Quote handling
+% \sseq at handlequote will be installed later as the 'first char syntax' for ".
+\def\sseq at protectlabel{\@nx\sseq at protectlabel\@nx}
+\def\sseq at handlequote#1{\pgfkeysalso{handle quote=#1}}
+\pgfkeys{%
+    /sseqpages/class/handle quote/.code={%
+        \let\tikz at quotes@as at save\tikz at quotes@as
+        \let\tikz at quotes@as\sseq at handleclassquotes
+        \tikz at quote@parser{#1}%
+        \let\tikz at quotes@as\tikz at quotes@as at save
+    },
+    /sseqpages/handle quote/.code={%
+        \begingroup % group gets ended by handleedgequotes
+        \let\tikz at quotes@as\sseq at handleedgequotes
+        \tikz at quote@parser{#1}%
+    }
+}
+
+
+\def\sseq at processlabels@default{%
+    \global\let\sseq at classnodetext\pgfutil at empty
+    \global\let\sseq at classnodetextoptions\pgfutil at empty
+    \global\let\sseq at classlabelnodes\pgfutil at empty
+}
+\let\sseq at processlabels\sseq at processlabels@default
+
+\def\sseq at handlescopequotes#1#2{% We use this via \let\tikz at quotes@as\sseq at handleclassquotes
+    /utils/exec={% so it's called inside \pgfkeysalso{stuff}. Need to surround with /utils/exec={} to get out.
+       \global\let\sseq at classnodetext\pgfutil at empty%
+       \global\let\sseq at classnodetextoptions\pgfutil at empty%
+       \global\let\sseq at classlabelnodes\pgfutil at empty%
+       \sseq at handleclassquotes@inner{#1}{#2}%
+    }
+}
+
+% We use this via \let\tikz at quotes@as\sseq at handleclassquotes
+% so it's called inside \pgfkeysalso{stuff}. Need to surround with /utils/exec={} to get out.
+\def\sseq at handleclassquotes#1#2{/utils/exec={\sseq at d@addto at macro\sseq at processlabels{\sseq at handleclassquotes@inner{#1}{#2}}}}
+
+\def\sseq at handleclassquotes@inner#1#2{%
+    \begingroup\pgfscope
+    \sseq at options@firstpassmode
+    \sseq at thesseqstyle
+    \sseq at thelabelstyle
+    \sseq at theclasslabelstyle
+    \the\sseq at scope@toks
+    \sseq at options@normalmode
+    \sseq at processoptions{class/label}{#2}%
+    \ifx\sseq at classlabeltextfn\@gobble
+        \def\processedlabel{#1}%
+    \else
+        \sseq at classlabeltextfn{#1}% labeltextfn is a private handler, classlabeltextfn is exposed via "class label handler"
+    \fi
+    \ifsseq at classlabel
+        \sseq at options@firstpassmode
+        \the\sseq at outerclasslabelstyle
+        \sseq at xprotected@addto at macro\sseq at classlabelnodes{
+            \@nx\ifsseq at needstikz
+                node[
+                    /sseqpages/class/label,
+                    /utils/exec={
+                        \let\@nx\sseq at tikz@transform at save\@nx\tikz at transform
+                        \let\@nx\tikz at transform\relax % The next line was set up to fix the classlabelstyle glitch
+                        \the\sseq at sseqstyle\@nx\the\sseq at sseqstyle@page
+                        \the\sseq at labelstyle\@nx\the\sseq at labelstyle@page\the\sseq at classlabelstyle\@nx\the\sseq at classlabelstyle@page
+                        \sseq at theouterclasslabelstyle\unexpanded\@xp{\sseq at savedoptioncode}%
+                     %   \@nx\iftikz at fullytransformed\@nx
+                     %      \@nx\tikz at fullytransformedtrue
+                     %   \else
+                     %       \@nx{\@nx\pgftransformresetnontranslations\@nx\sseq at globalrotatetransform}
+                     %   \@nx\fi
+                        \let\@nx\tikz at transform\@nx\sseq at tikz@transform at save
+                     }%
+                ]{\sseq at labeltextfn{\processedlabel}}%
+            \@nx\else
+                \@nx\node[
+                    /sseqpages/class/label,
+                    /utils/exec={
+                        \let\@nx\sseq at tikz@transform at save\@nx\tikz at transform
+                        \let\@nx\tikz at transform\relax % The next line was set up to fix the classlabelstyle glitch
+                        \the\sseq at sseqstyle\@nx\the\sseq at sseqstyle@page
+                        \the\sseq at labelstyle\@nx\the\sseq at labelstyle@page\the\sseq at classlabelstyle\@nx\the\sseq at classlabelstyle@page
+                        \sseq at theouterclasslabelstyle\unexpanded\@xp{\sseq at savedoptioncode}
+                     %   \@nx\iftikz at fullytransformed\@nx
+                     %      \@nx\tikz at fullytransformedtrue
+                     %   \else
+                     %       \@nx{\@nx\pgftransformresetnontranslations\@nx\sseq at globalrotatetransform}
+                     %   \@nx\fi
+                       \let\@nx\tikz at transform\@nx\sseq at tikz@transform at save
+                     }
+                ]{\unexpanded\@xp{\@xp\sseq at labeltextfn\@xp{\processedlabel}}};%
+            \@nx\fi
+        }%
+    \else
+        \sseq at options@firstpassmode
+        \the\sseq at innerclasslabelstyle
+        \sseq at options@normalmode
+        \sseq at protectedeval{\@nx\pgfqkeys{/sseqpages/class/label}{#2}}%
+        \sseq at protected@xdef\sseq at classnodetext{\processedlabel}%
+        \xdef\sseq at classnodetextoptions{%
+            %\unexpanded{\def\pgfkeysdefaultpath{/sseqpages/class/node texts/}}%
+            \sseq at thelabelstyle\sseq at theinnerclasslabelstyle\unexpanded\@xp{\sseq at savedoptioncode}%
+        }%
+    \fi
+    \endpgfscope\endgroup
+}
+
+\def\sseq at handleedgequotes#1#2{% We use this via \let\tikz at quotes@as\sseq at handleedgequotes
+    /utils/exec={% so it's called inside \pgfkeysalso{stuff}. Need to surround with /utils/exec={} to get out.
+        \endgroup
+        \let\sseq at savedoptioncode@save\sseq at savedoptioncode
+        \sseq at processoptions{label}{#2}
+        \sseq at needstikztrue
+        \let\sseq at temp\sseq at savedoptioncode
+        \let\sseq at savedoptioncode\sseq at savedoptioncode@save
+        \sseq at e@addto at options{
+            \@nx\tikzset{
+                every to/.append style={
+                    edge node={
+                        node [/sseqpages/label,
+                             /utils/exec={
+                                \let\@nx\sseq at tikz@transform at save\@nx\tikz at transform
+                                \let\@nx\tikz at transform\relax
+                                \@nx\sseq at thelabelstyle\@nx\sseq at theedgelabelstyle
+                                \unexpanded\@xp{\sseq at temp}
+                                \ifsseq at rotatelabels\iftikz at fullytransformed\else\@nx\tikz at fullytransformedtrue\@nx\tikz at addtransform{\@nx\pgftransformresetnontranslations\@nx\sseq at globalrotatetransform}\fi\fi
+                                 \unexpanded\@xp{\sseq at edgeoptionhook} % this is just to make description work
+                                 \let\@nx\tikz at transform\@nx\sseq at tikz@transform at save
+                            }
+                        ]{\sseq at labeltextfn{#1}}
+                   }
+                }
+            }
+        }
+    }
+}
+
+
+\def\sseq at checktransform@error{\sseq at error@nn{illegal-transform}}
+\let\sseq at checktransform\sseq at checktransform@error
+
+
+%% Parsing, background vs foreground, and context
+\def\sseq at standardparse{%
+    \let\sseq at tikzprimitives@coords at maybeclass\sseq at tikzprimitives@coords at notaclass
+    \let\sseq at checktransform\@gobbletwo
+    \let\sseq at tikz@shifttransform\sseq at okayshifttransform
+    %((((((((((((((((((
+    \def\class##1){\sseq at setthiscall{\string\class##1)}\sseq at error@x{standard-parse}{\string\class}}%
+    \def\replaceclass##1){\sseq at setthiscall{\string\replaceclass##1)}\sseq at error@x{standard-parse}{\string\replaceclass}}%
+    \def\classoptions##1){\sseq at setthiscall{\string\classoptions##1)}\sseq at error@x{standard-parse}{\string\classoptions}}%
+    \def\d##1){\sseq at setthiscall{\string\d##1)}\sseq at error@x{standard-parse}{\string\d}}%
+    \def\doptions##1){\sseq at setthiscall{\string\doptions##1)}\sseq at error@x{standard-parse}{\string\doptions}}%
+    \def\structline##1)##2){\sseq at setthiscall{\string\structline##1)##2)}\sseq at error@x{standard-parse}{\string\structline}}%
+    \def\structlineoptions##1)##2){\sseq at setthiscall{\string\structlineoptions##1)##2)}\sseq at error@x{standard-parse}{\string\structlineoptions}}%
+}
+
+\def\sseq at nodeparse{%
+    \let\sseq at tikzprimitives@coords at maybeclass\sseq at tikzprimitives@coords at maybeclass@save
+    \let\sseq at tikzprimitives@coords at maybeclass
+    \def\sseq at transform{\sseq at error@nn{illegal-transform}} % Disallow most coordinate transforms
+    \let\sseq at shifttransform\sseq at checkshifttransform
+    \let\class\sseq at class
+    \let\replaceclass\sseq at replaceclass
+    \let\structline\sseq at structline
+}
+
+
+\sseq at pgfqkeysdirlist{/sseqpages,/sseqpages/tikz primitives}{%
+    standard parse/.code={
+        \let\sseq at firstpass@shifttransform\@gobbletwo
+        \sseq at d@addto at options{\sseq at standardparse}
+        \pgfkeys{/sseqpages/tikz primitives/shift/.sseq @ second pass code={\tikzset{shift={##1}}}}
+    },
+    node parse/.code={ % This is never used, probably broken, and likely shouldn't exist
+        \let\sseq at firstpass@shifttransform\sseq at firstpass@checkshifttransform
+        \let\sseq at checktransform\sseq at checktransform@error
+        \sseq at d@addto at options{\sseq at nodeparse}
+    },
+    background/.code={\sseq at setsavedpaths{background}\pgfkeysalso{standard parse}},
+    foreground/.code={\ifsseq at keepchanges\sseq at setsavedpaths{standard}\else\sseq at setsavedpaths{temporary}\fi\pgfkeysalso{node parse}}
+}
+
+\pgfkeys{
+    /sseqpages/tikz primitives/handle quote/.sseq @ second pass code={\tikzset{#1}},
+    /tikz/handle quote/.code={\sseq at error{tikz-edge-quotes}}
+}
+
+\sseq at pgfqkeysdirlist{/sseqpages/class,/sseqpages/differential}{
+    standard parse/.sseq @ first pass code={\sseq at error@n{option-tikz-prims-only}{standard parse}},
+    background/.sseq @ first pass code={\sseq at error@n{option-tikz-prims-only}{background}}
+}
+
+\def\sseq at class@tag{}
+\def\sseq at class@tagprefix{}
+\def\sseq at class@name{}
+\def\sseq at namehandler{}%\@xp\sseq at normalizepolynomial\@xp{\sseq at class@name}\let\sseq at class@name\sseq at polynomial}
+\def\sseq at currenttag{\sseq at class@tag}% for the user ??
+\def\sseq at tooltip{}
+\pgfqkeys{/sseqpages/scope}{
+    tag/.code={\pgfkeys at spdef\sseq at class@tag{#1}},
+    tag prefix/.code={\pgfkeys at spdef\temp{#1}\sseq at e@addto at macro\sseq at class@tagprefix{\unexpanded\@xp{#1}}}
+}
+
+\pgfqkeys{/sseqpages/class}{
+    name/.code={\def\sseq at class@name{#1}\pgfkeysalso{/sseqpages/alias=#1}},
+    show name/.code={\def\sseq at class@showname{#1}},
+    page/.code={\sseq at getnumrange\sseq at class@page{#1}},% page & gen are only for \classoptions.
+    generation/.code={\sseq at getnumrange\sseq at gen{#1}}, % \class tests if \sseq at class@page is set and throw an error if so.
+    tag/.code={\sseq at d@addto at macro\sseq at class@tag{#1}},
+    offset/.code={\def\sseq at tempoffset{#1}},
+    tooltip/.sseq @ first pass code={\def\sseq at tooltip{#1}}
+}
+
+\pgfqkeys{/sseqpages/struct line}{
+    page/.code={\sseq at getnumrange\sseq at structline@page{#1}}
+}
+
+\def\sseq at fitalso{}
+\pgfqkeys{/sseqpages/fit}{
+    fit/.sseq @ first pass code={\sseq at d@addto at macro\sseq at fitalso{#1}},
+    page/.code={\sseq at getnumrange\sseq at fit@page{#1}}
+}
+
+\def\sseq at getnumrange#1#2{
+    \pgfutil at in@{--}{#2}\ifpgfutil at in@
+        \sseq at getnumrange@range#1#2\sseq at nil
+    \else
+        \edef#1{\the\numexpr#2}
+    \fi
+}
+\def\sseq at getnumrange@range#1#2--#3\sseq at nil{\edef#1{\the\numexpr#2}\@xp\edef\csname\sseq at macroname#1max\endcsname{\the\numexpr#3}}
+
+%% Needs tikz
+% Force \class or \d to fall back to using tikz to render their output
+% Rather than using the faster direct \pgf primitives (largely copied from tikz to maximize compatibility)
+% Drawing with tikz is slower, but I don't want to reimplement these features
+\def\sseq at needstikzandpass#1#2{\sseq at needstikzandpass@{#1}#2,\@nil}
+\def\sseq at needstikzandpass@#1#2,{%
+    \pgfqkeys{#1}{#2/.code={\sseq at options@firstpass{\sseq at needstikztrue}\sseq at options@secondpass{\sseq at pgfkeysdocommand{#2}{##1}\sseq at needstikztrue}}}%
+    \@ifnextchar\@nil{\@gobble}{\sseq at needstikzandpass@{#1}}%
+}
+
+\pgfqkeys{/sseqpages}{needs tikz/.code=\sseq at needstikztrue}
+\sseq at needstikzandpass{/sseqpages}{%
+    shade, blend mode, pattern, path picture, path fading, decorate, pin, label
+}
+
+\sseq at needstikzandpass{/sseqpages/differential}{%
+    bend left, bend right, in, out, relative, looseness, in looseness, out looseness,
+    min distance, max distance, out min distance, out max distance, in min distance, in max distance, distance,
+    controls, in control, out control,
+    loop, loop above, loop below, loop left, loop right % maybe delete the loops and replace them with errors? It's pretty pointless to use these.
+}
+
+\sseq at needstikzandpass{/sseqpages/struct line}{%
+    bend left, bend right, in, out, relative, looseness, in looseness, out looseness,
+    min distance, max distance, out min distance, out max distance, in min distance, in max distance, distance,
+    controls, in control, out control,
+    loop, loop above, loop below, loop left, loop right % maybe delete the loops and replace them with errors? It's pretty pointless to use these.
+}
+
+%    circle split/.code=\sseq at needstikzandpass,
+%    circle solidus/.code=\sseq at needstikzandpass,
+%    ellipse split/.code=\sseq at needstikzandpass,
+%    rectangle split/.code=\sseq at needstikzandpass,
+%    align/.code=\sseq at needstikzandpass,
+
+\sseq at addtostorelist\sseq at runoffarrow@start at differential@spec{...}
+\sseq at addtostorelist\sseq at runoffarrow@end at differential@spec{...}
+\sseq at addtostorelist\sseq at runoffarrow@start at structline@spec{...}
+\sseq at addtostorelist\sseq at runoffarrow@end at structline@spec{...}
+\sseq at pgfqkeysdirlist{/sseqpages/global,/sseqpages}{
+    run off differentials/.code args={#1-#2}{\def\sseq at runoffarrow@start at differential@spec{#1}\def\sseq at runoffarrow@end at differential@spec{#2}},
+    run off struct lines/.code args={#1-#2}{\def\sseq at runoffarrow@start at structline@spec{#1}\def\sseq at runoffarrow@end at structline@spec{#2}},
+    run off/.forward to=/sseqpages/run off differentials,
+    run off/.forward to=/sseqpages/run off struct lines
+}
+
+
+\sseq at pgfqkeysdirlist{/sseqpages/differential,/sseqpages/struct line}{
+    source anchor/.sseq @ second pass store in=\sseq at edgesourceanchor,
+    target anchor/.sseq @ second pass store in=\sseq at edgetargetanchor,
+    shorten >/.sseq @ second pass code={\sseq at pgfkeysdocommand{shorten >}{#1}},
+    shorten </.sseq @ second pass code={\sseq at pgfkeysdocommand{shorten <}{#1}},
+}
+\pgfqkeys{/sseqpages/differential}{
+    /sseqpages/differential/invisible/.sseq @ first pass code={\sseq at drawdifferentialfalse}
+}
+\newif\ifsseq at drawdifferential
+\sseq at drawdifferentialtrue
+
+%%%
+%%%   Global Keys
+%%%
+
+%%% Style options
+
+%% Add key code to \sseq at savedoptioncode
+% #1 -- a list of directories to search
+% #2 -- keys
+% This is a faster and sloppier way of doing:
+%\def\sseq at temp{#1}
+%\pgfqkeys{/sseqpages/alwaysunknown}{#2}
+% and defining an event handler: alwaysunknown/.unknown/.code={\@xp\sseq at keys@try at addtooptions\@xp{\sseq at temp}{}{\sseq at keys@unknown}
+% Copied with modification from /pgf/utilities/pfgkeys.code.tex
+\def\sseq at addstylecodetooptions#1#2{%
+    \def\sseq at directorylist{#1}%
+    \sseq at simple@pgfkeys at parse#2,\pgfkeys at mainstop
+}
+
+\def\sseq at simple@pgfkeys at parse{\futurelet\pgfkeys at possiblerelax\sseq at simple@pgfkeys at parse@main}
+\def\sseq at simple@pgfkeys at parse@main{%
+  \ifx\pgfkeys at possiblerelax\pgfkeys at mainstop%
+      \@xp\@gobble
+  \else%
+      \@xp\sseq at simple@pgfkeys@@normal
+  \fi%
+}
+
+\def\sseq at simple@pgfkeys@@normal#1,{%
+    \sseq at simple@pgfkeys at unpack#1=\pgfkeysnovalue=\pgfkeys at stop
+    \sseq at simple@pgfkeys at parse
+}
+
+\def\sseq at simple@pgfkeys at unpack#1=#2=#3\pgfkeys at stop{%
+  \pgfkeys at spdef\pgfkeyscurrentkey{#1}%
+  \pgfkeys at spdef\pgfkeyscurrentvalue{#2}%
+  \ifx\pgfkeyscurrentkey\pgfkeys at empty\else
+      \def\next{\@xp\sseq at keys@try at addtooptions\@xp{\sseq at directorylist}{}{\sseq at addstylecodetooptions@unknown}}%
+      \sseq at simple@pgfkeys at checkquote#1\sseq at nil{%
+            \def\pgfkeyscurrentname{handle quote}%
+            \def\pgfkeyscurrentvalue{#1}%
+      }{%
+          \edef\pgfkeyscurrentkey{\pgfkeyscurrentkey}%
+          \ifx\pgfkeyscurrentkey\pgfkeys at empty
+            \let\next\relax
+          \else%
+            \let\pgfkeyscurrentname\pgfkeyscurrentkey
+          \fi
+      }%
+      \@xp\next
+  \fi
+}
+\let\sseq at addstylecodetooptions@unknown\sseq at keys@unknown
+
+\long\def\sseq at simple@pgfkeys at checkquote#1#2\sseq at nil{%
+    \ifx#1"%
+        \@xp\@firstoftwo
+    \else
+        \@xp\@secondoftwo
+    \fi
+}
+
+\def\sseq at sseqstyle@globalpart{}
+
+
+\def\sseq at stylelist{}
+\def\sseq at clearchangestyles{}
+
+
+\def\sseq at newstyles#1#2{\def\sseq at temppath{#1}\sseq at newstyles@#2,\sseq at nil}
+\def\sseq at newstyles@#1,{\sseq at newsseqstyle{\sseq at trimleadingspaces#1}\@ifnextchar\sseq at nil{\@gobble}{\sseq at newstyles@}}
+
+\def\sseq at set@newstyle#1{\pgfqkeys{/sseqpages}{#1}\pgfqkeys{/sseqpages/global}{#1}\pgfqkeys{/sseqpages/global/default}{#1}\pgfqkeys{/sseqpages/first pass}{#1}}
+
+\def\sseq at newsseqstyle#1{%
+    \sseq at setmacronospaces\sseq at tempcmd{sseq@#1style}%
+    \edef\sseq at tempcmdb{\csname\@xp\sseq at macroname\sseq at tempcmd @page\endcsname}%
+    \sseq at setmacronospaces\sseq at tempcmdc{sseq at the#1style}%
+    \@xp\edef\sseq at tempcmdc{\@nx\the\@xp\@nx\sseq at tempcmd\@nx\the\sseq at tempcmdb}%
+    \@xp\newtoks\sseq at tempcmd
+    \@xp\newtoks\sseq at tempcmdb
+    \sseq at x@addto at macro\sseq at stylelist{\sseq at tempcmd{\@nx\the\sseq at tempcmd}}%
+    \sseq at x@addto at macro\sseq at clearchangestyles{\sseq at tempcmdb{}}%
+    \sseq at set@newstyle{%
+        #1s/.ecode={%
+            \let\@nx\sseq at savedoptioncode@store\@nx\sseq at savedoptioncode
+            \edef\@nx\sseq at savedoptioncode{\@nx\the\sseq at tempcmd}%
+            \@nx\sseq at addstylecodetooptions{\sseq at temppath}{##1}%
+            \sseq at tempcmd\@nx\@xp{\@nx\sseq at savedoptioncode}%
+            \@nx\ifsseq at inprogress
+                \@nx\sseq at savedpaths@xadd{\sseq at tempcmd{\@nx\the\sseq at tempcmd}}%
+            \@nx\fi
+            \let\@nx\sseq at savedoptioncode\@nx\sseq at savedoptioncode@store
+        },%
+        change #1s/.ecode={%
+            \@nx\ifsseq at ispageenv\@nx\else\@nx\sseq at error@nn{change-style-data}{#1}{##1}\@nx\fi
+            \@nx\ifsseq at hasname\@nx\else\@nx\sseq at error@nn{change-style-standalone}{#1}{##1}\@nx\fi
+            \let\@nx\sseq at savedoptioncode@store\@nx\sseq at savedoptioncode
+            \edef\@nx\sseq at savedoptioncode{\@nx\the\sseq at tempcmdb}%
+            \@nx\sseq at addstylecodetooptions{\sseq at temppath}{##1}%
+            \sseq at tempcmdb\@nx\@xp{\@nx\sseq at savedoptioncode}%
+            \let\@nx\sseq at savedoptioncode\@nx\sseq at savedoptioncode@store
+        }
+    }%
+}
+
+
+\newtoks\sseq at sseqstyle
+\newtoks\sseq at sseqstyle@page
+\def\sseq at thesseqstyle{\the\sseq at sseqstyle\the\sseq at sseqstyle@page}
+
+% 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.
+\sseq at g@addto at macro\sseq at stylelist{\sseq at sseqstyle{\the\sseq at sseqstyle}}%
+\sseq at g@addto at macro\sseq at clearchangestyles{\sseq at sseqstyle@page{}}%
+\sseq at set@newstyle{
+    sseqs/.code={%
+        \let\sseq at savedoptioncode@store\sseq at savedoptioncode
+        \let\sseq at savedoptioncode\sseq at sseqstyle@globalpart
+        \def\sseq at addstylecodetooptions@unknown{%
+            \let\sseq at sseqstyle@globalpart\sseq at savedoptioncode
+            \edef\sseq at savedoptioncode{\the\sseq at sseqstyle}%
+            \sseq at keys@unknown
+            \sseq at sseqstyle\@xp{\sseq at savedoptioncode}%
+            \let\sseq at savedoptioncode\sseq at sseqstyle@globalpart
+        }%
+        \sseq at addstylecodetooptions{/sseqpages/global}{#1}%
+        \let\sseq at sseqstyle@globalpart\sseq at savedoptioncode
+        \ifsseq at inprogress
+            \sseq at savedpaths@xadd{\sseq at sseqstyle{\the\sseq at sseqstyle}}%
+        \fi
+        \let\sseq at addstylecodetooptions@unknown\sseq at keys@unknown
+        \let\sseq at savedoptioncode\sseq at savedoptioncode@store
+    },%
+    change sseqs/.code={%
+        \ifsseq at ispageenv\else\sseq at error@nn{change-style-data}{sseq}{#1}\fi
+        \ifsseq at hasname\else\sseq at error@nn{change-style-standalone}{sseq}{#1}\fi
+        \let\sseq at savedoptioncode@store\sseq at savedoptioncode
+        \edef\sseq at savedoptioncode{\the\sseq at sseqstyle@page}%
+        \sseq at addstylecodetooptions{\sseq at temppath}{#1}%
+        \sseq at sseqstyle@page\@xp{\sseq at savedoptioncode}%
+        \let\sseq at savedoptioncode\sseq at savedoptioncode@store
+    }
+}
+
+
+%\sseq at newstyles{/sseqpages/}{sseq}% DON'T make this /global/default! Bad things will happen.
+\sseq at newstyles{/sseqpages/label,/sseqpages}{edge, label, edge label, differential label, struct line label}
+\sseq at newstyles{/sseqpages/class,/sseqpages}{class, permanent cycle, transient cycle, this page cycle}
+\sseq at newstyles{/sseqpages/differential,/sseqpages}{differential}
+\sseq at newstyles{/sseqpages/struct line,/sseqpages}{struct line, this page struct line}
+\sseq at newstyles{/sseqpages/class/label}{class label, inner class label, outer class label}
+\sseq at newstyles{/sseqpages/tikz primitives}{tikz primitive}
+\sseq at newstyles{/sseqpages/fit}{circle class}
+
+
+\sseq at set@newstyle{sseq/.style={sseqs={#1}},change sseq/.style={change sseqs={#1}},
+    classes/.style={classs={#1}},change classes/.style={change classs={#1}},
+    circle classes/.style={circle classs={#1}},change circle classes/.style={change circle classs={#1}},
+}% "class" has a nonstandard plural
+\sseq at set@newstyle{
+    cycles/.code={\pgfkeysalso{classes={#1}}},
+    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 at newplotstyle#1{
+    \sseq at setmacronospaces\sseq at tempcmd{sseq@#1style}
+    \sseq at setmacronospaces\sseq at tempcmdb{sseq@#1style at default}
+    \sseq at eval{\@nx\sseq at addtostorelist\@xp\@nx\sseq at tempcmd{\@xp\@nx\sseq at tempcmdb}}
+    \@xp\def\sseq at tempcmdb{}
+    \pgfqkeys{/sseqpages/global}{%
+        #1 style/.ecode={
+            \unexpanded{\let\sseq at savedoptioncode@store\sseq at savedoptioncode}
+            \let\@nx\sseq at savedoptioncode\@xp\@nx\sseq at tempcmd
+            \unexpanded{\sseq at addstylecodetooptions{/tikz}}{##1}
+            \let\@xp\@nx\sseq at tempcmd\@nx\sseq at savedoptioncode
+            \unexpanded{\let\sseq at savedoptioncode\sseq at savedoptioncode@store}
+        }
+    }
+    % Only difference here is \sseq at tempcmdb -- which puts it in the default code -- instead of \sseq at tempcmd
+    \pgfqkeys{/sseqpages/global/default}{%
+        #1 style/.ecode={
+            \unexpanded{\let\sseq at savedoptioncode@store\sseq at savedoptioncode}
+            \let\@nx\sseq at savedoptioncode\@xp\@nx\sseq at tempcmdb
+            \unexpanded{\sseq at addstylecodetooptions{/tikz}}{##1}
+            \let\@xp\@nx\sseq at tempcmdb\@nx\sseq at savedoptioncode
+            \unexpanded{\let\sseq at savedoptioncode\sseq at savedoptioncode@store}
+        }
+    }
+}
+
+
+\def\sseq at newplotstyles#1{\def\sseq at temppath{#1}\sseq at newplotstyles@#1,\sseq at nil}
+\def\sseq at newplotstyles@#1,{\sseq at newplotstyle{\sseq at trimleadingspaces#1}\@ifnextchar\sseq at nil{\@gobble}{\sseq at newplotstyles@}}
+
+\sseq at newplotstyles{x tick, y tick}
+
+
+%%% Global keys handlers and infrastructure
+
+\def\sseq at keys@lastpart{%
+    \edef\pgfkeyscurrentkey{\pgfkeyscurrentpath}%
+    \pgfkeys at split@path
+    \edef\sseq at temp{\pgfkeyscurrentname}%
+    \edef\sseq at temp@ii{\pgfkeyscurrentkey}%
+}
+
+\pgfqkeys{/handlers}{
+    .sseq store in/.code 2 args={%
+        \sseq at addtostorelist#1{#2}%
+        \sseq at keys@lastpart
+        \pgfkeys{%
+            \sseq at temp@ii/.store in=#1,%
+            /sseqpages/global/default/\sseq at temp/.store in/.expand once=\csname \sseq at macroname#1 at default\endcsname
+        }%
+    },
+    .sseq append to style/.code 2 args={%
+        \sseq at addkeytostorelist{#1}{\pgfkeysalso{#2}}%
+        \sseq at keys@lastpart
+        \pgfkeys{%
+            \sseq at temp@ii/.style={#1/.append style={##1}},%
+            /sseqpages/global/default/\sseq at temp/.ecode={%
+                \@nx\apptocmd\@xp\@nx\csname pgfk@#1/. at cmd@default\endcsname{\@nx\pgfkeysalso{##1}}{}{\@nx\sseq at error{this-shouldnt-happen}}%
+                \global\let\@xp\@nx\csname pgfk@#1/. at cmd@default\endcsname\@xp\@nx\csname pgfk@#1/. at cmd@default\endcsname
+            }%
+        }%
+    },
+    .sseq is if/.code={%
+        \sseq at addiftostorelist@truedefault{#1}%
+        \sseq at keys@lastpart
+        \pgfkeys{%
+            \sseq at temp@ii/.is if=sseq@#1,%
+            /sseqpages/global/default/\sseq at temp/.code={\@xp\edef\csname sseq@#1 at default\endcsname{\global\@xp\@nx\csname sseq@#1##1\endcsname}},%
+            /sseqpages/global/default/\sseq at temp/.default=true,%
+        }%
+    },
+    .sseq is if false/.code={%
+        \sseq at keys@lastpart
+        \pgfkeys{%
+            /sseqpages/global/\sseq at temp/.code/.expanded={\@xp\@nx\csname sseq@#1false\endcsname},
+            /sseqpages/global/\sseq at temp/.value forbidden,
+            % value forbidden and ecode don't work correctly together so we have to use .code/.expanded .
+            % I made a thread here: https://sourceforge.net/p/pgf/discussion/477362/thread/3e75d813/
+            /sseqpages/global/default/\sseq at temp/.code/.expanded={\def\@xp\@nx\csname sseq@#1 at default\endcsname{\global\@xp\@nx\csname sseq@#1false\endcsname}},
+            /sseqpages/global/default/\sseq at temp/.value forbidden,
+        }%
+    },
+    .sseq default code/.code={%
+        \sseq at keys@lastpart
+        \pgfkeys{/sseqpages/global/default/\sseq at temp/.code={#1}}%
+    },
+    .sseq default code 2 args/.code={%
+        \sseq at keys@lastpart
+        \pgfkeys{/sseqpages/global/default/\sseq at temp/.code 2 args={#1}}%
+    },
+    .sseq default error/.code={%
+        \sseq at keys@lastpart
+        \pgfkeys{/sseqpages/global/default/\sseq at temp/.ecode={\@nx\sseq at error@n{option-no-default-allowed}{\sseq at temp}}}%
+    },
+    .sseq x y alias/.code={%
+        \sseq at keys@lastpart
+        \ifx\pgfkeysnovalue#1%
+            \edef\sseq at tempb##1{##1 \sseq at temp}%
+        \else
+            \def\sseq at tempb##1{#1}%
+            \sseq at usedparam\sseq at tempb
+        \fi
+        \pgfkeys{%
+            /sseqpages/global/\sseq at temp/.ecode={\@nx\pgfkeysalso{\sseq at tempb{x}={##1},\sseq at tempb{y}={##1}}},%
+            /sseqpages/global/default/\sseq at temp/.ecode={\@nx\pgfkeysalso{\sseq at tempb{x}={##1},\sseq at tempb{y}={##1}}}%
+        }%
+    }
+}
+
+\bgroup\lccode`*=`#\lowercase{\egroup
+    \def\sseq at usedparam#1{
+        \@xp\sseq at usedparam@\@xp#1\meaning#1*\@nil
+    }
+    \def\sseq at usedparam@#1#2->#3*#4\@nil{
+        \sseq at ifempty{#4}{
+            \@xp\def\@xp#1\@xp##\@xp1\@xp{\@xp##\@xp1\@xp\space#1{}}
+        }{}
+    }
+}
+
+\def\sseq at add@tikzkey at to@options at forstylehander#1{\sseq at e@addto at options{\@nx\sseq at options@secondpass{#1}}}
+\pgfqkeys{/handlers}{ % defines sseq style, etc
+    sseq @@ make style handler/.style 2 args={%
+        .sseq #1/.code={%
+            \sseq at keys@lastpart
+            \let\sseq at savedoptioncode@store\sseq at savedoptioncode
+            \def\sseq at keys@unknown at error{}%
+            \def\sseq at savedoptioncode{}%
+            \let\sseq at add@tikzkey at to@options\sseq at add@tikzkey at to@options at forstylehander
+            \sseq at addstylecodetooptions{/sseqpages/scope}{##1}%
+            \sseq at eval{\@nx\pgfkeys{/sseqpages/scope/\sseq at temp/.#2={\unexpanded\@xp{\sseq at savedoptioncode}}}}%
+            \def\sseq at savedoptioncode{}%
+            \sseq at addstylecodetooptions{/sseqpages/class}{##1}%
+            \sseq at eval{\@nx\pgfkeys{/sseqpages/class/\sseq at temp/.#2={\unexpanded\@xp{\sseq at savedoptioncode}}}}%
+            \def\sseq at savedoptioncode{}%
+            \sseq at addstylecodetooptions{/sseqpages/differential}{##1}%
+            \sseq at eval{\@nx\pgfkeys{/sseqpages/differential/\sseq at temp/.#2={\unexpanded\@xp{\sseq at savedoptioncode}}}}%
+            \def\sseq at savedoptioncode{}%
+            \sseq at addstylecodetooptions{/sseqpages/struct line}{##1}%
+            \sseq at eval{\@nx\pgfkeys{/sseqpages/struct line/\sseq at temp/.#2={\unexpanded\@xp{\sseq at savedoptioncode}}}}%
+            \def\sseq at savedoptioncode{}%
+            \sseq at addstylecodetooptions{/sseqpages/circle classes}{##1}
+            \sseq at eval{\@nx\pgfkeys{/sseqpages/circle classes/\sseq at temp/.#2={\unexpanded\@xp{\sseq at savedoptioncode}}}}%
+            \def\sseq at savedoptioncode{}%
+            \sseq at addstylecodetooptions{/sseqpages/tikz primitives}{##1}%
+            \sseq at eval{\@nx\pgfkeys{/sseqpages/tikz primitives/\sseq at temp/.#2={\unexpanded\@xp{\sseq at savedoptioncode}}}}%
+            \let\sseq at savedoptioncode\sseq at savedoptioncode@store
+            \let\sseq at addstylecodetooptions@unknown\sseq at keys@unknown
+            \let\sseq at keys@unknown at error\sseq at keys@unknown at error@normal
+            \let\sseq at add@tikzkey at to@options\sseq at e@addto at options
+        }%
+    },%
+    sseq @@ make code handler/.style={%
+        .sseq #1/.code={%
+            \sseq at keys@lastpart
+            \pgfkeys{
+                /sseqpages/class/\sseq at temp/.#1={##1},%
+                /sseqpages/differential/\sseq at temp/.#1={##1},%
+                /sseqpages/struct line/\sseq at temp/.#1={##1}%
+            }%
+        }%
+    },
+%
+    sseq @@ make style handler={style}{code},
+    sseq @@ make style handler={prefix style}{prefix code},
+    sseq @@ make style handler={append style}{append code},
+    sseq @@ make code handler=code,
+    sseq @@ make code handler=prefix code,
+    sseq @@ make code handler=append code,
+%
+    .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}}}},
+%
+%
+    .sseq grading/.code 2 args={%
+        \sseq at keys@lastpart
+        \pgfkeys{%
+            /sseqpages/global/\sseq at temp/.estyle={\unexpanded{degree={#1}{#2}}},%I'm not really sure why these need to be estyle and \unexpanded but it does...
+            /sseqpages/global/default/\sseq at temp/.estyle={\unexpanded{degree={#1}{#2}}},%
+            /sseqpages/\sseq at temp/.sseq @ global only
+        }%
+    },
+    Adams grading/.sseq grading={-1}{#1},
+    homological Serre grading/.sseq grading={-#1}{#1-1},
+    cohomological Serre grading/.sseq grading={#1}{1-#1},
+}
+
+%%% Define global keys setter
+\gdef\sseq at globalkeys#1{%
+    \let\sseq at storetilde~%
+    \def~{}%
+    \pgfqkeys{/sseqpages/global}{#1}%
+    \sseq at globalkeys@#1,\sseq at nil
+    \let~\sseq at storetilde
+}
+
+\def\sseq at globalkeys@#1,{%
+    \sseq at tempiftrue
+    \sseq at keys@removehandler{#1}%
+    \ifsseq at tempif
+        \pgfkeys{/sseqpages/\sseq at temp/.sseq @ global only}%
+        \pgfkeysifdefined{/sseqpages/global/default/\sseq at temp/. at cmd}{}{%
+            \pgfkeys{/sseqpages/global/default/\sseq at temp/.ecode={\@nx\pgfkeysalso{sseqs={\sseq at temp}}}}%
+        }%
+    \fi
+    \sseq at globalkeys@next
+}
+
+\def\sseq at globalkeys@eatentry#1,{%
+    \sseq at globalkeys@next
+}
+
+\def\sseq at globalkeys@next{%
+    \@ifnextchar\sseq at nil{\@gobble}{%
+        \@ifnextchar~{\sseq at globalkeys@eatentry}{%
+            \@ifnextchar,{\sseq at globalkeys@eatentry}{%
+                \sseq at globalkeys@
+            }%
+        }%
+    }%
+}
+
+\def\sseq at keys@ignorehandlers{%
+    \\{value forbidden}\\{value required}\\{default}%\\{sseq store in}\\{sseq is if}%
+    \\{sseq default code}\\{sseq default code 2 args}%
+}
+\def\sseq at keys@removehandler#1{\sseq at keys@removehandler@#1=\sseq at nil}
+\def\sseq at keys@removehandler@#1/.#2=#3\sseq at nil{%
+    \def\sseq at temp{#2}%
+    \def\\##1{\def\sseq at tempii{##1}\ifx\sseq at tempii\sseq at temp \sseq at tempiffalse\let\\\@gobble\fi}%
+    \sseq at keys@ignorehandlers
+    \def\sseq at temp{#1}%
+}
+
+
+%%% Define global keys
+\def\sseq at currentoptionpath{default}
+\pgfkeys{
+    % \sseq at currentoptionpath is set to \sseq at thename in \sseqdata, then "temp" in \sseqpage
+    /sseqpages/global/.unknown/.code={%
+        \let\sseq at tempa\pgfkeyscurrentname
+        \let\sseq at tempb\pgfkeyscurrentvalue
+        \sseq at eval{\@nx\pgfqkeys{/sseqpages/global}{/sseqpages/userstyles/\sseq at tempa/.try={\unexpanded\@xp{\sseq at tempb}}}}
+        \ifpgfkeyssuccess\else
+            \pgfkeysifdefined{/tikz/\pgfkeyscurrentname/. at cmd}{\@firstofone}{\pgfkeysifdefined{/tikz/\pgfkeyscurrentname}{\@firstofone}{%
+                    \sseq at error{unknown-global}\@gobble
+            }}{%
+                \pgfkeysalso{{\sseq at currentoptionpath} options/.append code/.expand twice={\@xp\@xp\@xp\tikzset\@xp\@xp\@xp{\@xp\sseq at tempa\@xp=\@xp{\sseq at tempb}}}}%
+                \sseq at eval{%
+                    \global\let\@xp\@nx\csname pgfk@/sseqpages/global/{\sseq at currentoptionpath} options/. at cmd\endcsname
+                        \@xp\@nx\csname pgfk@/sseqpages/global/{\sseq at currentoptionpath} options/. at cmd\endcsname
+                }%
+            }%
+        \fi
+    },
+    /sseqpages/global/default/.unknown/.code={%
+        \sseq at passoptionto{/sseqpages/global}%
+    },
+    /sseqpages/global/{default} options/.code={},
+    /sseqpages/global/name only/.unknown/.code={},
+    /sseqpages/global/sseqstyle/.unknown/.code={}
+}
+
+\pgfqkeys{/sseqpages/global/name only}{
+    name/.code={\def\sseq at thename{#1}\sseq at hasnametrue},
+    name/.value required,
+    keep changes/.is if=sseq at keepchanges,
+    update existing/.code={\ifsseq at ispageenv\sseq at error{page-update-existing}\fi\sseq at updateexistingtrue},
+    update existing/.sseq default code={\sseq at updateexistingtrue}
+}
+
+\sseq at addtostorelist\sseq at grid{\relax}
+\sseq at addiftostorelist{hasdegree}
+\let\sseq at maybemathswitch\relax
+\sseq at globalkeys{%
+    name/.code={},
+    name/.sseq default error,
+    ~page/.code={
+        \ifsseq at hasname
+            \sseq at ifintexpr{#1}{
+                \def\sseq at thepage{#1}\sseq at thepagecount=#1\relax\let\page\sseq at thepage
+            }{
+                \sseq at error{invalid-page}{#1}
+            }
+        \else
+            \sseq at error{page-no-name}
+        \fi
+    },
+    ~page/.sseq default error,% implement page default?
+    degree/.code 2 args={\def\sseq at targetx##1{#1}\def\sseq at targety##1{#2}},
+    degree/.sseq default code 2 args={\def\sseq at targetx@default##1{#1}\def\sseq at targety@default##1{#2}},
+    strict degree/.sseq is if=strictdegree,
+    lax degree/.sseq is if false=strictdegree,
+    update existing/.code={}, % processed with "name" key and "keep changes" key in /sseqpages/global/name only
+    keep changes/.code={%
+        \ifsseq at hasname\else\sseq at error{keep-changes-no-name}\fi
+        \ifsseq at ispageenv\else\sseq at error{keep-changes-sseqdata}\fi
+    },
+    grid/.code={\ifcsname sseq at grid@#1\endcsname\@xp\let\@xp\sseq at grid\csname sseq at grid@#1\endcsname\else\sseq at error@n{unknown-grid}{#1}\fi},
+    grid/.sseq default code={\ifcsname sseq at grid@#1\endcsname\@xp\let\@xp\sseq at grid@default\csname sseq at grid@#1\endcsname\else\sseq at error@n{unknown-grid}{#1}\fi},
+    math nodes/.sseq is if=mathnodes, % TODO: make this locally toggleable
+    custom clip/.sseq store in=\sseq at customclip{},
+    clip/.sseq is if=clip,
+    draw differentials/.sseq is if=drawdifferentials,
+    no differentials/.sseq is if false={drawdifferentials},
+    draw struct lines/.sseq is if=drawstructlines,
+    no struct lines/.sseq is if false={drawstructlines},
+    draw orphan edges/.sseq is if=draworphanedges,
+    no orphan edges/.sseq is if false={draworphanedges},
+    class pattern/.sseq store in=\sseq at classpattern{standard},
+    class pattern/.append code={\ifcsname sseq@\sseq at classpattern xoffset1/1\endcsname\else\sseq at error{unknown-class-pattern}\fi},
+    class placement transform/.code={%
+        \bgroup
+        \let\tikz at transform\pgfutil at empty
+        \pgfqkeys{/sseqpages/class placement}{#1}%
+        \global\let\sseq at classplacementtransform\tikz at transform
+        \egroup
+    },
+    class placement transform/.sseq default code={%
+        \bgroup
+        \let\tikz at transform\pgfutil at empty
+        \pgfqkeys{/sseqpages/class placement}{#1}%
+        \global\let\sseq at classplacementtransform@default\tikz at transform
+        \egroup
+    },
+    class placement transform/.value required,
+    add class placement transform/.code={%
+        \bgroup
+        \let\tikz at transform\pgfutil at empty
+        \pgfqkeys{/sseqpages/class placement}{#1}%
+        \sseq at x@addto at macro\sseq at classplacementtransform{\unexpanded\@xp\tikz at transform}
+        \egroup
+    },
+    add class placement transform/.sseq default code={%
+        \bgroup
+        \let\tikz at transform\pgfutil at empty
+        \pgfqkeys{/sseqpages/class placement}{#1}%
+        \sseq at x@addto at macro\sseq at classplacementtransform@default{\unexpanded\@xp\tikz at transform}
+        \egroup
+    },
+    add class placement transform/.value required,
+}
+
+\sseq at mathnodestrue
+
+\sseq at addtostorelist\sseq at targetx{}\sseq at addtostorelist\sseq at targety{}
+\sseq at addtostorelist\sseq at xtickstep{1}\sseq at addtostorelist\sseq at ytickstep{1}
+\sseq at addtostorelist\sseq at classplacementtransform{}
+
+
+\sseq at addiftostorelist@truedefault{borderxaxis}\sseq at addiftostorelist@truedefault{borderyaxis}
+\sseq at addtostorelist\sseq at xaxisorigin{0}\sseq at addtostorelist\sseq at yaxisorigin{0}
+
+%%% Range keys and commands
+\sseq at globalkeys{%
+    x range/.code 2 args={\sseq at xrange{#1}{#2}},
+    x range/.sseq default code 2 args={\sseq at xrange@default{#1}{#2}},
+    y range/.code 2 args={\sseq at yrange{#1}{#2}},
+    y range/.sseq default code 2 args={\sseq at yrange@default{#1}{#2}},
+    xrange/.forward to=/sseqpages/global/x range,
+    yrange/.forward to=/sseqpages/global/y range
+}
+
+% These are set up so that if the user specifies no \xrange, the minimum position of any node can be calculated on the fly.
+\@xp\sseq at addtostorelist\@xp\sseq at xmin\@xp{\sseq at infinity}
+\@xp\sseq at addtostorelist\@xp\sseq at ymin\@xp{\sseq at infinity}
+\@xp\sseq at addtostorelist\@xp\sseq at xmax\@xp{\@xp-\sseq at infinity}
+\@xp\sseq at addtostorelist\@xp\sseq at ymax\@xp{\@xp-\sseq at infinity}
+\sseq at addtostorelist\xmin{\protect\sseq at xmin}
+\sseq at addtostorelist\ymin{\protect\sseq at ymin}
+\sseq at addtostorelist\xmax{\protect\sseq at xmax}
+\sseq at addtostorelist\ymax{\protect\sseq at ymax}
+% These are used to decide whether to add a certain node to savedpaths.
+% In general the check is whether xmin<=xcoord<=xmax, but since Latex has no <=, set xminmm=xmin-1, xmaxpp=xmax+1.
+% If the user doesn't specify a range, all nodes should be rendered
+% To ensure that xminmm<xccord<xminpp in that case, set the default to xminmm=-\infty, xmaxpp=+\infty.
+\@xp\sseq at addtostorelist\@xp\sseq at xminmm\@xp{\@xp-\sseq at infinity}
+\@xp\sseq at addtostorelist\@xp\sseq at yminmm\@xp{\@xp-\sseq at infinity}
+\@xp\sseq at addtostorelist\@xp\sseq at xmaxpp\@xp{\sseq at infinity}
+\@xp\sseq at addtostorelist\@xp\sseq at ymaxpp\@xp{\sseq at infinity}
+
+\def\sseq at xrange#1#2{%
+    \global\let\sseq at xminmax\@gobbletwo % Don't need to calculate range of nodes if user specifies it
+    \gdef\sseq at xmin{#1}%
+    \gdef\sseq at xmax{#2}%
+    \let\xmin\sseq at xmin
+    \let\xmax\sseq at xmax
+    % Need to know decremented \xmin and incremented \xmax to decide which nodes to print
+    \sseq at tempcount=#1 \advance\sseq at tempcount-1\xdef\sseq at xminmm{\the\sseq at tempcount}%
+    \sseq at tempcount=#2 \advance\sseq at tempcount1\xdef\sseq at xmaxpp{\the\sseq at tempcount}%
+}
+\def\sseq at yrange#1#2{%
+    \global\let\sseq at yminmax\@gobbletwo %
+    \gdef\sseq at ymin{#1}%
+    \gdef\sseq at ymax{#2}%
+    \let\ymin\sseq at ymin
+    \let\ymax\sseq at ymax
+    \sseq at tempcount=#1 \advance\sseq at tempcount-1\xdef\sseq at yminmm{\the\sseq at tempcount}%
+    \sseq at tempcount=#2 \advance\sseq at tempcount1\xdef\sseq at ymaxpp{\the\sseq at tempcount}%
+}
+
+\def\sseq at xrange@default#1#2{%
+    \global\let\sseq at xminmax\@gobbletwo % Don't need to calculate range of nodes if user specifies it
+    \gdef\sseq at xmin@default{#1}%
+    \gdef\sseq at xmax@default{#2}%
+    % Need to know decremented \xmin and incremented \xmax to decide which nodes to print
+    \sseq at tempcount=#1 \advance\sseq at tempcount-1\xdef\sseq at xminmm@default{\the\sseq at tempcount}%
+    \sseq at tempcount=#2 \advance\sseq at tempcount1\xdef\sseq at xmaxpp@default{\the\sseq at tempcount}%
+}
+\def\sseq at yrange@default#1#2{%
+    \global\let\sseq at yminmax\@gobbletwo %
+    \gdef\sseq at ymin@default{#1}%
+    \gdef\sseq at ymax@default{#2}%
+    \sseq at tempcount=#1 \advance\sseq at tempcount-1\xdef\sseq at yminmm@default{\the\sseq at tempcount}%
+    \sseq at tempcount=#2 \advance\sseq at tempcount1\xdef\sseq at ymaxpp@default{\the\sseq at tempcount}%
+}
+
+% If #1 is less than \xmin or greater than \xmax, update \xmin or \xmax appropriately
+% Gets set to \@gobble if user specifies range
+\def\sseq at xminmax@active#1#2{%
+    \ifnum#1<\sseq at xmin\relax
+        \ifx\sseq at yminmax\@gobbletwo
+            \ifnum#2>\sseq at yminmm\relax
+                \ifnum#2<\sseq at ymaxpp\relax
+                    \xdef\sseq at xmin{#1}%
+                \fi
+            \fi
+        \else
+            \xdef\sseq at xmin{#1}%
+        \fi
+    \fi
+    \ifnum#1>\sseq at xmax\relax
+        \ifx\sseq at yminmax\@gobbletwo
+            \ifnum#2>\sseq at yminmm\relax
+                \ifnum#2<\sseq at ymaxpp\relax
+                    \xdef\sseq at xmax{#1}%
+                \fi
+            \fi
+        \else
+            \xdef\sseq at xmax{#1}%
+        \fi
+    \fi
+}
+
+\def\sseq at yminmax@active#1#2{%
+    \ifnum#2<\sseq at ymin\relax
+        \ifx\sseq at xminmax\@gobbletwo
+            \ifnum#1>\sseq at xminmm\relax
+                \ifnum#1<\sseq at xmaxpp\relax
+                    \xdef\sseq at ymin{#2}%
+                \fi
+            \fi
+        \else
+            \xdef\sseq at ymin{#2}%
+        \fi
+    \fi
+    \ifnum#2>\sseq at ymax\relax
+        \ifx\sseq at xminmax\@gobbletwo
+            \ifnum#1>\sseq at xminmm\relax
+                \ifnum#1<\sseq at xmaxpp\relax
+                    \xdef\sseq at ymax{#2}%
+                \fi
+            \fi
+        \else
+            \xdef\sseq at ymax{#2}%
+        \fi
+    \fi
+}
+
+%%% Axes and Layout options
+\sseq at addtostorelist{\sseq at xtickfn}{} % These should initially be the identity macro, but addtostorelist doesn't accept functions as default
+\sseq at addtostorelist{\sseq at ytickfn}{} % so the default is instated in begin{sseqdata} / begin{sseqpicture}.
+\sseq at globalkeys{%
+    title/.sseq store in=\sseq at title{},
+	title style/.sseq append to style={/sseqpages/global/every title}{at={(0.5*\xmin+0.5*\xmax,\ymax)}},
+    draw title/.sseq is if=drawtitle,
+    no title/.code=\sseq at drawtitlefalse,
+%
+    x label/.sseq store in=\sseq at xaxislabel{},
+    y label/.sseq store in=\sseq at yaxislabel{},
+	x label style/.sseq append to style={/sseqpages/global/every x axis label}{at={(0.5*\xmin+0.5*\xmax,\ymin)}},
+	y label style/.sseq append to style={/sseqpages/global/every y axis label}{at={(\xmin ,0.5*\ymax+0.5*\ymin)}},
+	label style/.sseq x y alias,
+    draw x label/.sseq is if=drawxaxislabel,
+    draw y label/.sseq is if=drawyaxislabel,
+    no x label/.sseq is if false={drawxaxislabel},
+    no y label/.sseq is if false={drawyaxislabel},
+    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,
+    rotate labels/.sseq is if=rotatelabels,
+%
+    draw x ticks/.sseq is if=drawxaxisticks,
+    no x ticks/.sseq is if false=drawxaxisticks,
+    draw y ticks/.sseq is if=drawyaxisticks,
+    no y ticks/.sseq is if false=drawyaxisticks,
+    no ticks/.sseq x y alias=no #1 ticks,
+    no ticks/.value forbidden,
+    draw ticks/.sseq x y alias=draw #1 ticks,
+    draw ticks/.default=true,
+    tick step/.sseq x y alias,
+    tick step/.value required,
+    x tick step/.sseq store in=\sseq at xtickstep{1},
+    y tick step/.sseq store in=\sseq at ytickstep{1},
+    x tick handler/.code={\def\sseq at xtickfn##1{#1}},
+    x tick handler/.sseq default code={\def\sseq at xtickfn@default##1{#1}},
+    y tick handler/.code={\def\sseq at ytickfn##1{#1}},
+    y tick handler/.sseq default code={\def\sseq at ytickfn@default##1{#1}},
+    class label handler/.code = {\long\def\sseq at 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 at classlabeltextfn@default##1{#1}},
+    x tick style/.sseq store in=\sseq at xtickstyle{},
+    y tick style/.sseq store in=\sseq at 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 at drawxaxistrue\sseq at borderxaxistrue},
+    ~y axis style/border/.code={\sseq at drawyaxistrue\sseq at borderyaxistrue},
+    ~x axis style/center/.code={
+        \sseq at drawxaxistrue\sseq at borderxaxisfalse
+        \ifx\sseq at xaxisgap\sseq at xaxisgap@default
+            \def\sseq at xaxisgap{0cm}
+        \fi
+    },
+    ~y axis style/center/.code={\sseq at drawyaxistrue\sseq at borderyaxisfalse\ifx\sseq at yaxisgap\sseq at yaxisgap@default\def\sseq at yaxisgap{0cm}\fi},
+    ~x axis style/none/.code={\sseq at drawxaxisfalse},
+    ~y axis style/none/.code={\sseq at drawyaxisfalse},
+    x axis origin/.sseq store in=\sseq at xaxisorigin{0},
+    y axis origin/.sseq store in=\sseq at yaxisorigin{0},
+    axes origin/.sseq x y alias=axis origin,
+}
+\pgfqkeys{/sseqpages}{%
+    class label handler/.code = {\long\def\sseq at classlabeltextfn##1{#1}}
+}
+
+\sseq at globalkeys{
+    axes gap/.sseq x y alias=axis gap,
+    axes gap/.value required,
+    x axis gap/.sseq store in=\sseq at xaxisgap{0.5cm},
+    y axis gap/.sseq store in=\sseq at yaxisgap{0.5cm},
+    tick gap/.sseq x y alias,
+    tick gap/.value required,
+    x tick gap/.sseq store in=\sseq at xlabelgap{0.5cm},
+    y tick gap/.sseq store in=\sseq at ylabelgap{0.5cm},
+    x axis extend start/.sseq store in=\sseq at xaxis@start at extend{0.9cm},
+    y axis extend start/.sseq store in=\sseq at yaxis@start at extend{0.9cm},
+    axes extend start/.sseq x y alias=axis extend start,
+    x axis extend end/.sseq store in=\sseq at xaxis@end at extend{0.5cm},
+    y axis extend end/.sseq store in=\sseq at yaxis@end at extend{0.5cm},
+    axes extend end/.sseq x y alias=axis extend end,
+    x axis clip padding/.sseq store in=\sseq at xclip@axisgap{0.1cm},
+    y axis clip padding/.sseq store in=\sseq at yclip@axisgap{0.1cm},
+    axes clip padding/.sseq x y alias=axis clip padding,
+    right clip padding/.sseq store in=\sseq at clip@padding at right{0.1cm},
+    left clip padding/.sseq store in=\sseq at clip@padding at left{0.4cm},
+    top clip padding/.sseq store in=\sseq at clip@padding at top{0.1cm},
+    bottom clip padding/.sseq store in=\sseq at clip@padding at bottom{0.4cm}
+}
+
+%%%
+%%% Coordinate transformations
+%%%
+
+%%% Global Coordinate Transformations
+\sseq at globaldetonetrue
+\sseq at addtostorelist\sseq at globaldetonetransform{}
+\sseq at addtostorelist\sseq at globalrotatetransform{}
+\sseq at addtostorelist\sseq at globalscaletransform{}
+
+\def\sseq at globaldetoneoption#1#2{%
+    \ifsseq at globaldetone\else
+        \sseq at error@n{det-one-after-scale}{#2}
+    \fi
+    \@xp\gdef\@xp\sseq at globaldetonetransform\@xp{\sseq at globaldetonetransform #1}%
+    #1
+}
+\def\sseq at globalscaleoption#1{%
+    \sseq at globaldetonefalse
+    \@xp\gdef\@xp\sseq at globalscaletransform\@xp{\sseq at globalscaletransform#1}#1%
+}
+\pgfqkeys{/sseqpages/global}{%
+    x/.sseq @ illegal,
+    y/.sseq @ illegal,
+    z/.sseq @ illegal,
+    xshift/.sseq @ illegal as global,
+    yshift/.sseq @ illegal as global,
+    shift/.sseq @ illegal as global,
+    scale around/.sseq @ illegal as global,
+    rotate around/.sseq @ illegal as global,
+    rotate/.code={%
+        \@xp\gdef\@xp\sseq at globalrotatetransform\@xp{\sseq at globalrotatetransform\pgftransformrotate{#1}}%
+        \sseq at globaldetoneoption{\pgftransformrotate{#1}}{rotate}%
+    },
+    rotate/.value required,
+    xslant/.code={\sseq at globaldetoneoption{\pgftransformxslant{#1}}{xslant}},
+    xslant/.value required,
+    yslant/.code={\sseq at globaldetoneoption{\pgftransformyslant{#1}}{yslant}},
+    yslant/.value required,
+    xmirror/.code={\sseq at globaldetoneoption{\pgftransformxscale{-1}}{xmirror}},
+    xmirror/.value forbidden,
+    ymirror/.code={\sseq at globaldetoneoption{\pgftransformyscale{-1}}{ymirror}},
+    ymirror/.value forbidden,
+    mirror/.forward to=/sseqpages/global/xmirror,
+    mirror/.forward to=/sseqpages/global/ymirror,
+    xscale/.code={%
+        \pgfmathparse{int(#1-1)}%
+        \ifnum\pgfmathresult<\z@%
+            \sseq at error@nn{negative-scale}{x}{#1}%
+        \fi
+        \sseq at globalscaleoption{\pgftransformxscale{#1}}%
+    },
+    xscale/.value required,
+    yscale/.code={%
+        \pgfmathparse{int(#1-1)}%
+        \ifnum\pgfmathresult<\z@
+            \sseq at error@nn{negative-scale}{y}{#1}%
+        \fi
+        \sseq at globalscaleoption{\pgftransformyscale{#1}}%
+    },
+    yscale/.value required,
+    scale/.code={%
+        \pgfmathparse{int(#1-1)}%
+        \ifnum\pgfmathresult<\z@
+            \sseq at error@nn{negative-scale}{}{#1}%
+        \fi
+        \sseq at globalscaleoption{\pgftransformscale{#1}}%
+    },
+    scale/.value required
+}
+
+%%% Local Coordinate transformations
+
+\pgfqkeys{/sseqpages/class placement}{
+    x shift/.code={\sseq at error@nn{class-placement-shift}{x shift}{#1}},
+    y shift/.code={\sseq at error@nn{class-placement-shift}{y shift}{#1}},
+    shift/.code={\sseq at error@nn{class-placement-shift}{shift}{#1}}
+}
+
+%% setup for coordinate transformation keys
+\def\sseq at checktransform{\sseq at error@nn{illegal-transform}}
+\pgfqkeys{/sseqpages}{%
+    x/.code={\sseq at error@n{option-illegal}{#1}},
+    y/.code={\sseq at error@n{option-illegal}{#1}},
+    z/.code={\sseq at error@n{option-illegal}{#1}},
+    xshift/.sseq @ second pass code={\sseq at shifttransform{x}{#1}}, % I don't know why it has to be this way,
+    xshift/.sseq @ first pass append code={\sseq at firstpass@shifttransform{x}{#1}}, % but it definitely breaks if I change it...
+    xshift/.value required,
+    yshift/.sseq @ second pass code={\sseq at shifttransform{y}{#1}},
+    yshift/.sseq @ first pass append code={\sseq at firstpass@shifttransform{y}{#1}},
+    yshift/.value required,
+    shift/.sseq @ transform, shift/.value required,
+    shift only/.sseq @ transform,
+    xscale/.sseq @ transform, xscale/.value required,
+    yscale/.sseq @ transform, yscale/.value required,
+    scale/.sseq @ transform,  scale/.value required,
+    scale around/.sseq @ transform, scale around/.value required,
+    xslant/.sseq @ transform, xslant/.value required,
+    yslant/.sseq @ transform, yslant/.value required,
+    rotate/.sseq @ transform, rotate/.value required,
+    rotate around/.sseq @ transform, rotate around/.value required,
+    cm/.sseq @ transform, cm/.value required,
+    reset cm/.sseq @ transform, reset cm/.value forbidden,
+    transform canvas/.sseq @ transform, transform canvas/.value required
+}
+
+% These two should be exactly the same
+\def\sseq at shift@firstpassprocess#1{\sseq at shift@firstpassprocess@#1\sseq at nil}
+\def\sseq at shift@firstpassprocess@#1#2\sseq at nil{\ifx#1\pgfpointxy\sseq at shift@firstpassprocess@@#2\else\sseq at standardparse\fi}
+\def\sseq at shift@firstpassprocess@@#1#2{
+    \sseq at tikz@firstpass at checkshifttransform{x}{#1}
+    \sseq at tikz@firstpass at checkshifttransform{y}{#2}
+}
+
+\def\sseq at shift@secondpassprocess#1{\sseq at shift@secondpassprocess@#1\sseq at nil}
+\def\sseq at shift@secondpassprocess@#1#2\sseq at nil{\ifx#1\pgfpointxy\sseq at shift@secondpassprocess@@#2\else\sseq at standardparse \pgftransformshift{#1#2}\fi}
+\def\sseq at shift@secondpassprocess@@#1#2{
+    \sseq at tikz@shifttransform{x}{#1}
+    \sseq at tikz@shifttransform{y}{#2}
+}
+
+\sseq at pgfqkeysdirlist{/sseqpages/scope,/sseqpages/tikz primitives}{
+    shift/.code={
+        \sseq at options@firstpass{\tikz at scan@one at point\sseq at shift@firstpassprocess#1\relax}
+        \sseq at options@secondpass{\tikz at scan@one at point\sseq at shift@secondpassprocess#1\relax} % TODO: maybe try to save the work of processing the point twice?
+    },
+    xshift/.sseq @ first pass code=\sseq at tikz@firstpass at checkshifttransform{x}{#1},
+    yshift/.sseq @ first pass code=\sseq at tikz@firstpass at checkshifttransform{y}{#1},
+    xshift/.sseq @ second pass append code=\sseq at tikz@shifttransform{x}{#1},
+    yshift/.sseq @ second pass append code=\sseq at tikz@shifttransform{y}{#1},
+    rotate around/.sseq @ second pass code={\sseq at standardparse\sseq at pgfkeysdocommand{rotate}{#1}},
+    rotate/.sseq @ stdparse do transform, rotate/.value required,
+    xslant/.sseq @ stdparse do transform, xslant/.value required,
+    yslant/.sseq @ stdparse do transform, yslant/.value required,
+    xmirror/.sseq @ stdparse do transform={-1}, xmirror/.value forbidden,
+    ymirror/.sseq @ stdparse do transform={-1}, ymirror/.value forbidden,
+    xscale/.sseq @ stdparse do transform, xscale/.value required,
+    yscale/.sseq @ stdparse do transform, yscale/.value required,
+     scale/.sseq @ stdparse do transform,  scale/.value required,
+    scale around/.sseq @ stdparse do transform, scale around/.value required
+}
+
+%%% Error checking for nonglobal transformations:
+
+\def\sseq at firstpass@checkshifttransform#1#2{%
+    \pgfmathparse{#2}%
+    \sseq at ifpgfmathresultisunitlessint{%
+        \@xp\pgfmathint\@xp{\pgfmathresult}%
+        \@xp\advance\csname sseq@#1\endcsname\pgfmathresult\relax
+    }{\sseq at error@n{illegal-transform}{#1shift}}%
+}
+\let\sseq at firstpass@shifttransform\sseq at firstpass@checkshifttransform
+
+\def\sseq at checkshifttransform#1#2{%
+    \pgfmathparse{#2}%
+    \sseq at ifpgfmathresultisunitlessint{%
+        \@xp\pgfmathint\@xp{\pgfmathresult}%
+        \@xp\advance\csname sseq@#1\endcsname\pgfmathresult\relax
+        \sseq at pgfkeysdocommand{#1shift}{#2cm}
+    }{\sseq at error@n{illegal-transform}{#1shift}}%
+}
+
+\def\sseq at okayshifttransform#1#2{%
+    \pgfmathparse{#2}
+    \ifpgfmathunitsdeclared
+        \sseq at pgfkeysdocommand{#1shift}{#2}
+    \else
+        \sseq at pgfkeysdocommand{#1shift}{#2cm}
+    \fi
+}
+
+\def\sseq at tikz@firstpass at checkshifttransform#1#2{%
+    \pgfmathparse{#2}%
+    \sseq at ifpgfmathresultisunitlessint{%
+        \@xp\pgfmathint\@xp{\pgfmathresult}%
+        \@xp\advance\csname sseq@\sseq at getfirstchar#1\sseq at nil\endcsname\pgfmathresult\relax
+    }{\sseq at standardparse}%
+}
+
+\def\sseq at tikz@shifttransform#1#2{%
+    \pgfmathparse{#2}%
+    \sseq at ifpgfmathresultisunitlessint{%
+        \@xp\pgfmathint\@xp{\pgfmathresult}%
+        \@xp\advance\csname sseq@\sseq at getfirstchar#1\sseq at nil\endcsname\pgfmathresult\relax
+        \sseq at pgfkeysdocommand{#1shift}{#2cm}
+    }{
+        \sseq at standardparse
+        \ifpgfmathunitsdeclared
+            \sseq at pgfkeysdocommand{#1shift}{#2}
+        \else
+            \sseq at pgfkeysdocommand{#1shift}{#2cm}
+        \fi
+    }%
+}
+
+\def\sseq at ifpgfmathresultisunitlessint{\ifpgfmathunitsdeclared\@xp\@secondoftwo\else\sseq at ifpgfmathresultisint{\@xp\@firstoftwo}{\@xp\@secondoftwo}\fi}
+\def\sseq at ifpgfmathresultisint{\@xp\sseq at ifpgfmathresultisint@\pgfmathresult..\sseq at nil}
+\def\sseq at ifpgfmathresultisint@#1.#2.#3\sseq at nil{\ifx\sseq at nil#2\sseq at nil\@xp\@firstoftwo\else \ifnum#2=\z@ \@xp\@xp\@xp\@firstoftwo\else \@xp\@xp\@xp\@secondoftwo\fi\fi}
+
+%%%% Options for Tikz primitives
+
+\def\sseq at pageconstraint{1}
+\def\sseq at pageconstraint@true{1}
+
+\sseq at pgfqkeysdirlist{/sseqpages/scope,/sseqpages/tikz primitives}{
+    page constraint/.code={
+        \sseq at updatepageconstraint{#1}{&&}
+    },
+    page constraint or/.code={
+        \sseq at updatepageconstraint{#1}{||}
+    },
+    page/.code={\sseq at getnumrange\temp{#1}\sseq at updatepageconstraintrange},
+    set page constraint/.store in=\sseq at pageconstraint,
+    background/.code={\sseq at standardparse\sseq at setsavedpaths{background}\pgfkeysalso{standard parse}},
+}
+
+\sseq at pgfqkeysdirlist{/sseqpages/scope,/sseqpages/tikz primitives,/sseqpages/fit}{
+    class style/.code={\sseq at d@addto at options{\sseq at thesseqstyle\sseq at theclassstyle\the\sseq at scope@toks}},
+    cycle style/.forward to=/sseqpages/tikz primitives/class style,
+    permanent class style/.code={\sseq at d@addto at options{\sseq at thesseqstyle\sseq at theclassstyle\sseq at thepermanentcyclestyle\the\sseq at scope@toks}},
+    permanent cycle style/.forward to=/sseqpages/tikz primitives/permanent class style,
+    transient class style/.code={\sseq at d@addto at options{\sseq at thesseqstyle\sseq at theclassstyle\sseq at thetransientcyclestyle\the\sseq at scope@toks}},
+    transient cycle style/.forward to=/sseqpages/tikz primitives/transient class style,
+    this page class style/.code={\sseq at d@addto at options{\sseq at thesseqstyle\sseq at theclassstyle\sseq at thetransientcyclestyle\sseq at thethispagecyclestyle\the\sseq at scope@toks}},
+    this page cycle style/.forward to=/sseqpages/tikz primitives/this page class style,
+    differential style/.code={\sseq at d@addto at options{\sseq at thesseqstyle\sseq at theedgestyle\sseq at thedifferentialstyle\the\sseq at scope@toks}},
+    struct line style/.code={\sseq at d@addto at options{\sseq at thesseqstyle\sseq at theedgestyle\sseq at thestructlinestyle\the\sseq at scope@toks}},
+    tikz primitive style/.code={\sseq at d@addto at options{\sseq at thesseqstyle\sseq at thetikzprimitivestyle\the\sseq at scope@toks}}
+    %this page struct line style/.sseq @ first pass code={\sseq at d@addto at options{\sseq at thesseqstyle\sseq at theedgestyle\sseq at thestructlinestyle\the\sseq at scope@toks}}
+}


Property changes on: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqkeys.code.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqloadstore.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqloadstore.code.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqloadstore.code.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,175 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: sseqloadstore.code.tex
+%%
+%%    Defines commands for maintaining separate namespaces between distinct spectral sequences and saving information.
+%%
+
+
+% These are attributes that come with a given spectral sequence (by name)
+% All of these values are loaded at the beginning of sseqpage (and of sseqdata if an existing sseq is being modified).
+% They are then stored together at the end of sseqdata (and of sseqpage if "keep changes" option is present).
+\def\sseq at storelist{}
+\def\sseq at storelist@setdefaults{}
+\def\sseq at addtostorelist#1#2{%
+    \sseq at g@addto at macro\sseq at storelist{\\#1}%
+    \sseq at x@addto at macro\sseq at storelist@setdefaults{\global\let\@nx#1\@xp\@nx\csname \sseq at macroname#1 at default\endcsname}%
+    \@xp\gdef\csname\sseq at macroname#1 at default\endcsname{#2}%
+}
+\def\sseq at addtostorelistlet#1#2{%
+    \sseq at g@addto at macro\sseq at storelist{\\#1}%
+    \sseq at x@addto at macro\sseq at storelist@setdefaults{\global\let\@nx#1\@xp\@nx\csname \sseq at macroname#1 at default\endcsname}%
+    \global\@xp\let\csname\sseq at macroname#1 at default\endcsname#2%
+}
+
+\def\sseq at addiftostorelist#1{\sseq at addiftostorelistopt{#1}{false}}
+\def\sseq at addiftostorelist@truedefault#1{\sseq at addiftostorelistopt{#1}{true}}
+\def\sseq at addiftostorelistopt#1#2{%
+    \@xp\newif\csname ifsseq@#1\endcsname
+    \sseq at g@addto at macro\sseq at storelist{\sseq at storelistif{#1}}%
+    \sseq at x@addto at macro\sseq at storelist@setdefaults{\@xp\@nx\csname sseq@#1 at default\endcsname}%
+    \@xp\xdef\csname sseq@#1 at default\endcsname{\global\@xp\@nx\csname sseq@#1#2\endcsname}%
+}
+\def\sseq at addkeytostorelist#1#2{
+    \sseq at g@addto at macro\sseq at storelist{\sseq at storelistkey{#1}}%
+    \sseq at x@addto at macro\sseq at storelist@setdefaults{
+        \global\let\@xp\@nx\csname pgfk@#1/. at cmd\endcsname\@xp\@nx\csname pgfk@#1/. at cmd@default\endcsname
+        \global\let\@xp\@nx\csname pgfk@#1/. at body\endcsname\@xp\@nx\csname pgfk@#1/. at body@default\endcsname
+    }%
+    \pgfkeysdef{#1}{#2}%
+    \global\@xp\let\csname pgfk@#1/. at cmd@default\@xp\endcsname\csname pgfk@#1/. at cmd\endcsname
+    \global\@xp\let\csname pgfk@#1/. at body@default\@xp\endcsname\csname pgfk@#1/. at body\endcsname
+}
+
+% transfer data about the current spectral sequence between \<command> and \<command><sseqname>
+\def\sseq at storelist@store#1{\global\@xp\let\csname\sseq at macroname#1@@@\sseq at thename\endcsname#1}
+\def\sseq at storelist@get#1{\global\@xp\let\@xp#1\csname\sseq at macroname#1@@@\sseq at thename\endcsname}
+
+\def\sseq at storelistif@store#1{%
+    \@xp\edef\csname sseq at storeif@#1\endcsname{\csname ifsseq@#1\endcsname \@xp\@nx\csname sseq@#1true\endcsname\else\@xp\@nx\csname sseq@#1false\endcsname\fi}%
+    \@xp\sseq at storelist@store\csname sseq at storeif@#1\endcsname
+}
+\def\sseq at storelistif@get#1{
+    \@xp\sseq at storelist@get\csname sseq at storeif@#1\endcsname
+    \csname sseq at storeif@#1\endcsname
+}
+
+\def\sseq at storelistkey@store#1{
+    \global\@xp\let\csname pgfk@#1/. at cmd@@@\sseq at thename\@xp\endcsname\csname pgfk@#1/. at cmd\endcsname
+    \global\@xp\let\csname pgfk@#1/. at body@@@\sseq at thename\@xp\endcsname\csname pgfk@#1/. at body\endcsname
+}
+\def\sseq at storelistkey@get#1{
+    \global\@xp\let\csname pgfk@#1/. at cmd\@xp\endcsname\csname pgfk@#1/. at cmd@@@\sseq at thename\endcsname
+    \global\@xp\let\csname pgfk@#1/. at body\@xp\endcsname\csname pgfk@#1/. at body@@@\sseq at thename\endcsname
+}
+
+
+\def\sseq at storecmds{\let\\\sseq at storelist@store\let\sseq at storelistif\sseq at storelistif@store\let\sseq at storelistkey\sseq at storelistkey@store\sseq at storelist}
+\def\sseq at getcmds{\let\\\sseq at storelist@get\let\sseq at storelistif\sseq at storelistif@get\let\sseq at storelistkey\sseq at storelistkey@get\sseq at storelist}
+
+%%%% New "poor man's OOP" Load/Store
+% Directly stores things into commands that are annotated with the name of the spectral sequence.
+% I use this primarily for commands that won't necessarily exist for every spectral sequence
+% for instance because it has the description of a particular class or differential as part of its name
+\def\sseq at obj@fullname#1{sseq.\sseq at thename.#1}
+\def\sseq at obj#1{\csname sseq.\sseq at thename.#1\endcsname}
+\def\sseq at obj@gdef#1{\@xptwo\gdef\sseq at obj{#1}}
+\def\sseq at obj@xdef#1{\@xptwo\xdef\sseq at obj{#1}}
+\def\sseq at obj@protectedxdef#1{\@xptwo\sseq at protected@xdef\sseq at obj{#1}}
+\def\sseq at obj@xodef#1{\@xp\gdef\csname \sseq at obj@fullname{#1}\@xp\endcsname\@xp}
+\def\sseq at obj@let#1{\@xptwo\let\sseq at obj{#1}}
+\def\sseq at obj@gletcsname#1#2{\global\@xp\let\csname\sseq at obj@fullname{#1}\@xp\endcsname\csname#2\endcsname}
+\def\sseq at obj@gletobj#1#2{\global\@xp\let\csname\sseq at obj@fullname{#1}\@xp\endcsname\csname\sseq at obj@fullname{#2}\endcsname}
+\def\sseq at obj@undef#1{\@xptwo\let\sseq at obj{#1}\relax}
+\def\sseq at obj@show#1{\@xptwo\show\sseq at obj{#1}}
+\def\sseq at obj@ifundef#1{\@ifundefined{\sseq at obj@fullname{#1}}}
+\def\sseq at obj@ifdef#1#2#3{\@ifundefined{\sseq at obj@fullname{#1}}{#3}{#2}}
+\def\sseq at obj@inc#1{\bgroup\sseq at tempcount\sseq at obj{#1}\relax\advance\sseq at tempcount\@ne\sseq at obj@xdef{#1}{\the\sseq at tempcount}\egroup}
+\def\sseq at obj@gaddto{\@xptwo\sseq at g@addto at macro\sseq at obj}
+\def\sseq at obj@xaddto{\@xptwo\sseq at x@addto at macro\sseq at obj}
+\def\sseq at obj@xaddto{\@xptwo\sseq at x@addto at macro\sseq at obj}
+\def\sseq at obj@xoaddto#1{\@xp\sseq at g@addto at macro\csname \sseq at obj@fullname{#1}\@xp\endcsname\@xp}
+\def\sseq at obj@map#1#2{\def\\##1{#2}\sseq at obj{#1}}
+
+
+\def\sseq at obj@ifchanged#1#2#3{\sseq at obj@ifundef{#1.changed}{#3}{#2}}
+\def\sseq at obj@changedtrue#1{\sseq at obj@gdef{#1.changed}{}}
+\def\sseq at obj@changedfalse#1{\sseq at obj@undef{#1.changed}}
+
+\def\sseq at cleanup@obj#1{
+    \ifsseq at keepchanges\else
+        \sseq at obj@ifchanged{#1}{}{
+            \sseq at obj@changedtrue{#1}
+            \sseq at x@addto at macro\sseq at pagecleanup{
+                \@xptwo\ifx\sseq at obj{#1}\relax
+                    \global\@nx\sseq at obj@let{#1}\relax
+                \else
+                    \@nx\sseq at obj@gdef{#1}{\unexpanded\@xpthree{\sseq at obj{#1}}}
+                \fi
+                \@nx\sseq at obj@changedfalse{#1}
+            }
+        }
+    \fi
+}
+
+
+%%%% Saved paths, temporary saved paths, background saved paths
+% \sseq at savedpaths@whatever is redefined to be \sseq at savedpaths@whatever at standard or \sseq at savedpaths@whatever at temporary depending on context
+% This simplifies the code a lot because I don't have to check again where I should put things.
+\sseq at addtostorelist\sseq at savedpaths{}
+\def\sseq at tempsavedpaths{}
+\def\sseq at savedpaths@addclass at standard#1{\sseq at x@addto at macro\sseq at savedpaths{\@nx\sseq at class@draw at ifpage{#1}}}
+\def\sseq at savedpaths@adddifferential at standard#1{\sseq at x@addto at macro\sseq at savedpaths{\@nx\sseq at differential@draw at ifpage{#1}}}
+\def\sseq at savedpaths@addstructline at standard#1{\sseq at x@addto at macro\sseq at savedpaths{\@nx\sseq at structline@draw at ifpage{#1}}}
+\def\sseq at savedpaths@add at standard{\sseq at g@addto at macro\sseq at savedpaths}
+\def\sseq at savedpaths@xadd at standard{\sseq at x@addto at macro\sseq at savedpaths}
+\def\sseq at savedpaths@show at standard{\show\sseq at savedpaths}
+\def\sseq at scope@savedpaths at add@standard#1{\sseq at savedpaths@add at standard{#1}\sseq at savedpaths@add at background{#1}}
+
+\def\sseq at savedpaths@addclass at temporary#1{\sseq at x@addto at macro\sseq at tempsavedpaths{\@nx\sseq at class@draw at ifpage{#1}}}
+\def\sseq at savedpaths@adddifferential at temporary#1{\sseq at x@addto at macro\sseq at tempsavedpaths{\@nx\sseq at differential@draw at ifpage{#1}}}
+\def\sseq at savedpaths@addstructline at temporary#1{\sseq at x@addto at macro\sseq at tempsavedpaths{\@nx\sseq at structline@draw at ifpage{#1}}}
+\def\sseq at savedpaths@add at temporary{\sseq at g@addto at macro\sseq at tempsavedpaths}
+\def\sseq at savedpaths@xadd at temporary{\sseq at x@addto at macro\sseq at tempsavedpaths}
+\def\sseq at savedpaths@show at temporary{\show\sseq at tempsavedpaths}
+\def\sseq at scope@savedpaths at add@temporary#1{\sseq at savedpaths@add at temporary{#1}\sseq at savedpaths@add at background{#1}}
+
+
+\def\sseq at savedpaths@addclass at background#1{\sseq at error@internal at n{illegal-add-background-mode}{\sseq at savedpaths@addclass}}
+\def\sseq at savedpaths@adddifferential at background#1{\sseq at error@internal at n{illegal-add-background-mode}{\sseq at savedpaths@adddifferential}}
+\def\sseq at savedpaths@addstructline at background#1{\sseq at error@internal at n{illegal-add-background-mode}{\sseq at savedpaths@addstructline}}
+\def\sseq at savedpaths@add at background{\sseq at g@addto at macro\sseq at savedbackgroundpaths}
+\def\sseq at savedpaths@xadd at background{\sseq at x@addto at macro\sseq at savedbackgroundpaths}
+\def\sseq at savedpaths@show at background{\show\sseq at savedbackgroundpaths}
+
+\def\sseq at savedpaths@addclass at ignore#1{}
+\def\sseq at savedpaths@adddifferential at ignore#1{}
+\def\sseq at savedpaths@addstructline at ignore#1{}
+\def\sseq at savedpaths@add at ignore#1{}
+\def\sseq at savedpaths@xadd at ignore#1{}
+\def\sseq at savedpaths@show at ignore#1{}
+\def\sseq at scope@savedpaths at add@ignore#1{}
+
+\def\sseq at setsavedpaths#1{%
+    \@xp\let\@xp\sseq at savedpaths@addclass       \csname sseq at savedpaths@addclass@#1\endcsname
+    \@xp\let\@xp\sseq at savedpaths@adddifferential\csname sseq at savedpaths@adddifferential@#1\endcsname
+    \@xp\let\@xp\sseq at savedpaths@addstructline  \csname sseq at savedpaths@addstructline@#1\endcsname
+    \@xp\let\@xp\sseq at savedpaths@add            \csname sseq at savedpaths@add@#1\endcsname
+    \@xp\let\@xp\sseq at savedpaths@xadd            \csname sseq at savedpaths@xadd@#1\endcsname
+    \pgfutil at ifundefined{sseq at scope@savedpaths at add@#1}{}{%
+        \@xp\let\@xp\sseq at savedpaths@show        \csname sseq at savedpaths@show@#1\endcsname
+        \@xp\let\@xp\sseq at scope@savedpaths at add   \csname sseq at scope@savedpaths at add@#1\endcsname
+    }%
+}
+
+\def\sseq at usesavedpaths{%
+    \sseq at savedpaths
+    \sseq at clearchangestyles
+    \sseq at tempsavedpaths
+    \gdef\sseq at tempsavedpaths{}%
+} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqloadstore.code.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmacromakers.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmacromakers.code.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmacromakers.code.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,389 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: sseqmacromakers.code.tex
+%% Exposes: \DeclareSseqCommand, \NewSseqCommand, \DeclareSseqGroup, \NewSseqGroup
+%%
+%%   Set up commands to define other commands, both the internal macros, and the external ones.
+%%   Also the internal macros \sseq at DeclareDocumentCommandAs and \sseq at DeclareDocumentCommand
+%%   For the user commands, sets up call stack, thiscall, etc
+%%
+
+
+
+\ExplSyntaxOn
+
+%%% \sseq at DeclareDocumentCommand
+%
+% \sseq at DeclareDocumentCommand\somecommand is shorthand for \sseq at DeclareDocumentCommandAs\sseq at somecommand\somecommand
+%
+% so the result is that it defines \sseq at somecommand intended to be \let to \somecommand later.
+%%% Install user commands
+% copy commands into user namespace by removing sseq@ prefixes
+% given a list of commands, \let\thiscommand\sseq at thiscommand on each one
+
+\def\sseq at recordmacros{\@xp\sseq at recordmacros@\sseq at macrolist\sseq at nil}
+\def\sseq at recordmacros@#1{%
+    \ifx#1\sseq at nil\else % if so, that was the last command in the list
+        \@xp\def\csname sseq at builtin\sseq at macroname#1\endcsname{}
+        \@xp\sseq at recordmacros@
+    \fi %
+}
+
+
+
+\def\sseq at installmacros{\@xp\sseq at installmacros@\sseq at macrolist\sseq at nil}
+\def\sseq at installmacros@#1{%
+    \ifx#1\sseq at nil\else % if so, that was the last command in the list
+        \@xp\let\@xp#1\csname sseq@\sseq at macroname#1\endcsname
+        \@xp\sseq at installmacros@
+    \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
+      {
+        \__xparse_add_arg:n {##1}
+        #2\l__xparse_args_tl #1
+      }
+    \l__xparse_fn_tl
+  }
+
+% 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 at install@xparse at Uarggrabber{ \cs_set_eq:NN \__xparse_grab_U:w \sseq__xparse_grab_U:w }
+
+%%% \sseq at DeclareDocumentCommand
+%
+% \sseq at DeclareDocumentCommand\somecommand is shorthand for \sseq at DeclareDocumentCommandAs\sseq at somecommand\somecommand
+%
+% so the result is that it defines \sseq at somecommand intended to be \let to \somecommand later.
+
+\cs_new_protected:Npn\sseq at DeclareDocumentCommand#1{%
+    \exp_args:Nc \sseq at DeclareDocumentCommandAs { sseq @ \cs_to_str:N #1 }#1
+}
+
+%%% \sseq at DeclareDocumentCommandAS
+%
+% #1 - the command to define
+% #2 - the command to use in argument parsing errors
+% #3 - parameters (\NewDocumentCommand style)
+% #4 - code
+%
+% 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 at 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
+    \sseq at installmsghooks
+    \def\sseq at error@setup{}
+    \def\sseq at error@cleanup{\sseq at errortrue}
+    \let\sseq at error@annotation\empty
+    \DeclareDocumentCommand #2 { #3 } { #4 }
+    \ifsseq at error
+        \group_end:
+        \sseq at errortrue % This only happens if it came from user code, so don't set error to be false so it can break out too.
+        \@xp\sseq at break
+    \fi
+    \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
+                \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 #1 \c_space_tl inner }
+        }
+        \pretocmd:cnnn { \cs_to_str:N #2 \c_space_tl code } { \endgroup } { } { \sseq at 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:NN #1 #2
+    }
+    \group_end: % In this case, I want to pass \sseq at errortrue out of the block, so I close the group before I break.
+    \sseq at breakpoint % So this breakpoint definitely should be after the \endgroup.
+}
+
+\cs_set_eq:NN \patchcmd:Nnnnn \patchcmd
+\cs_set_eq:NN \pretocmd:Nnnn  \pretocmd
+\cs_generate_variant:Nn \patchcmd:Nnnnn {cnfnn}
+\cs_generate_variant:Nn \pretocmd:Nnnn  {cfnn}
+\cs_generate_variant:Nn \pretocmd:Nnnn  {cnnn}
+
+\cs_new_protected:Npn\NewSseqCommand#1{%
+    \cs_if_free:cTF { sseq @ usermacro @ \cs_to_str:N #1 } { \DeclareSseqCommand#1 } { \sseq at error@x{usermacro-not-free}{\string#1} \use_none:nn }
+}
+
+\cs_new_protected:Npn\DeclareSseqCommand#1#2#3{%
+    \cs_if_exist:cTF { sseq @ builtin @ \cs_to_str:N #1 } {\sseq at error@x{wont-override-system-macro}{\string#1}\sseq at break} {}
+    \cs_if_free:cT { sseq @ usermacro @ \cs_to_str:N #1 } {
+        \sseq at x@addto at macro { \sseq at installmacros } { \let \exp_not:N #1 \exp_not:c { sseq @ usermacro @ \cs_to_str:N #1 } }
+    }
+    % 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 at DeclareDocumentCommandAs { sseq @ usermacro @ \cs_to_str:N #1 } #1 { #2 } {
+                #3
+            \endgroup
+        }%
+    \ifsseq at error
+        \global\sseq at errorfalse
+        \@xp\sseq at break
+    \fi
+    \sseq at parseargspec{#1}{#2}%
+    % 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 at 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}{
+            \@xp\endgroup
+            \@xp\begingroup
+            \the\sseq at temptoks
+            \sseq at atbeginusermacro@msgsetup
+        }{}{\error\sseq at error@x{usermacro-failed-patch}{\string#1}}
+    }{
+        \pretocmd:cfnn{ sseq @ usermacro @ \cs_to_str:N #1 }{
+            \@xp\begingroup
+            \the\sseq at temptoks
+            \sseq at atbeginusermacro@msgsetup
+        }{}{\error\sseq at 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 }
+    \ifsseq at inprogress
+        \cs_set_eq:Nc #1 { sseq @ usermacro @ \cs_to_str:N #1 }
+    \fi
+    \sseq at breakpoint
+}
+
+%%% Commands to help the user define "groups" of commands to be reused
+\def\sseqnewgroup at splitcoord#1,#2\sseq at nil{%
+    \sseq at eval{
+        \@nx\begin{scope}[xshift=#1,yshift=#2,\unexpanded\@xp{\sseq at options}]
+    }
+}
+
+% #1 -- command
+% #2 -- argspec
+% #3 -- body of function (long)
+\NewDocumentCommand\NewSseqGroup{mm+m}{\DeclareSseqGroup@\NewSseqCommand{#1}{#2}{#3}}
+\NewDocumentCommand\DeclareSseqGroup{mm+m}{\DeclareSseqGroup@\DeclareSseqCommand{#1}{#2}{#3}}
+
+% #1 -- \NewSseqCommand or \DeclareSseqCommand
+% #2 -- command
+% #3 -- argspec
+% #4 -- body of function (long)
+\long\def\DeclareSseqGroup@#1#2#3#4{%
+    \group_begin:
+    \let\sseq at parseargspec\@gobbletwo % Get rid of argparse so we can change what gets added for setting up thiscall
+    \sseq at temptoks\@xp{\sseq at SseqGroup@argspec} % This gets added to the outer command by DeclareSseqCommand
+%
+    \sseq at installmsghooks
+    \def\sseq at error@setup{}
+    \def\sseq at error@cleanup{\sseq at errortrue}
+    \let\sseq at error@annotation\empty
+%
+% 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
+        \end{scope}
+    }%
+    \ifsseq at error
+        \@xp\sseq at break
+    \fi
+    #1#2{od()}{%
+        \IfNoValueTF{##1}{\def\sseq at options{}}{\def\sseq at options{##1}}%
+        \IfNoValueTF{##2}{%
+            \sseq at eval{
+                \@nx\begin{scope}[\unexpanded\@xp{\sseq at options}]
+            }%
+        }{%
+            \sseqnewgroup at splitcoord##2\sseq at nil
+        }%
+        \csname sseq @ usermacro @ \sseq at macroname #2 @ helper \@xp\endcsname \@gobble % This gobble eats the endgroup added by sseqDeclareDocumentCommand
+    }%
+
+    \sseq at 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.    
+    \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 at temptoks
+            \sseq at atbeginusermacro@msgsetup
+        }{}{\error\sseq at 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
+    }{
+        \pretocmd:cfnn { sseq @ usermacro @ \cs_to_str:N #2 @ helper }{
+            \the\sseq at temptoks
+            \sseq at atbeginusermacro@msgsetup
+        }{}{\error\sseq at 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 at parseargspec\sseq at parseargspec@normal
+    \sseq at breakpoint
+    \group_end:
+}
+\let\sseqnewgroup\NewSseqGroup
+
+
+\bgroup\catcode`\#=12\relax
+    \gdef\sseq at SseqGroup@argspec{\sseq at eval{\sseq at temptoks{\IfNoValueF{#1}{\unexpanded{[#1]}}\IfNoValueF{#2}{\unexpanded{(#2)}}}}\@gobble}
+    \gdef\sseq at thearg{#\the\sseq at tempcount}
+\egroup
+
+
+% When there are arguments with default values (O, D, R, G), we need to put them into temporary macros to compare them and see if they are the default value
+% that's what temptoksii is for.
+\def\sseq at parseargspec#1#2{%
+    \sseq at tempcount=\z@
+    \sseq at temptoks{\@nx#1}% Holds the stuff that goes in \esetthiscall (so most stuff)
+    \sseq at temptoksii{}
+    \sseq at parseargspec@#2\sseq at nil
+    \sseq at eval{\sseq at temptoks{\the\sseq at temptoksii\@nx\sseq at usermacro@esetthiscall{\the\sseq at temptoks}}}
+}
+
+% For NewGroup:
+\let\sseq at parseargspec@normal\sseq at parseargspec
+\def\sseq at parseargspec@newgroup#1#2{%
+    \sseq at tempcount=\z@
+    \sseq at temptoks{}
+    \sseq at temptoksii{}%
+    \sseq at parseargspec@#2\sseq at nil
+    \sseq at eval{\sseq at temptoks{\the\sseq at temptoksii\@nx\sseq at usermacro@esetthiscall{\@nx\@nx\@nx#1\@nx\the\sseq at temptoks\the\sseq at temptoks}}}
+}
+
+
+\def\sseq at parseargspec@#1{
+    \advance\sseq at tempcount\@ne
+    \ifx#1\sseq at nil\else
+        \@xp\ifx\csname sseq at parseargspec@#1\@xp\endcsname\relax
+            \sseq at error@n{usermacro-unsupported-argument-type}{#1}
+        \else
+            \csname sseq at parseargspec@#1\@xptwo\endcsname
+        \fi
+    \fi
+}
+
+
+% Have to use \@alph to convert the number to a letter. Using a number here doesn't work because the control sequence gets retokenized
+% so we can only use letters in control sequences (another option would be to not expand the \csnames till later, but that would be harder).
+\def\sseq at parseargspec@ifargisnotdefault{%
+        \@nx\ifx
+            \@xp\@nx\csname sseq at parseargspec@temparg\@alph\sseq at tempcount\endcsname
+            \@xp\@nx\csname sseq at parseargspec@tempdefault\@alph\sseq at tempcount\endcsname
+    \unexpanded{%
+            \@xp\@gobble
+        \else
+            \@xp\@firstofone
+        \fi
+    }%
+}
+
+\def\sseq at parseargspec@setargdefault#1{%
+    \sseq at e@addto at toks\sseq at temptoksii{%
+        \def\@xp\@nx\csname sseq at parseargspec@temparg\@alph\sseq at tempcount\endcsname{\sseq at thearg}%
+        \def\@xp\@nx\csname sseq at parseargspec@tempdefault\@alph\sseq at tempcount\endcsname{\unexpanded{#1}}%
+    }
+}
+
+% Mandatory
+\def\sseq at parseargspec@m{%
+    \sseq at e@addto at temptoks{{\@nx\unexpanded{\sseq at thearg}}}
+    \sseq at parseargspec@
+}
+\def\sseq at parseargspec@l{%
+    \sseq at e@addto at temptoks{\@nx\unexpanded{\sseq at thearg}}
+    \sseq at parseargspec@
+}
+
+\def\sseq at parseargspec@u#1{%
+    \sseq at e@addto at temptoks{\@nx\unexpanded{\sseq at thearg}\unexpanded{\unexpanded{#1}}}
+    \sseq at parseargspec@
+}
+
+\def\sseq at parseargspec@U#1{%
+    \sseq at e@addto at temptoks{\@nx\unexpanded{\sseq at thearg}}
+    \sseq at parseargspec@
+}
+
+% Optional no default
+\def\sseq at parseargspec@o{%
+    \sseq at e@addto at temptoks{\@nx\IfNoValueF{\sseq at thearg}{[\@nx\unexpanded{\sseq at thearg}]}}
+    \sseq at parseargspec@
+}
+
+\def\sseq at parseargspec@d#1#2{%
+    \sseq at e@addto at temptoks{\@nx\IfNoValueF{\sseq at thearg}{\@nx\unexpanded{#1\sseq at thearg#2}}}
+    \sseq at parseargspec@
+}
+
+\def\sseq at parseargspec@r#1#2{ % technically required, but behaves like optional
+    \sseq at e@addto at temptoks{#1\@nx\unexpanded{\sseq at thearg}#2}
+    \sseq at parseargspec@
+}
+
+
+\def\sseq at parseargspec@g{%
+    \sseq at e@addto at temptoks{\@nx\IfNoValueF{\sseq at thearg}{\@nx\unexpanded{{\sseq at thearg}}}}
+    \sseq at parseargspec@
+}
+
+\def\sseq at parseargspec@s{%
+    \sseq at e@addto at temptoks{\@nx\IfBooleanT{\sseq at thearg}{*}}
+    \sseq at parseargspec@
+}
+
+\def\sseq at parseargspec@t#1{%
+    \sseq at e@addto at temptoks{\@nx\IfBooleanT{\sseq at thearg}{#1}}
+    \sseq at parseargspec@
+}
+
+
+
+\def\sseq at parseargspec@O#1{
+    \sseq at parseargspec@setargdefault{#1}%
+    \sseq at e@addto at temptoks{\sseq at parseargspec@ifargisnotdefault{\@nx\unexpanded{[\sseq at thearg]}}}%
+    \sseq at parseargspec@
+}
+\def\sseq at parseargspec@D#1#2#3{%
+    \sseq at parseargspec@setargdefault{#3}%
+    \sseq at e@addto at temptoks{\sseq at parseargspec@ifargisnotdefault{\@nx\unexpanded{#1\sseq at thearg#2}}}%
+    \sseq at parseargspec@
+}
+\def\sseq at parseargspec@R#1#2#3{%
+    \sseq at parseargspec@setargdefault{#3}%
+    \sseq at e@addto at temptoks{\sseq at parseargspec@ifargisnotdefault{\@nx\unexpanded{#1\sseq at thearg#2}}}%
+    \sseq at parseargspec@
+}
+\def\sseq at parseargspec@G#1{%
+    \sseq at parseargspec@setargdefault{#1}%
+    \sseq at e@addto at temptoks{\sseq at parseargspec@ifargisnotdefault{\@nx\unexpanded{{\sseq at thearg}}}}%
+    \sseq at parseargspec@
+}
+
+
+\ExplSyntaxOff
+
+%


Property changes on: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmacromakers.code.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,1123 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: sseqmain.code.tex
+%%
+%%    Defines the main environments and commands
+%%
+
+
+%%%%%%%
+%%%
+%%%  Environment definitions
+%%%
+%%%%%%%
+
+\sseq at addtostorelist\sseq at savedbackgroundpaths{}
+\sseq at addtostorelist\sseq at restorestyles{}
+
+\def\sseqdata{\@ifnextchar[{\sseqdata@}{\sseqdata@[]}}%}
+
+\def\sseq at page{\protect\sseq at thepage}
+
+\def\sseqdata@[#1]{%
+    \edef\sseq at restorefont{\font at name}
+    \selectfont\nullfont % Avoid space hazards!
+
+    \def\par{}
+%
+    \ifx\pgfpictureid\@undefined\else %Uh-oh, we're inside tikz.
+        \sseq at error@n{env-inside-tikz}{sseqdata}\@xp\sseq at breakdataenv
+    \fi
+    \ifsseq at inprogress % Uh-oh, we're already in a sseq environment. This is not good.
+        \sseq at error@n{env-inside-sseq}{sseqdata}\@xp\sseq at breakdataenv
+    \fi
+    \sseq at inprogresstrue
+    \def\sseq at sseqsetdirectory{/sseqpages}
+    \sseq at keepchangestrue
+    \sseq at storelist@setdefaults
+    \let\sseq at xtickfn\@firstofone\let\sseq at ytickfn\@firstofone % These are default functions, which addtostorelist can't handle.
+%
+    \ifx\sseq at xmin@default\sseq at infinity
+        \let\sseq at xminmax\sseq at xminmax@active
+    \fi
+    \ifx\sseq at ymin@default\sseq at infinity
+        \let\sseq at yminmax\sseq at yminmax@active
+    \fi
+    \ifsseq at mathnodes
+        \let\sseq at maybemathswitch=$\@gobble$
+    \fi
+%
+    % copy commands into the user namespace.
+    \sseq at installmacros
+    \sseq at installmsghooks
+    \sseq at install@xparse at Uarggrabber
+    \def\xmin{\protect\sseq at xmin}\def\xmax{\protect\sseq at xmax}
+    \def\ymin{\protect\sseq at ymin}\def\ymax{\protect\sseq at ymax}
+%
+    \sseq at modtikzcommands % Defer evaluation of tikz primitives
+    \sseq at patchfor % patch \foreach to work with deferred macros
+    \pgfkeys{/handlers/first char syntax/the character "/.initial=\sseq at handlequote} % install quotes parsing
+%
+%
+    \pgfqkeys{/sseqpages/global/name only}{#1}
+    \@ifundefined{sseq at thename}{\sseq at error{env-data-no-name}\sseq at breakdataenv}{}
+    \sseq at obj@ifundef{exists}{
+        \sseq at obj@gdef{exists}{}
+        \pgfqkeys{/sseqpages/global}{{\sseq at thename} options/.code={}}
+    }{
+        \ifsseq at updateexisting\else
+            \sseq at error@x{env-data-already-exist}{\sseq at thename}% this could be a warning
+        \fi
+        \sseq at restorestyles
+        \sseq at getcmds
+
+    }
+    \sseq at setsavedpaths{standard}
+%
+    % the default option handler for /sseqpages/global adds to \sseq at currentoptionpath options
+    \let\sseq at currentoptionpath\sseq at thename
+    \pgfqkeys{/sseqpages/global}{#1}
+    \ifx\sseq at targetx\pgfutil at empty\else
+        \sseq at hasdegreetrue
+    \fi
+    \sseq at eval{
+        \global\let\@xp\@nx\csname pgfk@/sseqpages/global/{\sseq at currentoptionpath} options/. at cmd\endcsname
+            \@xp\@nx\csname pgfk@/sseqpages/global/{\sseq at currentoptionpath} options/. at cmd\endcsname
+    }
+    \sseq at savedpaths@xadd{\sseq at stylelist}
+    \sseq at savedpaths@add{\begingroup} % prevent some of the two-pass user macros horrors
+}
+
+% Just store all the settings
+\def\endsseqdata{
+    \sseq at savedpaths@add{\endgroup} % prevent some of the two-pass user macros horrors
+    \xdef\sseq at restorestyles{\sseq at stylelist}
+    \sseq at storecmds
+    \ignorespacesafterend
+}
+
+\def\sseqpage{\@ifnextchar[{\sseqpage@}{\sseqpage@[]}} %]
+
+\def\sseqpage@[#1]{%
+    \edef\sseq at restorefont{\font at name}
+    \selectfont\nullfont % Avoid space hazards!
+    \def\par{}
+%
+    \ifx\pgfpictureid\@undefined\else %Uh-oh, we're inside tikz.
+        \sseq at error@n{env-inside-tikz}{sseqpage}\@xp\sseq at breakpageenv
+    \fi
+    \ifsseq at inprogress % Uh-oh, we're already in a sseq environment. This is not good.
+        \sseq at error@n{env-inside-sseq}{sseqpage}\@xp\sseq at breakpageenv
+    \fi
+    \sseq at inprogresstrue
+    \sseq at ispageenvtrue
+    \def\sseq at sseqsetdirectory{/sseqpages}
+%
+    \let\sseq at xminmax\sseq at xminmax@active
+    \let\sseq at yminmax\sseq at yminmax@active
+    \ifsseq at mathnodes
+        \let\sseq at maybemathswitch=$\@gobble$
+    \fi
+%
+    % Copy commands into user namespace
+    \sseq at installmacros
+    \sseq at installmsghooks
+    \sseq at install@xparse at Uarggrabber
+    \def\xmin{\protect\sseq at xmin}\def\xmax{\protect\sseq at xmax}
+    \def\ymin{\protect\sseq at ymin}\def\ymax{\protect\sseq at ymax}
+    \sseq at modtikzcommands % Redefine tikz primitives to store themselves in the appropriate place
+    \sseq at patchfor % Change foreach to record it's variable values in the appropriate places
+    \pgfkeys{/handlers/first char syntax/the character "/.initial=\sseq at handlequote}% install quotes parsing
+%
+    \gdef\sseq at pagecleanup{}% For undoing local option settings
+%
+    \def\sseq at thepage{0}% page defaults to 0
+    \sseq at thepagecount=\z@
+    \pgfqkeys{/sseqpages/global/name only}{#1}% Get the name
+    \sseq at tempiftrue
+    \ifsseq at hasname
+        \sseq at obj@ifundef{exists}{
+            \sseq at error@x{env-page-not-exist}{\sseq at thename} % This could be a warning
+            \sseq at obj@gdef{exists}{}
+            \let\sseq at currentoptionpath\sseq at thename
+            \pgfqkeys{/sseqpages/global}{{\sseq at thename} options/.code={}}
+            \sseq at keepchangestrue
+            \sseq at keepglobaloptionstrue
+            \sseq at setsavedpaths{standard}
+        }{
+            \sseq at restorestyles
+            \sseq at getcmds
+            \ifsseq at keepchanges
+                \sseq at setsavedpaths{standard}
+            \else
+                \sseq at setsavedpaths{temporary}
+            \fi
+            \sseq at tempiffalse
+            \def\sseq at currentoptionpath{this page}
+            \pgfqkeys{/sseqpages/global}{{this page} options/.code={},#1}
+        }
+    \else
+        \edef\sseq at thename{temp at sseq@number@\the\sseq at anonsseqcount}
+        \global\advance\sseq at anonsseqcount1
+        \sseq at setsavedpaths{temporary}
+    \fi
+    \ifsseq at tempif % Either the spectral sequence has no name, or it has a name but no such existed.
+        \sseq at storelist@setdefaults
+        \sseq at savedpaths@xadd{\sseq at stylelist}
+        \let\sseq at currentoptionpath\sseq at thename
+        \pgfqkeys{/sseqpages/global}{{\sseq at thename} options/.code={},{this page} options/.code={},#1}
+        \sseq at eval{
+            \global\let\@xp\@nx\csname pgfk@/sseqpages/global/{\sseq at currentoptionpath} options/. at cmd\endcsname
+                \@xp\@nx\csname pgfk@/sseqpages/global/{\sseq at currentoptionpath} options/. at cmd\endcsname
+        }
+    \fi
+    \sseq at savedpaths@xadd{\sseq at stylelist}
+    \sseq at savedpaths@add{\begingroup} % prevent some of the two-pass user macros horrors
+    \ifx\sseq at targetx\pgfutil at empty\else
+        \sseq at hasdegreetrue
+    \fi
+}
+
+% Here we do all of the work to actually print the page
+\def\endsseqpage{
+    \sseq at savedpaths@add{\endgroup} % prevent some of the two-pass user macros horrors
+    \ifx\sseq at xmin\sseq at infinity\sseq at error{no-range}\def\sseq at xmin{0}\def\sseq at xmax{0}\@xp\sseq at break\fi % could be warning
+    \ifx\sseq at ymin\sseq at infinity\sseq at error{no-range}\def\sseq at ymin{0}\def\sseq at ymax{0}\@xp\sseq at break\fi
+%
+    \tikzset{
+        z=0pt,
+        every path/.style={},
+        every node/.style={}
+    }
+    \let\errmessage\sseq at errmessage@std
+    \begin{tikzpicture}[/sseqpages/global/{default} options,\ifsseq at hasname/sseqpages/global/{\sseq at thename} options\fi,/sseqpages/global/{this page} options]%
+    \sseq at sseqstyle@globalpart
+    \pgftransformreset
+    \sseq at globaldetonetransform
+    \sseq at globalscaletransform
+%
+    \let\sseq at transform\sseq at error@illegaltransform % Disallow most coordinate transforms
+    \let\sseq at shifttransform\sseq at checkshifttransform % Allow shifts as long as they are by integers and have no units.
+%
+    \sseq at setupclip
+    \pgfonlayer{background}%
+    % Axes labels only occur once per page, so the cost of typesetting them with tikz doesn't matter ... THANK GOD
+    \ifx\sseq at title\pgfutil at empty\else
+        \ifsseq at drawtitle
+            \sseq at eval{\unexpanded{\path (0.5*\xmin+0.5*\xmax,\ymax) node[
+                /sseqpages/global/every title,
+                above=\sseq at clip@padding at top+\sseq at yaxis@end at extend+10pt
+            ]} {\unexpanded\expandafter{\sseq at title}};}
+        \fi
+    \fi
+    % Don't touch the shifts -- they are very persnickety.
+    \ifx\sseq at xaxislabel\pgfutil at empty\else\ifsseq at drawxaxislabel
+        \sseq at eval{\noexpand\node[/sseqpages/global/every x axis label, yshift=-\sseq at xaxisgap-\sseq at yaxis@start at extend-10pt] {\unexpanded\expandafter{\sseq at xaxislabel}};}
+    \fi\fi
+    \ifx\sseq at yaxislabel\pgfutil at empty\else\ifsseq at drawyaxislabel
+        \sseq at eval{\noexpand\node[/sseqpages/global/every y axis label,rotate=90,yshift=\sseq at yaxisgap+\sseq at xaxis@start at extend+10pt] {\unexpanded\expandafter{\sseq at yaxislabel}};}
+    \fi\fi
+    \sseq at handlexaxis % Draw the axis with pgf primitives. These are defined in sseqdrawing.code.tex
+    \sseq at handleyaxis
+    \sseq at grid
+    \endpgfonlayer
+%
+    \ifsseq at mathnodes
+        \tikzset{execute at begin node=$,execute at end node=$}%
+    \fi
+    %\let\sseq at error@setup\sseq at error@setup at withinfo
+    \begingroup
+    \sseq at savedbackgroundpaths
+    \endgroup
+%
+    \sseq at useclip
+%
+    \ifsseq at drawdifferentials\else
+        \let\sseq at differential@draw at ifpage\@gobble
+    \fi
+    \ifsseq at drawstructlines\else
+        \let\sseq at structline@draw at ifpage\@gobble
+    \fi
+%
+    \sseq at usesavedpaths
+%
+    \ifsseq at keepchanges
+        \xdef\sseq at restorestyles{\sseq at stylelist}
+    \fi
+    \end{tikzpicture}%
+    \ifsseq at keepchanges
+        \sseq at storecmds   % store changes
+    \else
+        \sseq at pagecleanup % undo any changes specific to this page
+    \fi
+    \sseq at breakpoint
+    \ignorespacesafterend
+}
+
+% Shorthand for sseqpage with empty body
+\def\printpage[#1]{%
+    \begin{sseqpage}[#1]
+    \end{sseqpage}%
+}
+
+%%% Scope
+\newcount\sseq at scope@savestackid
+\def\sseq at scope{\@ifnextchar[{\sseq at scope@}{\sseq at scope@[]}}%]
+\def\sseq at scope@[#1]{%
+    \sseq at scope@savedpaths at add{\begin{scope}}%
+    \sseq at processoptions{scope}{#1}% outputs into \sseq at savedoptioncode
+    \sseq at eval{\@nx\sseq at scope@savedpaths at add{\sseq at scope@toks{\unexpanded\@xp{\sseq at savedoptioncode\tikz at options}}}}%
+    %\advance\sseq at scope@savestackid\@ne
+    %\sseq at savestack@name{scope at save\the\sseq at scope@savestackid}
+}
+\def\sseq at endscope{%
+    \sseq at scope@savedpaths at add{\end{scope}}
+    %\sseq at restorestack@name{scope at save\the\sseq at scope@savestackid
+}
+
+
+
+
+\ifsseq at draftmode % Okay, have to dummy out all the main commands.
+    \sseq at setsavedpaths{ignore}     % Don't add stuff to paths
+    \let\sseq at 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 at defer@tikzcommand at option[#1]{%
+        \sseq at g@addto at macro\sseq at whattheusersaid{[#1]}%
+        \sseq at defer@tikzcommand@
+    } % These are the two expensive handlers, redefine them to do nothing.
+    \def\sseq at defer@tikzcommand at coord(#1){%
+        \sseq at g@addto at macro\sseq at whattheusersaid{(#1)}%
+        \sseq at defer@tikzcommand@
+    }
+
+
+    % All we want to do here is record the range. Have to process options in order to figure out where it is.
+    \sseq at DeclareDocumentCommand\class{or()}{%
+        \begingroup
+        \IfNoValueT{#2}{\sseq at break}%
+        \sseq at xsetthiscall{\string\class\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}%
+        \sseq at options@firstpassmode
+        \the\sseq at sseqstyle
+        \the\sseq at classstyle
+        \sseq at options@normalmode
+        \IfNoValueF{#1}{%
+            \sseq at processoptions{class}{#1}% Outputs result into \sseq at savedoptioncode
+        }%
+        \sseq at cparsecoord{#2}{}%
+        \sseq at xminmax{\xcoord}{\ycoord}%
+        \sseq at yminmax{\xcoord}{\ycoord}%
+        \sseq at pushstack@\coord % also need the class stack to calculate other \class commands.
+        \sseq at cleanup@obj{partcoord.(\partialcoord).numnodes}%
+        \sseq at cleanup@obj{partcoord.(\partialcoord).numnodespp}%
+        \ifnum\nodenum=\@ne
+            \sseq at obj@gdef{partcoord.(\partialcoord).numnodes}{0}%
+            \sseq at obj@gdef{partcoord.(\partialcoord).numnodespp}{1}%
+        \fi
+        \sseq at obj@xdef{partcoord.(\partialcoord).numnodes}{\nodenum}%
+        \sseq at obj@xdef{partcoord.(\partialcoord).numnodespp}{\the\numexpr\nodenum+1}%
+        \edef\classname{class.\coord[0]}%
+        \ifx\sseq at class@tag\pgfutil at empty\else
+            \sseq at obj@ifdef{partcoord.(\partialcoord).tag.\sseq at class@tagprefix\sseq at class@tag}{%
+                \sseq at error@xx{class-tag-already-defined}{\sseq at class@tagprefix\sseq at class@tag}{(\partialcoord)}% could be warning
+            }{}%
+            \sseq at cleanup@obj{partcoord.(\partialcoord).tag.\sseq at class@tagprefix\sseq at class@tag}%
+            \sseq at obj@xdef{partcoord.(\partialcoord).tag.\sseq at class@tagprefix\sseq at class@tag}{\nodenum}%
+        \fi
+        \ifx\sseq at class@name\pgfutil at empty\else
+            \sseq at cleanup@obj{class.\classname.name}
+            \sseq at cleanup@obj{class.namedclass.\sseq at class@name}
+            \sseq at namehandler
+            \sseq at obj@xdef{class.\classname.name}{\sseq at class@name}
+            \sseq at obj@xdef{class.namedclass.\sseq at class@name}{\coordnopar}
+        \fi
+        \sseq at breakpoint
+        \endgroup
+    }
+
+    % Now the rest of these can be no-ops
+    \sseq at DeclareDocumentCommand\classoptions{or()}{}
+    \sseq at DeclareDocumentCommand\replaceclass{or()}{}
+    \sseq at DeclareDocumentCommand\d{oU(r()d()}{}
+    \sseq at DeclareDocumentCommand\doptions{oU(r()d()}{}
+    \sseq at DeclareDocumentCommand\structline{or()r()}{}
+    \sseq at DeclareDocumentCommand\structlineoptions{or()r()}{}
+    \sseq at DeclareDocumentCommand\circleclasses{or()r()}{}
+    \endinput
+\fi
+
+
+\protected\def\sseq at xcoord{}\protected\def\sseq at ycoord{}
+
+%%%%%
+%%
+%% The main commands
+%%
+%%%%%
+%%% \class, \classoptions, \replaceclass
+\sseq at DeclareDocumentCommand\class{or()}{%
+    \begingroup
+    \IfNoValueT{#2}{\sseq at break}
+    \sseq at xsetthiscall{\string\class\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}%
+    \sseq at options@firstpassmode
+    \the\sseq at sseqstyle
+    \the\sseq at classstyle
+    \the\sseq at scope@toks
+    \sseq at options@normalmode
+    \IfNoValueF{#1}{%
+        \sseq at processoptions{class}{#1}% Outputs result into \sseq at savedoptioncode
+    }%
+%
+    \@ifundefined{sseq at class@page}{}{\sseq at error@xxx{cmdoptions-only}{page}      {\string\class}{\string\classoptions}}% could be warnings
+    \@ifundefined{sseq at gen} {}{\sseq at error@xxx{cmdoptions-only}{generation}{\string\class}{\string\classoptions}}
+%
+    \sseq at cparsecoord{#2}{}%
+    \ifnum\csname sseq@\sseq at classpattern @maxclasses\endcsname<\nodenum\relax
+        \sseq at error@xxxx{classpattern-too-many-classes}{(\partialcoord)}{\nodenum}{\sseq at classpattern}{\@xp\the\csname sseq@\sseq at classpattern @maxclasses\endcsname}
+        \sseq at breakfi
+    \fi
+    \sseq at processlabels
+%
+    \sseq at xminmax{\xcoord}{\ycoord}%
+    \sseq at yminmax{\xcoord}{\ycoord}%
+    \sseq at cleanup@obj{partcoord.(\partialcoord).numnodes}%
+    \sseq at cleanup@obj{partcoord.(\partialcoord).numnodespp}%
+    \ifnum\nodenum=\@ne
+        \sseq at obj@gdef{partcoord.(\partialcoord).numnodes}{0}%
+        \sseq at obj@gdef{partcoord.(\partialcoord).numnodespp}{1}%
+    \fi
+    \sseq at obj@xdef{partcoord.(\partialcoord).numnodes}{\nodenum}%
+    \sseq at obj@xdef{partcoord.(\partialcoord).numnodespp}{\the\numexpr\nodenum+1}%
+    \edef\classname{class.\coord[0]}%
+    \ifx\sseq at class@tag\pgfutil at empty\else
+        \sseq at obj@ifdef{partcoord.(\partialcoord).tag.\sseq at class@tagprefix\sseq at class@tag}{
+            \sseq at error@xx{class-tag-already-defined}{\sseq at class@tagprefix\sseq at class@tag}{(\partialcoord)}% could be warning
+        }{}
+        \sseq at cleanup@obj{class.\coord.tag}
+        \sseq at obj@xdef{class.\coord.tag}{\sseq at class@tagprefix\sseq at class@tag}
+        \sseq at cleanup@obj{partcoord.(\partialcoord).tag.\sseq at class@tagprefix\sseq at class@tag}
+        \sseq at obj@xdef{partcoord.(\partialcoord).tag.\sseq at class@tagprefix\sseq at class@tag}{\nodenum}%
+    \fi
+    \ifx\sseq at class@name\pgfutil at empty\else
+        \sseq at cleanup@obj{class.\classname.name}
+        \sseq at cleanup@obj{class.namedclass.\sseq at class@name}
+        \sseq at namehandler
+        \sseq at obj@xdef{class.\classname.name}{\sseq at class@name}
+        \sseq at obj@xdef{class.namedclass.\sseq at class@name}{\coordnopar}
+    \fi
+    \ifcsname sseq at class@showname\endcsname
+        \sseq at eval{\@nx\sseq at handleclassquotes{\sseq at obj{class.\classname.name}}{\sseq at class@showname}}
+    \fi
+    \sseq at pushstack@\coord
+%
+%
+    \sseq at obj@gdef{class.\coord.num}{0}% For \replaceclass
+    \sseq at obj@xdef{\classname.page}{\sseq at infinity}%
+    \sseq at obj@xodef{\classname.options}{\sseq at savedoptioncode}%
+    \sseq at obj@xodef{\classname.nodetext}{\sseq at classnodetext}%
+    \sseq at obj@xodef{\classname.nodetext.options}{\sseq at classnodetextoptions}%
+    \sseq at obj@xodef{\classname.labelnodes}{\sseq at classlabelnodes}%
+    \sseq at obj@xdef{class.\coord.x}{\xcoord}%
+    \sseq at obj@xdef{class.\coord.y}{\ycoord}%
+    \sseq at obj@gdef{\classname.dependencies}{}%
+    \sseq at obj@xdef{\classname.needstikz}{\ifsseq at needstikz\@nx\sseq at needstikztrue\fi}%
+    \@ifundefined{sseq at tempoffset}{}{%
+        \tikz at scan@one at point\sseq at setoffset\sseq at tempoffset
+    }%
+    \ifx\sseq at tooltip\pgfutil at empty\else
+        \sseq at obj@protectedxdef{\classname.tooltip}{\sseq at tooltip}
+    \fi
+%
+    \sseq at savedpaths@addclass{class.\coord}%
+    \sseq at obj@gdef{class.\coord.style}{}%
+    \sseq at breakpoint
+    \endgroup
+}
+\def\sseq at setoffset#1{\sseq at obj@gdef{\classname.offset}{\pgftransformshift{#1}}}
+
+\sseq at DeclareDocumentCommand\classoptions{or()}{%
+    \begingroup
+    \sseq at xsetthiscall{\classoptions\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}%
+    \IfNoValueT{#1}{\sseq at error@x{cmdoptions-without-options}{\string\classoptions}\sseq at break}% could be warning
+    \IfNoValueT{#2}{\sseq at break}%
+    \sseq at options@firstpassmode
+    \the\sseq at sseqstyle
+    \the\sseq at classstyle
+    \the\sseq at scope@toks
+    \sseq at options@normalmode
+    \let\sseq at processlabels\sseq at processlabels@default % Don't double dip on labels from the scope or classstyle
+    \sseq at processoptions{class}{#1}% Outputs result into \sseq at savedoptioncode
+%
+    \sseq at parsecoord\coord{#2}{\string\classoptions}%
+%
+    \sseq at processlabels
+%
+    \let\partialcoord\coord at partial
+    \@ifundefined{sseq at class@page}{%
+        \@ifundefined{sseq at gen}{
+            \@ifundefined{sseq at thepage}{
+                \edef\sseq at gen{\sseq at obj{class.\coord.num}}
+            }{
+                \sseq at obj@pagetogen{class.\coord}{\sseq at thepage} % stores in \sseq at gen
+            }
+            \let\sseq at genmax\sseq at gen
+        }{
+            \ifnum\sseq at gen<\z@
+                \edef\sseq at gen{\the\numexpr\sseq at obj{class.\coord.num}+\sseq at gen+1}
+            \fi
+            \@ifundefined{sseq at genmax}{\let\sseq at genmax\sseq at gen}{
+                \edef\sseq at genmax{\the\numexpr\sseq at obj{class.\coord.num}+\sseq at genmax+1}
+            }
+        }
+    }{
+        \@ifundefined{sseq at gen}{}{\sseq at error{classoptions-page-gen}}% This could be a warning
+        \sseq at class@getgen{\sseq at class@page}
+        \@ifundefined{sseq at class@pagemax}{
+            % If no max is present, apply options to all pages starting at specified minimum
+            \edef\sseq at genmax{\sseq at obj{class.\coord.num}}%
+            \let\sseq at class@pagemax\sseq at infinity % ensure if "page" is defined, "pagemax" is defined too
+        }{
+            \let\sseq at genmin\sseq at gen
+            \sseq at class@getgen{\sseq at class@pagemax}
+            \let\sseq at genmax\sseq at gen
+            \let\sseq at gen\sseq at genmin
+        }
+        \edef\sseq at class@page{\the\numexpr\sseq at class@page-\@ne}
+        \edef\sseq at class@pagemax{\the\numexpr\sseq at class@pagemax+\@ne}
+    }
+    \ifnum\sseq at gen=\m at ne
+        \edef\sseq at gen{\sseq at obj{class.\coord.num}}
+    \fi
+    \edef\classname{class.\coord[\sseq at gen]}
+    \ifsseq at keepchanges\else
+        \ifnum\sseq at thepagecount>\sseq at obj{\classname.page}\relax
+            \sseq at error@xxx{classoptions-already-dead}{\sseq at gen}{\coordname}{\sseq at obj{\classname.page}}
+            \sseq at breakfifi
+        \fi
+        \ifnum\sseq at gen>\z@
+            \ifnum\sseq at thepagecount>\sseq at obj{class.\coord[\the\numexpr\sseq at gen-\@ne].page}\relax\else
+                \sseq at error@xx{classoptions-not-yet-born}{\sseq at gen}{\coord}{\sseq at class@page}%
+                \sseq at breakfififi
+            \fi
+        \fi
+    \fi{}
+    \ifx\sseq at class@tag\pgfutil at empty\else
+        \sseq at obj@ifdef{partcoord.(\partialcoord).tag.\sseq at class@tagprefix\sseq at class@tag}{%
+            \sseq at error@nn{class-tag-already-defined}{\sseq at class@tagprefix\sseq at class@tag}{\sseq at partialcoord}% could be warning
+        }%
+        \sseq at cleanup@obj{class.\coord.tag}%
+        \sseq at obj@xdef{class.\coord.tag}{\sseq at class@tagprefix\sseq at class@tag}%
+        \sseq at cleanup@obj{partcoord.(\partialcoord).tag.\sseq at class@tagprefix\sseq at class@tag}%
+        \sseq at obj@xdef{partcoord.(\partialcoord).tag.\sseq at class@tagprefix\sseq at class@tag}{\sseq at index}%
+    \fi
+    \ifx\sseq at class@name\pgfutil at empty\else
+        \sseq at obj@ifdef{class.\classname.name}{
+            \sseq at error@nn{classoptions-class-already-named}{\coord}{\sseq at obj{class.\classname.name}}%could be warning
+        }{}
+        \sseq at cleanup@obj{class.\classname.name}
+        \sseq at cleanup@obj{class.namedclass.\sseq at class@name}
+        \sseq at namehandler
+        \sseq at obj@xdef{class.\classname.name}{\sseq at class@name}
+        \sseq at obj@xdef{class.namedclass.\sseq at class@name}{\coordnopar}
+    \fi
+    \ifcsname sseq at class@showname\endcsname
+        \sseq at eval{\@nx\sseq at handleclassquotes{\sseq at obj{class.\classname.name}}{\sseq at class@showname}}
+    \fi
+    \sseq at tempcount=\sseq at gen\relax
+    \advance\sseq at tempcount\m at ne
+    \loop
+        \advance\sseq at tempcount\@ne
+        \edef\classname{class.\coord[\the\sseq at tempcount]}
+        \sseq at cleanup@obj{\classname.options}
+        \sseq at classoptions@setup at pagerange
+        \sseq at classoptions@obj at addto@withpagerange{\classname.options}{\sseq at savedoptioncode}
+    %
+        \ifx\sseq at classnodetext\pgfutil at empty\else
+            \sseq at cleanup@obj{\classname.nodetext}
+            \sseq at classoptions@obj at addto@withpagerange{\classname.nodetext}{\sseq at classnodetext}
+        \fi
+        \ifx\sseq at classnodetextoptions\pgfutil at empty\else
+            \sseq at cleanup@obj{\classname.nodetext.options}
+            \sseq at classoptions@obj at addto@withpagerange{\classname.nodetext.options}{\sseq at classnodetextoptions}
+        \fi
+        \ifx\sseq at classlabelnodes\pgfutil at empty\else
+            \sseq at cleanup@obj{\classname.labelnodes}
+            \sseq at classoptions@obj at addto@withpagerange{\classname.labelnodes}{\sseq at classlabelnodes}
+        \fi
+        \@ifundefined{sseq at tempoffset}{}{
+            \sseq at cleanup@obj{\classname.offset}
+            \tikz at scan@one at point\sseq at setoffset\sseq at tempoffset
+        }
+    \ifnum\sseq at tempcount<\sseq at genmax\repeat
+    \sseq at breakpoint
+    \endgroup
+}
+\def\sseq at classoptions@setup at pagerange{%
+    \@ifundefined{sseq at class@page}{
+        \def\sseq at classoptions@obj at addto@withpagerange@{\sseq at obj@gaddto{\sseq at tempobj}}
+    }{
+        \def\sseq at temp##1{##1}
+        \ifnum\sseq at tempcount=\sseq at gen\relax
+            \sseq at eval{\@nx\pretocmd\@nx\sseq at temp{\@nx\ifnum\sseq at thepagecount>\sseq at class@page\relax}{}{%
+                \@nx\sseq at error@x{this-shouldnt-happen}{file main, function \string\sseq at classoptions@setup at pagerange}
+            }}%
+            \apptocmd\sseq at temp{\fi}{}{\sseq at error@x{this-shouldnt-happen}{file main, function \string\sseq at classoptions@setup at pagerange}}
+        \fi
+        \ifnum\sseq at tempcount=\sseq at genmax\relax
+            \sseq at eval{\@nx\pretocmd\@nx\sseq at temp{\@nx\ifnum\sseq at thepagecount<\sseq at class@pagemax\relax}{}{\@nx\sseq at error@internal{}}}
+            \apptocmd\sseq at temp{\fi}{}{\sseq at error@internal{this-shouldnt-happen}{file main, function \string\sseq at classoptions@setup at pagerange}}
+        \fi
+        \@xp\def\@xp\sseq at temp\@xp##\@xp1\@xp{\@xp{\sseq at temp{##1}}}
+        \pretocmd\sseq at temp{\sseq at obj@gaddto{\sseq at tempobj}}{}{\sseq at error@internal{this-shouldnt-happen}{file main, function \string\sseq at classoptions@setup at pagerange}}
+        \let\sseq at classoptions@obj at addto@withpagerange@\sseq at temp
+    }
+}
+\def\sseq at classoptions@obj at addto@withpagerange#1#2{%
+    \def\sseq at tempobj{#1}%
+    \@xp\sseq at classoptions@obj at addto@withpagerange@\@xp{#2}%
+}
+\def\sseq at class@getgen#1{
+    \bgroup
+        \ifnum\sseq at obj{class.\coord.num}>\z@
+            \sseq at eval{\unexpanded{\sseq at obj@pagetogen{class.\coord}}{#1}} % stores in \sseq at gen
+        \else
+            \def\sseq at gen{0}
+        \fi
+        \sseq at smuggle@macro\sseq at gen
+    \egroup
+}
+\sseq at DeclareDocumentCommand\replaceclass{or()}{%
+    \begingroup
+    \sseq at xsetthiscall{\string\replaceclass\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}
+    \sseq at options@firstpassmode
+    \the\sseq at sseqstyle
+    \the\sseq at classstyle
+    \the\sseq at scope@toks
+    \sseq at options@normalmode
+    \IfNoValueF{#1}{%
+        \sseq at processoptions{class}{#1}% Outputs result into \sseq at savedoptioncode
+    }%
+%
+    \sseq at parsecoord\coord{#2}{\string\replaceclass}
+    \sseq at processlabels
+%
+    \sseq at ifundefcoord\coord{\sseq at error@x{replaceclass-no-class}{\coordname}\sseq at break}{}
+    \sseq at ifdead\coord{}{\sseq at error@x{replaceclass-not-dead-yet}{\coordname}\sseq at break}
+    \ifsseq at keepchanges\else
+        \ifnum\the\numexpr\sseq at obj{class.\coord[\sseq at obj{class.\coord.num}].page}<\sseq at thepagecount\else
+            \edef\sseq at temp{\sseq at obj{class.\coord[\sseq at obj{class.\coord.num}].page}}
+            \sseq at error@xxx{replaceclass-no-effect-on-this-page}{\coord}{\sseq at temp}{\the\numexpr\sseq at temp+\@ne}% warning
+            \sseq at breakfifi
+        \fi
+    \fi
+    \let\partialcoord\coord at partial
+    \ifx\sseq at class@tag\pgfutil at empty\else
+        \sseq at obj@ifdef{partcoord.(\partialcoord).tag.\sseq at class@tagprefix\sseq at class@tag}{%
+            \sseq at error@nn{class-tag-already-defined}{\sseq at class@tagprefix\sseq at class@tag}{\sseq at partialcoord}% could be warning
+        }{}%
+        \sseq at cleanup@obj{partcoord.(\partialcoord).tag.\sseq at class@tagprefix\sseq at class@tag}%
+        \sseq at obj@xdef{partcoord.(\partialcoord).tag.\sseq at class@tagprefix\sseq at class@tag}{\nodenum}%
+    \fi
+    \ifx\sseq at class@name\pgfutil at empty\else
+        \sseq at cleanup@obj{class.\classname.name}
+        \sseq at cleanup@obj{class.namedclass.\sseq at class@name}
+        \sseq at namehandler
+        \sseq at obj@xdef{class.\classname.name}{\sseq at class@name}
+        \sseq at obj@xdef{class.namedclass.\sseq at class@name}{\coordnopar}
+    \fi
+    \ifcsname sseq at class@showname\endcsname
+        \sseq at eval{\@nx\sseq at handleclassquotes{\sseq at obj{class.\classname.name}}{\sseq at class@showname}}
+    \fi
+    \sseq at cleanup@obj{class.\coord.num}
+    \sseq at obj@inc{class.\coord.num}
+    \let\partialcoord\coord at partial
+    \ifx\sseq at class@tag\pgfutil at empty\else
+        \sseq at obj@ifdef{partialcoord.(\partialcoord).tag.\sseq at class@tagprefix\sseq at class@tag}{%
+            \sseq at error@nn{class-tag-already-defined}{\sseq at class@tagprefix\sseq at class@tag}{\sseq at partialcoord}% could be warning
+        }{}%
+        \sseq at obj@xdef{partialcoord.(\partialcoord).tag.\sseq at class@tagprefix\sseq at class@tag}{\nodenum}%
+    \fi
+    \edef\classname{class.\coord[\sseq at obj{class.\coord.num}]}
+%
+    \sseq at obj@xdef{\classname.page}{\sseq at infinity}
+    \sseq at obj@xodef{\classname.options}{\sseq at savedoptioncode}
+    \sseq at obj@xodef{\classname.nodetext}{\sseq at classnodetext}
+    \sseq at obj@xodef{\classname.nodetext.options}{\sseq at classnodetextoptions}
+    \sseq at obj@xodef{\classname.labelnodes}{\sseq at classlabelnodes}
+    \sseq at obj@gdef{\classname.dependencies}{}
+    \sseq at obj@xdef{\classname.needstikz}{\ifsseq at needstikz\@nx\sseq at needstikztrue\fi}
+    \@ifundefined{sseq at tempoffset}{}{\tikz at scan@one at point\sseq at setoffset\sseq at tempoffset}
+%
+    \sseq at breakpoint
+    \endgroup
+}
+\def\sseq at class@draw at ifpage#1{
+    \bgroup
+    \sseq at obj@pagetogen{#1}{\sseq at thepage} % sets \sseq at gen
+    \ifnum\sseq at gen>\m at ne % -1 means no class to print
+        \ifnum\sseq at obj{#1[\sseq at gen].page}=\sseq at thepagecount
+            \sseq at thispagetrue
+        \fi
+        \sseq at gsetthiscall{class #1}
+        \sseq at class@drawnode{#1[\sseq at gen]}
+    \fi
+    \egroup
+}
+% #1 -- class
+% #2 -- page
+% If there is a class #1 drawn on page #2, set \sseq at gen to be the generation of that class, otherwise set \sseq at gen to be -1.
+\def\sseq at obj@pagetogen#1#2{
+    \bgroup
+        \def\sseq at gen{-1}
+        \sseq at tempcount=\m at ne
+        \sseq at tempcountb=\sseq at obj{#1.num}\relax
+        \loop
+            \advance\sseq at tempcount\@ne
+            \ifnum\sseq at obj{#1[\the\sseq at tempcount].page}<#2\relax\else
+                \edef\sseq at gen{\the\sseq at tempcount}
+                \sseq at tempcount=\sseq at tempcountb\relax
+            \fi
+        \ifnum\sseq at tempcount<\sseq at tempcountb\repeat
+        \sseq at smuggle@macro\sseq at gen
+    \egroup
+}
+%%%
+%%% \d and \doptions
+%%%
+
+\sseq at DeclareDocumentCommand\d{oU(r()d()}{%
+    \sseq at d@{d}{#1}{#2}{#3}{#4}%
+}
+\sseq at DeclareDocumentCommand\doptions{oU(r()d()}{%
+    \begingroup
+    \IfNoValueT{#1}{
+        \sseq at xsetthiscall{\@xp\string\csname#1\endcsname\unexpanded{#2(#3)}\IfNoValueF{#4}{\unexpanded{(#4)}}}%
+        \sseq at error@x{cmdoptions-without-options}{\string\doptions}\sseq at break % could be warning
+    }
+    \sseq at d@{doptions}{#1}{#2}{#3}{#4}%
+    \sseq at breakpoint
+    \endgroup
+}
+\def\sseq at d@#1#2#3#4#5{%
+    \begingroup
+    \sseq at options@firstpassmode
+    \the\sseq at sseqstyle
+    \the\sseq at edgestyle
+    \the\sseq at differentialstyle
+    \the\sseq at scope@toks
+    \sseq at options@normalmode
+    \IfNoValueF{#2}{
+        \sseq at processoptions{differential}{#2}% Outputs result into \sseq at savedoptioncode
+    }
+    \sseq at xsetthiscall{\@xp\string\csname#1\endcsname\IfNoValueF{#2}{\unexpanded{[#2]}}\unexpanded{#3(#4)}\IfNoValueF{#5}{\unexpanded{(#5)}}}%
+    \sseq at ifintexpr{#3}{%
+        \sseq at tempcount=\numexpr#3\relax % this is a convenient way to get rid of spaces because #3 has to be a number
+    }{%
+        \sseq at error@n{d-invalid-page}{#3}\sseq at break%
+    }%
+    \@xp\sseq at dparsecoord\@xp{\the\sseq at tempcount}{#4}{#5}%
+    \sseq at eval{\unexpanded{\csname sseq at d@#1\endcsname{#2}}{\the\sseq at tempcount}}%
+    \sseq at breakpoint
+    \endgroup
+}
+
+% #1 -- options
+% #2 -- page
+% #3 -- source coordinate
+\def\sseq at d@d#1#2{%%
+    \sseq at d@setpageminrec{class.\source}{#2}{source}%  automatically handles \sseq at cleanup@obj
+    \sseq at d@setpageminrec{class.\target}{#2}{target}
+%
+    \ifsseq at drawdifferential
+        \sseq at obj@gdef{d.#2\source\target.page}{#2}
+        \sseq at obj@gdef{d.#2\source\target.style}{}%
+        \sseq at obj@xdef{d.#2\source\target.source}{\source}
+        \sseq at obj@xdef{d.#2\source\target.target}{\target}
+        \sseq at obj@xdef{d.#2\source\target.options}{\ifsseq at needstikz\@nx\sseq at needstikztrue\fi\unexpanded\@xp{\sseq at savedoptioncode}}
+%
+        \sseq at savedpaths@adddifferential{d.#2\source\target}%
+    \else
+        \sseq at obj@gdef{d.#2\source\target.invisible}{}
+    \fi
+}
+\def\sseq at d@doptions#1#2{%
+    \sseq at obj@ifundef{d.#2\source\target.options}{\sseq at error@n{cmdoptions-feature-doesn't-exist}{differential}\sseq at break}{}%
+    \sseq at obj@ifdef{d.#2\source\target.invisible}{\sseq at error{doptions-invisible}\sseq at break}
+    \ifsseq at keepchanges\else
+        \@ifundefined{sseq at thepage}{}{
+            \ifnum#2=\sseq at thepagecount\else\ifnum\sseq at thepagecount=\z@\else
+                \sseq at error@n{doptions-no-effect-on-this-page}{#2}\sseq at breakfififi
+            \fi\fi
+        }%
+    \fi
+%
+    \sseq at cleanup@obj{d.#2\source\target.options}
+    \sseq at obj@xoaddto{d.#2\source\target.options}{\sseq at savedoptioncode}
+}
+
+% Some helper macros:
+% #1 -- class name for \sseq at obj
+% #2 -- page
+% #3 -- source or target for error handling purposes.
+\def\sseq at d@setpageminrec#1#2#3{% not really recursive.
+    \sseq at cleanup@obj{#1[\sseq at obj{#1.num}].page}
+    \sseq at cleanup@obj{#1[\sseq at obj{#1.num}].deathinfo}
+    \sseq at cleanup@obj{#1[\sseq at obj{#1.num}].deathline}
+    \sseq at d@setpageclass{#1}{#2}{#3}
+    \sseq at obj@map{#1[\sseq at obj{#1.num}].dependencies}{
+        \sseq at d@setpagemin{##1}{#2} % automatically handles cleanup
+    }
+}
+
+% #1 -- class name for \sseq at obj
+% #2 -- page
+% #3 -- source or target for error handling purposes.
+\def\sseq at d@setpageclass#1#2#3{
+    \edef\sseq at classgenname{#1[\sseq at obj{#1.num}]}
+    % If the class is dead, then it's only not an error if it died on the current page
+    \ifnum\sseq at obj{\sseq at classgenname.page}<\sseq at infinitycount
+        % If the page it died on is greater than this one, hit-wrong-order error
+        \ifnum\sseq at obj{\sseq at classgenname.page}>#2\relax
+            \let\sseq at deadclass@genname\sseq at classgenname
+            \sseq at preparestacktrace
+            \sseq at error@xxxx{d-hit-wrong-order}{#3}{\csname #3name\endcsname}{#2}{\the\sseq at temptoks}
+            \sseq at breakfifi
+        \fi
+        % If the page it died on is less than this one, class-already-hit error
+        \ifnum\sseq at obj{\sseq at classgenname.page}<#2\relax
+            \let\sseq at deadclass@genname\sseq at classgenname
+            \sseq at preparestacktrace
+            \sseq at error@xxxx{d-class-already-hit}{#3}{\csname #3name\endcsname}{#2}{\the\sseq at temptoks}
+            \sseq at breakfifi
+        \fi
+    \fi
+    % If the class has been replaced before, that's only okay if it was replaced on a previous page.
+    \ifnum\sseq at obj{#1.num}>\z@
+        \sseq at tempcount=\sseq at obj{#1.num}\relax
+        \advance\sseq at tempcount\m at ne
+        \ifnum\sseq at obj{#1[\the\sseq at tempcount].page}<#2\relax\else
+            \ifnum#2=\sseq at obj{#1[\the\sseq at tempcount].page}
+                 \sseq at error@xxxx{d-hit-same-page-replaceclass}{#3}{\csname #3name\endcsname}{#2}{\sseq at obj{#1[\the\sseq at tempcount].deathinfo}}
+                 \sseq at breakfififi
+            \else
+                \edef\sseq at deadclass@genname{#1[\the\numexpr\sseq at obj{#1.num}-\@ne]}
+                \sseq at preparestacktrace
+                \sseq at error@xxxx{d-hit-wrong-order}{#3}{\csname #3name\endcsname}{#2}{\the\sseq at temptoks}
+                \sseq at breakfififi
+            \fi
+        \fi
+    \fi
+    \sseq at obj@xdef{\sseq at classgenname.page}{#2}
+    \sseq at obj@xdef{\sseq at classgenname.deathinfo}{#3 of differential \sseq at thiscall\space on page #2}
+    \bgroup
+    \def\foreach{\@nx\@nx\@nx\foreach}
+    \protected\def\\{}
+    \let\sseq at possibleperiod\empty
+    \let\sseq at possibleperiodb\empty
+    \sseq at obj@xdef{\sseq at classgenname.deathlocation}{%
+        on input line \the\inputlineno\sseq at error@inforeachloop
+    }
+    \sseq at obj@xdef{\sseq at classgenname.deathline}{\the\inputlineno}
+    \sseq at tempiffalse
+    \edef\sseq at temp{\the\sseq at foreachcall}
+    \ifx\sseq at temp\pgfutil at empty\else\sseq at tempiftrue\fi
+    \ifx\sseq at restofstacktrace\pgfutil at empty\else\sseq at tempiftrue\fi
+    \sseq at obj@xdef{\sseq at classgenname.deathstacktrace}{%
+        \ifsseq at tempif
+            \unexpanded{\\\\}Stack trace for differential \sseq at thiscall\ that killed #3:\unexpanded{\\}%
+            \ifx\sseq at temp\sseq at empty\else\unexpanded{\ \ \ }\@nx\sseq at stack@unexpanded{\unexpanded\@xp{\the\sseq at foreachcall}}\fi
+            \unexpanded\@xp{\sseq at restofstacktrace}%
+        \fi
+    }
+    \egroup
+}
+
+\def\sseq at preparestacktrace{
+    \def\foreach{\@nx\foreach}
+    \edef\sseq at temp@i{\unexpanded\@xpthree{\sseq at obj{\sseq at deadclass@genname.deathline}}}
+    \edef\sseq at temp@ii{\the\inputlineno}
+    \ifx\sseq at temp@i\sseq at temp@ii
+        \sseq at temptoks\@xpthree{\sseq at obj{\sseq at deadclass@genname.deathinfo} (in the same \foreach loop)}
+    \else
+        \protected\def\\{}
+        \sseq at eval{\sseq at temptoks{\unexpanded\@xpthree{\sseq at obj{\sseq at deadclass@genname.deathinfo}}\space(\sseq at obj{\sseq at classgenname.deathlocation})}}
+        \sseq at e@addto at macro\sseq at errorinfo{\unexpanded\@xpthree{\sseq at obj{\sseq at deadclass@genname.deathstacktrace}}}
+    \fi
+}
+
+\def\sseq at d@setpagemin#1#2{
+    \ifnum\sseq at obj{#1.page}>#2\relax
+        \sseq at cleanup@obj{#1.page}
+        \sseq at obj@xdef{#1.page}{#2}
+    \fi
+}
+\def\sseq at differential@draw at ifpage#1{
+    \ifnum\sseq at thepagecount=\z@
+        \sseq at drawdifferential{#1}
+    \else
+        \ifnum\sseq at obj{#1.page}=\sseq at thepagecount\relax
+            \sseq at drawdifferential{#1}
+        \fi
+    \fi
+}
+\def\sseq at drawdifferential#1{
+    \bgroup
+    \sseq at eval{
+        \@nx\sseq at drawedge\sseq at obj{#1.source}\sseq at obj{#1.target}{differential}{%
+            \@xptwo\@nx\sseq at obj{#1.options}
+        }
+    }
+    \egroup
+}
+%%%
+%%% \structline and \structlineoptions
+%%%
+\sseq at DeclareDocumentCommand\structline{or()r()}{%
+    \begingroup
+    \sseq at xsetthiscall{\string\structline\IfNoValueF{#1}{\unexpanded{[#1]}}\unexpanded{(#2)(#3)}}%
+    \sseq at structline@main{structline}{#1}{#2}{#3}%
+}
+\sseq at DeclareDocumentCommand\structlineoptions{or()r()}{%
+    \begingroup
+    \sseq at xsetthiscall{\string\structlineoptions\IfNoValueF{#1}{\unexpanded{[#1]}}\unexpanded{(#2)(#3)}}%
+    \IfNoValueT{#1}{\sseq at error@x{cmdoptions-without-options}{\string\structlineoptions}\sseq at break@withcleanup}
+    \sseq at structline@main{structlineoptions}{#1}{#2}{#3}%
+    \sseq at breakpoint\@gobble\endgroup
+}
+\def\sseq at structline@main#1#2#3#4{%
+    \sseq at options@firstpassmode
+    \the\sseq at sseqstyle
+    \the\sseq at edgestyle
+    \the\sseq at structlinestyle
+    \the\sseq at scope@toks
+    \sseq at options@normalmode
+    \IfNoValueF{#2}{%
+        \sseq at processoptions{struct line}{#2}% Outputs result into \sseq at savedoptioncode
+    }%
+    \sseq at parsecoord\source{#3}{source of structure line}%
+    \sseq at parsecoord\target{#4}{target of structure line}%
+    \@ifundefined{sseq at structline@page}{%this is repeated in circleclasses
+        \def\sseq at pagemin{0}
+        \ifnum\sseq at obj{class.\source.num}>\z@
+            \edef\sseq at pagemin{\sseq at obj{class.\source[\the\numexpr\sseq at obj{class.\source.num}-1].page}}
+        \fi
+        \ifnum\sseq at obj{class.\target.num}>\z@
+            \edef\sseq at test{\sseq at obj{class.\target[\the\numexpr\sseq at obj{class.\target.num}-1].page}}
+            \ifnum\sseq at test>\sseq at pagemin\relax
+                \let\sseq at pagemin\sseq at test
+            \fi
+        \fi
+    }{\edef\sseq at pagemin{\the\numexpr\sseq at structline@page-\@ne}}
+    \csname sseq at structline@#1\endcsname
+    \sseq at breakpoint
+    \endgroup
+}
+\def\sseq at structline@structline{
+    \@ifundefined{sseq at structline@pagemax}{}{\sseq at error{structline-no-page-max}}% could be warning
+    \ifnum\sseq at pagemin<\sseq at obj{class.\source[\sseq at obj{class.\source.num}].page}\relax\else
+        \sseq at error{structline-stillborn}
+        \sseq at breakfi
+    \fi
+    \ifnum\sseq at pagemin<\sseq at obj{class.\target[\sseq at obj{class.\target.num}].page}\relax\else % If the \structline is dead before it is born, throw an error
+        \sseq at error{structline-stillborn}
+        \sseq at breakfi
+    \fi
+    \sseq at obj@ifdef{structline.\source\target.num}{%
+        \ifnum\sseq at obj{structline.\source\target[\sseq at obj{structline.\source\target.num}].page}=\sseq at infinitycount
+            \sseq at error@xx{structline-already-exists}{\sourcename}{\targetname}
+            \sseq at breakfi
+        \fi
+        \sseq at cleanup@obj{structline.\source\target.num}
+        \sseq at obj@inc{structline.\source\target.num}
+    }{
+        \sseq at obj@gdef{structline.\source\target.num}{0}
+        \sseq at savedpaths@addstructline{structline.\source\target}
+    }
+    \edef\sseq at structlinename{structline.\source\target[\sseq at obj{structline.\source\target.num}]}
+    \sseq at obj@xdef{\sseq at structlinename.page}{\sseq at infinity}
+    \sseq at obj@xdef{\sseq at structlinename.pagemin}{\sseq at pagemin}
+    \sseq at obj@xdef{\sseq at structlinename.source}{\source}
+    \sseq at obj@xdef{\sseq at structlinename.target}{\target}
+    \sseq at cleanup@obj{structline.\source\target.num}
+    \sseq at class@adddependence{class.\source}{\sseq at structlinename}% If the source or target is already dead, this will set structlinename.page
+    \sseq at class@adddependence{class.\target}{\sseq at structlinename}
+    \sseq at obj@xdef{\sseq at structlinename.options}{\ifsseq at needstikz\@nx\sseq at needstikztrue\fi\unexpanded\@xp{\sseq at savedoptioncode}}
+}
+\def\sseq at structline@structlineoptions{
+    \sseq at obj@ifundef{structline.\source\target.num}{
+        \sseq at error@n{cmdoptions-feature-doesn't-exist}{\structline}
+        \sseq at break
+    }{}
+    \@ifundefined{sseq at structline@page}{
+        \edef\sseq at gen{\sseq at obj{structline.\source\target.num}}
+        \let\sseq at genmax\sseq at gen
+    }{
+        \sseq at structline@getgen{\sseq at structline@page}
+        \@ifundefined{sseq at structline@pagemax}{%
+            % If no max is present, apply options to all pages starting at specified minimum
+            \edef\sseq at genmax{\sseq at obj{structline.\source\target.num}}%
+            \let\sseq at structline@pagemax\sseq at infinity
+        }{
+            \let\sseq at genmin\sseq at gen
+            \sseq at structline@getgen{\sseq at structline@pagemax}
+            \let\sseq at genmax\sseq at gen
+            \let\sseq at gen\sseq at genmin
+        }
+        \edef\sseq at structline@page{\the\numexpr\sseq at structline@page-1}
+        \edef\sseq at structline@pagemax{\the\numexpr\sseq at structline@pagemax+1}
+    }
+    \sseq at tempcount=\sseq at gen\relax
+    \advance\sseq at tempcount\m at ne
+    \loop
+        \advance\sseq at tempcount\@ne
+        \edef\sseq at structlinename{structline.\source\target[\the\sseq at tempcount]}
+        \sseq at cleanup@obj{\sseq at structlinename.options}
+        \ifsseq at needstikz
+            \sseq at obj@gaddto{\sseq at structlinename.options}{\sseq at needstikztrue}
+        \fi
+        \ifnum\sseq at tempcount=\sseq at gen\relax
+            \@ifundefined{sseq at structline@page}{}{
+                \edef\sseq at savedoptioncode{\@nx\ifnum\sseq at thepagecount>\sseq at structline@page\relax\unexpanded\@xp{\sseq at savedoptioncode}\@nx\fi}
+            }
+        \fi
+        \ifnum\sseq at tempcount=\sseq at genmax\relax
+            \@ifundefined{sseq at structline@pagemax}{}{
+                \edef\sseq at savedoptioncode{\@nx\ifnum\sseq at thepagecount<\sseq at structline@pagemax\relax\unexpanded\@xp{\sseq at savedoptioncode}\@nx\fi}
+            }
+        \fi
+        \sseq at obj@xoaddto{\sseq at structlinename.options}{\sseq at savedoptioncode}
+    \ifnum\sseq at tempcount<\sseq at genmax\repeat
+}
+\def\sseq at structline@getgen#1{
+    \bgroup
+        \sseq at tempcount=\sseq at obj{structline.\source\target.num}\relax
+        \ifnum\sseq at tempcount>\z@
+            \ifnum#1<\z@\relax
+                \@ifundefined{sseq at thepage}{
+                    \ifnum\sseq at obj{structline.\source\target[\the\sseq at tempcount].page}<\sseq at infinitycount
+                        \sseq at tempcount=\sseq at obj{structline.\source\target[\the\sseq at tempcount].page}\relax
+                    \else
+                        \advance\sseq at tempcount\m at ne
+                        \sseq at tempcount=\sseq at obj{structline.\source\target[\the\sseq at tempcount].page}\relax
+                        \advance\sseq at tempcount\@ne
+                    \fi
+                }{
+                    \sseq at tempcount=\sseq at thepagecount
+                }
+                \advance\sseq at tempcount\@ne
+                \advance\sseq at tempcount#1\relax
+            \fi
+            \sseq at eval{\unexpanded{\sseq at obj@pagetogen{structline.\source\target}}{\the\sseq at tempcount}} % stores in \sseq at gen
+        \else
+            \def\sseq at gen{0}
+        \fi
+        \sseq at smuggle@macro\sseq at gen
+    \egroup
+}
+\def\sseq at class@adddependence#1#2{
+    \edef\sseq at temp{\sseq at obj{#1.num}}
+    \sseq at d@setpagemin{#2}{\sseq at obj{#1[\sseq at temp].page}}% automatically handles cleanup
+    \sseq at cleanup@obj{#1[\sseq at temp].dependencies}
+    \sseq at obj@xaddto{#1[\sseq at temp].dependencies}{\@nx\\{#2}}
+}
+\def\sseq at structline@draw at ifpage#1{
+    \bgroup
+    \ifnum\sseq at thepagecount=\z@
+        \ifnum\sseq at obj{#1[0].pagemin}=\z@
+            \sseq at structline@draw{#1[0]}
+        \fi
+    \else
+        \sseq at obj@pagetogen{#1}{\sseq at thepage} % sets \sseq at gen
+        \ifnum\sseq at gen<\z@\else % negative sseq at gen means don't draw it
+            \ifnum\sseq at obj{#1[\sseq at gen].page}=\sseq at thepagecount
+                \sseq at thispagetrue
+            \fi
+            \ifnum\sseq at obj{#1[\sseq at gen].pagemin}<\sseq at thepagecount
+                \sseq at structline@draw{#1[\sseq at gen]}
+            \fi
+        \fi
+    \fi
+    \egroup
+}
+\def\sseq at structline@draw#1{\sseq at eval{\@nx\sseq at drawedge\sseq at obj{#1.source}\sseq at obj{#1.target}{structline}{\@nx\sseq at obj{#1.options}}}}
+
+
+
+
+
+
+\newcount\sseq at circleclassuid
+\sseq at DeclareDocumentCommand\circleclasses{or()r()}{
+    \begingroup
+    \def\sseq at keysfortikzprim{}
+    \IfNoValueF{#1}{
+        \sseq at processoptions{fit}{#1}
+    }
+    \sseq at parsecoord\coorda{#2}{first \@nx\circleclass class}
+    \sseq at parsecoord\coordb{#3}{second \@nx\circleclass class}
+%
+%
+    \ifsseq at keepchanges
+        \@ifundefined{sseq at fit@page}{% also in structline at main. TODO: refactor these chunks together?
+            \def\sseq at pagemin{0}
+            \ifnum\sseq at obj{class.\coorda.num}>\z@
+                \edef\sseq at pagemin{\sseq at obj{class.\coorda[\the\numexpr\sseq at obj{class.\coorda.num}-\@ne].page}}
+            \fi
+            \ifnum\sseq at obj{class.\coordb.num}>\z@
+                \edef\sseq at test{\sseq at obj{class.\coordb[\the\numexpr\sseq at obj{class.\coordb.num}-\@ne].page}}
+                \ifnum\sseq at test>\sseq at pagemin\relax
+                    \let\sseq at pagemin\sseq at test
+                \fi
+            \fi
+        }{\edef\sseq at pagemin{\the\numexpr\sseq at fit@page-\@ne}}
+        \@ifundefined{sseq at fit@pagemax}{\let\sseq at pagemax\sseq at infinity}{\let\sseq at pagemax\sseq at fit@pagemax}
+    \else % Put it on the current page no matter what inside sseqpage
+        \let\sseq at pagemax\sseq at infinity\def\sseq at pagemin{-1}
+    \fi
+%
+%
+    \global\advance\sseq at circleclassuid\@ne
+    \edef\circleclassobjname{circleclass(\coordanopar)(\coordbnopar)\the\sseq at circleclassuid}
+%
+%
+    \sseq at obj@xodef{\circleclassobjname.options}{\sseq at savedoptioncode}
+    \sseq at obj@xodef{\circleclassobjname.tikzprimoptions}{\sseq at keysfortikzprim}
+    \sseq at obj@xdef{\circleclassobjname.fitnodes}{\@nx\tikz at lib@fit{(sseq{\coordanopar})(sseq{\coordbnopar})\sseq at fitalso}}
+    %\edef\temp{\@nx\sseq at circleclass@draw{\coorda at internalname}{\coordb at internalname}{\unexpanded\@xp{\sseq at savedoptioncode}}}
+    \sseq at savedpaths@xadd{\@nx\sseq at circleclass@draw at ifpage{\circleclassobjname}{\coordanopar}{\coordbnopar}}
+    \sseq at obj@xdef{\circleclassobjname.page}{\sseq at pagemax}
+    \sseq at obj@xdef{\circleclassobjname.pagemin}{\sseq at pagemin}
+    \@ifundefined{sseq at fit@pagemax}{
+        \ifsseq at keepchanges
+            \sseq at class@adddependence{class.\coorda}{\circleclassobjname}% If the source or target is already dead, this will set structlinename.page
+            \sseq at class@adddependence{class.\coordb}{\circleclassobjname}
+        \fi
+    }{}
+    \sseq at breakpoint
+    \endgroup
+}
+
+\ifsseq at patchfit\else
+    \sseq at DeclareDocumentCommand\circleclasses{or()r()}{%
+        \sseq at warning{circleclasses-not-provided}
+    }
+\fi
+
+\def\sseq at circleclass@draw at ifpage#1#2#3{
+    \ifnum\sseq at thepagecount<\numexpr\sseq at obj{#1.page}+\@ne
+        \ifnum\sseq at obj{#1.page}=\sseq at thepagecount
+            \sseq at thispagetrue
+        \fi
+        \ifnum\sseq at obj{#1.pagemin}<\sseq at thepagecount
+            \sseq at circleclass@draw{#1}{#2}{#3}
+        \fi
+    \fi
+} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmessages.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmessages.code.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmessages.code.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,508 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: sseqmessages.code.tex
+%% Exposes: Error message redirects?
+%%
+%%   Set up fancy error messages
+%%
+
+
+
+%% The error handling system is build on top of l3msg. l3msg produces errors like:
+%%
+%%    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+%%    !
+%%    ! LaTeX error: "<package>/<error-name>"
+%%    !
+%%    ! <error message text>
+%%    !
+%%    ! See the <package> documentation for further information. % produced by \msg_see_documentation_text:n{<package>}
+%%    !...............................................
+%%
+%% The user will see underneath it l.<line number> <text on line>
+%%
+%% Unfortunately, if the error is in a \foreach statement, the user will only see the final line of the foreach loop, often just the close brace.
+%% It's impossible to tell from this where in the \foreach the error occurred. Similar problems occur if the command is inside a user command.
+%%
+%% We're going to modify this file to improve the situation.
+%%
+%% If the command is in a forloop or a user command I want to:
+%%   -- annotate the error with the command that caused it, or the previous command if the error occurred before I can know what the current command looks like.
+%%   -- present a stack trace to inform the user where exactly the problem occurred
+%%
+%%
+%% We automatically print the annotation and stack trace at the end of all l3msg messages by hooking into \msg_see_documentation_text:n.
+%% The annotation and stack trace are prepared by a command \sseq at error@setup which we hook into the beginning of the latex3 message processing code.
+%%
+%% Here's an example of the result:
+%%
+%%    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+%%    !
+%%    ! sseqpages error: "index-too-large"
+%%    !
+%%    ! Index '-3' provided for target of structure line is too large -- only 1
+%%    ! classes exist at position (32,8).
+%%    !
+%%    ! (Error occurred during call "\structline(16,-1,-1)(16,0,-3)", in the    % This is the annotation
+%%    ! \foreach block that ends on line 158, with variable values: \n = 2.)    % it's stored in \sseq at error@annotation
+%%    !
+%%    ! Stack trace:                                                            % This is the stack trace
+%%    !    \towergroupb (8*\n ,4*\n )                                           % Produced by \sseq at printstacktrace
+%%    !    \foreach \n in {2,3,4}
+%%    !
+%%    ! See the sseqpages documentation for further information.
+%%    !
+%%    ! Type <return> to continue.
+%%    !...............................................
+
+
+\def\sseq at protecterror#1{\@nx\sseq at protecterror\unexpanded{{#1}}}
+
+% Stack, thiscall, foreachcall.
+% Here we record what the user has said (as best we can tell)
+\newtoks\sseq at thiscalltoks
+\def\sseq at thiscall{\the\sseq at thiscalltoks}
+\def\sseq at setthiscall#1{\sseq at seterrorannotation{call}\sseq at thiscalltoks{#1}}
+\def\sseq at esetthiscall#1{\sseq at seterrorannotation{call}\sseq at eval{\sseq at thiscalltoks{#1}}}
+\def\sseq at gsetthiscall{\sseq at seterrorannotation{call}\global\sseq at thiscalltoks}
+\def\sseq at xsetthiscall#1{\sseq at eval{\@nx\sseq at gsetthiscall{#1}}}
+\def\sseq at xsetlastcall#1{\sseq at eval{\global\sseq at thiscalltoks{#1}}}
+
+\def\sseq at usermacro@esetthiscall#1{\sseq at eval{\sseq at thiscalltoks{#1}}} % Don't set \sseq at error@annotation at call
+
+\newtoks\sseq at foreachcall
+\newtoks\sseq at topofstacktrace
+\sseq at topofstacktrace{}
+\def\sseq at restofstacktrace{}
+
+\def\sseq at pushstacktrace#1{
+    \edef\sseq at temp{\the\sseq at topofstacktrace}
+    \ifx\sseq at temp\pgfutil at empty\else
+        \edef\sseq at restofstacktrace{\unexpanded{\\\ \ \ }\@nx\sseq at stack@unexpanded{\the\sseq at topofstacktrace}\unexpanded\@xp{\sseq at restofstacktrace}}
+    \fi
+    \sseq at topofstacktrace{#1}
+}
+\def\sseq at opushstacktrace#1{\@xp\sseq at pushstacktrace\@xp{#1}}
+\def\sseq at stack@unexpanded#1{\@nx\sseq at stack@unexpanded\unexpanded{{#1}}}
+
+
+
+% Positional information about the error:
+% Lengths are five more than the correct length to account for the fact that the line starts with !<space> and to accommodate two quote characters and a comma.
+\def\sseq at error@annotation at aftercall{\\\\Error occurred after call\sseq at printthiscall\sseq at error@inforeachloop}
+\chardef\sseq at error@annotation at length@aftercall=34
+\def\sseq at error@annotation at call{\\\\Error occurred during call\sseq at printthiscall\sseq at error@inforeachloop}
+\chardef\sseq at error@annotation at length@call=33
+\def\sseq at error@annotation at atbeginforeach{\\\\Error occurred at the beginning of \string\foreach\ statement\sseq at printthiscall\sseq at error@inforeachloop}
+\chardef\sseq at error@annotation at length@atbeginforeach=60
+\def\sseq at error@annotation at atbeginusercmd{\\\\Error occurred at the beginning of user command\sseq at printthiscall\sseq at error@inforeachloop}
+\chardef\sseq at error@annotation at length@atbeginusercmd=54
+
+\def\sseq at seterrorannotation@drawing#1#2#3#4#5{%
+    \def\sseq at error@annotation{\\\\Error occurred while drawing class (#2,#3,#4)\ifnum#5>0 \space which has been replaced #5 time\ifnum#5>1s\fi\fi.
+    Look for a \ifnum#5>0\string\replaceclass\else\string\class\fi\space command that makes a class at that position.
+    Also make sure to check any \@nx\classoptions commands that could be the culprit.}%
+}
+
+\def\sseq at seterrorannotation#1{%
+    \@xp\let\@xp\sseq at error@annotation\csname sseq at error@annotation@#1\endcsname
+    \@xp\let\@xp\sseq at error@annotation at length\csname sseq at error@annotation at length@#1\endcsname
+}
+
+\sseq at seterrorannotation{aftercall}
+
+
+\def\sseq at error@inforeachloop{\sseq at possibleperiod}
+\def\sseq at error@inforeachloop at active{\sseq at possiblecomma in \foreach block with variable values:\sseq at for@printvars\sseq at possibleperiodb}
+\def\sseq at error@setup at errorinfo{}% Changed during \foreach and user commands
+
+\def\sseq at possiblecomma{,\space}
+\def\sseq at possibleperiod{.}
+\def\sseq at possibleperiodb{.}
+
+
+\def\sseq at error@announcestacktrace{\\\\Stack trace:}
+\def\sseq at printstacktrace{ % Only prints rest of stack trace because top element is mentioned in annotation.
+    \ifx\sseq at restofstacktrace\pgfutil at empty\else
+        \sseq at error@announcestacktrace\sseq at restofstacktrace
+    \fi
+}
+
+% \sseq at error@setup happens before the error is reported, \sseq at error@cleanup at the end.
+
+\ExplSyntaxOn
+
+\def\sseq at error@setup at withinfo{
+    \bgroup
+    \def\foreach{\@nx\foreach}
+    \sseq at countthiscall
+    \ifnum\sseq at thiscallnumchars>\numexpr\l_iow_line_count_int-\sseq at error@annotation at length\relax
+        \def\sseq at printthiscall{:\\\@xp\iow_indent:n\@xp{\the\sseq at thiscalltoks}\\}
+        \let\sseq at possiblecomma\empty
+        \let\sseq at possibleperiod\empty
+    \fi
+    \let\sseq at stack@unexpanded\unexpanded
+    \sseq at error@setup at errorinfo
+    \sseq at error@hook
+}
+
+\def\sseq at error@setup at noinfo  {\bgroup\def\foreach{\@nx\foreach}\let\sseq at stack@unexpanded\unexpanded\def\sseq at error@annotation{}\sseq at error@hook}
+\let\sseq at error@setup\sseq at error@setup at noinfo
+\def\sseq at error@cleanup{\egroup\sseq at errortrue} % If the error was thrown in NewDocumentCommand, we need to process it. Just used in sseqmacromakers.
+
+
+\def\sseq at printthiscall{\ "\the\sseq at thiscalltoks"}
+% make \exp_args:NNNf:
+\let \sseq_dummy:NNn \empty
+\cs_generate_variant:Nn \sseq_dummy:NNn {NNf}
+
+
+% Count the chars in thiscall
+% Detokenize handles the control words, but keeps the spaces as spaces. To count them properly, we lowercase them into 0's (any nonspace character would do just fine).
+\def\sseq at countthiscall{
+    \bgroup\lccode`\ =`\0\relax
+    \edef\temp{\detokenize\@xp{\the\sseq at thiscalltoks}}
+    \exp_args:Nf\lowercase{
+        \exp_args:NNNf\egroup
+        \edef\sseq at thiscallnumchars{
+            \exp_args:NNo\@nx\tl_count:n{\temp}
+        }
+    }
+}
+
+\ExplSyntaxOff
+
+
+\def\sseq at error@hook{} % \sseq at error@hook is just used once in the isalive error handling to set \protect to relax. Probably a better way to do that...
+\def\sseq at errorinfo{%
+    \sseq at error@annotation
+    \sseq at printstacktrace
+}
+
+
+
+\def\sseq at atbeginusermacro@msgsetup{%
+    \let\protect\empty % prevent issues if protected variables like \xmax are used as the loop max
+    \let\sseq at error@setup at errorinfo\sseq at error@setup at errorinfo@active % Install foreach error annotations
+    \let\sseq at error@setup\sseq at error@setup at withinfo
+    \sseq at opushstacktrace{\the\sseq at thiscalltoks}
+}
+
+\def\sseq at atbeginforeach@msgsetup{%
+    \let\protect\empty % prevent issues if protected variables like \xmax are used as the loop max
+    \let\sseq at error@build at foreachvarsinfo\sseq at error@build at foreachvarsinfo@active % Install stack annotation
+    \let\sseq at error@inforeachloop\sseq at error@inforeachloop at active  % install message indicating foreach variable values
+    \let\sseq at error@setup\sseq at error@setup at withinfo
+    \sseq at foreachcall{\foreach} % Stack gets pushed at the beginning of the body of the foreach loop once we know what the call looks like
+}
+
+
+\def\sseq at error@setup at errorinfo@active{%
+    \edef\tempa{\the\sseq at thiscalltoks}\edef\tempb{\the\sseq at foreachcall}
+    \ifx\tempa\tempb % We're at the beginning of a for loop
+        \sseq at seterrorannotation{atbeginforeach}
+    \else
+        \edef\tempb{\the\sseq at topofstacktrace}
+        \ifx\tempa\tempb % we're at the beginning of a user macro
+            \sseq at seterrorannotation{atbeginusercmd}
+        \else
+            % The top of the stack trace doesn't get included in the stack trace because it is assumed to be
+            % mentioned in the annotation. Since we aren't at the beginning of the foreach or usercmd,
+            % that means it won't be mentioned. Push an empty thing onto the stack so the innermost \foreach or usercommand is mentioned.
+            \sseq at pushstacktrace{}
+        \fi
+    \fi
+}
+
+
+
+
+
+
+%%%
+%%% Set up l3msg Hooks
+%%%
+
+
+\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 at error     {\msg_error:nn    {sseqpages}}
+\def\sseq at error@n   {\msg_error:nnn   {sseqpages}}
+\def\sseq at error@nn  {\msg_error:nnnn  {sseqpages}}
+\def\sseq at error@nnn {\msg_error:nnnnn {sseqpages}}
+\def\sseq at error@nnnn{\msg_error:nnnnnn{sseqpages}}
+\def\sseq at error@x   {\msg_error:nnx   {sseqpages}}
+\def\sseq at error@xx  {\msg_error:nnxx  {sseqpages}}
+\def\sseq at error@xxx {\msg_error:nnxxx {sseqpages}}
+\def\sseq at error@xxxx{\msg_error:nnxxxx{sseqpages}}
+\def\sseq at warning   {\msg_warning:nn{sseqpages}}
+
+\def\sseq at newerror#1#2{\msg_new:nnn{sseqpages}{#1}{#2}}
+\def\sseq at newerror@internal#1#2{\msg_new:nnn{sseqpages}{#1}{Internal error: #2 \sseq at contactpackageauthor}}
+\edef\sseq at contactpackageauthor{Contact package author \sseq at authorname\space at \sseq at authoremail.}
+
+
+\cs_new_eq:NN \__sseq_hooked_msg_see_documentation_text:n \msg_see_documentation_text:n
+\cs_new_eq:NN \__sseq_hooked_msg_fatal_code:nnnnnn   \__msg_fatal_code:nnnnnn
+\cs_new_eq:NN \__sseq_hooked_msg_error_code:nnnnnn   \__msg_error_code:nnnnnn
+\cs_new_eq:NN \__sseq_hooked_msg_warning_code:nnnnnn \__msg_warning_code:nnnnnn
+\cs_new_eq:NN \__sseq_hooked_msg_info_code:nnnnnn    \__msg_info_code:nnnnnn
+
+
+\cs_new:Npn \sseq at installmsghooks {%
+    \cs_set_eq:NN \errmessage \sseq at errmessage
+    \cs_set_eq:NN \msg_see_documentation_text:n \__sseq_hooked_msg_see_documentation_text:n
+    \cs_set_eq:NN \__msg_fatal_code:nnnnnn      \__sseq_hooked_msg_fatal_code:nnnnnn
+    \cs_set_eq:NN \__msg_error_code:nnnnnn      \__sseq_hooked_msg_error_code:nnnnnn
+    \cs_set_eq:NN \__msg_warning_code:nnnnnn    \__sseq_hooked_msg_warning_code:nnnnnn
+    \cs_set_eq:NN \__msg_info_code:nnnnnn       \__sseq_hooked_msg_info_code:nnnnnn
+}
+
+\sseq at newerror@internal{msg-patch-failed}{Failed to patch the latex 3 message system. The errors will not be as expressive.}
+
+\def\sseq at msgpatchfailed{
+    \msg_error:nn{sseqpages}{msg-patch-failed}
+    \def\sseq at installmsghooks{}
+    \sseq at break
+}
+
+\let\sseq at errmessage@std\errmessage
+\def\sseq at errmessage#1{\sseq at error@setup\let\\\iow_newline:\sseq at errmessage@std{#1\sseq at error@annotation}\sseq at error@cleanup}
+
+\pretocmd\__sseq_hooked_msg_see_documentation_text:n{\sseq at errorinfo}{}{\sseq at msgpatchfailed}
+
+
+
+\pretocmd\__sseq_hooked_msg_fatal_code:nnnnnn  {\sseq at error@setup}  {}{\sseq at msgpatchfailed}
+\pretocmd\__sseq_hooked_msg_error_code:nnnnnn  {\sseq at error@setup}  {}{\sseq at msgpatchfailed}
+%\pretocmd\__sseq_hooked_msg_warning_code:nnnnnn{\sseq at msg@setup}  {}{\sseq at msgpatchfailed}
+%\pretocmd\__sseq_hooked_msg_info_code:nnnnnn   {\sseq at msg@setup}  {}{\sseq at msgpatchfailed}
+\apptocmd\__sseq_hooked_msg_fatal_code:nnnnnn  {\sseq at error@cleanup}{}{\sseq at msgpatchfailed}
+\apptocmd\__sseq_hooked_msg_error_code:nnnnnn  {\sseq at error@cleanup}{}{\sseq at msgpatchfailed}
+%\apptocmd\__sseq_hooked_msg_warning_code:nnnnnn{\sseq at error@cleanup}{}{\sseq at msgpatchfailed}
+%\apptocmd\__sseq_hooked_msg_info_code:nnnnnn   {\sseq at error@cleanup}{}{\sseq at msgpatchfailed}
+
+\sseq at breakpoint
+
+
+
+%%%%
+%%%%
+%%%% Error message definitions
+%%%%
+%%%%
+
+
+%%
+%%
+%% checkdefinitions -- patch-failed errors
+%%
+%%
+\@ifpackagelater{tikz}{2015/07/08}{
+    \sseq at 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 at 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 at 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 at newerror@internal{circleclasses-not-provided}{\@nx\circleclasses won't work because your copy of tikz is too new. Instead I'm doing nothing.}
+}{
+    \sseq at 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 at 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 at 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 at 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 at pgfkeyspatchfailed {
+    \msg_critical:nn { sseqpages } { pgfkeys-patch-failed }
+}
+
+
+\sseq at newerror@internal{this-shouldnt-happen}{This branch of the code should be unreachable. Something really weird has happened. Error occurred in #1.}
+
+% Convexity thing
+\sseq at newerror{clip-not-convex}{The clip you provided to the "clip" option was not convex and the current edge intersects it more than two times. I'm not going to draw it.}
+
+
+%%
+%%
+%% macromakers
+%%
+%%
+\sseq at newerror{won't-override-builtin}{Macro '#1' is a sseqpages builtin and I won't override it. Try a different name.}
+\sseq at 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 at 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.}
+\sseq at newerror{usermacro-unsupported-argument-type}{Unsupported argument type '#1'. All argument types in the 2017/05/29 release of xparse are supported except for v, e, and E.}
+
+%%
+%%
+%% parsers
+%%
+%%
+\sseq at newerror{classpattern-already-defined}{Class pattern '#1' already defined. Overwriting it.}
+\sseq at newerror{classpattern-unexpected-token}{Unexpected token '#1' in class pattern definition. Skipping the definition.}
+\sseq at newerror{classpattern-missing-tokens}{Incomplete class pattern definition. Skipping the definition.}
+\sseq at newerror{classpattern-extra-coord-ignored}{Extra coordinate '#1' ignored. You probably forgot a semicolon.}
+\sseq at newerror{classpattern-too-few-coords}{Too few coordinates in row #1.}
+
+\sseq at newerror{classpattern-too-many-classes}{%
+    Too many classes in position #1. You are trying to add a #2th class, but the current class pattern is "#3" which only defines offset patterns for up to #4 classes.
+    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 at newerror{invalid-coordinate}{Invalid #1coordinate\sseq at printerrortype.}
+\sseq at newerror{no-classes}{No classes yet exist in #1.}
+\sseq at newerror{index-too-large}{Index '#1' provided\sseq at printerrortype\ is too large -- only #2 classes exist at position #3.}
+\sseq at newerror{undefined-tag}{Index '#1' provided\sseq at printerrortype\ is not a valid integer expression or known tag in position #2.}
+\sseq at newerror{class-no-tag}{The class #1 has no tag so I cannot get it.}
+
+\sseq at newerror{class-extra-coords}{Too many coordinates. Ignoring the extra ones.}
+\sseq at newerror{named-coordinate-class}{You can't pass a named coordinate to \string\class.} % Probably not actually possible to obtain this error
+\sseq at newerror{d-no-degree}{%
+    You must specify the degree of your spectral sequence if you want to use the differential command \string\d.
+    Specify the degree by providing 'degree={f(\#1)}{g(\#1)}' as an option to '\string\begin{sseqdata}',
+    where f(\#1) and g(\#1) are formulas for the x and y degree of the \#1th page differential.%
+}
+\sseq at newerror{d-named-coord-two-indexes}{You provided a named class and two indexes, but the named class already comes with an index so you can only provide one more for the target. Ignoring the second index.}% should be a warning
+\sseq at newerror{d-target-index-target-coord}{You provided both a target index and a target coordinate, but this overdetermines the differential. Ignoring the target index.}
+\sseq at newerror{d-wrong-degree}{Differential does not respect grading. The target should be in position #1 but instead it is #2 in position #3.}
+
+\sseq at newerror{index-ignored}     {The coordinate #1 is not a class, but it has an index '#3'. Ignoring the index and treating it as the literal position #2.}
+\sseq at 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 at 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
+%%
+%%
+\sseq at newerror{illegal-add-background-mode}{\string#1 occurred in background mode.} % Should be impossible to trigger
+
+%%
+%%
+%% keys
+%%
+%%
+
+\def\sseq at possiblecurrentvalue{\ifx\pgfkeyscurrentvalue\pgfkeysnovalue at text\else=\pgfkeyscurrentvalue\fi}
+\def\sseq at possiblecurrentvaluemean{\ifx\pgfkeyscurrentvalue\pgfkeysnovalue at text\else={\@xp\sseq at macrogobble\meaning\pgfkeyscurrentvalue}\fi}
+
+\sseq at newerror{option-illegal}{%
+    You said '#1\sseq at possiblecurrentvalue', but the option '#1' is
+    illegal in the sseqdata and sseqpage environments#3.%
+}
+\sseq at newerror{option-illegal-as-global}{%
+    You passed '#1\sseq at possiblecurrentvalue' as a global option, but option '#1' is illegal as a global option.%
+}
+\sseq at newerror{option-global-only}{%
+    You said '#1\sseq at possiblecurrentvaluemean', but the option '#1' is
+    only allowed as a global option (as in '\string\begin{sseqdata}[#1\sseq at possiblecurrentvaluemean]'
+    or '\string\begin{sseqpage}[#1\sseq at possiblecurrentvaluemean]').%
+}
+
+% Applies to name and page, and saying "sseqs={name=somename}" is just a bad idea.
+\sseq at newerror{option-no-default-allowed}{%
+    You cannot set a default value for '#1'.% Try \@nx\sseqset{sseqs={#1\ifx\pgfkeyscurrentvalue\pgfkeysnovalue at text\else=\pgfkeyscurrentvalue\fi}}.%
+}
+\sseq at newerror{option-tikz-prims-only}{%
+    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 at newerror{det-one-after-scale}{You cannot use the option '#1\ifx\pgfkeyscurrentvalue\pgfkeysnovalue at text\else=\pgfkeyscurrentvalue\fi' as a global option after using 'xscale', 'yscale', or 'scale'. Please move '#1\ifx\pgfkeyscurrentvalue\pgfkeysnovalue at text\else=\pgfkeyscurrentvalue\fi' before any scaling options.}
+\sseq at 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 at newerror{illegal-transform}{%
+    You said '#1\ifx\pgfkeyscurrentvalue\pgfkeysnovalue at text\else=\pgfkeyscurrentvalue\fi', but
+    no coordinate transforms are allowed in the body of sseqpages 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'.%
+}
+
+\sseq at newerror{unknown-key}{I do not know the key "\pgfkeyscurrentname".}
+\sseq at newerror{unknown-global}{Undefined global option '\pgfkeyscurrentname\@xp\ifx\pgfkeyscurrentvalue\pgfkeysnovalue\else=\pgfkeyscurrentvalue\fi'.}
+
+\sseq at newerror{scope-quotes}{Quotes are not allowed as options to a scope.}
+\sseq at newerror{tikz-edge-quotes}{If you want to use quotes on a tikz edge, please provide it directly to the 'to' command e.g., \@nx\draw (0,0) to["hi"] (1,0);}
+
+\sseq at newerror{change-style-data}{It's pointless to use 'change #1s' in the sseqdata environment. Try '#1s={##1}' instead.}
+\sseq at newerror{change-style-standalone}{It's pointless to use 'change #1s' in a standalone sseqpage environment. Try '#1s={##1}' instead.}
+\sseq at newerror{page-update-existing}{Option 'update existing' is only for the sseqdata environment.}
+\sseq at newerror{page-no-name}{You can't specify a page but no name.}
+\sseq at newerror{keep-changes-no-name}{Option 'keep changes' is only for named spectral sequences.}
+\sseq at newerror{keep-changes-sseqdata}{Option 'keep changes' is only for the sseqpage environment.}
+\sseq at newerror{unknown-grid}{Undefined grid style '#1'.}
+\sseq at newerror{unknown-class-pattern}{Unknown class pattern '\sseq at classpattern'.}
+\sseq at newerror{class-placement-shift}{Shifts are illegal in the transformations applied in "class placement" key. If you want to shift your nodes, use \string\sseqnewclasspattern.} % #1 <- x shift, #2 <- shift amount
+\sseq at newerror{do-command-failed}{\string\sseq at pgfkeysdocommand{#1}{#2} failed.}
+
+\sseq at newerror{standard-parse}{You cannot use \string#1 inside a scope that has either the background key or coordinate transformations other than integer shifts.}
+
+%%
+%%
+%% main
+%%
+%%
+
+\sseq at newerror{env-inside-tikz}{#1 environment started inside tikz.}
+\sseq at newerror{env-inside-sseq}{#1 environment started inside other sseq environment.}
+\sseq at newerror{env-data-no-name}{Every 'sseqdata' environment must have a name. Specify one by saying 'name=your sseq name'.}
+\sseq at newerror{env-data-already-exist}{A spectral sequence with the name '#1' already exists; updating it. If you want to add to an already existing spectral sequence, please pass the option 'update existing'.} % warning
+\sseq at newerror{env-page-not-exist}{No spectral sequence named '#1' exists. Making a new one.} % warning
+
+
+\sseq at newerror{is-alive-illegal-here}{You can't use \@nx\isalive outside of a page constraint for a tikz primitive.}
+
+\sseq at 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 at newerror{index-larger-than-stack}{Index #1 is larger than the current stack depth #2.}
+\sseq at 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.}
+
+
+\sseq at newerror{cmdoptions-only}{You can only use the '#1' option with #2, not with #3.} % warning
+\sseq at newerror{cmdoptions-without-options}{There is no reason to use \string#1 without giving options.} % warning
+\sseq at newerror{cmdoptions-feature-doesn't-exist}{There is no #1 of the form '\sseq at thiscall' so I can't add options to it.}
+
+\sseq at newerror{classoptions-already-dead}{Generation #1 of the class #2 perished on page #3 so there is no reason to add an option to it on page \sseq at thepage.}
+\sseq at newerror{classoptions-not-yet-born}{Generation #1 of the class #2 is not yet present on page \sseq at thepage\ so there is no reason to add an option to it.}
+\sseq at newerror{classoptions-page-gen}{Don't use both "page" and "generation" for the same \@nx\classoption command.} % warning
+\sseq at newerror{classoptions-class-already-named}{The class \coord\ already is named '\sseq at obj{class.\classname.name}'. Overwriting it. Use \@nx\nameclass if you want to give it a second name.}%warning
+\sseq at newerror{doptions-invisible}{Cannot add options to invisible differential.}
+\sseq at newerror{doptions-no-effect-on-this-page}{Adding an option to a differential on page #1 when the current page is \sseq at thepage\ and the 'keep changes' option is not present has no effect.}
+
+
+\sseq at newerror{class-tag-already-defined}{A class with tag '#1' is already defined in position #2. Overwriting it.} % warning
+
+\sseq at newerror{replaceclass-not-dead-yet}{I cannot replace the class at #1 because it seems to be alive and well.}
+\sseq at newerror{replaceclass-no-effect-on-this-page}{The class at #1 died on page #2 so replacing it only affects pages after #3, but the current page is \sseq at thepage.} % warning
+
+
+
+\sseq at newerror{d-invalid-page}{Invalid page '#1'.}
+\sseq at newerror{d-class-already-hit}{% #1 <-#3, #2 <-\csname #3name\endcsname, #3 <- #2, #4 <- \unexpanded\@xpthree{\sseq at obj{\sseq at temp.deathinfo}}
+    The #1 #2 of differential \sseq at thiscall\ on page #3 has already been the #4.
+    Use \string\replaceclass#2 before \sseq at thiscall.%
+}
+\sseq at newerror{d-hit-same-page-replaceclass}{%#1 <- #3, #2 <- \csname #3name\endcsname, #3 <- #2, #3 <-\sseq at obj{#1[\the\sseq at tempcount].deathinfo},
+    The #1 #2 of differential \sseq at thiscall\ was the #3.
+    If multiple differentials touch a class on the same page, they cannot be separated by a \@nx\replaceclass command.%
+}
+\sseq at newerror{d-hit-wrong-order}{%
+    The #1 #2 of differential \sseq at thiscall\ on page #3 has already been the #4.
+    First use the shorter differential, then \string\replaceclass#2, then the longer differential.%
+}
+
+
+\sseq at newerror{structline-no-page-max}{You cannot provide \@nx\structline with the option "page=min--max", only with "page=min".} %warning
+\sseq at newerror{structline-already-exists}{Cannot add a structline from #1 to #2 because such a structline already exists.}
+\sseq at newerror{structline-stillborn}{Structline dies before it is born. Perhaps you meant to specify a different source or target?}
+
+
+\ExplSyntaxOff


Property changes on: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmessages.code.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqparsers.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqparsers.code.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqparsers.code.tex	2017-06-19 21:07:40 UTC (rev 44639)
@@ -0,0 +1,1324 @@
+%%
+%% Package: spectralsequences.sty version 1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-06-18
+%% License: Latex Project Public License
+%%
+%% File: sseqparsers.code.tex
+%%
+%%    Defines the parsers and input sanitizers. Also handles tikz primitive parsing and \isalive.
+%%    ExplSyntaxOn for this whole file!
+
+\ExplSyntaxOn
+
+
+% Prevent \protect from causing trouble for \pgfmathparse
+\let\sseq at pgfmathparse@orig\pgfmathparse
+\def\sseq at pgfmathparse#1{\let\@@protect\protect\def\protect{}\sseq at pgfmathparse@orig{#1}\restore at protect}
+
+
+%%% ifpgfmathexpr
+% #1 -- expresion to test
+% #2 -- true case
+% #3 -- false case
+% This tests true if \pgfmathparse{#1} throws an error or not. Luckily, \pgfmathparse pipes its errors through \pgfmath at error so this is easy.
+\def\sseq at ifpgfmathexpr#1{
+    \bgroup
+    \let\protect\pgfutil at empty
+    \global\sseq at gtempiftrue
+    \def\pgfmath at error##1##2{\global\sseq at gtempiffalse}
+    \pgfmathparse{#1}
+    \ifpgfmathunitsdeclared
+        \xdef\sseq at mathresult{\pgfmathresult pt}
+    \else
+        \xdef\sseq at mathresult{\pgfmathresult}
+    \fi
+    \egroup
+    \ifsseq at gtempif
+        \@xp\@firstoftwo
+    \else
+        \@xp\@secondoftwo
+    \fi
+}
+
+
+% Test if single token input is a digit
+\def\sseq at ifdigit#1{
+    \ifodd0
+        \ifx#1 0 1 \else
+        \ifx#1 1 1 \else
+        \ifx#1 2 1 \else
+        \ifx#1 3 1 \else
+        \ifx#1 4 1 \else
+        \ifx#1 5 1 \else
+        \ifx#1 6 1 \else
+        \ifx#1 7 1 \else
+        \ifx#1 8 1 \else
+        \ifx#1 9 1 \else
+        \fi \fi \fi \fi \fi
+        \fi \fi \fi \fi \fi
+    \relax
+        \@xp\@firstoftwo
+    \else
+        \@xp\@secondoftwo
+    \fi
+}
+
+%%% ifintexpr
+% #1 -- expresion to test
+% #2 -- true case
+% #3 -- false case
+% This tests true if \numexpr #1\relax throws no error and consumes all of #1 and false otherwise.
+
+% Spaces matter to us, because \sseq at ifintexpr{1 1} is false but \sseqsifintexpr{11} is true
+% so we make spaces into catcode other and use \scantokens
+\def\sseq at ifintexpr#1{%
+    \bgroup
+    \char_set_catcode_other:N \ %
+    \sseq at tempcount\z@
+    \makeatletter
+    \scantokens{\sseq at ifintexpr@first{needsint}#1\sseq at nil}%
+    \@xp\egroup\next
+}
+\@xp\let\@xp\sseq at otherspace\c_catcode_other_space_tl % This has to be a let, no idea why
+%\def\sseq at ifintexpr#1{\@firstoftwo}
+
+% Gobble the space of catcode other that scantokens inserts after \sseq at ifintexpr@first
+\def\sseq at ifintexpr@first#1#2{\sseq at 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 at ifintexpr@state
+
+\def\sseq at ifintexpr@#1{\def\sseq at ifintexpr@state{#1}\futurelet\testtok\sseq at ifintexpr@@}
+\def\sseq at ifintexpr@@{%
+    \ifx\testtok\bgroup%
+        \let\next\sseq at ifintexpr@false
+    \else
+        \ifx\testtok\sseq at nil
+            \@xp\let\@xp\next\csname sseq at ifintexpr@@\sseq at ifintexpr@state @done\endcsname
+        \else
+            % Even though I \let \sseq at 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 at ifintexpr@@@ real hard because it doesn't expect \string#1 to produce no characters.
+            \@xp\ifx\sseq at otherspace\testtok
+                \def\next{\sseq at ifintexpr@next{~}\@xp\next\@gobble}
+            \else
+                \let\next\sseq at ifintexpr@@@
+            \fi
+        \fi
+    \fi
+    \next
+}
+
+\def\sseq at ifintexpr@@@#1{
+    \ifcat$\@xp\@gobble\string#1$%
+        \@xp\sseq at 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
+        % Then use f expansion.
+        \@xp\@xp\@xp\sseq at ifintexpr@@@fexpcs\@xp\@xp\@xp#1\@xp\@gobble
+    \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 at ifintexpr@@@fexpcs{\exp_last_unbraced:Nf\sseq at ifintexpr@@@fexpcs@}
+\def\sseq at ifintexpr@@@fexpcs@{\futurelet\testtok\sseq at ifintexpr@@@fexpcs@@}
+\def\sseq at ifintexpr@@@fexpcs@@{
+    \ifx\testtok\bgroup
+        \@xp\sseq at ifintexpr@false
+    \else
+        \@xp\sseq at ifintexpr@@@@
+    \fi
+}
+
+
+
+%\exp_last_unbraced:Nf\sseq at 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,
+% cases: a digits, + or -, * or /, (, ), or something else (anything else always leads to false
+\def\sseq at ifintexpr@@@@#1{%
+    \ifx#1\sseq at nil
+        \def\next{\csname sseq at ifintexpr@@\sseq at ifintexpr@state @done\endcsname\sseq at nil}%
+    \else
+        \sseq at ifdigit{#1}%
+            {\sseq at ifintexpr@next{digit}}%
+            {%
+                \ifx#1+%
+                    \sseq at ifintexpr@next{+-}
+                \else
+                    \ifx#1-%
+                        \sseq at ifintexpr@next{+-}
+                    \else
+                        \ifx#1*%
+                            \sseq at ifintexpr@next{*/}
+                        \else
+                            \ifx#1/%
+                                \sseq at ifintexpr@next{*/}
+                            \else
+                                \pgfutil at ifundefined{sseq at ifintexpr@@\sseq at ifintexpr@state @#1}%
+                                    {\let\next\sseq at ifintexpr@false}%
+                                    {\sseq at ifintexpr@next{#1}}%
+                            \fi
+                        \fi
+                    \fi
+                \fi
+            }%
+    \fi
+    \next
+}
+
+% This has to eat the space
+%\bgroup\lccode`\*=`\ \lowercase{\egroup
+    \def\sseq at ifintexpr@true#1\sseq at nil{\ifnum\sseq at tempcount=\z@ \let\next\@firstoftwo\else\let\next\@secondoftwo\fi}
+    \def\sseq at ifintexpr@false#1\sseq at nil{\let\next\@secondoftwo}
+%}
+\def\sseq at makeifint#1#2#3{\@xp\def\csname sseq at ifintexpr@@#1@#2\endcsname{#3}}
+\def\sseq at ifintexpr@next#1{\@xp\let\@xp\next\csname sseq at ifintexpr@@\sseq at ifintexpr@state @#1\endcsname}
+
+\sseq at makeifint{needsint}{done}{\sseq at ifintexpr@false}
+\sseq at makeifint{needsint}{digit}{\sseq at ifintexpr@{int}}
+\sseq at makeifint{needsint}{*/}{\sseq at ifintexpr@false}
+\sseq at makeifint{needsint}{+-}{\sseq at ifintexpr@{needsint}}
+\sseq at makeifint{needsint}{(}{\advance\sseq at tempcount\@ne\sseq at ifintexpr@{needsint}}
+\sseq at makeifint{needsint}{)}{\sseq at ifintexpr@false}
+\sseq at makeifint{needsint}{\space}{\sseq at ifintexpr@{needsint}}
+
+\sseq at makeifint{int}{done}{\sseq at ifintexpr@true}
+\sseq at makeifint{int}{digit}{\sseq at ifintexpr@{int}}
+\sseq at makeifint{int}{*/}{\sseq at ifintexpr@{needsint}}
+\sseq at makeifint{int}{+-}{\sseq at ifintexpr@{needsint}}
+\sseq at makeifint{int}{(}{\sseq at ifintexpr@false}
+\sseq at makeifint{int}{)}{
+    \advance\sseq at tempcount\m at ne
+    \ifnum\sseq at tempcount<\z@\relax
+        \@xp\@xp\@xp\sseq at ifintexpr@false\@xp\@gobble
+    \else
+        \@xp\sseq at ifintexpr@
+    \fi{nointallowed}
+}
+\sseq at makeifint{int}{\space}{\sseq at ifintexpr@{nointallowed}}
+
+\sseq at makeifint{nointallowed}{done}{\sseq at ifintexpr@true}
+\sseq at makeifint{nointallowed}{digit}{\sseq at ifintexpr@false}
+\sseq at makeifint{nointallowed}{*/}{\sseq at ifintexpr@{needsint}}
+\sseq at makeifint{nointallowed}{+-}{\sseq at ifintexpr@{needsint}}
+\sseq at makeifint{nointallowed}{(}{\sseq at ifintexpr@false}
+\sseq at makeifint{nointallowed}{)}{
+    \advance\sseq at tempcount\m at ne
+    \ifnum\sseq at tempcount<\z@
+        \@xp\@xp\@xp\sseq at ifintexpr@false\@xp\@gobble
+    \else
+        \@xp\sseq at ifintexpr@
+    \fi{nointallowed}
+}
+\sseq at makeifint{nointallowed}{\space}{\sseq at ifintexpr@{nointallowed}}
+
+%%
+%%
+%%          New Class Pattern
+%%
+%%
+
+\newcount\sseq at cp@row
+\newcount\sseq at cp@n
+
+\def\sseqnewclasspattern#1#2{
+    \ifcsname sseq@#1xoffset1/1\endcsname\sseq at error@n{classpattern-already-defined}{#1}\fi % could be a warning
+    \begingroup
+    \def\sseq at name{#1}
+    \def\sseq at temp{}
+    \def\sseq at state{nocoord}
+    \sseq at cp@row=\@ne
+    \sseq at cp@n=\z@
+    \let\next\sseq at newclasspattern@
+    \sseq at newclasspattern@#2\sseq at nil
+}
+
+\def\sseq at newclasspattern@{
+    \@ifnextchar\bgroup{\sseq at error@n{classpattern-unexpected-token}{\{}}{\sseq at newclasspattern@processstate}
+}
+
+\def\sseq at newclasspattern@processstate{
+    \csname sseq at newclasspattern@processstate@\sseq at state\endcsname
+}
+
+\def\sseq at newclasspattern@processstate at xcoord#1{
+    \ifx#1,
+        \sseq at ifpgfmathexpr{\sseq at temp}{
+            \let\sseq at tempx\sseq at mathresult
+            \def\sseq at temp{}
+            \def\sseq at state{ycoord}
+        }{
+            \sseq at error{classpattern-not-integer-expression}
+            \let\next\sseq at newclasspattern@abort
+        }
+    \else
+        \ifx#1\sseq at nil
+            \sseq at error{classpattern-missing-tokens}
+            \let\next\endgroup
+        \else
+            \sseq at d@addto at macro\sseq at temp{#1}
+        \fi
+    \fi
+    \next
+}
+
+\def\sseq at newclasspattern@processstate at ycoord#1{
+    \ifx#1)
+        \sseq at ifpgfmathexpr{\sseq at temp}{% Need iffloatexpr =(
+            \let\sseq at tempy\sseq at mathresult
+            \def\sseq at temp{}
+            \def\sseq at state{nocoord}
+            \advance\sseq at cp@n\@ne
+            \ifnum\sseq at cp@n>\sseq at cp@row\relax
+                \sseq at error@x{classpattern-extra-coord-ignored}{(\sseq at tempx,\sseq at tempy)}
+            \else
+                \sseq at e@addto at macro\sseq at newclasspattern@dodefs{
+                    \def\@xp\@nx\csname sseq@\sseq at name xoffset\the\sseq at cp@n/\the\sseq at cp@row\endcsname{\sseq at tempx}
+                    \def\@xp\@nx\csname sseq@\sseq at name yoffset\the\sseq at cp@n/\the\sseq at cp@row\endcsname{\sseq at tempy}
+                }
+            \fi
+        }{
+            \sseq at error{classpattern-not-integer-expression}
+            \let\next\sseq at newclasspattern@abort
+        }
+    \else
+        \ifx#1\sseq at nil
+            \sseq at error{classpattern-missing-tokens}
+            \let\next\endgroup
+        \else
+            \sseq at d@addto at macro\sseq at temp{#1}
+        \fi
+    \fi
+    \next
+}
+
+\def\sseq at newclasspattern@processstate at nocoord#1{
+    \ifx#1(
+        \def\sseq at state{xcoord}
+    \else
+        \ifx#1;
+            \ifnum\sseq at cp@n=\sseq at cp@row\relax
+                \advance\sseq at cp@row\@ne
+                \sseq at cp@n=\z@
+            \else
+                \sseq at error@x{classpattern-too-few-coords}{\the\sseq at cp@row}
+                \let\next\sseq at newclasspattern@abort
+            \fi
+        \else
+            \ifx#1\sseq at nil
+                \let\next\sseq at newclasspattern@finish
+            \else
+                \sseq at error@n{classpattern-unexpected-token}{#1}
+                \let\next\sseq at newclasspattern@abort
+            \fi
+        \fi
+    \fi
+    \next
+}
+
+\def\sseq at newclasspattern@finish{
+    \ifnum\sseq at cp@n=\z@\relax
+        \advance\sseq at cp@row\m at ne
+    \else
+        \ifnum\sseq at cp@n=\sseq at cp@row\relax\else
+            \sseq at error@x{classpattern-too-few-coords}{\the\sseq at cp@row}
+            \let\sseq at newclasspattern@dodefs\empty
+        \fi
+    \fi
+    % This will make a definition even if the class pattern was rejected because of the too-few-coords error
+    % It doesn't matter though, because we don't use this to check for existence
+    \sseq at e@addto at macro\sseq at newclasspattern@dodefs{%
+        \chardef\@xp\@nx\csname sseq@\sseq at name @maxclasses\endcsname=\the\sseq at cp@row\relax
+    }%
+    \@xp\endgroup
+    \sseq at newclasspattern@dodefs
+
+
+}
+\def\sseq at newclasspattern@dodefs{}
+\def\sseq at newclasspattern@abort#1\sseq at nil{\endgroup}
+
+
+
+
+%%%%%%                                            %%%%%%
+%%                                                    %%
+%%               Coordinate Parsers                   %%
+%%                                                    %%
+%%%%%%                                            %%%%%%
+
+% Only works for full coordinates. Used for error checking in \replaceclass and \d.
+\def\sseq at ifundefcoord{\@xp\sseq at ifundefcoord@}
+\def\sseq at ifundefcoord@(#1){%
+    \sseq at obj@ifundef{class.(#1).num}%
+}
+
+\def\sseq at ifdead#1{\ifnum\sseq at obj{class.#1[\sseq at obj{class.#1.num}].page}<\sseq at infinitycount\@xp\@firstoftwo\else\@xp\@secondoftwo\fi}
+
+
+% These do all of the work of taking a coordinate of the form (x,y), (x,y,n), or (x,y,tag) and turning them
+% into the internal representation needed for the rest of the package.
+% This comes in two parts:
+%   \sseq at parsecoord@maincoord -- separates a coordinate into {x,y}{n or tag}, numerically evaluates x and y, and adds in the values of \sseq at x and \sseq at y
+%   \sseq at parsecoord@index -- decides which class {n or tag} represents
+%
+% There are three interface commands:
+%    \sseq at parsecoord   -- for most things
+%    \sseq at cparsecoord  -- for \class (but not for \replaceclass or \classoptions). Doesn't use \sseq at parsecoord@index at all.
+%    \sseq at dparsecoord  -- for \d and \doptions
+%    \sseq at parsecoordex -- for \isalive: the body of a page constraint needs to be \edef'd so we need a completely expandable version.
+%      The expandable version doesn't have any error checking -- to get the error checking, we pass the coordinates once through the unexpandable version
+%      inside of an hbox.
+
+\def\sseq at errortype{}
+\def\sseq at printerrortype{\@xp\sseq at ifempty\@xp{\sseq at errortype}{}{~ for ~ \sseq at errortype}}
+
+%% 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}
+\let\sseq at relax\relax
+% The \sseq at relax is just to make \lastclass work. It has to pull an argument off the token stream to expandably check whether
+% it is an integer. However, without this \sseq at relax, \lastclass could appear as the last token of the edef, which is no good.
+\def\sseq at parsecoord@maincoord#1{\exp_last_unbraced:Nx\sseq at parsecoord@maincoord@{#1\sseq at relax}}
+\def\sseq at parsecoord@maincoord@#1\sseq at relax{%
+    \pgfutil at in@ \sseq at protecterror { #1 }
+    \ifpgfutil at in@
+        \bgroup
+        \sseq at restorefont
+        \let\sseq at protecterror\relax
+        \setbox0=\hbox{#1} % Trigger the error message
+        \egroup
+        \@xp\sseq at break
+    \else
+        \pgfutil at in@,{#1}
+        \ifpgfutil at in@
+            \sseq at parsecoord@maincoord@@#1,\sseq at nil
+        \else
+            \sseq at obj@ifdef{class.namedclass.\detokenize{#1}}{
+                \def\sourcename{#1}
+                \@xpthree\sseq at parsecoord@maincoord at named\sseq at obj{class.namedclass.#1}\sseq at nil
+            }{
+                \sseq at error{invalid-coordinate}\sseq at breakfifi
+            }
+        \fi
+    \fi
+}
+
+\def\sseq at parsecoord@maincoord@@#1,#2,#3\sseq at nil{%
+    \sseq at obj@ifdef{class.namedclass.\detokenize{#1}}{
+        \def\sourcename{#1}
+        \@xpthree\sseq at parsecoord@maincoord at named\sseq at obj{class.namedclass.#1}\sseq at nil
+        \edef\sseq at restcoord{\sseq at removecomma#2,#3\sseq at nil}
+    }{
+        \sseq at ifintexpr{#1}{
+            \sseq at ifintexpr{#2}{}{\sseq at error@n{invalid-coordinate}{y }\sseq at breakfifi} % breakfifi to get out of ifs from maincoord@
+            \edef\sseq at xcoord{\the\numexpr\sseq at x+(#1)\relax}%
+            \edef\sseq at ycoord{\the\numexpr\sseq at y+(#2)\relax}%
+            \edef\sseq at xycoord{\sseq at xcoord,\sseq at ycoord}%
+            \sseq at ifempty{#3}{\let\sseq at restcoord\pgfutil at empty}{%
+                \edef\sseq at restcoord{\sseq at removecomma#3\sseq at nil}%
+            }%
+        }{
+            \sseq at error@n{invalid-coordinate}{x }\sseq at breakfifi % breakfifi to get out of ifs from maincoord@
+        }
+    }%
+}%
+
+\def\sseq at parsecoord@maincoord at named#1,#2,#3\sseq at nil{
+    \def\sseq at xcoord{#1}%
+    \def\sseq at ycoord{#2}%
+    \edef\sseq at xycoord{\sseq at xcoord,\sseq at ycoord}
+    \def\sseq at restcoord{}
+    \pgfkeys at spdef\sseq at rawindex{#3}
+    \def\sseq at index{#3}
+    \let\rawindex\sseq at rawindex
+    \let\index\sseq at index
+}
+
+\def\sseq at removecomma#1,\sseq at nil{#1}
+
+
+% "Input" to this command is stored in the following commands:
+% \sseq at xycoord -- x,y
+% \sseq at rawindex -- n
+% \sseq at errortype -- description for error messages
+\def\sseq at errortype@tikzprim{tikz ~ primitive}% This is sort of a silly hack, but this first error check shouldn't happen in a tikz primitive.
+\def\sseq at parsecoord@index{%
+    \sseq at obj@ifundef{partcoord.(\sseq at xycoord).numnodes}{
+        \ifx\sseq at errortype\sseq at errortype@tikzprim
+            \def\sseq at index{}%  Communicates to \sseq at tikzprimitives@coords at maybeclass that this is not a class
+        \else
+            \sseq at error@x{no-classes}{(\sseq at xycoord)}\@xp\sseq at break
+        \fi
+    }{
+        \ifx\sseq at rawindex\pgfutil at empty
+            \def\sseq at index{1}
+        \else
+            \sseq at obj@ifdef{partcoord.(\sseq at xycoord).tag.\sseq at class@tagprefix\sseq at rawindex}{% If the raw index is a tag
+                \edef\sseq at index{\sseq at obj{partcoord.(\sseq at xycoord).tag.\sseq at class@tagprefix\sseq at rawindex}}
+            }{%
+                \sseq at ifintexpr{\sseq at rawindex}{%
+                    \edef\sseq at rawindexeval{\the\numexpr\sseq at rawindex}
+                    \ifnum\sseq at rawindexeval<\z@%
+                        \edef\sseq at index{\the\numexpr\sseq at obj{partcoord.(\sseq at xycoord).numnodes} + \sseq at rawindex + \@ne\relax}%
+                        \ifnum\sseq at index<\@ne
+                            \sseq at error@xxx{index-too-large}{\sseq at rawindex}{\sseq at obj{partcoord.(\sseq at xycoord).numnodes}}{(\sseq at xycoord)}%
+                            \edef\sseq at index{1}% or maybe I should break?
+                        \fi
+                    \else
+                        \ifnum\sseq at rawindexeval>\sseq at obj{partcoord.(\sseq at xycoord).numnodes}\relax
+                            \sseq at error@xxx{index-too-large}{\sseq at rawindex}{\sseq at obj{partcoord.(\sseq at xycoord).numnodes}}{(\sseq at xycoord)}%
+                            \edef\sseq at rawindex{\sseq at obj{partcoord.(\sseq at xycoord).numnodes}}% or maybe I should break?
+                        \fi
+                        \edef\sseq at index{\the\numexpr\sseq at rawindex}
+                    \fi
+                }{
+                    \sseq at error@xx{undefined-tag}{\sseq at rawindex}{(\sseq at xycoord)}%
+                    \def\sseq at index{1}%
+                }
+            }
+        \fi
+    }
+}
+
+% #1 -- name to define
+% #2 -- coordinate
+% #3 -- the error message
+\def\sseq at parsecoord#1#2#3{%
+    \def\sseq at index{}
+    \def\sseq at errortype{#3}
+    \sseq at parsecoord@maincoord{#2}%
+    \let\sseq at rawindex\sseq at restcoord
+    \ifx\sseq at index\pgfutil at empty
+        \@xp\sseq at parsecoord@index
+    \fi
+    \@xp\let\csname x\sseq at macroname#1\endcsname\sseq at xcoord
+    \@xp\let\csname y\sseq at macroname#1\endcsname\sseq at ycoord
+    \@xp\let\csname \sseq at macroname#1 at partial\endcsname\sseq at xycoord
+    \edef#1{(\sseq at xycoord,\sseq at index)}%
+    \@xp\edef\csname\sseq at macroname#1nopar\endcsname{\sseq at xycoord,\sseq at index}
+    \@xp\def\csname\sseq at macroname#1name\endcsname{(#2)}%
+    \@xp\def\csname\sseq at macroname#1nameunbraced\endcsname{#2}%
+    \@xp\edef\csname\sseq at macroname#1 at internalname\endcsname{sseq{\sseq at xycoord,\sseq at index}}%
+}
+
+% EXPOSE: a wrapper around \sseq at parsecoord. Use full name of coordinate to avoid name class with sseq at parsecoord.
+\sseq at DeclareDocumentCommand \parsecoordinate { m r() }{%
+    \sseq at parsecoord{#1}{#2}{call of \string\parsecoord}%
+}
+
+% #1 -- coordinate
+\def\sseq at cparsecoord#1{%
+    \def\sseq at index{}
+    \sseq at parsecoord@maincoord{#1}%
+    \ifx\sseq at index\pgfutil at empty\else\sseq at error{named-coordinate-class}\fi% probably not possible to get this error
+    \ifx\sseq at restcoord\pgfutil at empty\else\sseq at error{class-extra-coords}\fi%
+    \let\partialcoord\sseq at xycoord
+    \let\xcoord\sseq at xcoord
+    \let\ycoord\sseq at ycoord
+    \edef\nodenum{\sseq at obj@ifundef{partcoord.(\partialcoord).numnodespp}{1}{\sseq at obj{partcoord.(\partialcoord).numnodespp}}}%
+    \edef\coordnopar{\xcoord,\ycoord,\nodenum}
+    \edef\coord{(\coordnopar)}%
+}
+
+
+% #1 -- page
+% #2 -- coordinate
+% #3 -- target coordinate or "No Value"
+\def\sseq at dparsecoord#1#2#3{%
+    \def\sseq at index{}%
+    \def\sseq at errortype{differential}%
+    \sseq at parsecoord@maincoord{#2}%
+    \ifx\sseq at index\pgfutil at empty
+        \edef\sseq at rawsindex{\@xp\sseq at dparsecoord@getxindex\@xp{\sseq at restcoord}}%
+        \@xp\pgfkeys at spdef\@xp\sseq at rawsindex\@xp{\sseq at rawsindex}
+        \edef\sseq at rawtindex{\@xp\sseq at dparsecoord@getyindex\@xp{\sseq at restcoord}}%
+        \@xp\pgfkeys at spdef\@xp\sseq at rawtindex\@xp{\sseq at rawtindex}
+    %
+        \let\sseq at rawindex\sseq at rawsindex
+        \def\sseq at errortype{source ~ of ~ differential}
+        \@xp\sseq at parsecoord@index % the \@xp is needed so that \sseq at break inside of parsecoordindex works properly.
+    \else
+        \edef\sseq at rawtindex{\@xp\sseq at dparsecoord@getxindex\@xp{\sseq at restcoord}}%
+        \@xp\pgfkeys at spdef\@xp\sseq at rawtindex\@xp{\sseq at rawtindex}
+        \edef\sseq at shouldbeempty{\@xp\sseq at dparsecoord@getyindex\@xp{\sseq at restcoord}}
+        \ifx\sseq at shouldbeempty\pgfutil at empty\else
+            \sseq at error{d-named-coord-two-indexes}
+        \fi
+    \fi
+    \let\sourcecoord\sseq at xycoord
+    \edef\source{(\sseq at xycoord,\sseq at index)}%
+    \ifx\sourcename\undefined
+        \edef\sourcename{(\sseq at xycoord\ifx\sseq at rawindex\pgfutil at empty\else,\sseq at rawindex\fi)}
+    \fi
+    \IfNoValueTF{#3}{
+        \ifsseq at hasdegree\else\sseq at error{d-no-degree}\@xp\sseq at break\fi
+        \sseq at eval{\edef\@nx\sseq at xycoord{\@nx\sseq at differential@gettarget{#1}{\sseq at xycoord}}}
+        \let\sseq at rawindex\sseq at rawtindex
+        \def\sseq at errortype{target ~ of ~ differential}
+        \sseq at parsecoord@index
+        \let\targetcoord\sseq at xycoord
+        \edef\target{(\sseq at xycoord,\sseq at index)}%
+        \edef\targetname{(\sseq at xycoord\ifx\sseq at rawindex\pgfutil at empty\else,\sseq at rawindex\fi)}
+    }{
+        \ifx\sseq at rawtindex\pgfutil at empty\else
+            \sseq at error{d-target-index-target-coord}
+        \fi
+        \sseq at parsecoord\target{#3}{differential}
+        \let\targetcoord\target at partial
+        \ifsseq at hasdegree
+            \ifsseq at strictdegree
+                \sseq at eval{\edef\@nx\sseq at checktarget{\@nx\sseq at differential@gettarget{#1}{\sourcecoord}}}
+                \ifx\sseq at checktarget\targetcoord\else
+                    \sseq at error@xxx{d-wrong-degree}{(\sseq at checktarget)}{\targetname}{(\targetcoord)}
+                \fi
+            \fi
+        \fi
+    }
+}
+
+\def\sseq at differential@gettarget#1#2{\sseq at differential@gettarget@{#1}#2\sseq at nil}
+\def\sseq at differential@gettarget@#1#2,#3\sseq at nil{\the\numexpr#2+\sseq at targetx{#1}\relax,\the\numexpr#3+\sseq at targety{#1}\relax}
+
+\def\sseq at getfirsttwoelts#1,#2,#3\sseq at nil{#1,#2}
+\def\sseq at getdtarget#1#2#3{\sseq at eval{\edef\@nx#1{\@nx\sseq at differential@gettarget{#2}{\sseq at getfirsttwoelts#3,,\sseq at 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 at dparsecoord@getxindex#1{\sseq at dparsecoord@getxindex@#1,\sseq at nil}
+\def\sseq at dparsecoord@getxindex@#1,#2\sseq at nil{#1}
+% Takes a comma separated list that can be empty, have one element, or two elements, returns second element (or empty if less than two elements).
+\def\sseq at dparsecoord@getyindex#1{\sseq at dparsecoord@getyindex@#1,\sseq at nil}
+\def\sseq at dparsecoord@getyindex@#1,#2\sseq at nil{%
+    \sseq at ifempty{#2}{}{%
+        \sseq at removecomma#2\sseq at nil%
+    }%
+}
+
+\def\sseq at parsecoordinate#1#2{%
+    \sseq at parsecoord{#1}{#2}{call of \string\parsecoord}%
+}
+
+
+% EXPOSE: a wrapper around \sseq at parsecoord. Use full name of coordinate to avoid name class with sseq at parsecoord.
+\sseq at DeclareDocumentCommand \parsedifferential { m r() }{%
+    \sseq at dparsecoord{#1}{#2}{call of \string\parsecoord}%
+}
+
+% Expandable coordinate parsing for \isalive.
+% Doesn't do any error checking -- the error checking is done by passing it through \sseq at parsecoord in a non-\edef context.
+% #1 -- a callback. Must be a single command b/c it's an N in \exp_args
+% #2 -- the coordinate
+\cs_new:Npn \exp_last_unbraced:NNNf #1#2#3#4
+  {
+    \exp_after:wN #1
+    \exp_after:wN #2
+    \exp_after:wN #3 \tex_romannumeral:D -`0 #4
+  }
+
+\def\sseq at parsecoordex{\exp_last_unbraced:NNNf\sseq at parsecoordex@}
+\def\sseq at parsecoordex@#1(#2){\sseq at parsecoordex@@#1#2,\@nil}
+\def\sseq at parsecoordex@@#1#2,#3,#4\@nil{
+    \ifx&#4&
+        \exp_last_unbraced:NNo\sseq at parsecoord@indexex#1(\the\numexpr#2\@xp,\the\numexpr#3,1)
+    \else
+        \exp_args:NNo\sseq at parsecoord@indexex#1{\the\numexpr#2\@xp,\the\numexpr#3\@xp\relax\@xp}\@xp{\sseq at removecomma#4\sseq at nil}
+    \fi
+}
+
+
+% This is \sseq at parsecoord@index pared down as much as possible -- all error checking is removed because that will happen in a
+% \setbox0=\hbox{stuff} sequestered calculation that uses \sseq at parsecoord@index instead.
+% #1 -- callback which takes one argument --  the final coordinate in parentheses.
+% #2 -- x,y
+% #3 -- n
+\def\sseq at parsecoord@indexex#1#2#3{%
+    \sseq at obj@ifdef{partcoord.(#2).tag.\sseq at class@tagprefix#3}{% If the raw index is a tag
+        \exp_args:NNo\sseq at parsecoord@indexex@#1{\the\numexpr\sseq at obj{partcoord.(#2).tag.\sseq at class@tagprefix#3}}{#2}%
+    }{%
+        \ifnum\numexpr#3<0\space
+            \exp_args:NNo\sseq at parsecoord@indexex@#1{\the\numexpr\sseq at obj{partcoord.(#2).numnodes} + #3 + 1}{#2}%
+        \else
+            \exp_args:NNo\sseq at parsecoord@indexex@#1{\the\numexpr#3}{#2}%
+        \fi
+    }%
+}
+\def\sseq at parsecoord@indexex@#1#2#3{
+    #1(#3,#2)
+}
+
+
+
+
+%%%
+%%% The Stack
+%%%
+
+\sseq at addtostorelistlet\sseq at stacktop\relax
+\def\sseq at stackitem#1#2#3{\csname sseq.\sseq at thename.stack.#1.#3\endcsname} % gobble #2 which we added in for the error message
+\def\sseq at getstackentry#1{
+    \exp_args:No\sseq at getstackentry@{\sseq at stacktop}{#1}{#1} % Second copy of #1 for error message
+}
+
+\def\sseq at getstackentry@#1#2{
+    \ifnum#2=\z@\@xp\@firstoftwo\else\@xp\@secondoftwo\fi
+        {\sseq at stackitem{#1}}
+        {\@ifundefined{sseq.\sseq at thename.stack.#1.next}{\sseq at getstackentry@indextoolarge}{
+            \exp_args:Nf\sseq at getstackentry@{\csname sseq.\sseq at thename.stack.#1.next\@xp\endcsname\@xp}\@xp{\the\numexpr#2-1}
+        }}
+}
+
+\def\sseq at getstackentry@indextoolarge#1{\sseq at protecterror{\sseq at error@xx{index-larger-than-stack}{#1}{\the\sseq at stackdepth}}}
+
+\def\sseq at pushstack(#1){
+    \bgroup
+    \sseq at parsecoord\temp{#1}{}
+    \sseq at pushstack@\temp
+    \egroup
+}
+
+\def\sseq at pushstack@{\@xp\sseq at pushstack@@}
+
+\def\sseq at pushstack@@(#1,#2,#3){
+    \global\advance\sseq at stackdepth\@ne
+    \@xp\gdef\csname sseq.\sseq at thename.stack.\the\sseq at stackdepth.lastx\endcsname{#1}
+    \@xp\gdef\csname sseq.\sseq at thename.stack.\the\sseq at stackdepth.lasty\endcsname{#2}
+    \@xp\xdef\csname sseq.\sseq at thename.stack.\the\sseq at stackdepth.lastclass\endcsname{lastclass.\the\sseq at stackdepth}
+    \sseq at obj@gdef{class.namedclass.lastclass.\the\sseq at stackdepth}{#1,#2,#3}
+    \global\@xp\let\csname sseq.\sseq at thename.stack.\the\sseq at stackdepth.next\endcsname\sseq at stacktop
+    \xdef\sseq at stacktop{\the\sseq at stackdepth}
+}
+
+
+\newcount\sseq at userstacksavecount
+\def\sseq at savestack{
+    \global\advance\sseq at userstacksavecount\@ne
+    \sseq at savestack@name{usersave@\the\sseq at userstacksavecount}
+}
+\def\sseq at restorestack{
+    \sseq at restorestack@name{usersave@\the\sseq at userstacksavecount}
+    \global\advance\sseq at userstacksavecount\m at ne
+}
+
+\def\sseq at savestack@name#1{\sseq at obj@xdef{stack.save#1}{\sseq at stacktop}}
+
+\def\sseq at restorestack@name#1{\xdef\sseq at stacktop{\sseq at obj{stack.save#1}}}
+
+\def\sseq at lastx#1{
+    % \romannumeral is testing here whether #1 is a nonnegative integer
+    % 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.
+    \@xp\sseq at ifempty\@xp{\romannumeral-0#1}{
+        \sseq at getstackentry{#1}{lastx}
+    }{
+        \sseq at getstackentry{0}{lastx}#1 % #1 isn't a number so put it back
+    }
+}
+\def\sseq at lasty#1{
+    \@xp\sseq at ifempty\@xp{\romannumeral-0#1}{
+        \sseq at getstackentry{#1}{lasty}
+    }{
+        \sseq at getstackentry{0}{lasty}#1 % #1 isn't a number so put it back
+    }
+}
+
+\def\sseq at lastclass#1{
+    \@xp\sseq at ifempty\@xp{\romannumeral-0#1}{
+        \sseq at getstackentry{#1}{lastclass}
+    }{
+        \sseq at getstackentry{0}{lastclass}#1 % #1 isn't a number so put it back
+    }
+}
+
+
+\def\sseq at nameclass#1(#2){
+    \bgroup
+    \sseq at parsecoord\coord{#2}{}
+    \sseq at cleanup@obj{class.namedclass.#1}
+    \sseq at obj@xdef{class.namedclass.#1}{\coordnopar}
+    \egroup
+}
+
+\def\sseq at tagclass#1(#2){%
+    \bgroup
+    \sseq at parsecoord\coord{#2}{}%
+    \sseq at obj@ifdef{partcoord.(\sseq at xycoord).tag.\sseq at class@tagprefix\sseq at class@tag}{%
+        \sseq at error@nn{class-tag-already-defined}{\sseq at class@tagprefix\sseq at class@tag}{(\sseq at xycoord)}% could be warning
+    }%
+    \sseq at cleanup@obj{class.\coord.tag}%
+    \sseq at obj@xdef{class.\coord.tag}{\sseq at class@tagprefix\sseq at class@tag}%
+    \sseq at cleanup@obj{partcoord.(\sseq at xycoord).tag.\sseq at class@tagprefix\sseq at class@tag}%
+    \sseq at obj@xdef{partcoord.(\sseq at xycoord).tag.\sseq at class@tagprefix\sseq at class@tag}{\sseq at index}%
+    \egroup
+}
+
+\def\sseq at gettag#1(#2){
+    \bgroup
+    \sseq at parsecoord\coord{#2}{}
+    \sseq at obj@ifdef{class.\coord.tag}{
+        \xdef#1{\sseq at obj{class.\coord.tag}}
+    }{
+        \sseq at error@n{class-no-tag}{(#2)}
+    }
+    \egroup
+}
+
+
+
+
+
+%%%%%%
+%%%
+%%%   Tikz Primitives
+%%%
+%%%%%%
+
+% Replace a tikz command with a command that saves the command on savedpaths
+
+\def\sseq at modtikzcommands{%
+    \let\scope\sseq at scope
+    \let\endscope\sseq at endscope
+    \@xp\sseq at modtikzcommands@\sseq at tikzcommands\sseq at nil
+}
+\def\sseq at modtikzcommands@#1{%
+    \ifx#1\sseq at nil\else
+        \edef#1{\@xp\@nx\csname\sseq at macroname#1\space\endcsname\@nx#1}%
+        \@xp\let\csname\sseq at macroname#1\space\endcsname\sseq at defer@tikzcommand % This is just for error reporting so that it will say "Paragraph ended before \draw  was complete"
+        \@xp\sseq at modtikzcommands@
+    \fi
+}
+
+\def\sseq at defer@tikzcommand#1{%
+    \begingroup
+    \let\sseq at isaliveprotect\sseq at isaliveprotect@protect
+    \sseq at callas{#1}%
+    \gdef\sseq at thepathsofar{#1[/utils/exec={\sseq at thesseqstyle\sseq at thetikzprimitivestyle\the\sseq at scope@toks\sseq at savedoptioncode}]}%
+    \xdef\sseq at whattheusersaid{\string#1}
+    \sseq at defer@tikzcommand@
+}
+
+\def\sseq at defer@tikzcommand@{%
+    \futurelet\testtok\sseq at defer@tikzcommand@@
+}
+
+\def\sseq at defer@tikzcommand@@{%
+    \ifx\testtok;
+        \let\next\sseq at defer@tikzcommand at finish
+    \else
+        \ifx\testtok[%
+            \let\next\sseq at defer@tikzcommand at option
+        \else
+            \ifx\testtok(%
+                \let\next\sseq at defer@tikzcommand at coord
+            \else
+                \@xp\ifx\space\testtok
+                    \let\next\sseq at defer@tikzcommand at space
+                \else
+                    \ifx\testtok\bgroup
+                        \let\next\sseq at defer@tikzcommand at group
+                    \else
+                        \let\next\sseq at defer@tikzcommand at other
+                    \fi
+                \fi
+            \fi
+        \fi
+    \fi
+    \sseq at call{\next}%
+}
+
+
+\def\sseq at defer@tikzcommand at option[#1]{%
+    \sseq at processoptions{tikz ~ primitives}{#1}%
+    \ifx\sseq at savedoptioncode\pgfutil at empty\else
+        \sseq at x@addto at macro\sseq at thepathsofar{[/utils/exec={\unexpanded\@xp{\sseq at savedoptioncode}}]}%
+    \fi
+    \sseq at g@addto at macro\sseq at whattheusersaid{[#1]}
+    \sseq at defer@tikzcommand@
+}
+
+\def\sseq at defer@tikzcommand at coord(#1){
+    \sseq at tikzprimitives@coord(#1)
+    \sseq at g@addto at macro\sseq at whattheusersaid{(#1)}
+    \sseq at defer@tikzcommand@
+}
+
+% When do groups occur in tikz commands? should we try to parse the inside?
+\def\sseq at defer@tikzcommand at group#1{
+    \sseq at g@addto at macro\sseq at whattheusersaid{{#1}}
+    \sseq at xprotected@addto at macro\sseq at thepathsofar{{#1}}%
+    \sseq at defer@tikzcommand@
+}
+
+\long\def\sseq at defer@tikzcommand at other#1{
+    \ifcat$\@xp\@gobble\string#1$ % test for control word. Won't catch active characters.
+        \@xp\use_i:nnn
+    \else
+        \@xp\ifx\csname sseq at illegalintikz@\string#1\endcsname\relax
+            \exp_last_unbraced:Nf \use_ii:nnn
+        \else
+            \exp_last_unbraced:Nf \use_iii:nnn
+        \fi
+    \fi{  % case i: it's not a control word. Just add it to the saved path
+        \sseq at g@addto at macro\sseq at whattheusersaid{#1}
+        \sseq at g@addto at macro\sseq at thepathsofar{#1}%
+        \sseq at defer@tikzcommand@
+    }{ % case ii: it's some different control word. Let's try full expanding it.
+       % note that here we cannot figure out what the user actually said, so we just have to report the f-expanded version.
+        \def\tempa{#1} % save the current value
+        \exp_last_unbraced:Nf \sseq at defer@tikzcommand at other@cs#1
+    }{ % case iii: it's an illegal control word (e.g., \class, \d, \begin, \end, ...) throw an error.
+        \sseq at error@xx{incomplete-tikz}{\unexpanded\@xp{\sseq at whattheusersaid}}{
+            \ifx\par#1 the ~ start ~ of ~ a ~ new ~ paragraph
+            \else \string#1\fi
+        }
+        \sseq at defer@tikzcommand at finish@ % finish@ doesn't try to grab a semicolon, which is good because there isn't one.
+        #1 % Reinsert the token that is causing us to stop
+    }
+}
+
+\def\sseq at defer@tikzcommand at other@cs#1{ % so we f expanded the control sequence, now we test if that did anything
+    \def\tempb{#1} % get the first f expanded token
+    \ifx\tempa\tempb
+        \@xp\@firstoftwo
+    \else
+        \@xp\@secondoftwo
+    \fi{% it didn't get expanded any more, so just add it to the stored stuff
+        \sseq at g@addto at macro\sseq at whattheusersaid{#1}
+        \sseq at g@addto at macro\sseq at thepathsofar{#1}
+        \sseq at defer@tikzcommand@
+    }{% it got expanded. Run it through the main loop again.
+        \sseq at defer@tikzcommand@#1
+    }
+}
+
+% Illegal control words:
+\long\def\sseq at setillegalcontrolwords#1{\sseq at setillegalcontrolwords@#1\sseq at nil}
+\long\def\sseq at setillegalcontrolwords@#1{
+    \ifx#1\sseq at nil\else
+        \@xp\def\csname sseq at illegalintikz@\string#1\endcsname{}
+        \@xp\sseq at setillegalcontrolwords@
+    \fi
+}
+
+% We missing anything here?
+\sseq at setillegalcontrolwords{
+    \class\classoptions\replaceclass\d\doptions\structline\structlineoptions\circleclasses
+    \savestack\restorestack\pushstack\nameclass\foreach\begin\end\par
+    \clip\coordinate\draw\fill\filldraw
+    \graph\matrix\node\path\pattern
+    \shade\shadedraw\useasboundingbox
+}
+
+
+\@xp\def\@xp\sseq at defer@tikzcommand at space\space{%
+    \sseq at g@addto at macro\sseq at thepathsofar{~}%
+    \sseq at g@addto at macro\sseq at whattheusersaid{~}
+    \sseq at defer@tikzcommand@
+}
+
+\def\sseq at defer@tikzcommand at finish;{
+    \sseq at g@addto at macro\sseq at whattheusersaid{;}
+    \sseq at defer@tikzcommand at finish@
+}
+
+% If the expression was incomplete, we'll jump here
+\def\sseq at defer@tikzcommand at finish@{
+    \sseq at g@addto at macro\sseq at thepathsofar{;}
+    \global\sseq at thiscalltoks\@xp{\sseq at whattheusersaid}
+    \ifx\sseq at pageconstraint\sseq at pageconstraint@true
+        \sseq at savedpaths@xadd{\unexpanded\@xp{\sseq at thepathsofar}}%
+    \else
+        \sseq at savedpaths@xadd{%
+            \@nx\sseq at tikzcommand@conditionaldraw{\unexpanded\@xp{\sseq at thepathsofar}}{\unexpanded\@xp{\sseq at pageconstraint}}
+        }%
+    \fi
+    \endgroup
+}
+
+
+\def\sseq at tikzcommand@conditionaldraw#1#2{%
+    \sseq at pgfmathparse@rescan{#2}%
+    \ifnum\pgfmathresult>\z@ #1 \fi
+}
+
+\def\sseq at pgfmathparse@rescan#1{\makeatletter\catcode`\&=12\relax\scantokens{\pgfmathparse{#1}}}
+
+%%% Coordinate parser, copied with huge simplifications from \tikz@@scan@@no at calculator, tikz.code.tex line 4994.
+%%% We don't need to handle any of the weird cases, we just need to know about them so we can give up and let tikz do the work later.
+% TODO: do same coordinate fixing for coordinates in calculations (yeah right! not even clear this is a good idea...)
+\def\sseq at tikzprimitives@coord(#1){
+    \begingroup
+    \let\next\sseq at tikzprimitives@coords at maybenamedclass
+    \ifsseq at tikzprims@integershift
+        \pgfutil at in@${#1}
+        \ifpgfutil at in@
+            \let\next\sseq at tikzprimitives@coords at handlemath
+        \else
+            \pgfutil at in@ :{#1}
+            \ifpgfutil at in@\else
+                \pgfutil at in@{intersection }{#1}
+                \ifpgfutil at in@\else
+                    \pgfutil at in@|{#1}%
+                    \ifpgfutil at in@\else
+                        \pgfutil at in@,{#1}
+                        \ifpgfutil at in@
+                            \let\next\sseq at tikzprimitives@coords at maybeclass
+                        \fi
+                    \fi
+                \fi
+            \fi
+        \fi
+    \fi
+    \next{#1}
+    \endgroup
+}
+\def\sseq at tikzprimitives@coords at maybeclass#1{
+    \let\next\sseq at tikzprimitives@coords at notaclass % most branches do this.
+    % First check whether there are any of the protect "to be determined later" variables like \xmax, etc. If there are, it's not a class
+    \sseq at protected@edef\sseq at temp@i{#1}
+    \edef\sseq at temp@ii{#1}
+    \ifx\sseq at temp@i\sseq at temp@ii
+        \@xp\sseq at tikzprimitive@getcoord at anchor#1.\sseq at nil % puts coord into \sseq at tempcoord, anchor if any into \sseq at tempanchor
+        \exp_args:NNo\pgfutil at in@.{\sseq at tempanchornopt} % If there's an extra . in the "anchor", it's not an anchor, and this is not a class
+        \ifpgfutil at in@\else
+            \exp_args:NNo \pgfutil at in@,{\sseq at tempcoord} % If the . we used to delineate the "anchor" was in the x-coordinate, it's not an anchor and this is not a class
+            \ifpgfutil at in@
+                \exp_args:NNo \pgfutil at in@,{\sseq at tempanchornopt} % If there is a comma in the "anchor" it's not an anchor and this is not a class
+                \ifpgfutil at in@\else
+                    \ifx\sseq at tempanchor\pgfutil at empty
+                        \sseq at tempiftrue
+                    \else % If there's an "anchor" we need to test whether the expression is a valid decimal coordinate. If it is, we're going to treat it as not a class
+                        % outputs into sseq at tempif, sets sseq at tempiffalse if it IS valid math, b/c then we're not a anchor
+                        \sseq at anchortrue % If this ends up getting handled as a tikz coordinate, we'll have to add an "anchor ignored" error
+                        \sseq at tikzprimitives@testlastcoord at validmathexpression#1,\sseq at nil
+                    \fi
+                    \ifsseq at tempif
+                        \@xp\sseq at tikzprimitives@ifintcoords\@xp{\sseq at tempcoord}{ % check we're all integer coordinates
+                            \sseq at parsecoord\coord{\sseq at tempcoord}{tikz ~ primitive}%
+                            \ifx\sseq at index\pgfutil at empty\else
+                                \sseq at x@addto at macro\sseq at thepathsofar{(sseq{\sseq at removeparens\coord}\sseq at tempanchor)}% Okay, we're all set, it's a class
+                                \let\next\@gobble % don't run \sseq at tikzprimitives@notaclass
+                            \fi
+                        }{}%
+                    \fi
+                \fi
+            \fi
+        \fi
+    \fi
+    \next{#1}
+}
+
+% Sets tempiffalse if if the second coordinate IS a valid math expression -- then t
+\def\sseq at tikzprimitives@testlastcoord at validmathexpression#1,#2,#3\sseq at nil{
+    \sseq at ifpgfmathexpr{#2}{
+        \sseq at tempiffalse
+    }{
+        \sseq at tempiftrue
+    }
+}
+
+\def\sseq at tikzprimitives@coords at maybenamedclass#1{
+    \sseq at tikzprimitive@getcoord at anchor#1.\sseq at nil % puts coord into \sseq at tempcoord, anchor if any into \sseq at tempanchor
+    \sseq at protectedeval{\@nx\sseq at obj@ifdef{class.namedclass.\@nx\detokenize{\sseq at tempcoord}}}{% need this detokenize here to prevent it from throwing errors when there's a command inside...
+        \sseq at x@addto at macro\sseq at thepathsofar{(sseq{\sseq at obj{class.namedclass.\sseq at tempcoord}\sseq at tempanchor})}
+    }{
+        \sseq at tikzprimitives@coords at notaclass{#1}
+    }
+}
+
+\let\sseq at tikzprimitives@coords at maybeclass@save\sseq at tikzprimitives@coords at maybeclass
+
+
+\def\sseq at tikzprimitives@coords at notaclass#1{
+    \def\next{\sseq at tikzprimitives@coords at notaclass@leavetotikz{#1}}
+    \pgfutil at in@${#1}
+    \ifpgfutil at in@\else
+        \pgfutil at in@ :{#1}
+        \ifpgfutil at in@\else
+            \pgfutil at in@{intersection }{#1}
+            \ifpgfutil at in@\else
+                \pgfutil at in@|{#1}%
+                \ifpgfutil at in@\else
+                    \pgfutil at in@,{#1}
+                    \ifpgfutil at in@
+                        \def\next{\sseq at tikzprimitives@coords at notaclass@handle{#1}}
+                    \fi
+                \fi
+            \fi
+        \fi
+    \fi
+    \next
+}
+
+\def\sseq at tikzprimitives@coords at notaclass@leavetotikz#1{
+    \sseq at g@addto at macro\sseq at thepathsofar{(#1)}
+}
+
+\def\sseq at tikzprimitives@coords at notaclass@handle#1{
+    \ifsseq at anchor
+        % Still seems impossible to trigger this?
+        \sseq at error@xxx{anchor-ignored}{(#1)}{(\unexpanded\@xp{\sseq at tempcoord})}{\sseq at tempanchor}
+        \@xp\sseq at tikzprimitives@coords at notaclass@handle@\sseq at tempcoord,\sseq at nil
+    \else
+        \sseq at tikzprimitives@coords at notaclass@handle@#1,\sseq at nil
+    \fi
+}
+
+\def\sseq at tikzprimitives@coords at notaclass@handle@#1,#2,#3\sseq at nil{
+    \sseq at ifempty{#3}{
+        \let\sseq at index\pgfutil at empty
+    }{
+        \edef\sseq at index{,\unexpanded\@xp{\sseq at removecomma#3\sseq at nil}}
+        \edef\sseq at indexnocomma{\unexpanded\@xp{\sseq at removecomma#3\sseq at nil}}
+    }
+    \sseq at ifpgfmathexpr{#1}{
+        % Decide whether we can keep the result, which is stored in \sseq at mathresult
+        \protected at edef\sseq at tempa{#1}
+        \edef\sseq at tempb{#1}
+        \ifx\sseq at tempa\sseq at tempb
+            \let\sseq at tempx\sseq at mathresult
+        \else
+            \def\sseq at tempx{#1}
+        \fi
+    }{
+        \sseq at error@xx{invalid-tikz-coord}{(#1,#2\sseq at index)}{x}
+        \def\sseq at defer@tikzcommand at finish;{\endgroup}
+    }
+    \sseq at ifpgfmathexpr{#2}{
+        % Decide whether we can keep the result, which is stored in \sseq at mathresult
+        \protected at edef\sseq at tempa{#2}
+        \edef\sseq at tempb{#2}
+        \ifx\sseq at tempa\sseq at tempb
+            \let\sseq at tempy\sseq at mathresult
+        \else
+            \def\sseq at tempy{#2}
+        \fi
+    }{
+        \sseq at error@xx{invalid-tikz-coord}{(#1,#2\sseq at index)}{y}
+        \def\sseq at defer@tikzcommand at finish;{\endgroup}
+    }
+    \def\sseq at tempa{#1}
+    \ifx\sseq at index\pgfutil at empty\else
+        \sseq at error@xxx{index-ignored}{(\unexpanded{#1,#2}\unexpanded\@xp{\sseq at index})}{\unexpanded{(#1,#2)}}{\unexpanded\@xp{\sseq at indexnocomma}}
+    \fi
+    \sseq at xprotected@addto at macro\sseq at thepathsofar{(\sseq at tempx,\sseq at tempy)}
+}
+
+\def\sseq at tikzprimitives@ifintcoords#1{\sseq at tikzprimitives@ifintcoords@#1,\sseq at nil}
+\def\sseq at tikzprimitives@ifintcoords@#1,#2,#3\sseq at nil{%
+    \sseq at ifintexpr{#1}{%
+        \sseq at ifintexpr{#2}{%
+            \@firstoftwo
+        }{\@secondoftwo}%
+    }{\@secondoftwo}%
+}
+\def\sseq at tikzprimitives@coords at handlemath#1{\sseq at tikzprimitives@coords at handlemath@(#1)}
+\def\sseq at tikzprimitives@coords at handlemath@#1$#2$){\sseq at g@addto at macro\sseq at thepathsofar{#1$#2$)}}
+\def\sseq at tikzprimitive@getcoord at anchor#1.#2\sseq at nil{
+    \def\sseq at tempcoord{#1}
+    \ifx\sseq at nil#2\sseq at nil
+        \def\sseq at tempanchor{}
+        \def\sseq at tempanchornopt{}
+    \else
+        \edef\sseq at tempanchor{.\sseq at tikzprimitive@getcoord at anchor@eatdot#2}
+        \edef\sseq at tempanchornopt{\sseq at tikzprimitive@getcoord at anchor@eatdot#2}
+    \fi
+}
+\def\sseq at tikzprimitive@getcoord at anchor@eatdot#1.{#1}
+\def\sseq at uptopt#1.#2\sseq at nil{#1}
+%%% Page constraint and \isalive
+% #1 -- the new page constraint
+% #2 -- a binary logical operator (&& or ||).
+\def\sseq at updatepageconstraint#1#2{
+    \def\sseq at isaliveprotect{}
+    \let\sseq at isalive@\sseq at isalive@active
+    \bgroup
+    % Was pretty hard to get \isalive to report errors correctly. And to work in general >_<
+    \let\sseq at isalive@parens\sseq at isalive@parens at check
+    \sseq at d@addto at macro\sseq at error@hook{\let\protect\relax}%
+    \let\protect\@unexpandable at protect
+    \edef\sseq at error@annotation{\unexpanded{.^^J(In page constraint "#1")}\unexpanded\@xp{\sseq at error@annotation}}
+    \selectfont\sseq at restorefont
+    \setbox0=\hbox{#1}
+    \egroup
+    \sseq at protected@edef\sseq at pageconstraint{(\unexpanded\@xp{\sseq at pageconstraint})#2(#1)}
+}
+
+
+%TODO: fix this...
+\def\sseq at updatepageconstraintrange{%
+    \sseq at protected@edef\sseq at pageconstraint{%
+        (\unexpanded\@xp{\sseq at pageconstraint})&&(\temp<=\page \ifx\tempmax\empty\else&&\page<=\tempmax\fi)%
+    }%
+}
+
+% This protect variant allows us to delay evaluation of \isalive, just so that we can
+% capture something close to the original argument to (does this matter anymore?)
+\let\sseq at isaliveprotect\relax
+\def\sseq at isaliveprotect@protect{\@nx\sseq at isaliveprotect\@nx}
+\def\sseq at isalive{\sseq at isaliveprotect\sseq at isalive@}
+\def\sseq at isalive@{\sseq at isalive@error}
+\def\sseq at isalive@error{\sseq at error{is-alive-illegal-here}}
+\def\sseq at isalive@active#1{%
+    \@xp\ifx\@xp$\@gobble#1$%
+        \@xp\sseq at isalive@parens\@xp#1%
+    \else
+        \sseq at isalive@list#1\sseq at nil
+    \fi
+}
+\def\sseq at isalive@list(#1)#2{%
+    \sseq at isalive@parens(#1)%
+    \ifx\sseq at nil#2\else
+        &&\@xp\sseq at isalive@list\@xp#2%
+    \fi
+}
+
+\def\sseq at isalive@parens at check(#1){
+    \sseq at parsecoord\coord{#1}{\string\isalive}
+}
+\def\sseq at isalive@parens(#1){\sseq at parsecoordex\sseq at isalive@parens@(#1)}
+\def\sseq at isalive@parens@(#1,#2,#3){\@nx\sseq at isalive@final{#1}{#2}{#3}{\sseq at obj{class.(#1,#2,#3).num}}}
+\def\sseq at isalive@final#1#2#3#4{%
+    \ifnum\sseq at obj{class.(#1,#2,#3)[#4].page}<\sseq at thepagecount
+        0%
+    \else
+        \ifnum#4=\z@
+            1%
+        \else
+            \ifnum\sseq at obj{class.(#1,#2,#3)[\the\numexpr #4-1\relax].page}=\sseq at thepagecount
+                0%
+            \else
+                1%
+            \fi
+        \fi
+    \fi
+}
+
+
+
+
+
+%%%
+%%% This is a macro for typesetting monomials.
+%%%
+
+% We need to check for math subscript characters
+\char_set_catcode_math_subscript:N \_
+
+\protected\def\sseqnormalizemonomial#1{
+    \bgroup
+    \def\sseq at support{}
+    \sseq at ifempty{#1}{1}{
+        \sseqnormalizemonomial@#1\sseq at nil
+    }
+}
+\def\sseqnormalizemonomial@#1{
+    \pgfkeys at spdef\sseq at var{#1}
+    \def\sseq at power{1}
+    \def\sseq at subscript{}
+    \futurelet\testtok\sseqnormalizemonomial@@
+}
+
+\def\sseqnormalizemonomial@@{
+    \ifx\testtok^
+        \let\next\sseqnormalizemonomial at sup
+    \else
+        \ifx\testtok_
+            \let\next\sseqnormalizemonomial at sub
+        \else
+            \let\next\sseqnormalizemonomial at add
+        \fi
+    \fi
+    \next
+}
+
+\def\sseqnormalizemonomial at sup^#1{
+    \edef\sseq at power{\the\numexpr#1\relax}
+    \futurelet\testtok\sseqnormalizemonomial@@
+}
+
+\def\sseqnormalizemonomial at sub_#1{
+    \def\sseq at subscript{_{#1}}
+    \futurelet\testtok\sseqnormalizemonomial@@
+}
+
+\def\sseqnormalizemonomial at add{
+    \def\temp{1}
+    \ifx\sseq at var\temp\else
+        \edef\sseq at var{\unexpanded\@xp{\sseq at var}\unexpanded\@xp{\sseq at subscript}}
+        \@ifundefined{\sseqnormalizemonomial at varcs}{
+            \@xp\edef\csname\sseqnormalizemonomial at varcs\endcsname{\sseq at power}
+            \sseq at e@addto at macro\sseq at support{\@nx\\{\unexpanded\@xp{\sseq at var}}{\sseqnormalizemonomial at varcs}}%
+        }{
+            \@xp\edef\csname\sseqnormalizemonomial at varcs\endcsname{\the\numexpr\csname\sseqnormalizemonomial at varcs\endcsname + \sseq at power}
+        }
+    \fi
+    \sseqnormalizemonomial at 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 at nil, \futurelet will grab the the open brace and not see
+% the \sseq at nil. So we use a full expansion and don't put braces around \sseq at nil if that's our argument.
+% MOTHERFUCKING SPACES.
+\def\sseqnormalizemonomial at id#1{
+    \ifx\sseq at nil#1
+        \@xp\@firstoftwo
+    \else
+        \@xp\@secondoftwo
+    \fi{\@nx\sseq at nil}{{#1}}
+}
+
+\def\sseqnormalizemonomial at testend{
+    \ifx\testtok\sseq at nil
+        \sseqnormalizemonomial at done
+        \sseq at smuggle@macro\processedlabel
+        \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 at id...
+            % LaTeX is really really weird.
+            \def\next{\@xp\futurelet\@xp\testtok\@xp\sseqnormalizemonomial at testend\romannumeral-`0\sseqnormalizemonomial at id}
+        \else
+            \let\next\sseqnormalizemonomial@
+        \fi
+    \fi
+    \next
+}
+
+\def\sseqnormalizemonomial at varcs{sseqnormalizemonomial at var@\detokenize\@xp{\sseq at var}}
+
+\def\sseqnormalizemonomial at done{
+    \def\processedlabel{}
+    \def\\##1##2{
+        \sseq at tempcount=\csname ##2\endcsname\relax
+        \ifnum\sseq at tempcount=\z@
+        \else
+            \ifnum\sseq at tempcount=\@ne
+                \sseq at d@addto at macro\processedlabel{##1}
+            \else
+                \sseq at e@addto at macro\processedlabel{\unexpanded{##1}^{\the\sseq at tempcount}}
+            \fi
+        \fi
+    }
+    \sseq at support
+    \ifx\processedlabel\pgfutil at empty % use 1 for empty monomial
+        \def\processedlabel{1}
+    \fi
+}
+
+% Restore catcode of underscore to letter
+\catcode`\_ = 11\relax
+
+
+
+
+\ExplSyntaxOff 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqparsers.code.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2017-06-19 21:07:40 UTC (rev 44639)
@@ -563,7 +563,7 @@
     snapshot snotez
     songbook songs sort-by-letters soton soul soup sourcecodepro sourcesanspro
     sourceserifpro
-    spalign spanish-mx sparklines spath3 spelling spie
+    spalign spanish-mx sparklines spath3 spectralsequences spelling spie
     sphack sphdthesis splines splitbib splitindex
     spot spotcolor spreadtab spverbatim
     sr-vorl srbook-mem srcltx srcredact sseq sslides

Modified: trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc	2017-06-19 14:00:21 UTC (rev 44638)
+++ trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc	2017-06-19 21:07:40 UTC (rev 44639)
@@ -113,6 +113,7 @@
 depend signchart
 depend smartdiagram
 depend spath3
+depend spectralsequences
 depend swimgraf
 depend table-fct
 depend texdraw

Added: trunk/Master/tlpkg/tlpsrc/spectralsequences.tlpsrc
===================================================================


More information about the tex-live-commits mailing list