texlive[44942] Master/texmf-dist: spectralsequences (3aug17)

commits+karl at tug.org commits+karl at tug.org
Thu Aug 3 23:07:31 CEST 2017


Revision: 44942
          http://tug.org/svn/texlive?view=revision&revision=44942
Author:   karl
Date:     2017-08-03 23:07:30 +0200 (Thu, 03 Aug 2017)
Log Message:
-----------
spectralsequences (3aug17)

Modified Paths:
--------------
    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/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

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/spectralsequences/README.md
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_2.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_2.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_3.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_3.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_2.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_2.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_3.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_3.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-tmf_2.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-tmf_2.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-EO2_3.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-EO2_3.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-KO.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-KO.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/J_RPinfty.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/J_RPinfty.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-bo-A1.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-bo-A1.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-tmf-A2.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-tmf-A2.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KF3n.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KF3n.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KZ3.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KZ3.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/hatcher.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/hatcher.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/unstable_ASS_SO.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/unstable_ASS_SO.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.pdf
    trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.tex
    trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual-layoutcharts.tex

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/spectralsequences/README
    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/tex/latex/spectralsequences/spectralsequences.sty

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/README	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/README	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,8 +0,0 @@
-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

Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/README.md	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,49 @@
+
+spectralsequences v1.1.0
+========================
+Author: Hood Chatham  
+Email: hood at mit.edu  
+Date: 2017-08-02  
+License: All files have the Latex Project Public License.  
+Description: Print spectral sequence diagrams using pgf/tikz.  
+
+
+See the file manual/spectralsequencesmanual.pdf for a manual. See the examples directory for a large number of example files.
+Email me at hood at mit.edu to submit bug reports, request new features, etc. The current development copy is hosted at https://github.com/hoodmane/spectralsequences. 
+
+Changelog:
+==========
+    
+## [Unreleased] 
+
+### Added:
+- \sseqparseint
+- \parsecoordinate and \parsedifferential
+- \IfInBoundsTF, \IfOutOfBoundsTF
+- New loop constructs \Do, \DoUntilOutOfBounds, \DoUntilOutOfBoundsThenNMore
+- \kill which kills a class without having to put a differential
+- \lastclass as default arguments for \replaceclass, \classoptions, \d/\doptions, \structline/\structlineoptions
+- Pin key for labels
+- Families 
+- Insert key for new classes allows control over relative class placement without reordering commands
+- Draw differentials from a range of pages.
+- Frame axis type, tick marks.
+
+### Changed:
+- Ticks are now placed at values congruent to tick offset mod tick step, tick offset defaults to 0
+- What was called "x axis style" is now called "x axis type".
+
+### Fixed: 
+- The \tagclass command works now.
+- Scopes now nest properly.
+- Fixed a big performance issue with nested scopes and shifts. 
+- Adobe reader grid color is now correct (or more correct)
+- Fixed the grid drawing so that grids are handled correctly when the range includes negative numbers
+- The package now works with xparse after 2017/02/08 when changes were made that broke my original code
+- Fixed a bug where if you used a structline in two sseqpage environments with the same name, it would give an error. 
+- Now if you say \structline(0,0)(0,1) \structlineoptions(0,1)(0,0) it will work correctly.
+- Big ranges like 0 - 600 now work, provided that you provide an appropriate scale
+- Big range like 600 - 700 no longer will cause an overflow
+- Labels now are rectangle nodes so they don't shift down if they are very wide
+- Fixed a bug with ranges and the sseqpage environment where classes lying outside the printed range would enlarge the range even if an explicit range was specified.
+- The chess grid works correctly now


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

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_2.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_2.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_2.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_2.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/ANSS-S_2.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_2.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_2.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,175 @@
+%%
+%% Description: Adams Novikov Spectral Sequence for $S_2$
+
+\documentclass{spectralsequence-example}
+
+% figure out how to get width("\noexpand\small 16") working
+\sseqset{ppower/.sseq style={
+    rectangle,"#1" {inside, font=\tiny},
+    minimum height=width("16"),
+    minimum width=width("16")
+}}
+
+\sseqnewfamily{imJ}
+\begin{document}
+
+\NewSseqCommand\etaclass{O{}d()}{
+    \IfNoValueF{#2}{\pushstack(#2)}
+    \class[#1](\lastx+1,\lasty+1)
+    \structline(\lastclass1)(\lastclass)
+}
+
+\NewSseqCommand\divetaclass{O{}d()}{
+    \IfNoValueF{#2}{\pushstack(#2)}
+    \class[#1](\lastx-1,\lasty-1)
+    \structline(\lastclass1)(\lastclass)
+}
+
+\NewSseqCommand\nuclass{O{}d()}{
+    \IfNoValueF{#2}{\pushstack(#2)}
+    \class[#1](\lastx+3,\lasty+1)
+    \structline(\lastclass1)(\lastclass)
+}
+
+\NewSseqCommand\nustruct{d()}{
+    \IfNoValueF{#1}{\pushstack(#1)}
+    \structline(\lastx-3,\lasty-1,-1)(\lastclass)
+}
+
+\begin{sseqdata}[
+    name=ANSS-S_2, Adams grading,
+    class labels={below},
+    %label distance=-1pt,
+    below label distance=0pt,
+    classes={tooltip={(\xcoord,\ycoord)}},
+    class pattern = linear,
+    class placement transform={rotate=90,scale=2},
+    differentials=blue,
+    x range={0}{40},
+    y range={0}{10},
+    xscale=0.7,
+    yscale=1.7,
+    grid=go,
+    right clip padding=2em
+]
+\begin{scope}[imJ]
+\class[rectangle,fill,inner sep=3pt](0,0)
+\DoUntilOutOfBoundsThenNMore{3}{\etaclass}
+\classoptions["\alpha_1" above left](1,1)
+
+\class["\alpha_{2/2}",circlen=2](3,1)
+\nustruct
+\structline[dashed](3,1)(3,3)
+
+
+\class["\alpha_3"](5,1)
+\d3(\lastclass)
+\DoUntilOutOfBounds{\etaclass\d3(\lastclass)}
+
+\class["\alpha_{4/4}",ppower=16](7,1)
+\DoUntilOutOfBoundsThenNMore{3}{\etaclass}
+
+\class["\alpha_{5}"](9,1)
+\DoUntilOutOfBoundsThenNMore{3}{\etaclass}
+
+\class["\alpha_{6/3}", circlen=3](11,1)
+\d3(\lastclass)
+\DoUntilOutOfBounds{\etaclass\d3(\lastclass)}
+\replaceclass["\alpha_{6/2}", circlen=2](11,1)
+\structline[dashed](11,1)(11,3)
+
+\class["\alpha_7"](13,1)
+\d3(\lastclass)
+\DoUntilOutOfBounds{\etaclass\d3(\lastclass)}
+
+
+\class["\alpha_{8/5}",ppower=32](15,1)
+\DoUntilOutOfBoundsThenNMore{3}{\etaclass}
+
+\class["\alpha_9"](17,1)
+\DoUntilOutOfBoundsThenNMore{3}{\etaclass}
+
+\class["\alpha_{10/3}",circlen=3](19,1)
+\d3(\lastclass)
+\DoUntilOutOfBounds{\etaclass\d3(\lastclass)}
+\replaceclass["\alpha_{10/2}",circlen=2](19,1)
+\structline[dashed](19,1)(19,3)
+
+\class["\alpha_{11}"](21,1)
+\d3(\lastclass)
+\DoUntilOutOfBounds{\etaclass\d3(\lastclass)}
+\end{scope}
+
+\class["\beta_{2/2}"](6,2)
+\nustruct
+\class["\beta_{2}" below](8,2)
+\etaclass\structline(\lastclass)(6,2,2) % This is a *nu
+
+\class["\beta_3" left,insert = 1](14,2)
+\etaclass[insert=1](14,2,-1)
+\divetaclass["\beta_{4/4}" left, insert = 2]
+\nuclass(14,2,2)\nuclass[circlen=2]\nuclass[circlen=3]\nuclass["P\beta_{2/2}" above left]
+\nuclass\divetaclass["P\beta_2"]
+
+
+\class["\beta_{4/3}",insert=1](16,2)
+\etaclass[insert=1]\etaclass[insert=1]
+\class["\beta_{4/2,2}",circlen=2](18,2)
+\structline[dashed,](18,2,-1)(18,4,-1)
+
+\class["\eta_2"](19,3)
+\etaclass
+
+\class["\beta_{4}"below](20,2)
+\structline[dashed,bend left=20](20,2,-1)(20,4,2)
+%\structlineoptions[](20,2,-1)(20,4,2)%page=0--3
+\etaclass\etaclass\structline(\lastclass)(\lastx+1,\lasty+1,-1)
+
+\nuclass["\alpha_{4/4}^3" {above left=-1pt}](18,2,-1)
+
+
+
+\class["\eta_{3/2}"](23,3)
+\etaclass\etaclass
+
+\class["\beta_5" below](26,2)
+\d3(\lastclass,-1)
+
+\class["\beta_{8/8}" ](30,2)
+\etaclass
+\class["\beta_{6/2}" left](30,2)
+\d5(\lastclass)
+
+\class["\gamma_3" left](31,3)
+\nuclass
+\class["\eta_{5/3}"](33,4)
+
+\class["\beta_{8/7}"](32,2)
+\etaclass\etaclass\etaclass\etaclass\etaclass\etaclass
+\class["\beta_{6}"left](32,2)\etaclass
+
+\class["x_{32}"](32,4)\etaclass\etaclass["P\beta_{4/4}" right]
+\class["x_{36}"](36,4)
+\nuclass(32,4,-1)\nuclass
+
+\class["P\beta_3" above left](34,6)\etaclass\nuclass(34,6,-1)
+
+\class["\beta_{8/6,2}",circlen=2](34,2)
+\etaclass\nuclass(\lastclass1)
+
+\class["\gamma_{4/2,2}" right](37,3)
+\class["\beta_{8/4,2}",circlen=2](38,2)
+\class["\beta_{7}" right](38,2)
+\class["d_{4/4}\beta_{8/7}" right](39,3)
+\class["x''_{39}" right](39,3)
+\class["\gamma_{4,2}" right](39,3)
+\class["x_{39}'"](39,5)
+\class["P\eta_2"](39,7)
+\end{sseqdata}
+
+\printpage[name=ANSS-S_2]
+
+\printpage[name=ANSS-S_2,page=5]
+
+\printpage[name=ANSS-S_2, no imJ]
+\end{document} 
\ No newline at end of file


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

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_3.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_3.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_3.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_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/ANSS-S_3.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_3.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_3.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,92 @@
+%%
+%% Description: Adams Novikov Spectral Sequence for $S_3$
+%%
+%% File: example_anss3.tex
+%%
+%%    Draws the Adams Novikov spectral sequence at the prime 3 through the 45 stem.
+%%    In this range, all we see is the Toda differential d_{2p-1}(\beta_{p/p}) = \alpha\beta^p
+%%    Thanks to Eric Peterson for contributing this diagram. Presumably he copied it from page 13 of the green book.
+%%    Compare this to page 5 of example_ass3
+%%
+
+\documentclass{spectralsequence-example}
+\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)
+}
+
+\centering
+\begin{sseqpage}[
+    Adams grading,
+    classes = { tooltip = {(\xcoord,\ycoord)}, inner sep=1.2pt },
+    class labels = below,
+    label distance=3pt,
+    differentials={-{>[width=4]}, target anchor=-60},
+    y range={0}{11},
+    x range={0}{45},
+    x tick step=5,
+    xscale=0.7,
+    yscale=1.2,
+    y axis gap=2em
+]
+\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" left](26,2)
+\class["\beta_{3/3}" left](34,2)
+\class["\beta_{3/2}" {left}](38,2)
+\class["\beta_3" left](42,2)
+
+% tower off of beta_1
+\alphaclass(10,2)\betaclass
+\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)
+
+%% Doug's contributions
+\classoptions["{\left<\alpha_1,\alpha_1,\beta_1^3\right>}" {below right=0em}](37,3)
+\structline[dashed](37,3)(40,8)
+
+
+\end{sseqpage}
+
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ANSS-S_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/ASS-S_2.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_2.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_2.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_2.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_2.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/ASS-S_2.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_2.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_2.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,399 @@
+%%
+%% Description: Adams Novikov Spectral Sequence for $S_2$
+%%
+%%
+%%    Draws the Adams Spectral Sequence at the prime 2 through the 45 stem.
+%%    See pages 146 - 147 of Green book
+%%    https://mathoverflow.net/questions/102316/differentials-in-the-adams-spectral-sequence-for-spheres-at-the-prime-p-2
+%%    https://en.wikipedia.org/wiki/Homotopy_groups_of_spheres#Table_of_stable_homotopy_groups
+%%
+
+
+\documentclass{spectralsequence-example}
+
+
+\begin{document}
+\sseqset{imJ/.sseq style={purple}}
+
+
+\NewSseqCommand\twoclass{O{}d()}{
+    \IfNoValueF{#2}{\pushstack(#2)}
+    \class[#1](\lastx,\lasty+1)
+    \structline(\lastclass1)(\lastclass)
+}
+
+\NewSseqCommand\divtwoclass{O{}d()}{
+    \IfNoValueF{#2}{\pushstack(#2)}
+    \class[#1](\lastx,\lasty-1)
+    \structline(\lastclass1)(\lastclass)
+}
+
+
+\NewSseqCommand\etaclass{O{}d()}{
+    \IfNoValueF{#2}{\pushstack(#2)}
+    \class[#1](\lastx+1,\lasty+1)
+    \structline(\lastclass1)(\lastclass)
+}
+\NewSseqCommand\divetaclass{O{}d()}{
+    \IfNoValueF{#2}{\pushstack(#2)}
+    \class[#1](\lastx-1,\lasty-1)
+    \structline(\lastclass1)(\lastclass)
+}
+\NewSseqCommand\etastruct{d()}{
+    \IfNoValueF{#1}{\pushstack(#1)}
+    \structline(\lastx-1,\lasty-1,-1)(\lastclass)
+}
+
+
+\NewSseqCommand\nuclass{O{}d()}{
+    \IfNoValueF{#2}{\pushstack(#2)}
+    \class[#1](\lastx+3,\lasty+1)
+    \structline(\lastclass1)(\lastclass)
+}
+
+\NewSseqCommand\nustruct{d()}{
+    \IfNoValueF{#1}{\pushstack(#1)}
+    \structline(\lastx-3,\lasty-1,-1)(\lastclass)
+}
+
+\NewSseqCommand\hznudiamond{d()}{
+    \IfNoValueF{#1}{\pushstack(#1)}
+    \savestack
+    \class(\lastx,\lasty+1)
+    \structline(\lastclass1)(\lastclass)
+    \nustruct
+    \restorestack
+}
+
+\NewSseqCommand\etanudiamond{d()}{
+    \IfNoValueF{#1}{\pushstack(#1)}
+    \savestack
+    \class(\lastx+1,\lasty+1)
+    \structline(\lastclass1)(\lastclass)
+    \nustruct
+    \restorestack
+}
+
+\NewSseqCommand \czero {O{} r() }{
+    \savestack
+    \class[#1](#2)
+    \etaclass
+    \restorestack
+}
+
+\NewSseqCommand\tower {O{}d()mO{}} {
+    \begin{scope}[#4]
+    \IfNoValueF{#2}{\class[#1](#2)}
+    \savestack
+    \Do{#3-1}{
+        \class(\lastx, \lasty+1)
+        \structline(\lastclass)(\lastclass1)
+    }
+    \restorestack
+    \end{scope}
+}
+
+
+\NewSseqCommand \towergroup {o r() m O{}} {
+    \tower(#2){#3}[#4]
+    \IfNoValueF{#1}{\classoptions[#1](#2)}
+    \etaclass\etaclass\etaclass
+    \nustruct\divtwoclass\nustruct\divtwoclass
+    \nustruct\nuclass
+}
+
+
+\protected\def\Psqvphant{\vphantom{P^2}}
+\NewSseqGroup \Phone { mm } {
+    \class["#1h_1#2"](0,0)
+    \etaclass\etaclass
+    \divtwoclass\divtwoclass["\Psqvphant#1h_2#2" {below=-4pt}]
+}
+
+\NewSseqGroup \Phonegroup {G{}}{
+    \sseqset{class label handler = { \sseqnormalizemonomial{##1} }}
+    \czero["#1c_0" above](-1,-2)
+    \Phone[imJ]{P#1}{}
+    \nuclass[imJ]\divtwoclass[imJ]\divtwoclass["#1d_0" left,name=d0]
+    \etaclass\etaclass\etaclass
+    \nustruct\divtwoclass\nustruct\divtwoclass\nustruct\divtwoclass["#1e_0" left,name=e0]
+    \nuclass\hznudiamond
+    \divtwoclass
+    \classoptions["#1g" {below=0.3em},page=0-3](\lastclass)
+    %\etanudiamond
+
+    % Have to go back and draw path e0 to g
+    \savestack
+    \d2(e0,-1)
+    \etaclass(e0)\d2(\lastclass,-1)
+    \divtwoclass[name=f0]\d2(\lastclass,-1)
+    \nuclass[name=nuf0]
+    \etastruct % Now we're back at g
+    \restorestack
+    \nuclass[name=nug]\hznudiamond\nuclass[name=nu2g]
+}
+
+
+\NewSseqGroup \Phonegroupb {G{}}{
+    \Phonegroup{P#1}
+
+    \divtwoclass["\Psqvphant#1j" {below left=-1pt,yshift=2pt}](f0) \d2(\lastclass,-1)
+    \divtwoclass(nuf0) \d2(\lastclass,-1)
+    \nustruct\divtwoclass["\Psqvphant#1k" {below=-1pt}] \d2(\lastclass,-1)
+    \nuclass\d2(\lastclass,-1)
+    \hznudiamond
+    \divtwoclass["\Psqvphant#1l" {below left=-1pt,yshift=2pt}]\d2(\lastclass,-1)
+    \nuclass\d2(\lastclass,-1)\hznudiamond
+    \divtwoclass["\Psqvphant#1m" {below left=-3pt},name=m]
+
+    \divtwoclass(nug)\structline(\lastclass)(\lastx+1,\lasty+1)
+    \divtwoclass(nu2g)\nustruct
+    \divtwoclass\structline(\lastclass)(\lastx+1,\lasty+1)
+    \d2(m,-1)
+}
+
+
+
+\begin{sseqdata}[
+    name = ASS-S_2,
+    Adams grading,
+    classes=fill,
+    class labels={above left=0.2em,black},
+    x range={0}{46},
+    y range={0}{23},
+   % xscale=0.7,
+   % yscale=0.8,
+    differentials = blue,
+    classes = { tooltip = { (\xcoord,\ycoord) } },
+    grid = go,
+    run off = -
+]
+\towergroup(0,0){\ymax-\ymin+2}
+\classoptions["h_2" below](3,1)
+\nuclass
+\divetaclass\divetaclass["h_3" below]
+\tower{4}
+
+
+\Phonegroup(9,5)
+\classoptions["f_0"](f0)
+
+\Phonegroupb(17,9)
+\pushstack(d0)
+\tower["i" {below left,yshift=2pt}](23,7){6}[imJ]
+\structline(\lastclass)(\lastx+3,\lasty+1,-1)
+\structline(\lastx,\lasty+1)(\lastx+3,\lasty+2,-1)
+\d2(23,7)
+\d2(23,8)
+
+\Phonegroupb(25,13){P}
+\Phonegroupb(33,17){P^2}
+\tower["P^2i" {below left,yshift=2pt}](39,15){6}[imJ]
+\structline(\lastclass)(\lastx+3,\lasty+1,-1)
+\structline(\lastx,\lasty+1)(\lastx+3,\lasty+2,-1)
+\d2(39,15)
+\d2(39,16)
+\d4(39,12)
+\d4(40,13,,1)
+
+\Phonegroup(41,21){P^4}
+\tower["P^2i" {below left,yshift=2pt}](47,19){6}[imJ]
+\d2(47,19)
+\d2(47,20)
+
+\towergroup["h_4" below](15,1){8}[imJ]
+\classoptions["h_3^3" below](\lastclass)
+
+\tower["h_3^2" left](14,2){2}
+\d2(15,1) % d2(h_4) = h_0h_3^2
+\d3(15,2)\d3(15,3) % d2(h_0h_4) = h_0d_0
+
+\class["c_1"](19,3)\nuclass
+\czero["h_4c_0"](23,4)
+
+
+
+\towergroup["h_5" below](31,1){16}[imJ]
+\nuclass
+\divetaclass\divetaclass["h_3h_5" {below=-2pt}]
+\tower{4}
+
+\class["n"{above=-0.5pt}](31,5)
+\nuclass\nuclass
+\divetaclass["t"]
+\nuclass["c_1g"]
+
+\class["q" {below right=-0.7pt}](32,6)
+\etaclass
+
+\class["p"](33,4)
+\twoclass\divetaclass["d_1"]
+\nuclass\nuclass
+\divetaclass["x" below]\tower{6}
+
+\d[bend left=15]4(38,3,,2)
+\d[bend left=30]4(38,2)
+
+
+\tower["h_4^2" below](30,2){4}
+\etaclass
+\tower["r" left](30,6){6}
+\d3(\lastclass)
+
+\d2(31,1)\d2(31,2)\d2(31,3)
+\d3(31,4)\d3(31,5)\d3(31,6)\d3(31,7)\d3(31,8,-1)
+\d4(31,8,1)\d4(32,9,,1)
+\d4(31,9,-1,-1)\d4(31,10,-1,-1)
+
+\d3(34,2)
+
+
+\class(38,6)\d2(\lastclass,-1)
+\twoclass\d2(\lastclass,-1)
+\twoclass\nustruct\d2(\lastclass,-1)
+\twoclass\nustruct\d4(\lastclass,-1)
+\divetaclass["e_0g"]\d4(\lastclass,-1)
+
+\czero[pin distance=3em,pin=below right:h_5c_0"](39,4)
+
+\class["e_1" {below=-1pt}](38,4)
+\d3(\lastclass,1)
+\etaclass\etaclass\divtwoclass\divtwoclass["f_1" below]
+\etaclass
+\divtwoclass\d2(\lastclass)
+\divtwoclass\d2(\lastclass,-1)
+
+
+\Phone(40,6){P}{h_5}
+
+\class["u"](39,9)\etaclass\etaclass\divtwoclass
+
+\class["g^2"](40,8)
+\class["v"](42,9)
+\d2(\lastclass)
+
+\tower["P^2r" {below=-4pt}](46,14){6}
+\d3(\lastclass)
+
+\class["Pe_0g" right](45,12)
+\d4(\lastclass)
+
+\class["w"](45,9)
+
+\class["d_0r" right](44,10)
+\d3(\lastclass)
+
+
+\class["h_4^3" below](45,3)\twoclass
+
+\tower["h_5d_0" {below right=-2pt}](45,5){3}
+\etaclass\etaclass
+\nuclass(45,5)\hznudiamond
+\nustruct(45,7)
+
+\tower["g_2" below](44,4){3}
+\etaclass
+
+\class["N"](46,8)
+\class["gj"](46,11)
+
+\tower(47,13){12}
+\foreach \y in {13,...,18} { \d2(47,\y)}
+\end{sseqdata}
+\centering
+
+\begin{sseqpage}[
+    page=7,
+    name=ASS-S_2, Adams grading,
+    class labels={below},
+    %label distance=-1pt,
+    below label distance=0pt,
+    differentials=blue,
+    x range={0}{40},
+    y range={0}{10},
+    xscale=0.7,
+    yscale=1.7,
+    grid=go,
+    right clip padding=2em
+]
+\structline[dashed,bend right=20](15,4)(16,7,1)
+\structline[dashed,bend right=20](23,9,2)(24,11)
+\structline[dashed,bend right=20](31,11)(32,15)
+\structline[dashed,bend right=20](39,17,2)(40,19)
+
+\structline[dashed](14,2)(15,5,1)
+\structline[dashed](21,5)(22,8)
+\structline[dashed,bend right=20](20,6)(23,9,1)
+\structline[dashed](23,6)(23,9,1)
+\structline[dashed,bend right=20](30,2)(33,4)
+\structline[dashed,bend left=20](32,6)(35,9)
+
+\structline[dashed](38,4)(39,7)
+
+\structline[dashed](40,8)(40,10)
+\structline[dashed](40,8)(41,10)
+\structline[dashed,bend left=40](39,9)(42,12)
+\structline[dashed](41,10)(42,12)
+
+\classoptions["h_0^2i" right=1pt](23,9)
+\classoptions["h_0^{10}h_5" left](31,11)
+\classoptions["h_1h_5" below](32,2)
+\classoptions["h_0h_2h_5" below](34,3)
+\classoptions["h_2^2h_5" below](37,3)
+\classoptions["h_0^2h_3h_5" {left=-0.1em}](38,4,1)
+\classoptions["h_1h_3h_5" {below=-.4em}](39,3,1)
+
+\classoptions["Ph_3"   left](15,5,1)
+\classoptions["P^2h_3" left](23,9,1)
+%\classoptions["P^3h_3" left](31,13,1)
+%\classoptions["P^4h_3" left](39,17,1)
+\end{sseqpage}
+%\end{document}
+
+\newgeometry{margin = 0.1cm}
+\printpage[name=ASS-S_2,page=2,xscale=0.7,yscale=0.8,keep changes]
+
+%\printpage[name=ASS-S_2,page=2]
+
+\printpage[name=ASS-S_2,page=3]
+
+\printpage[name=ASS-S_2,page=4]
+
+\begin{sseqpage}[name=ASS-S_2,page=5]
+\structline[dashed,bend right=20](15,4)(16,7,1)
+\structline[dashed,bend right=20](23,9,2)(24,11)
+\structline[dashed,bend right=20](31,11)(32,15)
+\structline[dashed,bend right=20](39,17,2)(40,19)
+
+\structline[dashed](14,2)(15,5,1)
+\structline[dashed](21,5)(22,8)
+\structline[dashed,bend right=20](20,6)(23,9,1)
+\structline[dashed](23,6)(23,9,1)
+\structline[dashed,bend right=20](30,2)(33,4)
+\structline[dashed,bend left=20](32,6)(35,9)
+
+\structline[dashed](38,4)(39,7)
+
+\structline[dashed](40,8)(40,10)
+\structline[dashed](40,8)(41,10)
+\structline[dashed,bend left=40](39,9)(42,12)
+\structline[dashed](41,10)(42,12)
+
+\classoptions["g" {below=0.3em}](20,4)
+\classoptions["{d_0^2=Pg=c_0g}" {xshift=5pt, below=-2.15em}](28,8)
+
+
+\classoptions["h_0^2i" right=1pt](23,9)
+\classoptions["h_0^{10}h_5" left](31,11)
+\classoptions["h_1h_5" below](32,2)
+\classoptions["h_0h_2h_5" below](34,3)
+\classoptions["h_2^2h_5" below](37,3)
+\classoptions["h_0^2h_3h_5" {left=-0.1em}](38,4,1)
+\classoptions["h_1h_3h_5" {below=-.4em}](39,3,1)
+
+\classoptions["Ph_3"   left](15,5,1)
+\classoptions["P^2h_3" left](23,9,1)
+%\classoptions["P^3h_3" left](31,13,1)
+%\classoptions["P^4h_3" left](39,17,1)
+\end{sseqpage}
+\end{document} 
\ No newline at end of file


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

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_3.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_3.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_3.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_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/ASS-S_3.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_3.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_3.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,158 @@
+%%
+%% Description: The Adams Novikov Spectral Sequence for $S_3$, styled to superimpose on ANSS-S_3
+%%
+%%    The Adams spectral sequence at the prime 3 through the 45 stem.
+%%    Compare page 5 to example_ass3
+%%    Copied from page 11 of the green book.
+%%
+
+\documentclass{spectralsequence-example}
+
+\begin{document}
+
+\NewSseqCommand\tower {d()m} {
+    \IfNoValueF{#1}{\class(#1)}
+    \savestack
+    \Do { #2 } {
+        \class(\lastx, \lasty+1)
+        \structline(\lastclass1)(\lastclass)
+    }
+    \restorestack
+}
+
+\NewSseqCommand\hclass {d()}{
+    \IfNoValueF{#1}{\pushstack(#1)}
+    \class(\lastx+3,\lasty+1)
+    \structline(\lastclass1)(\lastclass)
+}
+
+\NewSseqCommand\bclass {d()}{
+    \IfNoValueF{#1}{\pushstack(#1)}
+    \class(\lastx+7,\lasty+1)
+    \structline(\lastclass1)(\lastclass)
+}
+
+\NewSseqCommand\hbachair {d()}{
+    \IfNoValueF{#1}{\pushstack(#1)}
+    \nameclass{tempclass}(\lastclass)
+    \bclass(\lastx,\lasty+1)
+    \hclass
+    \hclass(tempclass)
+    \bclass
+    \structline(\lastclass3)(\lastclass)
+}
+
+\NewSseqCommand\bahclaw { r() } {
+    \class(#1)
+    \bclass
+    \class(\lastx,\lasty+1)
+    \structline(\lastclass1)(\lastclass)
+    \class(\lastx-3,\lasty-1)
+    \structline(\lastclass1)(\lastclass)
+    \pushstack(\lastclass2)
+}
+\begin{sseqdata}[
+    name=ass3,
+    Adams grading,
+    classes={fill, inner sep=1.2pt, tooltip={(\xcoord,\ycoord)}},
+    class labels={below,black},
+    differentials=blue,
+    grid = go,
+    x tick step = 5,
+    x range={0}{45},
+    y range={0}{11},
+    xscale=0.7,
+    yscale=1.2,
+    y axis gap=2em
+]
+\tower(0,0){\ymax+1}
+\classoptions["a_0" {left=0pt}](0,1)
+\hbachair
+\classoptions["h_0"](3,1)
+\classoptions["b_0"](\lastclass)
+\classoptions[purple,page=3](7,2)
+\DoUntilOutOfBounds{\hbachair}
+
+\begin{scope}[sseq=purple]
+\class["h_1"](11,1)
+\tower{2}
+\d2(\lastclass)
+\DoUntilOutOfBounds{
+    \bclass\d2(\lastclass)
+    \hclass\d2(\lastclass)
+}
+\end{scope}
+
+\begin{scope}[orange]
+\class["k_0"](26,2)
+\DoUntilOutOfBounds{
+    \hclass\bclass
+}
+\end{scope}
+
+
+\begin{scope}[sseq=purple]
+\bahclaw(15,4)
+\DoUntilOutOfBounds{\hbachair}
+\bahclaw(27,7)
+\DoUntilOutOfBounds{\hbachair}
+\bahclaw(39,10)
+\DoUntilOutOfBounds{\hbachair}
+\bahclaw(38,7)
+\d2(\lastclass1)\d2(\lastclass2)\d2(\lastclass3)\d2(\lastclass4)
+\DoUntilOutOfBounds{
+    \hbachair
+    \d2(\lastclass)\d2(\lastclass1)
+    \d2(\lastclass3)\d2(\lastclass4)
+}
+\end{scope}
+
+
+
+
+\begin{scope}[sseq=purple]
+\class[](23,3) % label me
+\tower{3}
+\d2(\lastclass)\d2(\lastx,\lasty+1)
+\DoUntilOutOfBounds{
+    \hbachair
+    \d2(\lastclass)\d2(\lastclass1)
+    \d2(\lastclass3)\d2(\lastclass4)
+}
+\end{scope}
+
+
+\class["h_2"](35,1)
+\tower{8}
+\DoUntilOutOfBounds{\hbachair}
+
+\begin{scope}[sseq=orange]
+\class["b_{11}"](34,2)
+\tower{4}
+\DoUntilOutOfBounds{
+    \hclass\bclass
+}
+\d5(34,2)
+\d5(44,4)
+\end{scope}
+\foreach \y in {1,...,4}{
+    \d2(35,\y)
+}
+\d3(35,5)\d3(35,6)
+\foreach \y in {7,...,9}{
+    \classoptions[purple,page=4](35,\y,-1)
+}
+
+
+
+
+\end{sseqdata}
+\centering
+\printpage[name=ass3,page=1]
+\newpage
+\printpage[name=ass3,page=2]
+\newpage
+\printpage[name=ass3,page=3]
+\newpage
+\printpage[name=ass3,page=5]
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-S_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/ASS-tmf_2.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-tmf_2.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-tmf_2.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-tmf_2.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-tmf_2.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/ASS-tmf_2.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-tmf_2.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/ASS-tmf_2.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,284 @@
+%%
+%% Description: The Adams spectral sequence for $\tmf_2$
+%%
+%% 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{spectralsequence-example}
+
+\begin{document}
+
+\NewSseqGroup\tower {} {% 25
+    \class(0,0)
+    \DoUntilOutOfBoundsThenNMore{2}{
+        \class(\lastx,\lasty+1)
+        \structline(\lastclass1) (\lastclass)
+    }
+}
+
+\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)}},
+    class placement transform={scale=1.5},
+    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]
+
+\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/ASS-tmf_2.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-EO2_3.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-EO2_3.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-EO2_3.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-EO2_3.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-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/HFPSS-EO2_3.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-EO2_3.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-EO2_3.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,75 @@
+%%
+%% Description: The homotopy fixed point spectral sequence for a maximal finite subgroup of $\mathbb{G}_{p-1}$ acting on $E_{p-1}$ with $p=3$
+%%
+%%    This is the homotopy fixed point spectral sequence for EO_2 at the prime 3. The maximal finite subgroup of the Morava stabilizer for E_{p-1} is
+%%    of size 2p(p-1)^2 = 24, and so there is a norm element v in degree 24. There's also a bunch of trace classes on the zero line, but the trace map
+%%    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{spectralsequence-example}
+
+\begin{document}
+\begin{sseqdata}[name=EO(2),Adams grading,
+    y range={0}{14},x range={0}{160},
+    xscale=0.15, x tick step=5,
+    classes={fill, tooltip={(\xcoord,\ycoord)}},
+    title=Page \page
+]
+\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,title={\phantom{Page 5}}]
+\newpage
+\printpage[name=EO(2),page=5]
+\newpage
+\printpage[name=EO(2),page=9]
+\newpage
+\begin{sseqpage}[name=EO(2),page=10,title={Page $\infty$}]
+\classoptions["a" left](3,1)
+\classoptions["b" right](10,2)
+\classoptions["ab" left](13,3)
+\classoptions["b^2" right](20,4)
+\classoptions["b^3" right](30,6)
+\classoptions["b^4" right](40,8)
+\classoptions["v^3" right](72,0)
+
+% Doug's additions:
+\classoptions["{\left<a,a,b^2\right>}" below](27,1)
+\structline[dashed](27,1)(30,6)
+\structline[dashed](37,3)(40,8)
+
+\structline[dashed](99,1)(102,6)
+\structline[dashed](109,3)(112,8)
+
+\end{sseqpage}
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-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/HFPSS-KO.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-KO.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-KO.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-KO.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-KO.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/HFPSS-KO.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-KO.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/HFPSS-KO.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,88 @@
+%%
+%% Description: The homotopy fixed point spectral sequence for $C_2$ acting on $KU$ by complex conjugation, compare the odd-primary case HFPSS-EO2_3
+%%
+%% File: example_KUHFPSS.tex
+%%
+%%    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{spectralsequence-example}
+\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 type=center,
+    y axis gap=0.425cm,
+    tick step=4,
+    classes=Z2class,
+    differentials=->,
+    degree={-1}{#1-1},
+    scale=1.45,
+    right clip padding=0.1cm,
+    top clip padding=0.05cm,
+    x axis extend start=0cm,
+    x axis extend end=0.33cm,
+    y axis extend end=0.3cm,
+    grid=go
+]
+
+% This is just to make sure the bounding box doesn't move around
+\path[background] (\xmin-1,\ymin-1) rectangle (\xmax+1,\ymax+1);
+
+\sseqparseint\xitstart{\xmin/8*8-16} % division is integer division (I think with rounding towards 0...) so /8*8 rounds up to the nearest multiple of 8?
+\sseqparseint\xitgap{\xitstart+4}
+\sseqparseint\xitend{\xmax+2}
+\sseqparseint\xmaxpp{\xmax+2}
+
+\foreach \x in {\xitstart,\xitgap,...,\xitend} {
+    \class[Zclass](\x,0)
+    \foreach \z in {0,...,\xmaxpp} {
+        \class(\x+\z+1,\z+1)
+        \structline(\x+\z,\z)(\x+\z+1,\z+1)
+    }
+}
+
+\sseqparseint\xitstart{\xitgap}
+\sseqparseint\xitgap{\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.2cm,yshift=-0.33cm](-\antidiag,\antidiag)--(-1,1)--(-0.4,0)--(\xmax + 0.28,0)--(\xmax+0.28,\antidiag)--cycle;
+\foreach \z in {2,6}{
+    \doptions[draw=none]4(-\z-1,\z-1)
+    \structlineoptions[draw=none](-\z-1,\z-1)(-\z,\z)
+    \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/HFPSS-KO.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/J_RPinfty.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/J_RPinfty.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/J_RPinfty.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/J_RPinfty.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/J_RPinfty.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/J_RPinfty.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/J_RPinfty.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/J_RPinfty.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,136 @@
+%%
+%% Package: spectralsequences v1.1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-08-02
+%% 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{spectralsequence-example}
+\usepackage{amssymb}
+
+\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/J_RPinfty.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-bo-A1.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-bo-A1.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-bo-A1.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-bo-A1.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-bo-A1.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/MaySS-bo-A1.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-bo-A1.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-bo-A1.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,76 @@
+%%
+%% Description: The May spectral sequence for $Ext(\HF_{2*}bo)$
+%%
+%%    This is the May spectral sequence computing Ext_{A(1)} ( F_2, F_2 ), which by a change of rings and a simple argument that the ASS has to collapse,
+%%    is telling us pi_* bo. See the Green Book for reference.
+%%    The main purpose of this example from my perspective is to illustrate the utility of class "tags".
+%%
+
+
+\documentclass{spectralsequence-example}
+
+\NewSseqCommand\tower {} {
+    \class(0,0)
+    \foreach\i in {1,...,11}{
+        \class(0,\i)
+        \structline(0,\i-1,-1)(0,\i,-1)
+    }
+}
+\NewSseqGroup\hvee {} {
+    \tower
+    \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/MaySS-bo-A1.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-tmf-A2.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-tmf-A2.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-tmf-A2.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-tmf-A2.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-tmf-A2.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/MaySS-tmf-A2.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-tmf-A2.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/MaySS-tmf-A2.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,232 @@
+%%
+%% Description: The May spectral sequence for $Ext(\HF_{2*}\tmf)$
+%%
+%%    I got this from Mike Hill's note: https://pdfs.semanticscholar.org/ddbb/8d584e4e81a71400088117b16cd241238c6c.pdf
+%%
+
+
+\documentclass{spectralsequence-example}
+\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
+    \begin{scope}[#1]
+    \DoUntilOutOfBounds{
+        \class(\lastx,\lasty+1)
+        \structline(\lastclass1)(\lastclass)
+    }
+    \end{scope}
+    \restorestack
+}
+
+\NewSseqCommand\honetower {O{}} {
+    \savestack
+    \begin{scope}[#1]
+    \DoUntilOutOfBounds{
+        \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)
+    }
+    \begin{scope}[#1]
+    \gettag\thetag(\lastclass)
+    \class(\lastx+3,\lasty+1)
+    \structline[htwostructstyle](\lastclass)(\lastclass1)
+    \savestack
+    \DoUntilOutOfBounds{
+        \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}, degree={-1}{1},
+    classes=fill,
+    class labels={below=3pt},differentials=blue,
+    class pattern=linear, classes={ tooltip = {(\xcoord,\ycoord)} }, xscale=0.8,
+    title = {Page \page},
+    run off differentials = ->
+]
+\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/MaySS-tmf-A2.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KF3n.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KF3n.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KF3n.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KF3n.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-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/SSS-KF3n.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KF3n.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KF3n.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,323 @@
+%%
+%% Description: The Serre spectral sequence for $\HF_3$ cohomology of $K(\F_3,n-1)\to pt \to K(\F_3,n)$ for $n=2,3,4$, with Bockstein SS's for going up to $\Zbb_3$ coefficients.
+%%
+%%   This is a computation of the Z_3 cohomology of K(F_3,n). This was part of a way-too-hard problem on Haynes Algebraic Topology II problem set which asked to compute
+%%   the smallest k>0 such that H_{n+k}(K(--,n);Z_p) : Ab --> Ab is not the zero functor and to compute what functor it is. One of the main ideas is to use the Bockstein
+%%   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=1.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 = {},
+    }
+}
+
+\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_2\}"](3,-1)
+\class["\Z/3\{\beta\iota_2^2\}"](5,-1)
+\class["\Z/9\{\beta\iota_2^3\}"](7,-1)
+\class["\Z/3\{\beta P^1\iota_2\}"](8,-1)
+\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/SSS-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/SSS-KZ3.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KZ3.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KZ3.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KZ3.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-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/SSS-KZ3.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KZ3.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/SSS-KZ3.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,133 @@
+%%
+%% Description: The Serre spectral sequence for $\HZ$ cohomology of $\CP^\infty \to pt \to K(\Z,3)$
+%%
+%% 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{spectralsequences}
+\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={->},
+    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))$}
+]
+
+\column0["\Z\{\ifnum\y>0\relax x\ifnum\y>1\relax  ^{\y}\fi\else1\fi\}"]
+\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/SSS-KZ3.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.pdf
===================================================================
(Binary files differ)

Deleted: 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	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_A1_May_SS.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,82 +0,0 @@
-%%
-%% 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

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_EO2_3.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,74 +0,0 @@
-%%
-%% 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

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KF3n.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,330 +0,0 @@
-%%
-%% 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

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KRHFPSS.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KUHFPSS.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,92 +0,0 @@
-%%
-%% 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

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_KZ3.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,139 +0,0 @@
-%%
-%% 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}

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_anss3.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,88 +0,0 @@
-%%
-%% 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

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_ass.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,359 +0,0 @@
-%%
-%% 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

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_duggarKRAHSS.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,79 +0,0 @@
-%%
-%% 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

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_endofVFoS.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,139 +0,0 @@
-%%
-%% 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}

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_hatcher.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,126 +0,0 @@
-%%
-%% 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}

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_mayss.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,129 +0,0 @@
-%%
-%% 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

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfass.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,292 +0,0 @@
-%%
-%% 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}
-

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/example_tmfmayss.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,242 +0,0 @@
-%%
-%% 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

Added: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/hatcher.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/hatcher.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/hatcher.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/hatcher.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/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/hatcher.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/hatcher.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/hatcher.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,126 @@
+%%
+%% Package: spectralsequences v1.1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-08-02
+%% License: Latex Project Public License
+%%
+%% File: example_hatcher.tex
+%%
+%%    This comes from Hatcher's spectral sequences book. I think it's a good demonstration of the flexibility of sseqpages.
+%%    Thanks to Antonio Ruiz for suggesting it.
+%%
+
+\documentclass{spectralsequence-example}
+\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=0.5cm,
+    tick gap=1em,
+]
+\begin{scope}[background,opacity=0.1]
+\foreach \n in {1,3,...,9}{
+    \fill(-1.3,\n-0.5)--(-1.3,\n+0.5)--(0,\n+0.5)--(\n+0.5,0)--(\n+0.5,-2)--(\n-0.5,-2)--(\n-0.5,0)--(0,\n-0.5)--cycle;
+}
+\end{scope}
+
+\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]
+
+\vskip30pt
+
+\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.3,\n-0.5)--(-1.3,\n+0.7)--(0,\n+0.7)--(\n+0.5,0)--(\n+0.5,-2)--(\n-0.5,-2)--(\n-0.5,0)--(0,\n-0.5)--cycle;
+}
+\end{scope}
+
+
+\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/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/unstable_ASS_SO.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/unstable_ASS_SO.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/unstable_ASS_SO.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/unstable_ASS_SO.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/unstable_ASS_SO.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/unstable_ASS_SO.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/unstable_ASS_SO.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/examples/unstable_ASS_SO.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,78 @@
+%%
+%% Package: spectralsequences v1.1.0
+%% Author: Hood Chatham
+%% Email: hood at mit.edu
+%% Date: 2017-08-02
+%% License: Latex Project Public License
+%%
+%% File: example_unstable_ASS_SO.tex
+%%
+%%    From Kathryn Lesh: A conjecture on the unstable Adams spectral sequences for SO and U top of page 21.
+%%    http://hopf.math.purdue.edu//Lesh/uass-so-model.pdf
+%%
+
+\documentclass{spectralsequence-example}
+
+\begin{document}
+\sseqset{
+    M3M2/.sseq style = { fill },
+    M4M3/.sseq style = { circlen = 2, fill }
+}
+%\pgfkeys{/sseqpages/class/M4M3/.show code}
+
+\NewSseqCommand \tower { O{} d() } {
+    \IfNoValueF{#2}{\class(#2)}
+    \savestack
+    \begin{scope}[#1]
+        \DoUntilOutOfBounds{
+            \class(\lastx,\lasty+1)
+            \structline(\lastclass1)(\lastclass)
+        }
+    \end{scope}
+    \restorestack
+}
+
+\NewSseqCommand \etaclass {} {
+    \class(\lastx+1,\lasty+1)
+    \structline(\lastclass1)(\lastclass)
+}
+
+\NewSseqCommand \divtwoclass {} {
+    \class(\lastx,\lasty-1)
+    \structline(\lastclass1)(\lastclass)
+}
+
+\begin{sseqdata}[ name = SO_UASS, tick step = 5, x range = {0}{20}, Adams grading, y range={0}{10} ]
+\class(1,0)
+\tower(3,0)
+
+\begin{scope}[M3M2]
+\tower(7,0)
+\etaclass\etaclass
+
+\tower(11,3)
+
+\class(14,4)
+\divtwoclass\divtwoclass
+\etaclass\etaclass\etaclass
+\divtwoclass\divtwoclass
+
+\class(16,5)\etaclass
+\end{scope}
+
+\begin{scope}[M4M3]
+\tower(15,0)
+\etaclass\etaclass\etaclass
+\divtwoclass\divtwoclass
+\end{scope}
+
+\d2(15,0)\d2(15,1)\d2(15,2)
+\d2(16,1)\d2(17,2)\d2(18,3)
+\d2(18,2)\d2(18,1)
+\end{sseqdata}
+
+
+\printpage[ name = SO_UASS, page = 2 ]
+\newpage
+\printpage[ name = SO_UASS, page = 3 ]
+\end{document} 
\ No newline at end of file


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

Index: trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.pdf	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.pdf	2017-08-03 21:07:30 UTC (rev 44942)

Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.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/spectralsequences-howitworks.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,121 @@
+\input spectralsequencesmanualpreamble
+
+\def\eatclnifpresent#1{#1}
+\def\pgfkeysname{pgfkeys}
+\def\file#1{\path{#1.code.tex}}
+\begin{document}
+\title{A brief overview of the \\ \sseqpages\ code}
+\author{Hood Chatham\\\mailtoHC}
+\maketitle
+\section{Introduction}
+The basic idea is comparable to a more elaborate version of \tikzcdpkg.
+We plan to draw multiple copies of a spectral sequence, so the commands are not issued inside of a picture environment.
+Instead, all information must be stored to draw later. The |\sseq at savedpaths| is responsible for storing the collection of objects of the spectral sequence.
+
+The user defines ``classes'' (which correspond roughly to generators of the spectral sequence $E_2$ / $E_1$ page).
+From the point of view of the programmer, a class is an object with a death page (either infinite or finite) signalling on which page it is the source or target of a differential
+and some pile of information on how to draw it. When the user calls the |\class| command, it makes a new class object with an appropriate name and stores the
+information to tell \spectralsequences\ how to draw the class later, and sets the page to be infinite. A macro informing spectralsequences about the class
+is added to |\sseq at savedpaths| so that it can be drawn later if appropriate.
+
+The |\d| command is similar -- we set the page of the source and target to be the current page and also the pages of any relevant structlines, store the page of the differential and the data needed to draw it, and add the differential to |\sseq at savedpaths|.
+
+The |\structline| command saves code to draw a line, and also figures out what page it should die on based on the smaller of the two death pages of the source and target. If the source and target haven't been killed yet, it hooks into them so that |\d| knows to set the page of this structline too.
+
+Now to draw a page of the spectral sequence, we start up a \tikzpictureenv\ environment, draw some axes,
+walk across |\sseq at savedpaths|, and for each class, we check whether the death page of the class is greater than or equal to the current page and if so we draw a corresponding
+pgf/tikz node. Similarly, we draw the differentials that lie on exactly the current page, and the subset of the structure lines with death page later than the current one.
+
+This is the core idea of the package. In addition to these core features are many important reusability features. For instance, we need a way to define reusable user macros that draw collections of classes and we need looping constructs.
+
+So, having heard this simple description, a reasonable question to ask is: why does it take in excess of 8000 lines of TeX code to accomplish these simple tasks? There are a few reasons. Firstly, the package handles a lot of use cases and has a quite a few different features and there is a large amount of intrinsic complexity to getting these things right. Another huge reason is that \TeX\ is a completely unreasonable coding environment. This is responsible for a good deal of the complexity in \file{sseqparsers}, for example.
+
+Perhaps the biggest single contributor to code complexity is performance. \tikzname\ is very robust, but it is not fast. \spectralsequences\ draws roughly cubically many classes in large diagrams, and my larger test examples have as many as 5,000 classes. If each class takes an extra millisecond a second to draw, that comes out to an extra five seconds of compilation time. Because of this, unless the performance critical drawing code is super optimized, the package will be way too slow on large diagrams. Most of the added complexity due to performance considerations is contained in \file{sseqdrawing}, but the hard parts of the key value code are all related to performance too.
+
+The last major source of complexity is the robust error handling code. Most \LaTeX\ packages have crappy error handling and result in inscrutable errors even in relatively reasonable use conditions. There are a two main reasons for this as far as I can tell: \LaTeX\ doesn't have good error handling tools and most people who write \LaTeX\ packages are not primarily programmers and have other priorities than ensuring that their packages have clean failure modes. The files \file{sseqmessages} and \file{sseqforeach} are entirely devoted to error handling, and almost all of the complexity of \file{sseqmacromakers} is tied up in error handling too.
+
+
+
+\section{Load Store}
+The file \file{sseqloadstore} defines two storage systems. The point of these systems is to ensure that unrelated spectral sequences do not interfere with each other. One system is faster and relatively storage intensive, and it is for macros that contain global information about the spectral sequence. These macros have default values which can be changed using |\sseqset|. The other system is for storing the data about the spectral sequence objects (classes, differentials, structlines, etc). This file is short and simple, but the seemingly innocuous features provided here lead to huge simplifications in much of the rest of the code.
+
+The first system works by making a list |\sseq at storelist| of the commands that need to be stored. It defines commands |\sseq at storecmds| and |\sseq at getcmds| which iterate over |\sseq at storelist| and copy each command between |\sseq at whatevercommand| and |\sseq at whatevercommand@@@\metatt{sseqname}|. Each command also has a default value stored in |\sseq at whatevercommand@@default|. This default can be changed by the user using |\sseqset| outside of a spectral sequence. There is also a command |\sseq at storelist@setdefaults| which loads the default values of all of the commands in |\sseq at storelist|. At the beginning of a \sseqdataenv\ or \sseqpageenv\ environment, if the spectral sequence is new then |\sseq at storelist@setdefaults| is run, and otherwise |\sseq at getcmds| is run. At the end of the \sseqdataenv\ environment, |\sseq at storecmds| is run.
+
+The second system basically is just semantic sugar for indexing into a command that has the name of the current spectral sequence inserted into it: the command |\sseq at obj{some name}| just expands to |\csname sseq.\sseq at thename.some name\endcsname|. This allows different spectral sequences to have different name spaces. A large number of commands to manipulate this are provided. All changes to objects are made global, so at the end of a \sseqpageenv\ environment, any changes that have been made must be reverted. The command |\sseq at cleanup@obj| checks if we are in a context where changes will have to be reverted, checks if an old value of the current object has been stored yet, and if neither of these are true, it adds reverting the current object to a ``cleanup'' command to be run at the end of the current environment.
+
+\section{Messages}
+The file \file{sseqmessages} defines the error handling code. It uses the delightful l3msg infrastructure which separates message content from the position the errors are triggered in and makes much more attractive error messages. One deficiency for my purposes in l3msg though is that it doesn't have very many hooks. My package knows a lot about the circumstances under which most errors trigger and wants to tell the user about this. The basic idea for this approach came from \tikzcdpkg. At the beginning of the \tikzcdenv\ environment, the |\errmessage| command is patched to add an annotation explaining what cell in the matrix the error occurred in. This is because \tikzcdenv\ has a two-pass algorithm, and so errors can occur far away from the code that triggered them.
+
+Anyways, I have a fairly complicated pile of extra information to add into the picture. Firstly, I reconstruct what the user said as closely as possible. This is done inside of \file{sseqmacromakers} and \file{sseqmain}. I also assemble a stack trace that indicates all loops and user macros and all loop variable values. I assemble all this context information and a little more, and then make an annotation message accordingly. All of the many cases here are handled using a pile of horrible spaghetti code.
+
+The annotation setup code is not expandable, so it cannot happen as the error is written to stderr. We need a setup hook before the error is triggered, we need a hook inside the body of the message, and we need a cleanup hook after the error is done to remove any local changes the setup code made. I make a copy of |\__msg_error_code:nnnnnn| and add these two hooks to the beginning and end. The annotation itself is prepended to |\__sseq_hooked_msg_see_documentation_text:n| which is conveniently located inside of the message text.
+
+The other interesting thing in this file is my code for handling |\end| mismatches. Because of the need for nested environment definitions, \LaTeX\ only checks that the environment being |\end|ed matches the current environment after running the |\end| code. However, the code for |\end{sseqpage}| tries to draw a picture, and drawing this picture depends on a large amount of state. If the current environment isn't \sseqpageenv, none of this state is actually present and so hundreds of incomprehensible low level errors happen before the check end code is run and \LaTeX\ gives the environment mismatch error. The fix for my package is to run my own checkend code, which is pretty simple. See my \href{https://tex.stackexchange.com/questions/378174/why-does-checkend-occur-after-running-endenvironment}{tex stack exchange question} for more details.
+
+\section{Loops}
+The file \file{sseqforeach} is responsible for defining looping constructs. It's mostly pretty simple. The first half defines |\DoUntilOutOfBounds|, which repeats some block of stack based code until the top of the stack is out of bounds. The most complicated part of this is the descent check -- it periodically checks that the top of the stack has moved towards the boundary of the page to prevent infinite loops.
+
+The other part of this file patches the |\foreach| command from \tikzname\ in order to make it inform \sseqpages\ what the user said for the foreach loop (as best as I can approximate) and what the loop variables are. This is for error messages -- the ``what the user said'' part will go into the stack trace, and the loop variables will be listed.
+
+
+\section{Macro Makers}
+The file \file{sseqmacromakers} defines commands to define commands. It is built on top of \xparsepkg\ but adds a large number of features specific to my package. Unfortunately, it depends on \xparsepkg\ internals and \xparsepkg\ is not yet stable. None of these dependencies are mission critical, but they significantly increase usability. I have attempted to make fallback code that will work even if incompatible \xparsepkg\ changes are made, but this is incomplete.
+
+Like \tikzname, \spectralsequences\ defines a bunch of commands that only make sense to use inside of certain environments. Thus, we define the command |\class| as |\sseq at class| and at the beginning of the \sseqdataenv\ or \sseqpageenv\ environments, we run a command |\sseq at installmacros| that does a bunch of things like |\let\class\sseq at class|. I want to use \xparsepkg\ to define |\sseq at class|, but the problem I run into is that \xparsepkg\ stores the name of the command being defined and uses that name in certain error messages. These error messages would refer incorrectly to |\sseq at class| instead of |\class|. The fix for this is pretty boring -- it just involves redefining macros back and forward. Anyways, I make a command |\sseq at DeclareDocumentCommandAs| that defines a command using \xparsepkg\ that gives errors as if it were named a specific other command. I use this for defining most of the user-facing macros.
+
+The rest of the file is responsible for defining |\NewSseqCommand| and |\NewSseqGroup|. These commands are relatively simple in principle -- the point of |\NewSseqCommand| is almost already accomplished by \xparsepkg\ already. Most of the complexity is introduced in order to improve the error messages that \spectralsequences\ produces. In particular, I want to reconstruct as closely as possible what the user said when they ran the command. This way, if an error occurs nested several commands deep, or inside of a loop, the user can still get a decent idea about where the error is coming from.
+
+
+\section{Keys}
+There are different options that make sense for the |\class| command versus for the |\d| command, and some options that do make sense for both need distinct handling. However, there are also overlaps. Thus, the key value system is naturally a tree structure. \pgfkeysname\ has support for ``directories'' which proves extremely valuable. Each directory has an unknown option handler, which by default throws an error. I have a command |\sseq at passoptionto| that hands the keys to the parent directory.
+% The directory structure is as follows:
+%\begin{tikzpicture}
+%\node {sseq at keys@unknown} child {
+%    node { /sseqpages } child {
+%        node {/sseqpages/class}
+%        node {/sseqpages/differential}
+%    }
+%\end{tikzpicture}
+
+\sseqpages\ is a two-pass algorithm. On the first pass, it creates the data structures necessary to encode the spectral sequence, and on the second pass, the spectral sequence is actually drawn. The second basic design feature of the \sseqpages\ key value system is that keys need to be able to do different things on the first and second pass. This is accomplished very simply -- I use two wrapper macros |\sseq at options@firstpass| and |\sseq at options@secondpass| for code that should only happen respectively on the first and second pass. To use them, I basically just define |\sseq at options@firstpass| as a no-op and |\sseq at options@secondpass| to add its argument to a macro to be stored for later use at draw time. However, in some circumstances I need to redefine these two hooks, either to delete their argument or to evaluate there arguments.
+
+Once we have this basic design, we can implement many of the basic features of \sseqpages. There is a problem, which is that I want to mix \tikzname\ keys with keys that my package defines gracefully. However, \tikzname\ keys execute code that assumes that we are in the middle of drawing something. One early design approach I used was to define my package's unknown option handler to do validation only on \tikzname\ keys on the first pass, and then store the keys and run |\pgfkeys| again to evaluate them at draw time.
+
+The third major design goal is to allow ``styles'' that change the display of logical collections of classes. That is, the user should be able to say something ``permanent cycles = red'' and change all permanent cycles (as identified by \spectralsequences) to red. Originally I implemented this by storing the keys that the user provided and using |\pgfkeys| at draw time to evaluate them each time I made a class. Here I ran into a problem: |\pgfkeys| is very slow. When I used this design and compiled a 5,000 class spectral sequence, saying \codeverb|classes = {red, red, red}| took over a second longer than not saying it. This was obviously an unsatisfactory state of affairs. The solution to this problem sped up the package tremendously, but at the cost of a large increase in design complexity of the key value system.
+
+The solution of course is to only run |\pgfkeys| on any given key once and store the result, rather than repeatedly using |\pgfkeys| on the same input. In order to do this, I needed to hook into |\pgfkeys| and change it so that every time that it would normally evaluate code, it should just store it into |\sseq at savedoptioncode|. Conveniently enough, there are only two places where |\pgfkeys| emits code, so this basic idea is easy enough. The problem is that many keys execute recursive calls to |\pgfkeys| that are state-dependent. Normally, the key code is executed instantly, so it can reasonably expect the state it needs to be preserved. However, if I defer the body of a key that makes such a recursive call, pieces of the necessary state are lost before the code is executed and it breaks. Thankfully, all such state-dependent recursive calls are made using the command |\pgfkeysalso|. So the fix is to first walk across the key code and find any instances of |\pgfkeysalso| that occur in it, and run these |\pgfkeysalso|s. Once this recursive expansion has taken place, the resulting code is independent of the state of the key value system's state and is safe to store for later use.
+
+\section{Main}
+The \file{sseqmain} defines the main environments and user commands. The logic is pretty much as described in the overview section, and nothing super notable happens beyond that. There are a lot of details to get right, in particular a lot of the mess in this file is due to the complicated interfacing with \file{sseqkeys}.
+
+
+
+\section{Parsers}
+The file \file{sseqparsers} is a bit of a grab bag. The code is grouped by structure more than by content, hence the name. Most importantly, it has all of the coordinate parsers that define the coordinate syntax. This file uses some amount of \LaTeX3 programming, though it is a bit of a chimera. There are three main reasons I did not use \LaTeX3 programming more broadly or consistently. The first is inexperience: I simply haven't used \LaTeX3 much. The second is that \LaTeX3 and \tikzname\ do not get along all that well. This is fixable but a pain. The third is that \LaTeX3 has a lot of fancy convenient robust macros, but I generally need sloppy fast macros. If I can write a faster macro that adds a large number of weird preconditions, for the purposes of \spectralsequences\ that is probably better.
+
+One very good reason to use |\ExplSyntax| in this file is that it gets rid of a lot of space hazards. In this file, I really just make use of the variants of |\exp_args| and |\exp_last_unbraced|. These macros are tremendous innovations that greatly improve expandable macro writing.
+
+One major annoyance is the need for |\sseq at ifintexpr|. This is a sanitizer for |\numexpr|. I don't understand why the \eTeX\ source doesn't contain an input sanitizer! \TeX\ does not support catch blocks or exceptions, so because we can't ask forgiveness we have to ask for permission. Anyways |\sseq at ifintexpr| was difficult to write and is slow. Together, |\sseq at ifintexpr| and |\numexpr| are still much faster than |\pgfmathparse| though, and the input sanitization only has to occur at the user input stage, so all of the internal uses of |\numexpr| don't pay this cost. Contrast the case for |\sseq at ifpgfmathexpr| which is my sanitizer for |\pgfmathparse|. All it does is redefine |\pgfmath at error| to throw away the error, set a flag, and quit out of |\pgfmathparse|. It was orders of magnitude easier to write.
+
+There is a parser that does some manipulation on \tikzname\ commands to process the options and the coordinates. The options processing is primarily for speed purposes, and the coordinate parsing I do because I want to make several changes to the way that tikz processes coordinates for the sake of better interoperability with the rest of the \spectralsequences\ feature set (these changes are unfortunately quite involved...). A third thing gained by this is that \sseqpages\ can know that the path looks reasonably close to being syntactically correct at compile time (though I don't run much of the tikz parser, so there's only so much it can tell).
+
+There are a few tricks in here that I think are relatively interesting. The one that I find the most interesting is as follows: suppose you have an expandable macro that needs error handling. The problem with errors in expandable macros is that the errors themselves are not expandable. My solution is to write the macro so that it either a) satisfies whatever the postcondition of the macro was supposed to be or b) is of the form |\protecterror{\someerror}|. Before the |\edef| occurs, the |\protecterror| is defined to expand to |\noexpand\protecterror\unexpanded{#1}|, so that it hangs around after being |\edef|'d. Suppose we are writing |\edef\theoutput{\somemacro{some input}}|. Then when you want to check for the error, redefine |\protecterror| to globally set some error flag, then say |\setbox0=\hbox{\theoutput}| in a local scope. Because |\hbox| evaluates its argument, this throws an error if |\theoutput| contains an error, and also |\protecterror| sets the error flag. However, |\theoutput| can have other random junk in it, which won't leak into the output. This solution doesn't depend on the error being in the top level of |\theoutput|, it can be in as deeply nested braces as necessary and doesn't require |\scantokens| hacking. It doesn't rely on any particular structure features other than the presence or absence of the error.
+Anyways, this is how I manage to have robust error messages with expandable macros. Obviously this isn't applicable to many circumstances, but in my code, my need for expandable macros is always in situations where I have a macro whose evaluation depends on temporary state, but whose result needs to be stored inside of a command (not an |\hbox|) for later handling.
+
+
+\section{Drawing}
+The most notable aspect of the \file{sseqdrawing} is that significant chunks of it need to be highly optimized. The command that is used the most times in a normal spectral sequence is the one that prints a class. It is important to be aware of differences between the efficiency of different low level pdf commands. It is worth pointing out that I have fallen into the trap in some places of optimizing code that didn't need optimization.
+
+In order to maintain all the features of \tikzname\ while being as fast as possible, all drawing code is done in two ways -- one way that is fast and uses low level \pgfpkg, and a second way that is slow and uses \tikzname\. Certain options the user asks for cause the fallback slow code to be run instead of the fast code. It is actually surprising to me how easy it has actually been to maintain this two-method code. It's unusual for the class drawing code to have to resort to the fallback, but if an edge is bent or has a label on it, \sseqpages\ uses \tikzname\ to draw it. Both of these are reasonably standard use cases, but hopefully they will only ever apply to a small percentage of edges in any diagram.
+
+In order to build the relevant chunks of the fast code, I copied the \tikzname\ main loop and deleted stuff until I got to the minimal subset of code that works for my purposes.
+One of the main enemies of speed in this section (other than the \tikzname\ parser and main loop which I avoid by using \pgfpkg) is the |\pgfmathparse| command, which comes up a lot even in \pgfpkg\ code and is quite slow. As much as possible, I try to get away with using the \eTeX\ |\numexpr| and |\dimexpr| commands, both of which are implemented in the \eTeX\ binary and so are very fast. These two commands both have annoying limitations, and it can be difficult to accomplish certain tasks with them. However, it is worth it in interest of speed. In fact, |\numexpr| is actually preferable to |\pgfmathparse| for most of the code outside of the drawing file, because \sseqpages\ deals primarily with integers and basic arithmetic |+-*/()| that |\numexpr| handles, and because |\pgfmathparse| has the unfortunate property of turning all integers into floats.
+
+The other difficulty that arises here is that \spectralsequences\ needs to be able to handle very large diagrams. In a normal |\tikzpicture|, the distance from |(0,0)| to |(1,0)| is 1cm. If you use |scale=0.5| for instance, and use a coordinate |(3,0)|, then the order that multiplications are performed in is $(3\times 1\textup{cm})\times 0.5$. The issue is that 600cm is an overflow, and this overflow occurs even if you have a very small scaling factor that would make that coordinate fit onto the page (which is probably a bit less than 600cm long). The solution is instead of applying a scaling transformation, I adjust the position of the coordinate (1,0), say to be 0.01cm. Then $600*0.01\textup{cm}= 6\textup{cm}$ leads to no overflow. This leads to various complications in the drawing code.
+
+There's a second more problematic issue though. Suppose that I want to zoom in on the range from 600 to 700 on a very large spectral sequence. The scale I want to use to fit this to the page will cause an overflow. To fix this I subtract an offset between the minimum and maximum value of x from every single coordinate. This adjusts the range so that it actually goes from say 0 to 100, and then no overflow occurs.
+
+The issue then is how to make this offset also apply to \tikzname\ primitives. In order to do this I patch into the \tikzname\ coordinate parser and every time it parses a coordinate add in the offsets in the appropriate place. There are a few spots where this goes awry and offsets are added to coordinates that are calculated relative to a another coordinate with the offset already calculated in (the |to| keyword is the main offender here), so there are second order fixes to prevent this.
+
+
+\end{document} 
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequences-howitworks.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-layoutcharts.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual-layoutcharts.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual-layoutcharts.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -0,0 +1,204 @@
+\sseqset{
+    distance label/.sseq style = {orange,{<[width = 4pt]}-},
+    description/.sseq style = {black, align = center},
+    title style={yshift=25pt,font=\Large}
+}
+\catcode`\| = 12 % | is active to be verbatim, but we need to use it here for our arrowhead specification.
+%
+\begin{sseqpage}[ grid = chess,
+    x range = {0}{5}, y range = {0}{5}, math nodes = false,
+    x axis clip padding = 0.15cm, y axis clip padding = 0.15cm,
+    right clip padding = 0.2cm, top clip padding = 0.2cm, axes gap = 25pt,
+    title = {Axis type border layout},    
+]
+\begin{scope}[background]
+\sseq at savedpaths@add{\color{red}\pgfsetpath\sseq at theclippath\pgfusepath{draw}}
+\path (\sseq at xmin-3,\sseq at ymin-3) -- (\sseq at xmax+3,\sseq at ymax+3);
+\end{scope}
+
+\begin{scope}[background,|-|,blue]
+% axis clip padding
+\draw[shift = {(1,-\sseq at xaxisgap)}] (0,0)--(0,\sseq at xclip@axisgap-0);
+\draw[distance label,shift = {(1,-\sseq at xaxisgap+\sseq at xclip@axisgap/2)}] (0,0) .. controls (0.5,0) .. (0.5,-1.5)
+    node[description, below] {x axis\\ clip padding};
+%
+\draw[shift = {(-\sseq at yaxisgap,1)}] (0,0)--(\sseq at yclip@axisgap,0);
+\draw[distance label,shift = {(-\sseq at yaxisgap+\sseq at yclip@axisgap/2,1)}] (0,0) .. controls (0,0.3) .. (-0.7,0.3)
+node[description, left] {y axis\\ clip padding};
+
+
+% border clip padding
+\draw[shift = {(\sseq at xmax cm + \sseq at xaxis@end at extend-0.02cm,\sseq at ymax - 1)}] (-0.02cm,0)--(\sseq at clip@padding at right,0);
+\draw[distance label, shift = {(\sseq at xmax cm + \sseq at xaxis@end at extend+\sseq at clip@padding at right/2,\sseq at ymax-1)}] (0,0) .. controls (0,-0.7) ..(0.7,-0.7)
+    node[description, right] {right clip\\ padding};
+%
+\draw[shift = {(\sseq at xmax - 1,\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 -1,\sseq at ymax cm+\sseq at yaxis@end at extend+\sseq at clip@padding at top/2)}] (0,0) .. controls (0.2,0) .. (0.2,0.3)
+    node[description, above] {top clip\\ padding};
+
+% axis tail
+\draw[shift = {(\sseq at xmin-\sseq at yaxisgap-0.02cm,\sseq at ymin-\sseq at xaxisgap+0.1cm)}] (0,0) -- (-\sseq at xaxis@tail, 0);
+\draw[distance label,shift = {(\sseq at xmin-\sseq at yaxisgap-0.02cm-\sseq at xaxis@tail/2,\sseq at ymin-\sseq at xaxisgap+0.1cm)}] (0,0) .. controls (0,0.5) .. (-1,0.5)
+    node[description, left]{x axis\\ tail};
+%
+\draw[shift = {(\sseq at xmin-\sseq at yaxisgap+0.1cm,\sseq at ymin-\sseq at xaxisgap-0.02cm)}] (0,0) -- (0, -\sseq at yaxis@tail);
+\draw[distance label,shift = {(\sseq at xmin-\sseq at yaxisgap+0.1cm,\sseq at ymin-\sseq at xaxisgap-0.02cm-\sseq at yaxis@tail/2)}] (0,0) .. controls (0.5,0) .. (0.5,-1)
+    node[description, below]{y axis\\ tail};
+
+% 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[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,-0.8)
+    node[description, below] {x axis\\ extend end};
+%
+\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 xmin cm- \sseq at yaxisgap-0.1cm,\sseq at ymax cm+\sseq at yaxis@end at extend/2)}] (0,0) -- (-0.6,0)
+    node[description, left] {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[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[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 yaxisgap -\sseq at ylabelgap/2,\sseq at ymin+\sseq at ymax/2+0.2)}] (0,0) .. controls (0, -0.3) .. (-0.5,-0.3)
+node[left,black]{y tick gap};
+
+% axis gap
+\draw[shift = {(\sseq at xmax cm+0.17cm,\sseq at ymin cm-\sseq at xaxisgap+0.02cm)}] (0,0) -- (0, \sseq at xaxisgap);
+\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[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 xmin cm-\sseq at yaxisgap/2+0.02cm,\sseq at ymax cm+0.17cm)}](0,0)--(0,1) %.. controls (0,1) ..  (0.5,1);
+node[above,description]{y axis gap};
+\end{scope}
+
+\class(0,0)
+\class(5,0)
+\class(0,5)
+\end{sseqpage}
+
+
+\begin{sseqpage}[ grid = chess, axes type=frame,
+    title = {Axes type frame layout},
+    x range = {0}{5}, y range = {0}{5}, math nodes = false,
+    x axis clip padding = 0.15cm, y axis clip padding = 0.15cm,
+    right clip padding = 0.2cm, top clip padding = 1cm, axes gap = 25pt
+]
+\begin{scope}[background]
+\sseq at savedpaths@add{\color{red}\pgfsetpath\sseq at theclippath\pgfusepath{draw}}
+\path (\sseq at xmin-3,\sseq at ymin-3) -- (\sseq at xmax+3,\sseq at ymax+3);
+\end{scope}
+
+\begin{scope}[background,|-|,blue]
+% axis clip padding
+\draw[shift = {(\sseq at xmax+0.5,-\sseq at xaxisgap)}] (0,0)--(0,\sseq at xclip@axisgap);
+\draw[shift = {(-\sseq at yaxisgap,\sseq at ymax+0.5)}] (0,0)--(\sseq at yclip@axisgap,0);
+\draw[distance label,shift = {(\sseq at xmax+0.5,-\sseq at xaxisgap+\sseq at xclip@axisgap/2)}] (0,0) .. controls (1,0) .. (1,-0.3)
+node[description, below] {x axis\\ clip padding};
+\draw[distance label,shift = {(-\sseq at yaxisgap+\sseq at yclip@axisgap/2,\sseq at ymax+0.5)}] (0,0) .. controls (0,0.5) .. (-0.5,0.5)
+node[description, left] {y axis\\ clip padding};
+
+\draw[shift = {(\sseq at xmax+0.5,\sseq at ymax cm+\sseq at xaxisgap)}] (0,0)--(0,-\sseq at xclip@axisgap);
+\draw[distance label,shift = {(\sseq at xmax+0.5,\sseq at ymax cm+\sseq at xaxisgap-\sseq at xclip@axisgap/2)}] (0,0) .. controls (-0.5,0) .. (-0.5,0.2)
+node[description, above] {x axis\\ clip padding};
+
+
+\draw[shift = {(\sseq at xmax cm +\sseq at yaxisgap,\sseq at ymax +0.5)}] (-\sseq at yclip@axisgap,0)--(0,0);
+\draw[distance label,shift = {(\sseq at xmax cm +\sseq at yaxisgap-\sseq at yclip@axisgap/2,\sseq at ymax +0.5)}] (0,0) .. controls (0,-0.5) .. (0.2,-0.5)
+node[description, right] {y axis\\ clip padding};
+
+
+% tick gap
+\draw[shift = {(\sseq 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,1) %.. controls (0,1) ..  (0.5,1);
+node[above,description]{y axis gap};
+
+\draw[shift = {(\sseq at xmax cm-0.02cm,\sseq at ymin cm+0.17cm)}] (0,0) -- (\sseq at yaxisgap,0);
+\draw[distance label,shift = {(\sseq at xmax cm-0.02cm+\sseq at yaxisgap/2,\sseq at ymin cm+0.17cm)}](0,0) .. controls (0,1) ..  (0.8,1)
+    node[right,description]{y axis gap};
+\draw[shift = {(\sseq at xmin cm+0.17cm,\sseq at ymax cm-0.02cm)}] (0,0) -- (0,\sseq at xaxisgap);
+\draw[distance label,shift = {(\sseq at xmin cm+0.17cm,\sseq at ymax cm-0.02cm+\sseq at xaxisgap/2)}](0,0) .. controls (1.3,0) ..  (1.3,0.75)
+    node[above,description]{x axis gap};
+\end{scope}
+
+\class(0,0)
+\class(5,0)
+\class(0,5)
+\end{sseqpage}
+
+
+\begin{sseqpage}[ grid = chess, axes type=center,
+    title = {Axes type center layout},
+    x range = {-3}{3}, y range = {-3}{3}, math nodes = false,
+    x axis clip padding = 0.15cm, y axis clip padding = 0.15cm,
+    right clip padding = 0.2cm, top clip padding = 0.2cm,
+    left clip padding = 0.2cm, bottom clip padding = 0.2cm %axes gap = 25pt
+]
+\begin{scope}[background]
+\sseq at savedpaths@add{\color{red}\pgfsetpath\sseq at theclippath\pgfusepath{draw}}
+\path (\sseq at xmin-3,\sseq at ymin-3) -- (\sseq at xmax+3,\sseq at ymax+3);
+\end{scope}
+
+\begin{scope}[background,|-|,blue]
+
+% tick gap
+\draw[shift = {(\sseq at xmin-0.4,-\sseq at xaxisgap-0.02cm)}] (0,0)--(0,-\sseq at xlabelgap);
+\draw[distance label,shift = {(\sseq at xmin-0.4,-\sseq at xaxisgap-0.02cm-\sseq at xlabelgap/2)}] (0,0) -- (-0.5,0)
+    node[left,black]{x tick gap};
+
+\draw[shift = {(-0.02cm-\sseq at yaxisgap,\sseq at ymin-0.4)}] (0,0)--(-\sseq at ylabelgap,0);
+\draw[distance label,shift = {(-0.02cm-\sseq at yaxisgap -\sseq at ylabelgap/2,\sseq at ymin-0.4)}] (0,0) -- (0,-0.6)
+    node[below,black]{y tick gap};
+
+% border clip padding
+\draw[shift = {(\sseq at xmin cm - \sseq at xaxis@start at extend+0.02cm,\sseq at ymin +1)}] (0,0)--(-\sseq at clip@padding at left,0);
+\draw[distance label, shift = {(\sseq at xmin cm - \sseq at xaxis@start at extend-\sseq at clip@padding at left/2,\sseq at ymin +1)}] (0,0) .. controls (0,-0.5) ..(-0.5,-0.5)
+    node[description, left] {left clip\\ padding};
+%
+\draw[shift = {(\sseq at xmax cm + \sseq at xaxis@end at extend-0.02cm,\sseq at ymin +1)}] (0,0)--(\sseq at clip@padding at right,0);
+\draw[distance label, shift = {(\sseq at xmax cm + \sseq at xaxis@end at extend+\sseq at clip@padding at right/2,\sseq at ymin +1)}] (0,0) .. controls (0,-0.5) ..(0.5,-0.5)
+    node[description, right] {right clip\\ padding};
+%
+\draw[shift = {(\sseq at xmin+1 ,\sseq at ymax cm+\sseq at yaxis@end at extend-0.02cm)}] (0,0)--(0,\sseq at clip@padding at top);
+\draw[distance label, shift = {(\sseq at xmin+1,\sseq at ymax cm -0.02cm+\sseq at yaxis@end at extend+\sseq at clip@padding at top/2)}] (0,0) .. controls (-0.9,0)..(-0.9,0.3)
+    node[description, above] {top clip\\ padding};
+%
+\draw[shift = {(\sseq at xmin +1 ,\sseq at ymin cm-\sseq at yaxis@start at extend+0.02cm)}] (0,0)--(0,-\sseq at clip@padding at bottom);
+\draw[distance label, shift = {(\sseq at xmin +1 ,\sseq at ymin cm +0.02cm - \sseq at yaxis@start at extend-\sseq at clip@padding at bottom/2)}] (0,0) .. controls (-0.9,0)..(-0.9,-0.4)
+    node[description, below] {bottom clip\\ padding};
+
+% extend axis
+\draw[shift = {(\sseq at xmax,-\sseq at xaxisgap+0.1cm)}] (0,0)--(\sseq at xaxis@end at extend,0);
+\draw[distance label,shift = {(\sseq at xmax cm+\sseq at xaxis@end at extend/2,-\sseq at xaxisgap+0.1cm)}] (0,0) .. controls (0,0.5) .. (0.9,0.5)
+    node[description, right] {x axis\\ extend end};
+%
+\draw[shift = {(-\sseq at yaxisgap+0.1cm,\sseq at ymax)}] (0,0)--(0,\sseq at yaxis@end at extend);
+\draw[distance label,shift = {(-\sseq at yaxisgap+0.1cm,\sseq at ymax cm+\sseq at yaxis@end at extend/2)}] (0,0) .. controls (0.4,0)..(0.4,0.7)
+    node[description, above] {y axis\\ extend end};
+%
+\draw[shift = {(\sseq at xmin,-\sseq at xaxisgap+0.1cm)}] (0,0)--(-\sseq at xaxis@start at extend,0);
+\draw[distance label,shift = {(\sseq at xmin cm-\sseq at xaxis@start at extend/2,-\sseq at xaxisgap+0.1cm)}] (0,0) .. controls (0,0.5) .. (-0.7,0.5)
+    node[description, left] {x axis\\ extend start};
+%
+\draw[shift = {(-\sseq at yaxisgap+0.1cm,\sseq at ymin)}] (0,0)--(0,-\sseq at yaxis@start at extend);
+\draw[distance label,shift = {(-\sseq at yaxisgap+0.1cm,\sseq at ymin cm-\sseq at yaxis@start at extend/2)}] (0,0) .. controls (2,0)..(2,-0.7)
+    node[description, below] {y axis\\ extend start};
+\end{scope}
+
+\class(0,0)
+\class(5,0)
+\class(0,5)
+\end{sseqpage}
\ No newline at end of file


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

Modified: trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanual.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,8 +1,8 @@
 %%
-%% Package: spectralsequences.sty version 1.0
+%% Package: spectralsequences v1.1.0
 %% Author: Hood Chatham
 %% Email: hood at mit.edu
-%% Date: 2017-06-18
+%% Date: 2017-08-02
 %% License: Latex Project Public License
 %%
 %% File: spectralsequencesmanual.tex
@@ -12,6 +12,11 @@
 
 %
 % TODO:
+%  families
+%
+%  consistency issues?
+%  perhaps think about ordering, particularly of "Misc commands" section
+%  tutorial
 %  explain / cross reference examples folder?
 %
 
@@ -30,9 +35,9 @@
 
 \begin{abstract}
 \noindent
-The \sseqpages\space package is a specialized tool built on top of \pgfpkg/\tikzpkg\space for drawing spectral sequences. It provides a powerful, concise syntax for specifying the data of a spectral sequence, and then allows the user to print various pages of spectral sequence, automatically choosing which subset of the classes, differentials, and structure lines to display on each page. It also handles most of the details of the layout. At the same time, \sseqpages\space is extremely flexible. It is closely integrated with \tikzpkg\space to ensure that users can take advantage of as much as possible of its expressive power. It is possible to turn off most of the automated layout features and draw replacements using \tikzpkg\space commands. \sseqpages\space also has a carefully designed error reporting system intended to ensure that it is as clear as possible what is going wrong.
+The \sseqpages\  package is a specialized tool built on top of \pgfpkg/\tikzpkg\  for drawing spectral sequence charts. It provides a powerful, concise syntax for specifying the data of a spectral sequence, and then allows the user to print various pages of a spectral sequence, automatically choosing which subset of the classes, differentials, and structure lines to display on each page. It also handles most of the details of the layout. At the same time, \sseqpages\  is extremely flexible. It is closely integrated with \tikzpkg\  to ensure that users can take advantage of as much as possible of its expressive power. It is possible to turn off most of the automated layout features and draw replacements using \tikzpkg\  commands. \sseqpages\  also has a carefully designed error reporting system intended to ensure that it is as clear as possible what is going wrong.
 
-Many thanks to the authors of \tikzpkg\space for producing such a wonderful package with such thorough documentation. I would have needed to spend a lot more time reading the \tikzpkg\space code if the documentation weren't so excellent. I took ideas or code or both from \tikzcdpkg\ (part of the code for turning quotes into class or edge labels), \pgfplotspkg\ (axes labels), and \sseqpkg\ (the grid styles, the stack). I lifted a fair amount of code from tex stack exchange. Thanks to Eric Peterson for being a very early adopter and reporting many bugs, to Eva Belmont for many productive conversations and for the idea of adding the stack traces for errors and to Vishal Arul and Catherine Ray for helpful suggestions. Also thanks to all my friends, family, and acquaintances listened to me talk about \LaTeX\ programming even though they probably found it dreadfully boring.
+Many thanks to the authors of \tikzpkg\  for producing such a wonderful package with such thorough documentation. I would have needed to spend a lot more time reading the \tikzpkg\  code if the documentation weren't so excellent. I took ideas or code or both from \tikzcdpkg\ (part of the code for turning quotes into class or edge labels), \pgfplotspkg\ (axes labels), and \sseqpkg\ (the grid types, the stack). I lifted a fair amount of code from \TeX stack exchange. Thanks to Eva Belmont for tons of helpful suggestions, bug reports, and productive conversations. Talking to her has helped to clarify many design concepts for the package. Thanks to Eric Peterson for being a very early adopter and reporting many bugs. Also thanks to all my friends, family, and acquaintances listened to me talk about \LaTeX\ programming even though they probably found it dreadfully boring.
 \end{abstract}
 \end{titlepage}
 
@@ -43,7 +48,7 @@
 \tableofcontents
 \newpage
 \section{Introduction}
-The \sseqpages\space package consists of two main environments -- the \sseqdataenv\space environment, which specifies the data for a named spectral sequence diagram, and the \sseqpageenv\space environment, which prints a single page of a spectral sequence diagram. The |\printpage| command is also available as a synonym for a \sseqpageenv\space environment with an empty body.
+The \sseqpages\  package consists of two main environments -- the \sseqdataenv\  environment, which specifies the data for a named spectral sequence, and the \sseqpageenv\  environment, which prints a single page of a spectral sequence. The |\printpage| command is also available as a synonym for a \sseqpageenv\  environment with an empty body.
 
 Here is a basic example:
 \begin{codeexample}[width = 9cm]
@@ -58,30 +63,44 @@
 \printpage[ name = ex1, page = 3 ]  \quad
 \printpage[ name = ex1, page = 4 ]
 \end{codeexample}
-%TODO:
-|\begin{sseqdata}[|| name = ex1, cohomological Serre grading]| starts the declaration of the data of a spectral sequence named |ex1| whose page $\mathtt{r}$ differentials go $\mathtt{r}$ to the right and down $\mathtt{r-1}$ -- that is, it has cohomological Serre grading. Then we specify four classes and one page 3 differential, and we ask \sseqpages\space to print the third and fourth pages of the spectral sequence. Note that on the fourth page, the source and target of the differential have disappeared.
+|\begin{sseqdata}[|| name = ex1, cohomological Serre grading]| starts the declaration of the data of a spectral sequence named |ex1| whose page $\mathtt{r}$ differentials go $\mathtt{r}$ to the right and down $\mathtt{r-1}$ -- that is, it has cohomological Serre grading. Then we specify four classes and one page 3 differential, and we ask \sseqpages\  to print the third and fourth pages of the spectral sequence. Note that on the fourth page, the source and target of the differential have disappeared.
 
-\subsection{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.}
+\subsection{Installation}
+In both \miktex\ and \texlive\ installation should be automatic -- your \TeX\ distribution should automatically install the package the first time you include |\usepackage{spectralsequences}| in a document and compile it. However, in 2016, \texlive\ made an incompatible change to their database, so no new packages will run on versions of \texlive\ from before 2016. This includes \sseqpages. If you have an old version of \texlive, you can either perform a manual install,
+or, better, you should install an up to date version of \texlive. If you want to do a manual install, see \href{https://tex.stackexchange.com/a/73017}{this \TeX stack exchange post} for instructions.
 
-\section{The Environments}
+\subsection{Memory Constraints}
+In a default \TeX\ install, \pdfLaTeX\ has small static memory caps that prevent it from using more than about 60 megabytes of total ram. However, \spectralsequences\ and \pgfpkg/\tikzpkg\ use a large amount of memory. For this reason, using \pdfLaTeX\ with a default install, you cannot draw more than about 2500 classes across all of your diagrams (fewer if you include differentials, structure lines, and other features). There are a few solutions to this.
+
+The easiest solution is to run \LuaLaTeX. \LuaLaTeX\ dynamically allocates memory and so is unlikely to run out of it. Using \LuaLaTeX\ on my computer, I can compile a document that draws two copies of a diagram with 20,000 classes in it (so a total of 40,000 classes). This takes about 50 seconds and 250 megabytes of ram. I expect any real-world use case will compile fine on a modern computer using \LuaLaTeX. This option has the advantage that any modern \TeX\ install comes with a copy of \LuaLaTeX, and that \LuaLaTeX\ is the designated successor to \pdfLaTeX. It has the disadvantage that there are some incompatibilities between \LuaLaTeX\ and \pdfLaTeX\ so if your document depends on \pdfLaTeX-specific features, it might be a pain to switch to \LuaLaTeX.
+
+Another option is to increase the static memory caps for \pdfLaTeX. See \href{https://tex.stackexchange.com/a/26213}{this \TeX stack exchange post} for instructions on how to do this.
+
+\subsection{A warning about fragile macros}
+All the data in a \sseqpages\  environment is stored and used later. As a result, most of the \sseqpages\  commands currently cannot tolerate fragile macros. Unfortunately, it is impossible for \sseqpages\  to warn you about this situation -- if you use a fragile command in a place that it doesn't belong, the result will be an incomprehensible error message. If you are getting nonsense error messages, this is probably why. The solution is to convert fragile macros into robust ones. \href{http://www.tex.ac.uk/FAQ-protect.html}{See here for more information.}
+
+
+\section{Package Options and Environments}
+\begin{manualentry}{Draft Mode}
+The drawings that \sseqpages\ produces can be quite slow, especially if they are large. Draft mode skips drawing the content of the spectral sequence, but still takes up exactly the same amount of space in the document, so that you can deal with formatting issues. To active draft mode, load the package by saying |\usepackage[draft]{spectralsequences}|.
+\end{manualentry}
+
 \begin{environment}{{sseqdata}\moptions}
-The \sseqdataenv\space environment is for storing a spectral sequence to be printed later. This environment is intended for circumstances where you want to print multiple pages of the same spectral sequence. When using the \sseqdataenv\space environment, you must use the |name| option to tell \sseqpages\space where to store the spectral sequence so that you can access it later.
+The \sseqdataenv\  environment is for storing a spectral sequence to be printed later. This environment is intended for circumstances where you want to print multiple pages of the same spectral sequence. When using the \sseqdataenv\  environment, you must use the |name| option to tell \sseqpages\  where to store the spectral sequence so that you can access it later.
 \end{environment}
 
 \begin{environment}{{sseqpage}\ooptions}
-This environment is used for printing a page of existing spectral sequence that was already specified using the \sseqdataenv\space environment. The body of the environment adds local changes -- classes, differentials, structure lines, and arbitrary \tikzpkg\space options that are by default only printed on this particular page. The \sseqpageenv\space environment can also be used to print a standalone page of a spectral sequence -- that is, if you only want to print a single page of the spectral sequence, you can skip using the \sseqdataenv\space environment.
+This environment is used for printing a page of existing spectral sequence that was already specified using the \sseqdataenv\  environment. The body of the environment adds local changes -- classes, differentials, structure lines, and arbitrary \tikzpkg\  options that are by default only printed on this particular page. The \sseqpageenv\  environment can also be used to print a stand-alone page of a spectral sequence -- that is, if you only want to print a single page of the spectral sequence, you can skip using the \sseqdataenv\  environment.
 \end{environment}
 
-\needspace{5\baselineskip}
 \begin{command}{\printpage\moptions}
-This command prints a single page of an existing spectral sequence as-is. This is equivalent to a \sseqpageenv\space environment with an empty body.
+This command prints a single page of an existing spectral sequence as-is. This is equivalent to a \sseqpageenv\  environment with an empty body.
 \end{command}
 
 
-\section{The main commands}
+\section{The Main Commands}
 \begin{command}{\class\ooptions\parargtwo{x}{y}}
-This places a class at |(x,y)| where |x| and |y| are integers. If multiple classes occur at the same position, \sseqpages\space will automatically arrange them in a pre-specified pattern. This pattern may be altered using the |class pattern| option.
+This places a class at |(x,y)| where |x| and |y| are integers. If multiple classes occur at the same position, \sseqpages\  will automatically arrange them in a pre-specified pattern. This pattern may be altered using the |class pattern| option.
 \begin{codeexample}[]
 \begin{sseqpage}[ no axes, ymirror, yscale = 0.8 ]
 \class(0,0)
@@ -125,19 +144,17 @@
 \d[->>]3(1,0)
 \replaceclass["2\mathbb{Z}"](1,0)
 \end{sseqdata}
-\printpage[ name = replace class example, page = 2 ]
-\hskip1cm
-\printpage[ name = replace class example, page = 3 ]
-\hskip1cm
+\printpage[ name = replace class example, page = 2 ] \qquad
+\printpage[ name = replace class example, page = 3 ] \qquad
 \printpage[ name = replace class example, page = 4 ]
 \end{codeexample}
-Note that this will not restore any structlines coming into or off of the class, if you want the structlines to persist, you must call |\structline| again (or use the structline |structline:page| option)
+Note that this will not restore any structure lines coming into or off of the class, if you want the structure lines to persist, you must call |\structline| again (or use the |structline:page| option).
 \end{commandlist}
 
-\begin{commandlist}{{\classoptions\moptions\parargthreeopt{x}{y}{n}},\classoptions\moptions\pararg{classname}}
-This adds options to a class that already exists. This can be used in a \sseqpageenv\space environment to modify the appearance of a class for just one drawing of the spectral sequence, for instance to highlight it for discussion purposes.
+\begin{commandlist}{{\classoptions\moptions\parargthreeopt{x}{y}{n}},\classoptions\moptions\pararg{classname}, \classoptions\moptions}
+This adds options to an existing class. This can be used in a \sseqpageenv\  environment to modify the appearance of a class for just one drawing of the spectral sequence, for instance to highlight it for discussion purposes.
 
-If there are multiple classes at the coordinate |(x,y)| you may specify which using an integer or a |tag| $n$. By default, this command will affect the first class placed in that position. You can also provide the |class:name| of a class.
+If there are multiple classes at the coordinate |(x,y)| you may specify which using an integer or a |tag| $n$. By default, this command will affect the first class placed in that position. You can also provide the |class:name| of a class. If no coordinate is indicated at all, then |\lastclass| is used.
 \begin{codeexample}[width = 6cm]
 \begin{sseqdata}[ name = class options example,
                   classes = fill ]
@@ -177,13 +194,14 @@
 \end{commandlist}
 
 \begin{commandlist}{
+    {\d\ooptions\meta{page}},
     {\d\ooptions\meta{page}\pars{\meta{x},\meta{y}\opt{,\sourcen,\targetn}}},
     {\d\ooptions\meta{page}\pars{\sourcename\opt{,\targetn}}},
     {\d\ooptions\meta{page}\pars{\sourcecoord}\pars{\targetcoord}}%
 }
-Calling |\d\meta{page}|\parargtwo{x}{y} creates a differential starting at \parargtwo{x}{y} of length determined by the specified page. In order to use the |\d| command like this, you must first specify the |degree| of the differentials as an option to the \sseqdataenv\space or \sseqpageenv\space environment. The degree indicates how far to the right and how far up a page $\mathtt{r}$ differential will go as a function of $\mathtt{r}$. If there is a page $\mathtt{r}$ differential, on page $\mathtt{r+1}$, the source, target, and any |\structline|s connected to the source and target of the differential disappear.
+Calling |\d\meta{page}|\parargtwo{x}{y} creates a differential starting at \parargtwo{x}{y} of length determined by the specified page. In order to use the |\d| command like this, you must first specify the |degree| of the differentials as an option to the \sseqdataenv\  or \sseqpageenv\  environment. The degree indicates how far to the right and how far up a page $\mathtt{r}$ differential will go as a function of $\mathtt{r}$. If there is a page $\mathtt{r}$ differential, on page $\mathtt{r+1}$, the source, target, and any structure lines connected to the source and target of the differential disappear. If no class is specified, the default is to use |\lastclass|.
 
-If there are multiple nodes in the source or target, you may specify which one the differential should go to using an index or tag for \sourcen\space or \targetn. It is also possible to provide the name of the source coordinate and an optional target, or to separately provide the source and target coordinate, either as names or as \parargthree{x}{y}{n}. Using |\d| with explicit source and target coordinates works even if you did not provide a |degree| to the spectral sequence. If you did provide a |degree|, then \sseqpages\space will check whether the difference between the source and target is appropriate for a differential of a given page, and if not it will throw an error. If this is undesirable, you can use the |lax degree| option.
+If there are multiple nodes in the source or target, you may specify which one the differential should go to using an index or tag for \sourcen\  or \targetn. It is also possible to provide the name of the source coordinate and an optional target, or to separately provide the source and target coordinate, either as names or as \parargthree{x}{y}{n}. Using |\d| with explicit source and target coordinates works even if you did not provide a |degree| to the spectral sequence. If you did provide a |degree|, then \sseqpages\  will check whether the difference between the source and target is appropriate for a differential of a given page, and if not it will throw an error. If this is undesirable, you can use the |lax degree| option.
 \begin{codeexample}[width = 7.5cm]
 \begin{sseqdata}[ name = d example, degree = {-1}{#1},
                   struct lines = blue, yscale = 1.3 ]
@@ -196,8 +214,7 @@
 \structline(1,1)(1,0)
 \d2(1,0)
 \end{sseqdata}
-\printpage[ name = d example, page = 2 ]
-\hskip0.3cm
+\printpage[ name = d example, page = 2 ] \quad
 \printpage[ name = d example, page = 3 ]
 \end{codeexample}
 If there are multiple nodes in the source or target coordinate, then there is a funny syntax for indicating which one should be the source and target:
@@ -215,7 +232,7 @@
 \d2(3,0,,2)
 \end{sseqpage}
 \end{codeexample}
-Negative indices will count from the most recent class in the coordinate (so |-1| is the most recent, |-2| is the second most recent, etc). You can also use a |tag|, which works better if the situation is complicated.
+Negative indices will count from the most recent class in the coordinate (so the most recent is |-1|, the second most recent is |-2|, etc). You can also use a |tag|, which works better if the situation is complicated.
 \begin{codeexample}[width = 7.5cm]
 \begin{sseqpage}[ Adams grading, yscale = 0.65 ]
 \class(1,0)
@@ -238,22 +255,26 @@
 This command adds options to an existing differential, just like |\classoptions| except for differentials. Its syntax is identical to that of |\d|.
 \end{commandlist}
 
-\begin{command}{\structline\ooptions\pars{\sourcecoord}\pars{\targetcoord}}
-This command creates a structure line from \sourcecoord\space to \targetcoord. The source and target coordinates are either of the form \pars{\meta{x},\meta{y}\opt{,\meta{n}}} or \pararg{class name}. If there are multiple classes at $\mathtt{(x,y)}$, then \meta{n} specifies which of the classes at $\mathtt{(x,y)}$ the structline starts and ends at -- if n is positive, then it counts from the first class in that position, if n is negative, it counts backwards from the most recent. You can also use a |tag| for n.
+\begin{command}{\kill\meta{page}\oarg{coord}}
+This command sets the indicated coordinate to die on the indicated page, but does not establish a target for the differential. This is useful if you want to draw your own differential using tikz (see |\getdtarget|) or if you are not drawing the class on the other side of the differential for clutter reasons. As usual, if no coordinate is provided, the default argument is |\lastclass|.
+\end{command}
 
+\begin{command}{\structline\ooptions\opt{\pars{\sourcecoord}\pars{\targetcoord}}}
+This command creates a structure line from \sourcecoord\  to \targetcoord. The source and target coordinates are either of the form \pars{\meta{x},\meta{y}\opt{,\meta{n}}} or \pararg{class name}. If there are multiple classes at $\mathtt{(x,y)}$, then \meta{n} specifies which of the classes at $\mathtt{(x,y)}$ the structure line starts and ends at -- if n is positive, then it counts from the first class in that position, if n is negative, it counts backwards from the most recent. You can also use a |tag| for n. If the \targetcoord\ is omitted, then |\lastclass| is used, so that |\structline(\sourcecoord)| connects the most recent class to the specified coordinate. If both coordinates are omitted, then |\lastclass| and |\lastclass1| are used, and so |\structline| with no arguments at all will connect the two most recent classes.
+
 If the source or target of a structure line is hit by a differential, then on subsequent pages, the structure line disappears.
 
 If the source or target has had multiple generations (i.e., they got hit and you used |\replaceclass|), then the |\structline| will only appear starting on the first page where the current generation of both the source and target are present. If this is undesirable, you can use the |structline:page| option to change it.
-\begin{codeexample}[width = 9cm]
+\begin{codeexample}[width = 7cm]
 \DeclareSseqGroup\tower {} {
     \class(0,0)
     \foreach \y in {1,...,5} {
         \class(0,\y)
-        \structline(\lastclass1)(\lastclass)
+        \structline
     }
     \class(0,2)
-    \structline(0,1,-1)(\lastclass)
-    \structline(\lastclass)(0,3,-1)
+    \structline(0,1,-1)
+    \structline(0,3,-1)
 }
 \begin{sseqdata}[ name = structline example,
                   classes = { circle, fill },
@@ -266,13 +287,12 @@
 \tower[struct lines = red](2,0)
 \d2(1,1,2)
 \end{sseqdata}
-\printpage[name = structline example, page = 2]
-\hskip1cm
-\printpage[name = structline example, page = 3]
+\printpage[ name = structline example, page = 2 ] \quad
+\printpage[ name = structline example, page = 3 ]
 \end{codeexample}
 \end{command}
 
-\begin{command}{\structlineoptions\moptions\pars{\sourcecoord}\pars{\targetcoord}}
+\begin{command}{\structlineoptions\moptions\opt{\pars{\sourcecoord}\pars{\targetcoord}}}
 This command adds options to an existing structure line, just like |\classoptions| except for structure lines. Its syntax is identical to |\structline|.
 \end{command}
 
@@ -281,7 +301,7 @@
 \end{command}
 
 \begin{commandlist}{\draw,\path,\node,\clip}
-Any code that would work in a \tikzpictureenv\space environment will also work unchanged in a \sseqdataenv\space or \sseqpageenv\space environment, with a few minor differences. This is a very flexible way to add arbitrary background or foreground features to the spectral sequence:
+Any code that would work in a \tikzpictureenv\  environment will also work unchanged in a \sseqdataenv\  or \sseqpageenv\  environment, with a few minor differences. This is a very flexible way to add arbitrary background or foreground features to the spectral sequence:
 \begin{codeexample}[]
 \begin{sseqdata}[ name = tikz example, Adams grading, math nodes = false,
                   tikz primitives = { blue, font = \tiny, <- }, circle classes = tikz primitive style,
@@ -316,7 +336,7 @@
 \subsection{Universal options}
 The following options work with all of the drawing commands in this package, including |\class|, |\d|, and |\structline|, their friends |\replaceclass|, |\classoptions|, |\doptions|, and |\structlines|, as well as with \tikzpkg\ primitives.
 \begin{keylist}{xshift = \meta{integer},yshift = \meta{integer}}
-Shifts by integer values are the only coordinate changes that are allowed to be applied to |\class|, |\d|, |\structline|, their relatives, or to a \scopeenv\space environment that contains any of these commands. These shift commands help with reusing code. For instance:
+Shifts by integer values are the only coordinate changes that are allowed to be applied to |\class|, |\d|, |\structline|, their relatives, or to a \scopeenv\  environment that contains any of these commands. These shift commands help with reusing code. For instance:
 \begin{codeexample}[width = 6cm]
 \begin{sseqpage}[ cohomological Serre grading, yscale = 0.45 ]
 \foreach \x in {0,1} \foreach \y in {0,1} {
@@ -328,7 +348,7 @@
 }
 \end{sseqpage}
 \end{codeexample}
-This code segment is very useful so \sseqpages\space has the command |\NewSseqGroup| which to make code like this more convenient. The following code produces the same output as above:
+This code segment is very useful so \sseqpages\  has the command |\NewSseqGroup| which to make code like this more convenient. The following code produces the same output as above:
 \begin{codeexample}[code only,width = 6cm]
 \NewSseqGroup\examplegroup {} {
     \class(2,0)
@@ -344,11 +364,11 @@
 \end{codeexample}
 
 
-A word of warning: the behavior of |xshift| in \sseqpages\space is incompatible with the normal behavior of |xshift| in \tikzpkg. For some reason, saying |xshift = 1| in \tikzpkg\ does not shift the coordinate |(0,0)| to the coordinate |(1,0)| -- instead it shifts by 1pt. In \sseqpages\space, saying |xshift = 1| moves the coordinate |(0,0)| to the coordinate |(1,0)|. This includes \tikzpkg\ primitives: saying \codeverb|\draw[ xshift = 1 ] (0,0) -- (1,0);| inside a \sseqdataenv\space or \sseqpageenv\space environment is the same as saying \codeverb|\draw(1,0) -- (2,0);| despite the fact that this is not the case in the \tikzpictureenv\ environment.
+A word of warning: the behavior of |xshift| in \sseqpages\  is incompatible with the normal behavior of |xshift| in \tikzpkg. For some reason, saying |xshift = 1| in \tikzpkg\ does not shift the coordinate |(0,0)| to the coordinate |(1,0)| -- instead it shifts by 1pt. In \sseqpages\ , saying |xshift = 1| moves the coordinate |(0,0)| to the coordinate |(1,0)|. This includes \tikzpkg\ primitives: saying \codeverb|\draw[ xshift = 1 ] (0,0) -- (1,0);| inside a \sseqdataenv\  or \sseqpageenv\  environment is the same as saying \codeverb|\draw(1,0) -- (2,0);| despite the fact that this is not the case in the \tikzpictureenv\ environment.
 \end{keylist}
 
 \begin{manualentry}{Colors}
-These come from the \LaTeX\space \colorpkg\space package via \tikzpkg, so see the \href{\colormanualurl}{\colorpkg\space package documentation} for more information.
+These come from the \LaTeX\  \colorpkg\  package via \tikzpkg, so see the \href{\colormanualurl}{\colorpkg\  package documentation} for more information.
 \begin{codeexample}[width = 6cm]
 \begin{sseqpage}[ classes = {fill,inner sep = 0.4em},
                   no axes, scale = 1.3 ]
@@ -359,7 +379,7 @@
 \class[magenta](1,1)
 \class[yellow](2,1)
 \class[blue!50!red](0,2) % a 50-50 blend of blue and red
-\class[green!30!yellow](1,2) % 70% green, 30% yellow
+\class[green!30!yellow](1,2) % 30% green, 70% yellow
 \class[blue!50!black](2,2)
 \end{sseqpage}
 \end{codeexample}
@@ -366,7 +386,7 @@
 \end{manualentry}
 
 \begin{manualentry}{\pgfmanualpdflabel{""quotes}{}|"|\meta{text}|"|\opt{\meta{options}}}
-Specify a label for a class, a differential, or a structure line. This uses the \tikzpkg\ quotes syntax. The options include anything you might pass as an option to a \tikzpkg\ node, including arbitrary coordinate transforms, colors, opacity options, shapes, fill, draw, etc. The behavior is a little different depending on whether you use it on a class or on a differential or struct line.
+Specify a label for a class, a differential, or a structure line. This uses the \tikzpkg\ quotes syntax. If the label text includes an equal sign or comma, you need to enclose the entire label in braces, e.g., |\class["{x = y}"](0,0)|. The options include anything you might pass as an option to a \tikzpkg\ node, including arbitrary coordinate transforms, colors, opacity options, shapes, fill, draw, etc. The behavior is a little different depending on whether you use it on a class or on a differential or structure line.
 
 For a class, the \meta{text} is placed in the position |inside| the node by default -- in effect, the \meta{text} becomes the label text of the node (so saying |\class["label text"](0,0)| causes a similar effect to saying |\node at (0,0) {label text};|). There are other position options such as |left|, |above left|, etc which cause the label text to be placed in a separate node positioned appropriately. If the placement is above, left, etc, then any option that you may pass to a \tikzpkg\ node will also work for the label, including general coordinate transformations. If the placement is ``inside'', then the only relevant \opt{\meta{options}} are those that alter the appearance of text, such as opacity and color.
 \begin{codeexample}[width = 4cm]
@@ -389,8 +409,22 @@
 \end{sseqpage}
 \end{codeexample}
 
-For either a |\structline| or a |\class| the label normally goes on the right side of the edge. The special |'| option makes it go in the opposite position from the default. I imitated the label handling in the \tikzcdpkg\ package, so if you use \tikzcdpkg, this should be familiar.
+\begin{key}{pin = \meta{style}}
+The |pin| key makes \sseqpages\ draw a line connecting the label to the relevant class, which can provide necessary clarification in dense diagrams. The pin key itself can take options which adjust the way that the line is drawn:
 \begin{codeexample}[width = 6cm]
+\begin{sseqpage}
+\class(0,0)
+\class["xy" {above, xshift=-4pt, pin = red}](0,0)
+\class(0,0)
+\class(0,1)
+\structline
+\end{sseqpage}
+\end{codeexample}
+\end{key}
+
+
+For either a |\structline| or a |\class| the label normally goes on the right side of the edge. The special option |'| makes it go in the opposite position from the default. I imitated the label handling in the \tikzcdpkg\ package, so if you use \tikzcdpkg, this should be familiar.
+\begin{codeexample}[width = 6cm]
 \begin{sseqpage}[ Adams grading, yscale = 0.63 ]
 \class(0,0)
 \class(0,1)
@@ -411,7 +445,10 @@
 \draw (1,0) to["hi"'{ pos = 0.7, yshift = -0.5em }] (0,1);
 \end{sseqpage}
 \end{codeexample}
-The special option ``description,'' stolen from \tikzcdpkg, places the label on top of the edge. In order to make this option work correctly, if the background coolor is not the default white, you must inform sseqpages about this using the key |background color = |\meta{color}. In this document, the background color is called \textit{graphicbackground}.
+
+\needspace{3\baselineskip}
+\begin{key}{description}
+The |description| key, stolen from \tikzcdpkg, places the label on top of the edge. In order to make this option work correctly, if the background coolor is not the default white, you must inform \sseqpages\ about this using the key |background color = |\meta{color}. In this document, the background color is called \textit{graphicbackground}.
 \begin{codeexample}[width = 6cm]
 \begin{sseqpage}[ no axes, background color = graphicbackground ]
 \foreach \x in {0,1,2} \foreach \y in {0,1} {
@@ -422,6 +459,7 @@
 \structline["c" description](2,0)(2,1)
 \end{sseqpage}
 \end{codeexample}
+\end{key}
 \end{manualentry}
 
 
@@ -449,7 +487,7 @@
 There are many more \tikzpkg\ shapes in the shapes library, which you can load using the command |\usetikzlibrary{shapes}|. The following are some examples:
 \begin{codeexample}[width = 6cm]
 \begin{sseqpage}[ no axes, classes = { inner sep = 0.4em },
-                  class placement transform = { scale = 2 },
+                  class placement transform = { scale = 1.8 },
                   yscale = 1.63 ]
 \class(0,0)
 \class[isosceles triangle](2,0)
@@ -462,7 +500,7 @@
 \class[regular polygon, regular polygon sides = 8](2,2)
 \end{sseqpage}
 \end{codeexample}
-See the \href{\pgfmanualurl#section.49}{\tikzpkg\space manual} for more information.
+See the \href{\pgfmanualurl#section.49}{\tikzpkg\  manual} for more information.
 \end{manualentry}
 
 \begin{keylist}{minimum width = \meta{dimension}, minimum height = \meta{dimension}, minimum size = \meta{dimension}, inner sep = \meta{dimension}, outer sep = \meta{dimension}}
@@ -523,6 +561,47 @@
 We want each differential to go from the |h21| vee to the |id| vee, independent of which classes are in the same position of the two vees. The easy way to accomplish this is by giving tags to each of the two vees.
 \end{key}
 
+\begin{key}{insert = \meta{integer}}
+If there are multiple classes in the same position, this option allows you to insert classes later into earlier positions. This is intended to help you put logically related classes next to each other. If the integer is positive, it inserts the class in the specified position, and if the integer is negative, it counts backwards from the end. Providing |0| is the same as omitting the option entirely. Values larger in absolute value than the total number of classes are truncated.
+ Consider:
+\begin{codeexample}[]
+\DeclareSseqGroup \tower {} {
+    \class(0,0)
+    \DoUntilOutOfBounds {
+        \class(\lastx,\lasty+1)
+        \structline
+    }
+}
+
+\begin{sseqdata}[name=test, y range={0}{4}, class pattern = linear]
+\tower(0,2)
+\tower(0,3)
+\tower(0,1)
+\end{sseqdata}
+\qquad
+\begin{sseqpage}[name=test]
+\tower[red,classes={insert=1}](0,0)
+\end{sseqpage}
+\qquad
+\begin{sseqpage}[name=test]
+\tower[red,classes={insert=2}](0,0)
+\end{sseqpage}
+\qquad
+\begin{sseqpage}[name=test]
+\tower[red,classes={insert=3}](0,0)
+\end{sseqpage}
+\qquad
+\begin{sseqpage}[name=test]
+\tower[red,classes={insert=-2}](0,0)
+\end{sseqpage}
+\qquad
+\begin{sseqpage}[name=test]
+\tower[red,classes={insert=-3}](0,0)
+\end{sseqpage}
+\end{codeexample}
+
+\end{key}
+
 \begin{key}{offset = \{\pars{\meta{x offset},\meta{y offset}}\}}
 By default, a class uses the offset specified by |class pattern|. Occasionally this is undesirable. In this case, you can specify the offset for a particular class by hand. For example if the sum of two classes is hit by a differential, it looks better for the class replacing them to be centered:
 \begin{codeexample}[width = 9cm]
@@ -547,9 +626,9 @@
 \end{key}
 
 \begin{key}{tooltip = \meta{text}}
-This key generates a ``tooltip'' over the given class. That is, if you hover your mouse over it, a little window will popup with the tooltip text. This is particularly useful to give the coordinates or names of classes in large diagrams where it may be hard to tell from looking at the picture what position the class is in, or there may not be room to supply names to classes.
+This key generates a ``tooltip'' over the given class. That is, if you hover your mouse over it, a little window will popup with the tooltip text. This is particularly useful to give the coordinates or names of classes in large charts where it may be hard to tell from looking at the picture what position the class is in, or there may not be room to supply names to classes.
 
-The tooltip is made using the |\pdftooltip| command from the |pdfcomment| package. This cannot handle math, but it will print math expressions into tex input form. Not all pdf viewers will display the tooltip correctly. If this concerns you, the command |\sseqtooltip| is used to produce the tooltip, and you can redefine it as any other command that takes |\sseqtooltip|\marg{text}\marg{tooltip text} and produces a tooltip. For instance, on \href{https://tex.stackexchange.com/a/164186/23866}{this stack exchange post}, there is code that supposedly produces tooltips that work with Evince. I have not tested whether it works by itself or whether it works with my package, but you could. You could potentially figure out how to get math to work in tooltips too -- if you find a satisfactory method, please let me know.
+The tooltip is made using the |\pdftooltip| command from the |pdfcomment| package. This cannot handle math, but it will print math expressions into \TeX input form. Not all pdf viewers will display the tooltip correctly. If this concerns you, the command |\sseqtooltip| is used to produce the tooltip, and you can redefine it as any other command that takes |\sseqtooltip|\marg{text}\marg{tooltip text} and produces a tooltip. For instance, on \href{https://tex.stackexchange.com/a/164186/23866}{this stack exchange post}, there is code that supposedly produces tooltips that work with Evince. I have not tested whether it works by itself or whether it works with my package, but you could. You could potentially figure out how to get math to work in tooltips too -- if you find a satisfactory method, please let me know.
 
 Anyways, here's an example:
 \begin{codeexample}[]
@@ -578,7 +657,7 @@
 \printpage[ name = page_example, page = 4 ]
 \end{codeexample}
 A ``generation'' of a class is the interval from one call of |\class| or |\replaceclass| to the page on which it next supports or is hit by a differential.
-By default the |\classoptions| command adds options only to the most recent generation of the class in a \sseqdataenv\space environment, or on the generation appropriate to the current page in a \sseqpageenv\space environment. Using the |generation| option allows you to provide a single generation or range of generations of the class that the options should apply to. The first generation is generation 0, and the most recent generation is generation -1. Larger negative values count backwards.
+By default the |\classoptions| command adds options only to the most recent generation of the class in a \sseqdataenv\  environment, or on the generation appropriate to the current page in a \sseqpageenv\  environment. Using the |generation| option allows you to provide a single generation or range of generations of the class that the options should apply to. The first generation is generation 0, and the most recent generation is generation -1. Larger negative values count backwards.
 \begin{codeexample}[]
 \begin{sseqdata}[ name = page_example2, Adams grading, xscale = 0.6, yscale = 0.5 ]
 \class(0,2)\class(1,0)
@@ -637,7 +716,7 @@
 Because the main job of the |\d| and |\structline| commands is to print an edge on the appropriate pages of the spectral sequence, most \tikzpkg\ options that you could apply to a \tikzpkg\ ``to'' operator (as in |\draw (x1,y1) to (x2,y2);|) can be applied to both |\d| and |\structline|. Some such options are as follows:
 
 \begin{keylist}{source anchor = \meta{anchor}, target anchor = \meta{anchor}}
-Because you can't use the normal \tikzpkg\ mechanism for specifying the source and target anchors, \sseqpages\space has these two keys for |\d| and |\structline|:
+Because you can't use the normal \tikzpkg\ mechanism for specifying the source and target anchors, \sseqpages\  has these two keys for |\d| and |\structline|:
 \begin{codeexample}[width = 4cm]
 \begin{sseqpage}[ no axes, yscale = 1.24 ]
 \foreach \x in {0,1} \foreach \y in {0,1} {
@@ -651,11 +730,11 @@
 
 
 \begin{keylist}{shorten > = \meta{distance}, shorten < = \meta{distance}}
-These behave exactly like the corresponding options from \tikzpkg\space, shortening the end and beginning of the edge respectively. Note that you can lengthen the edge by shortening by a negative amount.
+These behave exactly like the corresponding options from \tikzpkg\ , shortening the end and beginning of the edge respectively. Note that you can lengthen the edge by shortening by a negative amount.
 \end{keylist}
 
 \begin{manualentry}{Dash patterns:}
-See the \href{\pgfmanualurl#subsubsection.15.3.2}{\tikzpkg\space manual} for a complete explanation of the dash pattern related options. Some examples:
+See the \href{\pgfmanualurl#subsubsection.15.3.2}{\tikzpkg\  manual} for a complete explanation of the dash pattern related options. Some examples:
 \begin{codeexample}[width = 6cm]
 \begin{sseqpage}[ no axes, yscale = 1.6 ]
 \foreach \x in {0,1,2} \foreach \y in {0,1} {
@@ -682,12 +761,12 @@
 \end{codeexample}
 \end{keylist}
 
-\begin{key}{invisible}
-This key is only for |\d|. It prevents a differential from being drawn at all. The typical reason you might want this is so that you can draw your own differential using \tikzpkg\space commands. See |\getdtarget| for an example of this.
-\end{key}
+%\begin{key}{invisible}
+%This key is only for |\d|. It prevents a differential from being drawn at all. The typical reason you might want this is so that you can draw your own differential using \tikzpkg\  commands. See |\getdtarget| for an example of this.
+%\end{key}
 
 \begin{key}{structline:page = \meta{page}\opt{-{}-\meta{page max}}}
-This key is only for |\structline| and |\structlineoptions|. By default, the |\structline| command only adds a structline starting on the page where the most recent generation of the source or target is born:
+This key is only for |\structline| and |\structlineoptions|. By default, the |\structline| command only adds a structure line starting on the page where the most recent generation of the source or target is born:
 
 \begin{codeexample}[width = 7.6cm]
 \begin{sseqdata}[ name = structpage example,
@@ -735,7 +814,7 @@
 
 \subsection{Options for \sectionstring\circleclass}
 \begin{key}{fit = \meta{coordinates or nodes}}
-The |\circleclasses| command uses the \href{\pgfmanualurl#section.52}{\tikzpkg\space fitting library}. Sometimes it's desirable to make the resulting node fit extra things, for example a label. It doesn't necessarily end up looking great though.
+The |\circleclasses| command uses the \href{\pgfmanualurl#section.52}{\tikzpkg\  fitting library}. Sometimes it's desirable to make the resulting node fit extra things, for example a label. It doesn't necessarily end up looking great though.
 \begin{codeexample}[]
 \begin{sseqpage}[Adams grading,axes gap = 0.7cm]
 \class(0,2)
@@ -756,27 +835,27 @@
 \end{key}
 
 \begin{keylist}{cc:class style,cc:permanent cycle style,cc:transient cycle style,cc:this page class style,cc:differential style,cc:struct line style}
-See the \pgfmanualpdfref{class style}{corresponding entry} in the \tikzpkg\space primitives section.
+See the \pgfmanualpdfref{class style}{corresponding entry} in the \tikzpkg\  primitives section.
 \end{keylist}
 
 \begin{key}{cc:page = \meta{page}\opt{-{}-\meta{page max}}}
-By default, the ellipse will be drawn on the same set of pages that a structline between the two classes would be drawn on. This specifies a range of pages for the ellipse to be drawn. Note that unlike with structlines, you can instruct \circleclasses\ to draw the shape even on pages where one or both of the classes that it is fitting are dead.
+By default, the ellipse will be drawn on the same set of pages that a structure line between the two classes would be drawn on. This specifies a range of pages for the ellipse to be drawn. Note that unlike with structure lines, you can instruct |\circleclasses| to draw the shape even on pages where one or both of the classes that it is fitting are dead.
 \end{key}
 
-\subsection{Options for \tikzpkg\space primitives}
+\subsection{Options for \tikzpkg\  primitives}
 \begin{key}{background}
-This key instructs \sseqpages\space to put the current \tikzpkg\space primitive in the background. The way that the spectral sequence is printed is as follows:
+This key instructs \sseqpages\  to put the current \tikzpkg\  primitive in the background. The way that the spectral sequence is printed is as follows:
 \begin{itemize}
 \item The title, axes, axes ticks, and axes labels are printed (the appropriate steps are skipped when the |no title|, |no axes|, |no ticks|, or |no labels| keys are used or if no title or axes labels are provided).
 
-\item The \tikzpkg\space background paths are printed.
+\item The \tikzpkg\  background paths are printed.
 
 \item The clipping is inserted (unless the |no clip| key is used).
 
-\item All foreground elements (classes, differentials, structlines, and normal \tikzpkg\space paths) are printed.
+\item All foreground elements (classes, differentials, structure lines, and normal \tikzpkg\  paths) are printed.
 \end{itemize}
 
-In particular, this means that foreground \tikzpkg\space paths can be clipped by the standard clipping, but background paths that are outside of the clipping expand the size of the \tikzpkg\space picture.
+In particular, this means that foreground \tikzpkg\  paths can be clipped by the standard clipping, but background paths that are outside of the clipping expand the size of the \tikzpkg\  picture.
 \begin{codeexample}[]
 \begin{sseqpage}[no ticks,yscale = 0.9,math nodes = false]
 \class(0,0)
@@ -807,11 +886,10 @@
 \printpage[name = tikz background example, page = 3]
 \end{codeexample}
 
-For this particular use case, it's and probably better to use |title|, |x label|, and |y label|:
+For this particular use case, it's probably better to use |title|, |x label|, and |y label|:
 \begin{codeexample}[]
 \begin{sseqdata}[ name = tikz background example2, cohomological Serre grading, classes = fill,
-                  grid = go, title = { Page \page }, x label = { $H^*(B)$ }, y label = { $H^*(F)$ },
-                  x label style = { yshift = 10pt}, y label style = { xshift = 10pt } ]
+                  grid = go, title = { Page \page }, x label = { $H^*(B)$ }, y label = { $H^*(F)$ } ]
 \class(0,0)
 \class(3,0)
 \class(0,2)
@@ -823,16 +901,31 @@
 \end{codeexample}
 
 But if you need more flexible labeling, you'll likely want to use tikz primitives with |background|. See \example{KF3} for an instance where this key is useful.
+
+One useful tip is that you can ensure consistent bounding boxes between different diagrams using |\path[background] (smallest x, smallest y) -- (largest x, largest y);|:
+\begin{codeexample}[]
+\begin{sseqdata}[ name = boundingboxex, x range = {0}{2}, y range = {0}{2}, scale = 0.5 ]
+\end{sseqdata}
+\printpage[ name = boundingboxex, title = not aligned ]
+\quad
+\printpage[ name = boundingboxex, x label = Hi ]
+\qquad
+\begin{sseqpage}[ name = boundingboxex, keep changes, title = aligned ]
+\path[background] (\xmin,\ymin-4) -- (\xmax,\ymax+2);
+\end{sseqpage}
+\quad
+\printpage[ name = boundingboxex, x label = Hi, title = {} ]
+\end{codeexample}
 \end{key}
 
 \begin{keylist}{page constraint = \meta{predicate}, page constraint or = \meta{predicate}}
-This places a constraint on the pages in which the \tikzpkg\space primitive is printed. This predicate should look something like
-\texttt{(\string\page< = 4)} |&&| \texttt{(\string\page> = 3)}. The predicate is anded together with any previous predicates, so that you can use this as an option for a \scopeenv\space and again for the individual \tikzpkg\ primitive.
+This places a constraint on the pages in which the \tikzpkg\  primitive is printed. This predicate should look something like
+\texttt{(\string\page< = 4)} |&&| \texttt{(\string\page> = 3)}. The predicate is anded together with any previous predicates, so that you can use this as an option for a \scopeenv\  and again for the individual \tikzpkg\ primitive.
 
 \begin{commandlist}{\isalive\pararg{coordinate},\isalive\{\pararg{coordinate 1}$\cdots$\pararg{coordinate n}\}}
 This command can only be used with |page constraint|. Saying
 $$|page constraint = ||{|\pars{\meta{x},\meta{y}\opt{,\meta{index}}}|}}|$$
-will print the \tikzpkg\space primitive only on pages where the specified class is alive. Saying
+will print the \tikzpkg\  primitive only on pages where the specified class is alive. Saying
 $$|page constraint = ||{\isalive|\pars{\meta{coordinate 1}}\,\cdots\,\pars{\meta{coordinate n}}|}|$$
 is equivalent to
 $$|page constraint = ||{\isalive|\pararg{coordinate 1}| &&|\,\cdots\,|&& \isalive|\pararg{coordinate n}|}|$$
@@ -843,7 +936,7 @@
 \end{keylist}
 
 \begin{keylist}{class style,permanent cycle style,transient cycle style,this page class style,differential style,struct line style}
-These classes apply the styling of the corresponding element to your \tikzpkg\space commands.
+These classes apply the styling of the corresponding element to your \tikzpkg\  commands.
 \begin{codeexample}[width = 6cm]
 \begin{sseqpage}[ differentials = blue, yscale = 0.65, no axes ]
 \class(0,2)
@@ -857,7 +950,8 @@
 
 
 
-\section{Miscellaneous commands}
+\section{Miscellaneous Commands}
+\subsection{Settings}
 \begin{command}{\sseqset\marg{keys}}
 The |\sseqset| command is for adjusting the global options for all spectral sequences in the current scope, or for applying options to the rest of the current spectral sequence. For instance, if most of the spectral sequences in the current document are going to be Adams graded, you can say |\sseqset{Adams grading}| and all future spectral sequences in the current scope will have Adams grading (unless you specify a different grading explicitly). As another example, |\sseqset{no axes}| will suppress axes from spectral sequences in the current scope. Note that defaults only apply to new \sseqdataenv\ environments or to unnamed \sseqpageenv\ environments; they won't apply to existing spectral sequences.
 
@@ -868,10 +962,10 @@
     .sseq style = \meta{keys},
     .sseq append style = \meta{keys}
 }
-These handlers create reusable styles to be used in spectral sequences. If this style is a set of global options, then use the |.global sseq style| handler, whereas if it is supposed to be applied to individual features (classes, differentials, struct lines, circle classes, and tikz primitives) then use the |.sseq style| handler.
+These handlers create reusable styles to be used in spectral sequences. If this style is a set of global options, then use the |.global sseq style| handler, whereas if it is supposed to be applied to individual features (classes, differentials, structure lines, circle classes, and tikz primitives) then use the |.sseq style| handler.
 \begin{codeexample}[width=6cm]
 \sseqset{
-    mysseq/.style = {
+    mysseq/.global sseq style = {
         Adams grading, title = Page \page,
         x range = {0}{4}, y range = {0}{2},
         xscale = 0.5, yscale = 1.35
@@ -881,7 +975,8 @@
 \begin{sseqpage}[ mysseq ]
 \class(0,0) \class(0,1) \class(0,2) \class(0,3)
 \class(3,1) \class(3,2) \class(3,3)
-\structline(0,0)(0,1) \structline(0,1)(0,2) \structline(0,2)(0,3)
+\structline(0,0)(0,1) \structline(0,1)(0,2)
+\structline(0,2)(0,3)
 \structline(3,1)(3,2) \structline(3,2)(3,3)
 \structline[htwostruct](0,0)(3,1)
 \structline[htwostruct](0,1)(3,2)
@@ -891,27 +986,95 @@
 \end{keylist}
 \end{command}
 
-\begin{command}{\foreach}
-This command is from \tikzpkg\space and works in pretty much the same way in \sseqpages, though with slightly better variants. The |\foreach| command is very flexible and has a lot of variants. See the \href{\pgfmanualurl#section.64}{\tikzpkg\space manual} for more details.
-\end{command}
-
 \begin{command}{\sseqerrortowarning\meta{error-name}}
-Turns the error with the given name into a warning. An error message will start by saying |sseqpages error: "error-name"|. This is the name you need to put into this command.
+Turns the error with the given name into a warning. An error message will start by saying \let\eatclnifpresent\empty|spectralsequences error: "error-name"|. This is the name you need to put into this command.
 \end{command}
 
-\begin{command}{\sseqnormalizemonomial}
-This command simplifies a monomial by combining like variables and removing bases that are raised to the 0th power, removing exponents of 1, removing 1's, and replacing the empty monomial with 1. It outputs its result into |\processedlabel|. This command is specifically meant to be used as a value for |class label handler|, so see the example there for the actual purpose. The exponents must be integers or else it will misbehave.
-\begin{codeexample}[]
-\sseqnormalizemonomial{x^0y^0} $\processedlabel$, \quad
-\sseqnormalizemonomial{x^3yx^{-1}z^0} $\processedlabel$, \quad
-\sseqnormalizemonomial{1x_2^2x^2_2} $\processedlabel$
+\subsection{Code reuse commands}
+\begin{command}{\foreach }
+This command is from \tikzpkg\  and works in pretty much the same way in \sseqpages, though with slightly better variants. The |\foreach| command is very flexible and has a lot of variants. The basic usage is |\foreach \x in {\meta{xmin},...,\meta{xmax}} \marg{loop body}| which will execute |\meta{loop body}| with |\x| set to each value between \meta{xmin} and \meta{xmax} inclusive. If you want a step greater than 1, try |\foreach \x in {\meta{xmin},\meta{xmin}+\meta{xstep},...,\meta{xmax}} \marg{loop body}|.
+
+If you need to do multiple loops with a common body, you can just stack the |\foreach| commands:
+\begin{codeexample}[width=6cm]
+\begin{sseqpage}[ xscale = 0.5, x tick step = 2 ]
+\foreach \x in {0,2,...,6}
+\foreach \y in {0,...,3}{
+    \class(\x,\y)
+}
+\end{sseqpage}
 \end{codeexample}
+
+You can also loop through tuples, for instance:
+\begin{codeexample}[width=6cm]
+\begin{sseqpage}[ xscale = 0.5 ]
+\foreach \x/\y/\label in {0/1/a,1/1/b,0/0/c,1/0/d}{
+    \class["\label" above](\x,\y)
+}
+\end{sseqpage}
+\end{codeexample}
+See the last example for |normalize monomial| for a better example of this usage.
+
+There are tons of other things you can do with |\foreach|, though I haven't yet found need for them in combination with \sseqpages. See the \href{\pgfmanualurl#section.64}{\tikzpkg\  manual} for more details.
 \end{command}
 
-\begin{commandlist}{\NewSseqCommand    \texttt{\textbackslash}\meta{command}\marg{argspec}\marg{body},
-                    \DeclareSseqCommand\texttt{\textbackslash}\meta{command}\marg{argspec}\marg{body}}
-The \xparsepkg\ package provides these very powerful commands for defining macros. They are used internally to the \sseqpages\space package to define |\class|, |\d|, etc. To help you create variants of these commands, I will record here the argument specifications for each of them. See the \href{\xparseurl}{\xparsepkg\ manual} for a better explanation and more information.
+\begin{commandlist}{
+    \Do\marg{iterations}\meta{loop body},
+    \DoUntilOutOfBounds\meta{loop body},
+    \DoUntilOutOfBoundsThenNMore\marg{extra iterations}\meta{loop body},
+    \iteration
+}
+The one use case that |\foreach| doesn't cover all that well is if you want the loop to always repeat until the features you are drawing go off the page. This is what |\DoUntilOutOfBounds| and |\DoUntilOutOfBoundsThenNMore| are for. These help ensure that if you change the range of your chart, infinite families will automatically be drawn correctly without the need to adjust a bunch of loop bounds. The purpose of |\DoUntilOutOfBoundsThenNMore| is for towers that are receiving a differential. If your spectral sequence is Adams graded, and a tower is receiving a $d_r$ differential from another tower, you should use |\DoUntilOutOfBoundsThenNMore{r}|:
+\begin{codeexample}[width=7cm]
+\begin{sseqpage}[
+    Adams grading, classes = fill,
+    x range = {0}{10}, y range = {0}{6},
+    x tick step = 2,
+    xscale = 0.3,yscale = 0.7,
+    run off differentials = {->}
+]
+\class(0,0)
+\DoUntilOutOfBoundsThenNMore{3}{
+    \class(\lastx+1,\lasty+1)
+    \structline
+}
+\class(4,0)
+\DoUntilOutOfBounds{
+    \class(\lastx+1,\lasty+1)
+    \structline
+    \d3
+}
+\end{sseqpage}
+\end{codeexample}
+You can also nest |\DoUntilOutOfBounds| reasonably:
+\begin{codeexample}[width=7cm]
+\begin{sseqpage}[
+    x range = {0}{6}, y range = {0}{6},
+    tick step = 2,
+    scale = 0.6
+]
+\class(0,0)
+\DoUntilOutOfBounds{
+    \class(\lastx+1,\lasty+1)
+    \structline
+    \DoUntilOutOfBounds{
+        \class(\lastx,\lasty+1)
+        \structline
+    }
+}
+\end{sseqpage}
+\end{codeexample}
+One important difference between |\foreach| and the |\Do| family of commands is that |\Do| has no effect on the stack. This is in order to ensure that they nest properly.
 
+Note that if you are using these commands and you are planning to draw several pictures of the chart with restricted range, you need to specify a range for the \sseqdataenv\ that contains all of the ranges of pages that you want to draw. If you then want to set a smaller default range, specify the smaller range the first time you use \sseqpageenv\ or |\printpage| to draw the spectral sequence, and include the |keep changes| key.
+
+The |\Do| command is less general than |\foreach|; the purpose is to provide a syntax for stack-based looping that is similar to |\DoUntilOutOfBounds| but with a fixed range. So |\Do{n}\marg{loop body}| repeats \meta{loop body} |n| times. The assumption is that the loop body draws something relative to the position of the |\lastclass|.
+
+If you need to know how many iterations one of these three commands has gone through, this is stored in the variable |\iteration|.
+\end{commandlist}
+\begin{commandlist}{\NewSseqCommand    \cmdarg{command}\marg{argspec}\marg{body},
+                    \DeclareSseqCommand\cmdarg{command}\marg{argspec}\marg{body}}
+The \xparsepkg\ package provides these very powerful commands for defining macros. They are used internally to the \sseqpages\  package to define |\class|, |\d|, etc. To help you create variants of these commands, I will record here the argument specifications for each of them. See the \href{\xparseurl}{\xparsepkg\ manual} for a better explanation and more information.
+
 To make a command like |\class|, you can use the argument specification |O{}r()|. The argument type \texttt{O\marg{default}} stands for a bracket delimited optional argument with default value \meta{default}. In this case, we've specified the default to be empty. |r()| stands for a ``required'' argument delimited by |(| and |)|. In the command definition, access the optional argument with |#1| and the coordinate with |#2|.
 \begin{codeexample}[width = 6.5cm,vbox]
 \DeclareDocumentCommand\demo{ O{} r() }
@@ -956,7 +1119,7 @@
 \DeclareSseqCommand\etaclass{ O{} d() }{
     \IfNoValueF{#2}{ \pushstack(#2) }
     \class[#1] (\lastx+1, \lasty+1)
-    \structline (\lastclass) (\lastclass1)
+    \structline
 }
 \begin{sseqpage}[ classes = fill, yscale = 0.55 ]
 \class(0,0)
@@ -968,6 +1131,11 @@
 
 
 The |\d| command has argument specification |O{} U( r()|. The argument type |U| is special to \sseqpages, and is a variant of until that reinserts the delimiting token. This allows the |(| token to also delimit the beginning of the |r()| argument. Note that the argument type |U| is specially added by \sseqpages\ and might be removed in the future if the \LaTeX3 team yells at me or something.
+    \ExplSyntaxOn
+    \cs_set_eq:NN \__xparse_add_type_U:w \sseq__xparse_add_type_U:w
+    \cs_set_eq:NN \__xparse_normalize_type_U:w \sseq__xparse_normalize_type_U:w
+    \sseq at install@xparse at Uarggrabber
+    \ExplSyntaxOff
 \begin{codeexample}[width = 7cm,vbox]
 \DeclareDocumentCommand {\demo} { O{} U( r() }
     {  \#1 = \textcolor{purple}{\{#1\}};
@@ -990,10 +1158,10 @@
 \end{codeexample}
 \end{commandlist}
 
-\begin{commandlist}{\NewSseqGroup\texttt{\textbackslash}\meta{command}\oarg{argspec}\marg{body},
-                    \DeclareSseqGroup\texttt{\textbackslash}\meta{command}\oarg{argspec}\marg{body}}
-% TODO: explain me
-So that calling |\mygroup(x,y)| prints the whole group shifted to start at $\mathtt{(x,y)}$ instead of $\mathtt{(0,0)}$. For instance:
+\begin{commandlist}{\NewSseqGroup\cmdarg{command}\marg{argspec}\marg{body},
+                    \DeclareSseqGroup\cmdarg{command}\marg{argspec}\marg{body}}
+These are similar to |\NewSseqCommand| and |\DeclareSseqCommand| except that the commands defined take an optional square bracket delimited options list, followed by an optional parenthesis delimited |(x,y)| pair and wraps the body of the code in |\begin{scope}[xshift = \meta{xcoord}, yshift = \meta{ycoord}, options]|.
+For instance:
 \begin{codeexample}[width = 8cm]
 \DeclareSseqGroup\tower {m} {
     \class(0,0)
@@ -1003,28 +1171,115 @@
     }
 }
 \begin{sseqpage}
-\tower[orange](0,0){4}
-\tower[red](1,1){2}
+\tower[orange]{4}
+\tower(1,1){2}
 \end{sseqpage}
 \end{codeexample}
+Here we define a command which takes an options list, a coordinate, and a single mandatory argument. The options are applied to all the classes and structlines, the coordinate shifts the origin, and the mandatory argument is the length of the tower.
 \end{commandlist}
 
-\begin{command}{\getdtarget\marg{macro}\marg{page}\pars{\sourcecoord}}
-Sets \meta{macro} equal to the coordinates of the target position of a length \meta{page} differential starting at \sourcecoord. This helps to make commands that draw fancy differentials. For instance, consider the following example, suggested by Catherine Ray:
+\subsection{Families}
+\spectralsequences\ has a concept of ``class families'' that can be drawn or suppressed as a group, and that can have styling options applied to them as a group. 
+\begin{command}{\sseqnewfamily\marg{family name}}
+This makes a new family with name \meta{family name}. The effect of this is to define global options |\meta{family name} style| which apply options to all classes in the family, |draw \meta{family name}| which causes the family to be drawn, and |no \meta{family name}| which suppresses the family (drawing is the default behavior of course). It also defines an option |\meta{family name}| which puts a feature into the family -- so it can be used as an option to any of the normal commands like |\class|, |\d|, |\structline|, etc and to a scope. 
+
+\begin{codeexample}[vbox]
+\sseqnewfamily{imJ}
+\begin{sseqdata}[
+    name=ANSS-S_2, Adams grading,
+    class labels={below}, label distance=-1pt,
+    class placement transform={rotate=90,scale=2},
+    differentials=blue,
+    x range={0}{9}, y range={0}{4},
+    xscale=0.7, grid=go
+]
+% Image of J classes
+\begin{scope}[imJ]
+\class[rectangle,fill,inner sep=3pt](0,0)
+\DoUntilOutOfBoundsThenNMore{3}{\etaclass}
+\classoptions["\alpha_1" above left](1,1)
+\class["\alpha_{2/2}",circlen=2](3,1)
+\structline(0,0) \structline[dashed](3,3)
+\class["\alpha_3"](5,1) \d3\relax
+\DoUntilOutOfBounds{ \etaclass \d3 }
+\class["\alpha_{4/4}", rectangle, "16" {font=\tiny,inside}, inner sep=1pt](7,1)
+\DoUntilOutOfBoundsThenNMore{3}{\etaclass}
+\end{scope}
+
+% Other classes
+\class["\beta_{2/2}" {below right=-4pt}, insert = 1](6,2)
+\structline(3,1)
+\class["\beta_{2}" left](8,2)
+\etaclass\structline(6,2,2) % This is a *nu
+\end{sseqdata}
+
+\printpage[name=ANSS-S_2, title = with image of J, imJ style=purple]
+
+\printpage[name=ANSS-S_2, no imJ, x range={2}{9}, title = without image of J]
+\end{codeexample}
+\end{command}
+
+
+\subsection{Utilities}
+\begin{command}{\sseqparseint\cmdarg{macro}\marg{integer expression}}
+Stores the result of evaluating an integer expression into \cmdarg{macro}. An integer expression consists of |+|, |-|, |*|, |/|, parentheses, and macros that expand to more of the same. The exact rules regarding what is a valid expression are pretty much what you would expect. Note that juxtaposition is a syntax error, not multiplication, so |2(1+1)| is invalid, you must say |2*(1+1)|.
+\end{command}
+
+\begin{command}{\sseqifempty\marg{expression}\marg{true code}\marg{false code}}
+This tests if an expression is the empty expression. This is mainly useful for giving systematic labels to things. Probably it won't ever matter to you.
+\end{command}
+
+\begin{commandlist}{
+    \IfOutOfBoundsTF\pararg{coordinate}\marg{true code}\marg{false code},
+    \IfOutOfBoundsT\pararg{coordinate}\marg{true code},
+    \IfOutOfBoundsF\pararg{coordinate}\marg{false code},
+    \IfInBoundsTF\pararg{coordinate}\marg{true code}\marg{false code},
+    \IfInBoundsT\pararg{coordinate}\marg{true code},
+    \IfInBoundsF\pararg{coordinate}\marg{false code}
+}
+Test whether an existing class is in bounds or out of bounds. I don't have an obvious use for these. I had to make commands to do this as part of the drawing code and in order to make |\DoUntilOutOfBounds| and it was no extra effort to expose them. Maybe they will be helpful at some point.
+\end{commandlist}
+
+
+\begin{command}{\sseqnormalizemonomial}
+This command simplifies a monomial by combining like variables and removing bases that are raised to the 0th power, removing exponents of 1, removing 1's, and replacing the empty monomial with 1. It outputs its result into |\processedlabel|. This command is specifically meant to be used as a value for |class label handler|, so see the example there for the actual purpose. The exponents must be integers or else it will misbehave.
 \begin{codeexample}[]
-% O{}u(u) is the arg-spec for \d, O{}u(u)mm looks like \d with two extra mandatory arguments
-\NewSseqCommand{\twods}{ O{} U( r() m m }{
-    \getdtarget\target#2{#3}             % Store the target position in \target
-    \nameclass{source}(#3)               % naming the classes gives us a speed boost
-    \nameclass{target1}(\target,#4)      % by preventing sseqpages from reparsing the coordinate
-    \nameclass{target2}(\target,#5)      % it also makes the code easier to read
+\sseqnormalizemonomial{x^0y^0} $\processedlabel$, \quad
+\sseqnormalizemonomial{x^3yx^{-1}z^0} $\processedlabel$, \quad
+\sseqnormalizemonomial{1x_2^2x^2_2} $\processedlabel$
+\end{codeexample}
+\end{command}
+
+
+\subsection{Coordinate parsers and related}
+%    \parsecoordinate and \parsedifferential
+\begin{command}{\parsecoordinate\cmdarg{macro}(\meta{coordinate})}
+This command parses the coordinate and puts the triple |(x,y,n)| into \cmdarg{macro}. It also puts the components of the coordinate into macros, for instance if \cmdarg{macro} is |\coord|, then |\xcoord| will contain the x coordinate, |\ycoord| will contain the y coordinate, and |\ncoord| will contain the index. The coordinate can be anything that would be valid to use in a differential or structure line; this is the macro that is used internally to handle coordinates.
+\end{command}
+
+\begin{command}{\getdtarget\cmdarg{macro}\marg{page}\pars{\sourcecoord}}
+Sets \cmdarg{macro} equal to the coordinates of the target position of a length \meta{page} differential starting at \sourcecoord. This helps to make commands that draw fancy differentials.
+\end{command}
+
+\begin{command}{\parsedifferential\meta{page}(\meta{differential coordinate})\opt{\pararg{differential target}}}
+This has the same weird syntax of |\d|, except that you are required to put braces around the page (if it has multiple digits) and you are required to provide at least one coordinate (you have to say |\parsedifferential{2}(\lastclass)| for instance). This command is similar in effect to saying both |\parsecoordinate\source\meta{source coordinate}| and |\parsecoordinate\target\meta{target coordinate}|, but it handles determination of the target coordinate for you.
+
+
+For instance, consider the following example, suggested by Catherine Ray:
+\begin{codeexample}[]
+% O{} U( r() is the arg-spec for \d, O{} U( r() mm looks like \d with one extra mandatory arguments
+\NewSseqCommand{\twods}{ O{} U( r() d()  m }{
+    \parsedifferential{#2}(#3)(#4)             % Store the target position in \target
+    \nameclass{source}(\sourcecoord,\nsource)  % give names to the three classes
+    \nameclass{target1}(\targetcoord,\ntarget)
+    \nameclass{target2}(\targetcoord,#5)
 %
-    \circleclasses[ cc:differential style, #1,
-           name path = circ, page = #2--#2 ]
-                (target1)(target2)            % Circle the classes, use differential style
+    \circleclasses[ cc:differential style, name path = circ,
+                    #1, page = #2--#2 ]
+                    (target1)(target2)         % Circle the classes, use differential style
 %
-    \d[invisible]#2(source)(target1)     % don't draw anything, but record source and targets as hit.
-    \d[invisible]#2(source)(target2)
+    % record source and targets as hit.
+    \kill#2(source) \kill#2(target1) \kill#2(target2)
 %
     \path(target1)--(target2)
                 coordinate[midway](midpt);% put a coordinate in the center of the two classes
@@ -1040,7 +1295,7 @@
 \class(0,2)
 \class(1,0)\class(1,0)
 
-\twods2(1,0,-1){1}{2}
+\twods2(1,0,-1,1){2}
 \end{sseqdata}
 \printpage[ name = cathex, page = 1 ]
 \qquad
@@ -1051,7 +1306,7 @@
 \end{command}
 
 \begin{command}{\nameclass\marg{name}\pararg{coordinate}}
-The |\nameclass| command gives a name to a class. It's similar to saying |\doptions[name = |\meta{name}|]|, but faster. It's also similar to saying |\pushstack|\pararg{coordinate}. Giving temporary names to coordinates that you are going to use repeatedly makes the code easier to read and is faster (though this only matters in very large diagrams). See |\getdtarget| for an example.
+The |\nameclass| command gives a name to a class. It's similar to saying |\doptions[name = |\meta{name}|]|, but faster. It's also similar to saying |\pushstack|\pararg{coordinate}. Giving temporary names to coordinates that you are going to use repeatedly makes the code easier to read and is faster (though this only matters in very large charts). See |\getdtarget| for an example.
 \end{command}
 
 \begin{command}{\tagclass\marg{tag}\pararg{coordinate}}
@@ -1058,7 +1313,7 @@
 The |\tagclass| command gives a tag to a class. It's similar to saying |\doptions[tag = |\meta{name}|]|, but faster. See \example{tmfmayss} for a use case for this.
 \end{command}
 
-\begin{command}{\gettag\texttt{\textbackslash}\meta{somecontrolsequence}\pararg{coordinate}}
+\begin{command}{\gettag\cmdarg{somecontrolsequence}\pararg{coordinate}}
 The |\gettag| command finds the most recent tag applied to the coordinate and stores it into the command. This is useful for connecting groups of nodes. For example, consider the following code, inspired by \example{tmfmayss}.
 \begin{codeexample}[width=6cm]
 \DeclareSseqCommand \tower { O{} } {
@@ -1065,7 +1320,7 @@
     \begin{scope}[#1]
     \foreach\i in {1,...,7}{
         \class(\lastx,\lasty+1)
-        \structline(\lastclass1)(\lastclass)
+        \structline
     }
     \end{scope}
     \restorestack
@@ -1077,12 +1332,12 @@
     \begin{scope}[#1]
     \gettag\thetag(\lastclass)
     \class(\lastx+3,\lasty+1)
-    \structline[gray](\lastclass)(\lastclass1)
+    \structline[gray]
     \savestack
     \foreach\i in {1,...,7}{
         \class(\lastx,\lasty+1)
-        \structline(\lastclass1)(\lastclass)
-        \structline[gray](\lastx-3,\lasty-1,\thetag)(\lastclass)
+        \structline
+        \structline[gray](\lastx-3,\lasty-1,\thetag)
     }
     \restorestack
     \end{scope}
@@ -1101,9 +1356,9 @@
 \end{command}
 
 
-\subsection{The Class Stack}
+\subsection{The class stack}
 \label{sec:class stack}
-The class stack is a linked list of the classes in the order that they are produced that \sseqpages\space maintains. I've only recently implemented this feature, so it is more liable to change in the future than other things. Whenever you use the |\class| function, the class you added is pushed onto the stack. Here's an example that demonstrates basic usage:
+The class stack is a linked list of the classes in the order that they are produced that \sseqpages\  maintains. I've only recently implemented this feature, so it is more liable to change in the future than other things. Whenever you use the |\class| function, the class you added is pushed onto the stack. Here's an example that demonstrates basic usage:
 
 
 The following commands are used to access the stack:
@@ -1110,7 +1365,46 @@
 
 \begin{commandlist}{\lastx\opt{\meta{n}},\lasty\opt{\meta{n}},\lastclass\opt{\meta{n}}}
 The commands |\lastx| and |\lasty| evaluate to the |x| and |y| position, respectively, of the $n$th class on the stack. If $n = 0$ you can leave it off.
-The command |\lastclass| evaluates to the coordinate of
+The command |\lastclass| evaluates to the coordinate of the most recent class on the stack. This is useful for writing turtle-style code:
+\begin{codeexample}[width=6cm]
+\DeclareSseqCommand \etaclass {}{
+    \class(\lastx+1,\lasty+1)
+    \structline
+}
+\DeclareSseqCommand \divtwoclass {}{
+    \class(\lastx,\lasty-1)
+    \structline
+}
+\begin{sseqpage}
+\class(0,0)
+\savestack
+\foreach \y in { 1,...,5 }{
+    \class(0,\y)
+    \structline
+}
+\restorestack
+\etaclass\etaclass\etaclass
+\divtwoclass\divtwoclass
+\end{sseqpage}
+\end{codeexample}
+
+You can use |\lastx| and |\lasty| in other contexts than in the body of a \sseqpages\ command, most notably inside |\sseqparseint| (they also go fine inside |\pgfmathparse| if you need it or one of its siblings). For instance, consider the following tower command:
+\begin{codeexample}[width=6cm]
+\DeclareSseqCommand \tower { } {
+    \savestack
+    \sseqparseint\numclasses{\ymax-\lasty0}
+    \foreach \n in {1,...,\numclasses}{
+        \class(\lastx,\lasty+1)
+        \structline
+    }
+    \restorestack
+}
+\begin{sseqpage}[y range = {0}{5}]
+\class(0,0)\tower
+\class(1,3)\tower
+\class(3,2)\tower
+\end{sseqpage}
+\end{codeexample}
 \end{commandlist}
 
 
@@ -1124,7 +1418,7 @@
 
 
 \section{Styles}
-The \sseqpages\space package has a large number of styles which control the appearance of specific components (e.g., classes, differentials, or structlines) of a spectral sequence. Each style has two corresponding keys: |classes| and |change classes|.  Saying |classes = |\marg{keys} adds the keys to the list of options used to style every future class, whereas |change classes = |\marg{keys} only makes sense in a \sseqpageenv\space environment, and temporarily overwrites the list of options. Note that |change classes| only applies to classes that existed before the current page, and that even with the |keep changes| option, the |change classes| options are local to the current page. Compare:
+The \sseqpages\  package has a large number of styles which control the appearance of specific components (e.g., classes, differentials, or structure lines) of a spectral sequence. Each style has two corresponding keys: |classes| and |change classes|.  Saying |classes = |\marg{keys} adds the keys to the list of options used to style every future class, whereas |change classes = |\marg{keys} only makes sense in a \sseqpageenv\  environment, and temporarily overwrites the list of options. Note that |change classes| only applies to classes that existed before the current page, and that even with the |keep changes| option, the |change classes| options are local to the current page. Compare:
 \begin{codeexample}[width = 8cm]
 \begin{sseqdata}[ name = stylesex ]
 \class(0,0)\class(1,1)
@@ -1142,7 +1436,7 @@
 \end{sseqpage}
 \end{codeexample}
 
-You can modify these styles outside of a spectral sequence or inside it using |\sseqset|, you can modify them as options to the \sseqdataenv\space and \sseqpageenv\space environments, or you can modify them as arguments to the \scopeenv\space environment.
+You can modify these styles outside of a spectral sequence or inside it using |\sseqset|, you can modify them as options to the \sseqdataenv\  and \sseqpageenv\  environments, or you can modify them as arguments to the \scopeenv\  environment.
 
 In cases where the same drawing feature is affected by multiple of these styles, the more specific style takes precedence. For instance, for a class that is the source or target of a differential on the current page, the precedence order from lowest to highest goes: |sseq style|, |class style|, |transient cycle style|, |this page cycle style|, and then any options from scopes in the order they appear, and any local options (the options that come right with the class, e.g., |\class[local options](x,y)|). If you don't want the options to your scopes to override more specific styles, use |sseq|:
 \begin{codeexample}[width = 7cm]
@@ -1157,7 +1451,7 @@
 
 \begin{sseqpage}[ classes = { blue, fill },
    title style = { align = center, text width = 2.4cm },
-   title = { only structline is orange } ]
+   title = { only structure line is orange } ]
 \begin{scope}[ sseq = orange ]
 \class(0,0) \class(0,1)
 \structline(0,0)(0,1)
@@ -1239,8 +1533,7 @@
 \class(1,3) \class(2,0)
 \d2(1,0) \d3(2,0)
 \end{sseqdata}
-\printpage[ name = this page cycles example, page = 2 ]
-\hskip1cm
+\printpage[ name = this page cycles example, page = 2 ] \qquad
 \printpage[ name = this page cycles example, page = 3 ]
 \end{codeexample}
 \end{stylekeylist}
@@ -1254,12 +1547,12 @@
 \end{stylekeylist}
 
 \begin{stylekeylist}{tikz primitives,change tikz primitives}
-Applies to all \tikzpkg\space primitives.
+Applies to all \tikzpkg\  primitives.
 \end{stylekeylist}
 
 
 \begin{stylekeylist}{labels,change labels}
-This style applies to labels on classes, differentials, and structlines. All the more specific label styles take precedence over it.
+This style applies to labels on classes, differentials, and structure lines. All the more specific label styles take precedence over it.
 \end{stylekeylist}
 
 \begin{stylekeylist}{class labels,inner class labels,outer class labels,
@@ -1266,7 +1559,8 @@
                 change class labels,change inner class labels,change outer class labels}
 Inner class labels specifically applies to class labels that are inside the node, outer class labels specifically applies to ones outside it:
 \begin{codeexample}[]
-\begin{sseqpage}[ no axes, classes = { inner sep = 0.1cm },
+\begin{sseqpage}[ no axes, classes = { inner sep = 1pt },
+    label distance=2pt,
     outer class labels = { red },
     inner class labels = { blue } ]
 \class["a", "b" above](0,0)
@@ -1301,9 +1595,9 @@
 \begin{keylist}{run off = \meta{start tip}--\meta{end tip},
     run off struct lines = \meta{start tip}--\meta{end tip}  (initially {...--...}),
     run off differentials = \meta{start tip}--\meta{end tip} (initially {...--...})}
-Change the default behavior of run off edges for either all edges, just struct lines, or just differentials respectively. Local arrowhead options override this.
+Change the default behavior of run off edges for either all edges, just structure lines, or just differentials respectively. Local arrowhead options override this.
 
-If an edge runs off the edge of the clipping, sseqpages automatically add an arrowhead to indicate that the edge continues. This option controls which arrow head is added if the start or end of an edge runs off the page.
+If an edge runs off the edge of the clipping, \sseqpages\ automatically add an arrowhead to indicate that the edge continues. This option controls which arrow head is added if the start or end of an edge runs off the page.
 \begin{codeexample}[width = 6cm]
 \begin{sseqpage}[ x range = {0}{2}, y range = {0}{2},
                   draw orphan edges, run off = >-stealth ]
@@ -1325,13 +1619,13 @@
 Here is an example of a function that evaluates an arithmetic expression:
 \begin{codeexample}[width=6cm]
 \begin{sseqpage}[
-    class label handler = { \edef\processedlabel{\the\numexpr#1} }
+    class label handler = { \sseqparseint\processedlabel{#1} }
 ]
 \class["1+1"](0,0)
 \class["1+2*(1+3*(4-1))"](1,1)
 \end{sseqpage}
 \end{codeexample}
-Here's an example using |\sseqnormalizepolynomial|:
+Here's an example using |\sseqnormalizemonomial|:
 \begin{codeexample}[width = 6cm]
 \NewSseqGroup \test {m} {
     \class["1#1"](0,0)
@@ -1350,6 +1644,7 @@
 \end{codeexample}
 
 Here is another example which demonstrates a useful idiom for drawing Serre spectral sequences. For a more complete example, see \example{KF3n}. Note the use of braces in |{Sq^1\iota_2}|. Without braces, |\sseqnormalizemonomial| will simplify |Sq^1xSq^2x| into $S^2q^3x^2$, which is obviously undesirable, so the correct way to input this is |{Sq^1x}{Sq^2x}|. Unfortunately, |\foreach| strips a pair of braces from its arguments, so you need to put two pairs of braces.
+%\pgfmanualpdflabel{normalizemonomialex-labels}
 \begin{codeexample}[width=8cm]
 \begin{sseqpage}[
   xscale = 1.4,
@@ -1368,20 +1663,22 @@
 \end{key}
 
 
-\section{Global options}
-These options can only be set at the beginning of a \sseqdataenv\space or \sseqpageenv\space environment. When it makes sense, you can also set a default value using |\sseqset|. Generally, these options either modify the plot style or the logic for the spectral sequence.
+\section{Global Options}
+These options can only be set at the beginning of a \sseqdataenv\  or \sseqpageenv\  environment. When it makes sense, you can also set a default value using |\sseqset|. Generally, these options either modify the plot style or the logic for the spectral sequence.
 \begin{key}{name = \meta{sseq name}}
-This option must be used with the \sseqdataenv\space environment where it indicates the name of the spectral sequence, which will be used with the \sseqpageenv\space environment or |\printpage| command to draw the spectral sequence. The name used in a \sseqdataenv\space environment must be new unless the environment is used with the |update existing| key in which case the \sseqdataenv\space environment will add to the existing spectral sequence. It is optional when used with \sseqpageenv\space, and if included the name given must be the name of an existing spectral sequence.
+This option must be used with the \sseqdataenv\  environment where it indicates the name of the spectral sequence, which will be used with the \sseqpageenv\  environment or |\printpage| command to draw the spectral sequence. The name used in a \sseqdataenv\  environment must be new unless the environment is used with the |update existing| key in which case the \sseqdataenv\  environment will add to the existing spectral sequence. It is optional when used with \sseqpageenv\ , and if included the name given must be the name of an existing spectral sequence.
 \end{key}
 
-\begin{key}{page = \meta{page number} (initially 0)}
-This key is for \sseqpageenv\space and |\printpage|. It specifies which page of the spectral sequence is to be printed. On page r, all |\class|es that are not hit by differentials on pages less than r will be printed, as well as all |\structline|s whose source and target classes are both printed on page r, and all differentials of length exactly r. The special value |page = 0| prints all classes, differentials, and structure lines.
+\begin{key}{page = \meta{page number}\opt{--\meta{page max} (initially 0)}}
+This key is for \sseqpageenv\  and |\printpage|. It specifies which page of the spectral sequence is to be printed. On page r, all |\class|es that are not hit by differentials on pages less than r will be printed, as well as all |\structline|s whose source and target classes are both printed on page r, and all differentials of length exactly r. The special value |page = 0| prints all classes, differentials, and structure lines.
+
+If you use this key with a range, then all differentials in that range of lengths will be drawn. The larger number only changes which differentials are drawn. If you use 0 for the \meta{page max}, then all differentials longer than \meta{page number} will be drawn.
 \end{key}
 
 \begin{keylist}{degree = \marg{x degree}\marg{y degree},cohomological Serre grading, homological Serre grading, Adams grading}
 Specifies the degree of differentials. The \meta{x degree} and \meta{y degree} should both be mathematical expressions in one variable |#1| that evaluate to integers on any input. They specify the $\mathtt{x}$ and $\mathtt{y}$ displacement of a page $\mathtt{\#1}$ differential. In practice, they will be linear expressions with |#1| coefficient 1, -1, or 0.
 
-The |degree| option must be given before placing any differentials. It can be specified at the beginning of the \sseqdataenv\space environment, at the beginning of the \sseqpageenv\space environment if it is being used as a standalone page, or as a default by saying |\sseqset{degree = \marg{x degree}\marg{y degree}}| or |\sseqset{Adams grading}| outside of the \sseqdataenv\space and \sseqpages\space environments.
+The |degree| option must be given before placing any differentials. It can be specified at the beginning of the \sseqdataenv\  environment, at the beginning of the \sseqpageenv\  environment if it is being used as a standalone page, or as a default by saying |\sseqset{degree = \marg{x degree}\marg{y degree}}| or |\sseqset{Adams grading}| outside of the \sseqdataenv\  and \sseqpages\  environments.
 
 You can make a named grading convention by saying \codeverb|\sseqset{my grading/.sseq grading = \marg{x degree}\marg{y degree}}|. Then later passing |my grading| to a spectral sequence is equivalent to saying |degree = \marg{x degree}\marg{y degree}|. The following grading conventions exist by default:
 \begin{codeexample}[width = 6cm]
@@ -1411,7 +1708,7 @@
 \end{keylist}
 
 \begin{keylist}{strict degree, lax degree}
-If the degree is strict, then latex will throw an error if you try to specify a differential that doesn't have the proper grading. The degree is strict by default.
+If the degree is strict, then \LaTeX will throw an error if you try to specify a differential that doesn't have the proper grading. The degree is strict by default.
 \begin{codeexample}[code only]
 \begin{sseqdata}[ name = laxdegree, Adams grading ]
 \class(0,2)
@@ -1432,13 +1729,13 @@
 \end{keylist}
 
 \begin{key}{update existing}
-This key is only for the \sseqdataenv\space environment. It specifies that the current \sseqdataenv\space environment is adding data to an existing spectral sequence. If you don't pass this key, then giving a \sseqdataenv\space environment the same |name| as a different \sseqdataenv\space environment will cause an error. This is intended to help you avoid accidentally reusing the same name.
+This key is only for the \sseqdataenv\  environment. It specifies that the current \sseqdataenv\  environment is adding data to an existing spectral sequence. If you don't pass this key, then giving a \sseqdataenv\  environment the same |name| as a different \sseqdataenv\  environment will cause an error. This is intended to help you avoid accidentally reusing the same name.
 \end{key}
 
 
 \begin{key}{keep changes =\meta{boolean} (default true)(initially false)}
-This option is only for the \sseqpageenv\space environment, and only works when a |name| is provided.
-This option specifies that all of the commands in the current \sseqpageenv\space environment should be carried forward to future pages of the same named spectral sequence. For example:
+This option is only for the \sseqpageenv\  environment, and only works when a |name| is provided.
+This option specifies that all of the commands in the current \sseqpageenv\  environment should be carried forward to future pages of the same named spectral sequence. For example:
 \begin{codeexample}[]
 \begin{sseqdata}[ name = keep changes example, Adams grading, y range = {0}{3} ]
 \class(0,0)
@@ -1463,15 +1760,12 @@
 
 \printpage[ name = keep changes example, page = 3 ]
 \end{codeexample}
-Note that the orange classes and differential do not persist because the |keep changes| option is not set in the first \sseqpageenv\space environment, but the blue classes and differential do, since the |keep changes| option is set in the second \sseqpageenv\space environment.
+Note that the orange classes and differential do not persist because the |keep changes| option is not set in the first \sseqpageenv\  environment, but the blue classes and differential do, since the |keep changes| option is set in the second \sseqpageenv\  environment.
 \end{key}
 
 
 \begin{keylist}{no differentials,draw differentials}
 The option |no differentials| suppresses all of the differentials on the current page, whereas |draw differentials| causes the page appropriate differentials to be drawn. This is useful for explaining how the computation of a spectral sequence goes, or if you want to display one of the edges of the spectral sequence, like in \example{KF3n}.
-%\begin{codeexample}[]
-%TODO: build example
-%\end{codeexample}
 \end{keylist}
 
 \begin{keylist}{no struct lines,draw struct lines}
@@ -1528,7 +1822,7 @@
     (-0.5,0)(-0.3,0)(-0.1,0)(0.1,0)(0.3,0)(0.5,0);
 }
 \end{codeexample}
-For instance the third row indicates that if there are three classes at the position |(x,y)| they should be printed at |(x-0.2,y)|, |(x,y)|, and |(x+0.2,y)|. You can give as many rows as you like; \sseqpages\space will throw an error if there are more classes in any position than the maximum number that your class pattern can handle -- for instance, the |linear| class pattern can handle up to six classes based on this definition.
+For instance the third row indicates that if there are three classes at the position |(x,y)| they should be printed at |(x-0.2,y)|, |(x,y)|, and |(x+0.2,y)|. You can give as many rows as you like; \sseqpages\  will throw an error if there are more classes in any position than the maximum number that your class pattern can handle -- for instance, the |linear| class pattern can handle up to six classes based on this definition.
 \end{command}
 \end{key}
 
@@ -1535,9 +1829,9 @@
 
 \begin{key}{class placement transform = \marg{transform keys}, add class placement transform = \marg{transform keys} }
 \declareasstyle{class placement transform}\declareasstyle{add class placement transform}
-The option |class placement transform| allows the user to specify a \tikzpkg\space coordinate transform to adjust the relative position of multiple nodes in the same $\mathtt{(x,y)}$ position. The |class placement transform| key overrides the previous value of transformations, the |add class placement transform| just adds the new transformation to the end of the list. This coordinate transform can only involve rotation and scaling, no translation. Specifying a scaling factor helps if the nodes are too large and overlap. In some cases a rotation makes it easier to see which class is the target of a differential.
+The option |class placement transform| allows the user to specify a \tikzpkg\  coordinate transform to adjust the relative position of multiple nodes in the same $\mathtt{(x,y)}$ position. The |class placement transform| key overrides the previous value of transformations, the |add class placement transform| just adds the new transformation to the end of the list. This coordinate transform can only involve rotation and scaling, no translation. Specifying a scaling factor helps if the nodes are too large and overlap. In some cases a rotation makes it easier to see which class is the target of a differential.
 \begin{codeexample}[width = 5cm]
-\begin{sseqpage}[ class placement transform = { xscale = 3 },
+\begin{sseqpage}[ class placement transform = { xscale = 1.5 },
                   class pattern = linear,
                   classes = { draw = none },
                   xscale = 2, x axis extend end = 0.7cm ]
@@ -1563,7 +1857,7 @@
 \begin{codeexample}[width = 5.5cm]
 \begin{sseqpage}[ classes = {draw = none }, xscale = 2, yscale=1.55,
     class pattern = linear,
-    class placement transform = { scale = 3, rotate = 90 },
+    class placement transform = { scale = 1.5, rotate = 90 },
     right clip padding = 20pt, top clip padding = 20pt,
     x axis gap = 30pt, y axis gap = 20pt ]
 \class["\iota_3\beta\iota_3"](7,0)
@@ -1584,15 +1878,15 @@
 \end{key}
 
 \begin{key}{math nodes = \meta{boolean} (default true)(initially true)}
-This key instructs \sseqpages\space to put all labels in math mode automatically.
+This key instructs \sseqpages\  to put all labels in math mode automatically.
 \end{key}
 
 
 
-\subsection{Global Coordinate Transformations}
-Of the normal \tikzpkg\ coordinate transformations, only the following can be applied to a sseq diagram:
+\subsection{Global coordinate transformations}
+Of the normal \tikzpkg\ coordinate transformations, only the following can be applied to a \sseqpages\  chart:
 \begin{keylist}{scale = \meta{factor},xscale = \meta{factor}, yscale = \meta{factor}, xmirror, ymirror}
-Scale the diagram by \meta{factor}. Under normal circumstances, you can tell \tikzpkg\ to mirror a diagram by saying, for instance, |xscale = -1|, but \sseqpages\space needs to be aware that the diagram has been mirrored in order to draw the axes correctly. Thus, if you want to mirror a spectral sequence, use the |xmirror| and |ymirror| options as appropriate.
+Scale the chart by \meta{factor}. Under normal circumstances, you can tell \tikzpkg\ to mirror a chart by saying, for instance, |xscale = -1|, but \sseqpages\  needs to be aware that the chart has been mirrored in order to draw the axes correctly. Thus, if you want to mirror a spectral sequence, use the |xmirror| and |ymirror| options as appropriate.
 \end{keylist}
 
 \begin{key}{rotate = \meta{angle}}
@@ -1599,13 +1893,19 @@
 It probably won't look great if you pick an angle that isn't a multiple of 90 degrees.
 \end{key}
 
-\subsection{Plot Options and Axes Style}
+\subsection{Plot options and axes style}
 \begin{keylist}{x range = \marg{x min}\marg{x max},y range = \marg{y min}\marg{y max}}
-These options force the x and y range to be a specific interval. By default, if no range is specified then the range is chosen to fit all the classes. If an x range is specified but no y range, then the y range is chosen to fit all the classes that lie inside the specified x range, and vice versa.
+These options set the x range (respectively y range) to be a specific interval. By default, if no range is specified then the range is chosen to fit all the classes. If an x range is specified but no y range, then the y range is chosen to fit all the classes that lie inside the specified x range, and vice versa. The values must be integers -- if you want to extend the x axis a noninteger amount, try using |x axis start extend| or |x axis end extend|.
 \end{keylist}
 
-\begin{key}{grid = \marg{grid style}}
-Makes \sseqpages\space draw a grid. The grid styles and a significant part of the code that produces them were stolen from the \sseqpkg\ package.
+\begin{keylist}{
+    grid = \meta{grid type},
+    grid color = \meta{color},
+    grid step = \meta{positive integer},
+    x grid step = \meta{positive integer},
+    y grid step = \meta{positive integer}
+}
+Makes \sseqpages\  draw a grid. The grid types and a significant part of the code that produces them were stolen from the \sseqpkg\ package.
 \begin{codeexample}[vbox]
 \begin{sseqdata}[ name = grid example, scale = 0.8 ]
 \class(0,0)
@@ -1616,27 +1916,31 @@
 \class(3,3)
 \end{sseqdata}
 \hbox{
-\printpage[ name = grid example, grid = chess ]
+\printpage[ name = grid example, grid = chess, title=chess ]
 \qquad
-\printpage[ name = grid example, grid = crossword ]
-\qquad
-\printpage[ name = grid example, grid = dots ]
+\printpage[ name = grid example, grid = crossword, title=crossword ]
 }
 \vskip20pt
 \hbox{
-\printpage[ name = grid example, grid = go ]
+\printpage[ name = grid example, grid = go, title=go ]
 \qquad
 \printpage[ name = grid example, grid = none ]
 }
 \end{codeexample}
-It is possible to make your own grid style by defining the command |\sseq at grid@yourgridname| to draw a grid.
-\end{key}
+It is possible to make your own grid type by defining the command |\sseq at grid@yourgridname| to draw a grid.
 
+It is a known problem that acrobat reader displays grids very dark and thick. This is caused by the enhance thin lines ``feature'' of Acrobat reader. You can turn it off globally by going into the acrobat reader preferences window and unchecking the ``Enhance thin lines'' checkbox in the ``Rendering'' section. Unfortunately, there is no way to instruct Acrobat Reader to not apply this feature to a particular document. This has apparently been annoying graphic designers for over a decade.
+
+The grid color option changes the color of the grid; the default value is |gray|.
+The grid step keys change the grid step.
+\end{keylist}
+
 \begin{keylist}{title = \meta{text}, title style = \meta{keys}, x label = \meta{text}, y label = \meta{text},x label style = \meta{keys}, y label style = \meta{keys}, label style = \meta{keys}}
 \declareasstyle{title style}
 \declareasstyle{x label style}
 \declareasstyle{y label style}
 \declareasstyle{label style}
+This make chart labels.
 \begin{codeexample}[width = 6cm]
 \begin{sseqpage}[ title = { An example }, yscale = 0.5,
     x label = { x axis label },
@@ -1648,19 +1952,17 @@
 \class(2,2)
 \end{sseqpage}
 \end{codeexample}
+Note that if you make multiple versions of the same chart and some of the charts have labels and others don't, they might not align the way you want. An easy solution to this is to use |\path[background] (min x, min y) -- (max x, max y);| where the coordinates are below and to the left, respectively above and to the right, of everything else drawn in any picture. This makes the bounding boxes for all of the pictures the same size, so that they line up even if the exact collection of things drawn changes. See the example at the end of the |background| key for an illustration of this.
 \end{keylist}
 
-
+\needspace{5\baselineskip}
 \begin{keylist}{no title, draw title, no x label, no y label, no labels, draw x label, draw y label, draw labels}
 Suppress or unsuppress the title, x label, y label, or both x and y labels, respectively.
 \end{keylist}
 
-\begin{keylist}{no x axis, no y axis, no axes, draw x axis, draw y axis, draw axes}
-Suppress the axis. Also suppresses axes ticks. If there is a title or axes labels they will still be drawn. You can draw your own axes using \tikzpkg\space inside a \scopeenv\space environment with the |background| key.
-\end{keylist}
 
 \begin{keylist}{no x ticks, no y ticks, no ticks, draw x ticks, draw y ticks, draw ticks}
-Suppress axes ticks (the numbers next to the axes). Only matters if axes are drawn. You can make your own ticks using \tikzpkg\space inside a \scopeenv\space environment with the |background| key. For instance, you might want to label the axes as 0, $n$, $2n$, \ldots You can achieve this as follows: (you can also use |x tick handler|).
+Suppress axes ticks (the numbers next to the axes). Only matters if axes are drawn. You can make your own ticks using \tikzpkg\  inside a \scopeenv\  environment with the |background| key. For instance, you might want to label the axes as 0, $n$, $2n$, \ldots You can achieve this as follows: (you can also use |x tick handler|).
 \begin{codeexample}[width = 5.7cm]
 \begin{sseqpage}[ no x ticks, x range = {0}{3} ]
 \begin{scope}[ background ]
@@ -1677,10 +1979,38 @@
 \end{codeexample}
 \end{keylist}
 
+
 \begin{keylist}{x tick step = \meta{positive integer} (initially 1),y tick step = \meta{positive integer} (initially 1),tick step = \meta{positive integer} (initially 1)}
 Sets the interval between labels.
 \end{keylist}
 
+\begin{keylist}{x tick offset = \meta{integer} (initially 0),y tick offset = \meta{integer} (initially 0),tick offset = \meta{integer} (initially 0)}
+Sets the label offset -- by default the ticks will always be the set of numbers that are 0 mod \meta{tick step}. Change it so that the ticks are the set of numbers that are \meta{tick offset} mod \meta{tick step}.
+\end{keylist}
+
+\begin{keylist}{
+    x major tick step=\meta{nonnegative integer} (initially 0),
+    y major tick step=\meta{nonnegative integer} (initially 0),
+    major tick step=\meta{nonnegative integer},
+    x minor tick step=\meta{nonnegative integer} (initially 0),
+    y minor tick step=\meta{nonnegative integer} (initially 0),
+    minor tick step=\meta{nonnegative integer}%
+}
+If these are nonzero, they control the placement of tick marks on the axes. The value 0 prevents tick marks from being drawn. Uses |x tick offset| as an offset.
+\begin{codeexample}[width=7cm]
+\begin{sseqpage}[ 
+    tick step = 5,
+    major tick step = 5, 
+    minor tick step = 1, 
+    scale = 0.4,
+    axes type = frame
+]
+\class(0,0)
+\class(10,10)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+
 \begin{stylekeylist}{x tick style,y tick style,tick style}
 Change the tick style:
 \begin{codeexample}[width = 7cm]
@@ -1716,11 +2046,17 @@
 \end{codeexample}
 \end{keylist}
 
-\needspace{5\baselineskip}
+\newpage
 \subsection{Layout}
-\begin{keylist}{x axis style = \meta{style} (initially border), y axis style = \meta{style} (initially border),axes style = \meta{style} (initially border)}
-The \meta{style} is either |border| or |center|. The |border| option puts the axes on the bottom and left of the picture; the center option by default places the axes at $\mathtt{x = y = 0}$. This option is only worth using for multi-quadrant spectral sequences. See \example{KRAHSS} and \example{KUHFPSS} for examples where this is used.
-%TODO: example?
+\begin{keylist}{x axis type = \meta{type} (initially border), y axis type = \meta{type} (initially border),axes type = \meta{type} (initially border), no x axis, no y axis, no axes}
+The \meta{type} is either |border|, |center|, |frame|, or |none|. |no axes| is a shorthand for |axes type=none|. The |border| type is the default and puts the axes on the bottom and left of the picture. The |center| type by default places the axes to pass through $(0,0)$; this can be modified using the |x axis origin| and |y axis origin| keys. See \example{KRAHSS} and \example{KUHFPSS} for examples where this is used. The |frame| type draws a frame around the entire chart:
+
+\begin{codeexample}[width=6cm]
+\begin{sseqpage}[axes type=frame]
+\class(0,0)
+\class(3,2)
+\end{sseqpage}
+\end{codeexample}
 \end{keylist}
 
 \parskip=0pt
@@ -1728,109 +2064,48 @@
 If you use |axes style = center|, these keys change the position of the axes. Otherwise, they are ignored.
 \end{keylist}
 %
-%
 \begin{keylist}{x axis gap = \meta{dimension} (initially 0.5cm),y axis gap = \meta{dimension} (initially 0.5cm), axes gap = \meta{dimension} (initially 0.5cm)}
 %
 \end{keylist}
 %
-%
 \begin{keylist}{x tick gap = \meta{dimension} (initially 0.5cm),y tick gap = \meta{dimension} (initially 0.5cm)}
 %
 \end{keylist}
 %
-\begin{keylist}{x axis start extend = \meta{dimension} (initially 0.5cm), y axis start extend = \meta{dimension} (initially 0.5cm),
-                x axis end extend = \meta{dimension} (initially 0.9cm), y axis end extend = \meta{dimension} (initially 0.9cm)}
+\begin{keylist}{
+    x axis start extend = \meta{dimension} (initially 0.5cm), y axis start extend = \meta{dimension} (initially 0.5cm),
+    x axis extend end = \meta{dimension} (initially 0.5cm), y axis extend end = \meta{dimension} (initially 0.5cm),
+    x axis tail = \meta{dimension} (initially 0.9cm), y axis tail = \meta{dimension} (initially 0.9cm)%
+}
 \end{keylist}
 %
 \begin{keylist}{x axis clip padding = \meta{dimension} (initially 0.1cm), y axis clip padding = \meta{dimension} (initially 0.1cm)}
 \end{keylist}
 %
-\begin{keylist}{right clip padding = \meta{dimension} (initially 0.1cm), left clip padding = \meta{dimension} (initially 0.4cm),
-                top clip padding = \meta{dimension} (initially 0.1cm), bottom clip padding = \meta{dimension} (initially 0.4cm)}
+\begin{keylist}{
+    right clip padding = \meta{dimension} (initially 0.1cm), left clip padding = \meta{dimension} (initially 0.1cm),
+     top clip padding = \meta{dimension} (initially 0.1cm), bottom clip padding = \meta{dimension} (initially 0.1cm)%
+}
 \end{keylist}
 
+\afterpage{
 \begin{center}
-\pgfkeys{/sseqpages/tikz primitives/distance label/.style = {orange,{<[width = 4pt]}-}, /sseqpages/tikz primitives/description/.style = {black,/tikz/align = center}}
-\begin{sseqpage}[ grid = chess,
-    x range = {0}{5}, y range = {0}{5}, math nodes = false,
-    x axis clip padding = 0.15cm, y axis clip padding = 0.15cm,
-    right clip padding = 0.2cm, top clip padding = 0.2cm, axes gap = 25pt]
-\begin{scope}[background,red]
-\sseq 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};
+\input spectralsequencesmanual-layoutcharts
+\end{center}
+}
 
 
-% 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.
+Give a custom clipping. The clipping specified must be in the form of a valid \tikzpkg\ path, for instance |\clip (0,0) rectangle (10,10);|. This clipping is also applied to any grid and is used to draw ellipses on appropriate differentials or structure lines that go out of bounds and to determine whether a differential or structure line is an ``orphan''. It is not applied to any background elements, which is important because these are often used for axes labels and such that should lie outside of the clipping region. Weird things can happen with out of range edges if you provide an oddly shaped path.
 \end{key}
 
 \begin{key}{clip = \meta{boolean} (default true)(initially true)}
-If this is false the spectral sequence won't be clipped. I'm not really sure why you would want that, but there might be some use case. Setting this to be false is not fully supported, and it's possible that weird things will happen with some of the edges that go out of range.
+If this is false the spectral sequence chart won't be clipped. I'm not really sure why you would want that, but there might be some use case. Setting this to be false is not fully supported, and it's possible that weird things will happen with some of the edges that go out of range.
 \end{key}
 
 
 \begin{key}{rotate labels = \meta{boolean} (default true)(initially false)}
-If you use |rotate = 90| but also want the labels rotated (so that the whole diagram is sideways) use this key.
+If you use |rotate = 90| but also want the labels rotated (so that the whole chart is sideways) use this key.
 \end{key}
-\end{document} 
\ No newline at end of file
+\end{document}

Modified: trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanualpreamble.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanualpreamble.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/doc/latex/spectralsequences/manual/spectralsequencesmanualpreamble.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,8 +1,8 @@
 %%
-%% Package: spectralsequences.sty version 1.0
+%% Package: spectralsequences v1.1.0
 %% Author: Hood Chatham
 %% Email: hood at mit.edu
-%% Date: 2017-06-18
+%% Date: 2017-08-02
 %% License: Latex Project Public License
 %%
 %% File: spectralsequencesmanualpreamble.tex
@@ -17,6 +17,7 @@
 \usepackage{spectralsequences}
 \usetikzlibrary{shapes.geometric}
 \usepackage{amssymb}
+\usepackage{afterpage}
 \usepackage[notmath]{sansmathfonts}
 \usepackage{verbatim}
 \usepackage{needspace}
@@ -239,6 +240,7 @@
 \declarecustomhandler{page constraint}{\codehandler}
 \declarecustomhandler{page constraint}{\codehandler}
 
+
 \let\pgfmanualpdflabel at opt@old\pgfmanualpdflabel at opt
 \def\pgfmanualpdflabel at opt[#1]#2#3{%
     \pgfkeys at spdef\temp{#2}%
@@ -330,6 +332,8 @@
 %
     cs arguments/marg/.initial=1,
 	cs/marg/.code={\marg{\@gobble#1}},
+    cs arguments/metatt/.initial=1,
+	cs/metatt/.code={\meta{\texttt{\textup{\@gobble#1}}}},
 %
     cs arguments/pars/.initial=1,
     cs/pars/.code={\@xp\pars\@xp{\@xp\pgfmanualprettyprintpgfkeys\@xp{\@gobble#1}}},
@@ -434,6 +438,23 @@
 }
 
 
+
+\hypersetup{
+    pdftitle={The Sseqpages Package},
+    pdfauthor={Hood Chatham},
+    pdfsubject={A spectral sequence drawing package build on tikz},
+    pdfkeywords={spectral sequences,algebraic topology,homotopy theory,math,tikz,sseq},
+    pdflicenseurl={http://www.latex-project.org/lppl/}
+}
+
+\def\pars#1{|(|#1|)|}
+\def\pararg#1{\pars{\meta{#1}}}
+\def\parargtwo#1#2{|(\meta{#1},\meta{#2})|}
+\def\parargthree#1#2#3{|(\meta{#1},\meta{#2},\meta{#3})|}
+\def\parargthreeopt#1#2#3{|(\meta{#1},\meta{#2}|\opt{|,\meta{#3}|}|)|}
+\def\parargthreevar#1#2#3{|(\meta{#1},\meta{#2}#3)|}
+
+\def\cmdarg{\texttt{\textbackslash}\meta}
 \def\ooptions{\oarg{options}}
 \def\moptions{|[|\meta{options}|]|}
 \def\sourcecoord{\meta{source coordinate}}
@@ -442,7 +463,7 @@
 \def\targetn{\meta{target n}}
 \def\sourcename{\meta{source name}}
 
-\def\version{version 1.0}
+\def\version{version 1.0.0}
 \def\today{\the\year/\the\month/\the\day}
 \def\pgfmanualurl{http://math.mit.edu/~hood/pgfmanual_v3.0.1a.pdf}
 \def\xparseurl{http://mirror.ctan.org/macros/latex2e/contrib/l3packages/xparse.pdf}
@@ -450,6 +471,7 @@
 
 \def\pkg#1{\textsf{\textmd{#1}}}
 \def\sseqpages{\textsc{\pkg{spectralsequences}}}
+\let\spectralsequences\sseqpages
 \def\sseqpkg{\pkg{sseq}}
 \let\tikzpkg\tikzname
 \def\pgfpkg{\pkg{\textmd{PGF}}}
@@ -457,31 +479,23 @@
 \def\pgfplotspkg{\textsc{\pkg{pgfplots}}}
 \def\xparsepkg{\pkg{xparse}}
 \def\colorpkg{\pkg{color}}
+\def\texlive{\TeX\ Live}
+\def\miktex{MiK\TeX}
+\def\pdflatex{\textsc{PDF}\LaTeX}
+\def\lualatex{Lua\LaTeX}
+\let\pdfLaTeX\pdflatex
+\let\LuaLaTeX\lualatex
 
-\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)}}
-}
 
+\def\env#1{\texttt{\{#1\}}}
+\def\sseqpageenv{\pgfmanualpdfref{sseqpage}{\env{sseqpage}}}
+\def\sseqdataenv{\pgfmanualpdfref{sseqdata}{\env{sseqdata}}}
+\def\tikzpictureenv{\env{tikzpicture}}
+\def\scopeenv{\env{scope}}
+\def\tikzcdenv{\env{tikzcd}}
+\def\eTeX{\leavevmode\hbox{$\varepsilon$}-\TeX}
 
-\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}}
 
 

Deleted: trunk/Master/texmf-dist/tex/latex/spectralsequences/spectralsequences.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/spectralsequences.sty	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/spectralsequences.sty	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,279 +0,0 @@
-%%
-%% 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}

Modified: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqcheckdefinitions.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqcheckdefinitions.code.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqcheckdefinitions.code.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,8 +1,8 @@
 %%
-%% Package: spectralsequences.sty version 1.0
+%% Package: spectralsequences v1.1.0
 %% Author: Hood Chatham
 %% Email: hood at mit.edu
-%% Date: 2017-06-18
+%% Date: 2017-08-02
 %% License: Latex Project Public License
 %%
 %% File: sseqcheckdefinitions.code.tex
@@ -15,7 +15,7 @@
 
 \sseq at tempiftrue
 \begingroup
-
+\def\sseq at checkprotecteddef#1{\def\sseq at temp{\sseq at checkdef@{#1}}\afterassignment\sseq at temp\protected\long\@xp\def\csname sseq at check@\sseq at macroname#1\endcsname}
 \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
@@ -22,6 +22,47 @@
 \fi}
 
 %%
+%% sseqmacromakers.code.tex
+%%
+
+\ExplSyntaxOn
+% I should work out how old the version of xparse has to be before this breaks, but I'm too lazy.
+% It would also be nice if I could figure out how to ensure that my trick of setting \l__xparse_grab_expandably_bool to false works correctly, but this might be difficult
+\@ifpackagelater{xparse}{2017/02/08}{
+    \sseq at checkprotecteddef \__xparse_grab_u:w #1#2 \__xparse_run_code:{
+        \__xparse_grab_u_aux:nnN {#1} {#2} \cs_set_protected_nopar:Npn
+    }
+
+    \sseq at checkprotecteddef\__xparse_grab_u_aux:nnN #1#2#3
+      {
+        \tl_set:Nn \l__xparse_signature_tl {#2}
+        \exp_after:wN #3 \l__xparse_fn_tl ##1 #1
+          { \__xparse_add_arg:n {##1} }
+        \l__xparse_fn_tl
+    }
+
+
+    \sseq at checkprotecteddef \__xparse_normalize_type_u:w #1 {
+        \quark_if_recursion_tail_stop_do:nn {#1} { \__xparse_bad_arg_spec:wn }
+        \__xparse_normalize_check_lu:N u
+        \__xparse_add_arg_spec:n { u {#1} }
+        \int_incr:N \l__xparse_mandatory_args_int
+        \tl_clear:N \l__xparse_last_delimiters_tl
+        \__xparse_normalize_arg_spec_loop:n
+    }
+
+    \ifsseq at tempif
+        \global\sseq at patchxparseUtrue
+    \else
+        %\sseq at warning{fit-patch-failed}
+        \global\sseq at patchxparseUfalse
+    \fi
+    \sseq at tempiftrue
+}{}
+
+\ExplSyntaxOff
+
+%%
 %% sseqkeys.code.tex
 %%
 

Modified: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqdrawing.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqdrawing.code.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqdrawing.code.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,8 +1,8 @@
 %%
-%% Package: spectralsequences.sty version 1.0
+%% Package: spectralsequences v1.1.0
 %% Author: Hood Chatham
 %% Email: hood at mit.edu
-%% Date: 2017-06-18
+%% Date: 2017-08-02
 %% License: Latex Project Public License
 %%
 %% File: sseqdrawing.code.tex
@@ -14,165 +14,314 @@
 %%    the axes ticks was taking about 1/3 of the compile time (a little under 1s out of a 3.2)
 %%
 
+% Only for integer valued coordinates...
+\def\sseq at qpointxy#1#2{\pgfqpointxy{\numexpr#1+\sseq at xoffset\relax}{\numexpr#2+\sseq at yoffset\relax}}
 
+\def\sseq at transform@xymirror{
+    \pgfsetxvec{\pgfqpoint{1cm}{0cm}}
+    \pgfsetyvec{\pgfqpoint{0cm}{1cm}}
+    \pgftransformcm{0}{1}{1}{0}{\pgfpointxy{\sseq at xoffset*\sseq at xscale }{\sseq at yoffset*\sseq at yscale}} % Reflect x and y axes,
+    \pgftransformshift{\pgfpointxy{-\sseq at xoffset*\sseq at yscale}{-\sseq at yoffset*\sseq at xscale}}    % but we need to conjugate by a shift of (xoffset,yoffset)
+    \pgfsetyvec{\pgfqpoint{0cm}{\sseq at xscale cm}}
+    \pgfsetxvec{\pgfqpoint{\sseq at yscale cm}{0cm}}
+}
 
+
+\def\sseq at setlayoutparameter#1#2{\@xp\let\csname sseq@#1\@xp\endcsname\csname sseq@#1@#2\endcsname}
+\def\sseq at setlayoutparameters{
+    \sseq at setlayoutparameter{yaxisorigin}{x\sseq at xaxistype}
+    \sseq at setlayoutparameter{drawyaxis}{x\sseq at xaxistype}
+    \sseq at setlayoutparameter{yaxisstartoffset}{x\sseq at xaxistype}
+    \sseq at setlayoutparameter{yaxisendoffset}{x\sseq at xaxistype}
+    \sseq at setlayoutparameter{bottomgridpadding}{x\sseq at xaxistype}
+    \sseq at setlayoutparameter{topgridpadding}{x\sseq at xaxistype}
+    \sseq at setlayoutparameter{bottomclippadding}{x\sseq at xaxistype}
+    \sseq at setlayoutparameter{topclippadding}{x\sseq at xaxistype}
+    \sseq at setlayoutparameter{xlabelposition}{x\sseq at xaxistype}
+%
+    \sseq at setlayoutparameter{xaxisorigin}{y\sseq at yaxistype}
+    \sseq at setlayoutparameter{drawxaxis}{y\sseq at xaxistype}
+    \sseq at setlayoutparameter{xaxisstartoffset}{y\sseq at yaxistype}
+    \sseq at setlayoutparameter{xaxisendoffset}{y\sseq at yaxistype}
+    \sseq at setlayoutparameter{leftgridpadding}{y\sseq at yaxistype}
+    \sseq at setlayoutparameter{rightgridpadding}{y\sseq at yaxistype}
+    \sseq at setlayoutparameter{leftclippadding}{y\sseq at yaxistype}
+    \sseq at setlayoutparameter{rightclippadding}{y\sseq at yaxistype}
+    \sseq at setlayoutparameter{ylabelposition}{y\sseq at xaxistype}
+}
+
+% The appropriate one of these is chosen by the "axis type" keys in sseqkeys.
+
+% Used to determine axis and ticks placement
+\def\sseq at xaxisorigin@yborder{\sseq at xmin}
+\def\sseq at xaxisorigin@yframe{\sseq at xmin}
+\def\sseq at xaxisorigin@ycenter{\sseq at xaxisorigin@center@}
+\def\sseq at yaxisorigin@xborder{\sseq at ymin}
+\def\sseq at yaxisorigin@xframe{\sseq at ymin}
+\def\sseq at yaxisorigin@xcenter{\sseq at yaxisorigin@center@}
+
+% Used to determine clipping and grid boundaries
+\def\sseq at leftgridpadding@yborder{\dimexpr\sseq at yaxisgap-\sseq at yclip@axisgap\relax}
+\def\sseq at rightgridpadding@yborder{\sseq at xaxis@end at extend}
+\def\sseq at leftgridpadding@ycenter{\sseq at xaxis@start at extend}
+\def\sseq at rightgridpadding@ycenter{\sseq at xaxis@end at extend}
+\def\sseq at leftgridpadding@yframe{\dimexpr\sseq at yaxisgap-\sseq at yclip@axisgap\relax}
+\def\sseq at rightgridpadding@yframe{5cm} % Just make it big enough to push off the end of the clip
+\def\sseq at leftgridpadding@ynone{\sseq at yaxisgap}
+\def\sseq at rightgridpadding@ynone{\sseq at yaxisgap}
+
+
+\def\sseq at bottomgridpadding@xborder{\dimexpr\sseq at xaxisgap-\sseq at xclip@axisgap\relax}
+\def\sseq at topgridpadding@xborder{\sseq at yaxis@end at extend}
+\def\sseq at bottomgridpadding@xcenter{\sseq at yaxis@start at extend}
+\def\sseq at topgridpadding@xcenter{\sseq at yaxis@end at extend}
+\def\sseq at bottomgridpadding@xframe{\dimexpr\sseq at xaxisgap-\sseq at xclip@axisgap\relax}
+\def\sseq at topgridpadding@xframe{5cm}
+\def\sseq at bottomgridpadding@xnone{\sseqxaxisgap}
+\def\sseq at topgridpadding@xnone{\sseq at xaxisgap}
+
+\def\sseq at leftclippadding@yborder{\dimexpr-\sseq at yaxisgap+\sseq at yclip@axisgap\relax}
+\def\sseq at rightclippadding@yborder{\dimexpr\sseq at xaxis@end at extend+\sseq at clip@padding at right\relax}
+\def\sseq at leftclippadding@ycenter{\dimexpr-\sseq at xaxis@start at extend-\sseq at clip@padding at left\relax}
+\def\sseq at rightclippadding@ycenter{\dimexpr\sseq at xaxis@end at extend+\sseq at clip@padding at right\relax}
+\def\sseq at leftclippadding@yframe{\dimexpr-\sseq at yaxisgap+\sseq at yclip@axisgap\relax}
+\def\sseq at rightclippadding@yframe{\dimexpr\sseq at yaxisgap-\sseq at yclip@axisgap\relax}
+\def\sseq at leftclippadding@ynone{\dimexpr-\sseq at yaxisgap-\sseq at clip@padding at left\relax}
+\def\sseq at rightclippadding@ynone{\dimexpr\sseq at yaxisgap+\sseq at clip@padding at right\relax}
+
+\def\sseq at bottomclippadding@xborder{\dimexpr-\sseq at xaxisgap+\sseq at xclip@axisgap\relax}
+\def\sseq at topclippadding@xborder{\dimexpr\sseq at yaxis@end at extend+\sseq at clip@padding at top\relax}
+\def\sseq at bottomclippadding@xcenter{\dimexpr-\sseq at yaxis@start at extend-\sseq at clip@padding at bottom\relax}
+\def\sseq at topclippadding@xcenter{\dimexpr\sseq at yaxis@end at extend+\sseq at clip@padding at top\relax}
+\def\sseq at bottomclippadding@xframe{\dimexpr-\sseq at xaxisgap+\sseq at xclip@axisgap\relax}
+\def\sseq at topclippadding@xframe{\dimexpr\sseq at xaxisgap-\sseq at xclip@axisgap\relax}
+\def\sseq at bottomclippadding@xnone{\dimexpr-\sseq at xaxisgap-\sseq at clip@padding at bottom\relax}
+\def\sseq at topclippadding@xnone{\dimexpr\sseq at xaxisgap+\sseq at clip@padding at top\relax}
+
+% Used to figure out how much further beyond (min -- max) to draw axes
+\def\sseq at xaxisstartoffset@yborder{\dimexpr\sseq at xaxis@tail+\sseq at yaxisgap\relax}
+\def\sseq at xaxisendoffset@yborder{\sseq at xaxis@end at extend}
+\def\sseq at xaxisstartoffset@ycenter{\sseq at xaxis@start at extend}
+\def\sseq at xaxisendoffset@ycenter{\sseq at xaxis@end at extend}
+\def\sseq at xaxisstartoffset@yframe{\sseq at yaxisgap}
+\def\sseq at xaxisendoffset@yframe{\sseq at yaxisgap}
+
+\def\sseq at yaxisstartoffset@xborder{\dimexpr\sseq at yaxis@tail+\sseq at xaxisgap\relax}
+\def\sseq at yaxisendoffset@xborder{\sseq at yaxis@end at extend}
+\def\sseq at yaxisstartoffset@xcenter{\sseq at yaxis@start at extend}
+\def\sseq at yaxisendoffset@xcenter{\sseq at yaxis@end at extend}
+\def\sseq at yaxisstartoffset@xframe{\sseq at xaxisgap}
+\def\sseq at yaxisendoffset@xframe{\sseq at xaxisgap}
+
+\def\sseq at xlabelposition@xborder{(0,-\sseq at xaxisstartoffset)}
+\def\sseq at xlabelposition@xcenter{(-\sseq at yaxisgap,-\sseq at xaxisstartoffset-5pt)}
+\def\sseq at xlabelposition@xframe{(0,-\sseq at xaxisgap-\sseq at xlabelgap-10pt)}
+\def\sseq at xlabelposition@xnone{(0,0)}
+
+\def\sseq at ylabelposition@yborder{(0,\sseq at yaxisstartoffset)}
+\def\sseq at ylabelposition@ycenter{(-\sseq at xaxisgap,\sseq at yaxisstartoffset+5pt)}
+\def\sseq at ylabelposition@yframe{(0,\sseq at yaxisgap+\sseq at ylabelgap+10pt)}
+\def\sseq at ylabelposition@ynone{(0,0)}
 %%%
 %%% 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
+    \bgroup
+    \sseq at drawxaxis
+    \ifsseq at drawxaxisticks
+        \sseq at drawxticks
     \fi
+    \egroup
 }
 \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
+    \bgroup
+    \sseq at drawyaxis
+    \ifsseq at drawyaxisticks
+        \sseq at drawyticks
     \fi
+    \egroup
 }
-\def\sseq at drawxaxis{
+
+% Draws an x axis. Use with \sseq at transform@xymirror to draw y axis.
+% #1 -- horizontal start offset
+% #2 -- horizontal end offset
+% #3 -- vertical offset
+% #4 -- start value
+% #5 -- end value
+% #6 -- vertical value
+\def\sseq at drawaxis@generic#1#2#3#4#5#6{
     \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}}
+    \pgftransformshift{\pgfqpoint{#2}{#3}}
+    \pgfpathmoveto{\sseq at qpointxy{#5}{#6}}
     \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}}
+    \pgftransformshift{\pgfqpoint{#1}{#3}}
+    \pgfpathlineto{\sseq at qpointxy{#4}{#6}}
     \egroup
-    \egroup
+}
+
+\def\sseq at drawxaxis@ynone{
+    \sseq at drawxaxisticksfalse
+}
+\def\sseq at drawyaxis@xnone{
+    \sseq at drawyaxisticksfalse
+}
+
+\def\sseq at drawxaxis@yborder{
+    \sseq at drawaxis@generic{-\sseq at xaxisstartoffset}{\sseq at xaxisendoffset}{-\sseq at xaxisgap}{\sseq at xmin}{\sseq at xmax}{\sseq at yaxisorigin}
     \pgfusepath{stroke}
 }
-\def\sseq at drawyaxis{
+\let\sseq at drawxaxis@ycenter\sseq at drawxaxis@yborder
+
+\def\sseq at drawxaxis@yframe{
+    \sseq at drawaxis@generic{-\sseq at xaxisstartoffset}{\sseq at xaxisendoffset}{-\sseq at xaxisgap}{\sseq at xmin}{\sseq at xmax}{\sseq at ymin}
+    \sseq at drawaxis@generic{-\sseq at xaxisstartoffset}{\sseq at xaxisendoffset}{ \sseq at xaxisgap}{\sseq at xmin}{\sseq at xmax}{\sseq at ymax}
+    \pgfusepath{stroke}
+}
+\def\sseq at drawyaxis@xborder{
     \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}}
+    \sseq at transform@xymirror
+    \sseq at drawaxis@generic{-\sseq at yaxisstartoffset}{\sseq at yaxisendoffset}{-\sseq at yaxisgap}{\sseq at ymin}{\sseq at ymax}{\sseq at xaxisorigin}
+    \pgfusepath{stroke}%
     \egroup
+}
+\let\sseq at drawyaxis@xcenter\sseq at drawyaxis@xborder
+\def\sseq at drawyaxis@xframe{
     \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}}
+    \sseq at transform@xymirror
+    \sseq at drawaxis@generic{-\sseq at yaxisstartoffset}{\sseq at yaxisendoffset}{-\sseq at yaxisgap}{\sseq at ymin}{\sseq at ymax}{\sseq at xmin}
+    \sseq at drawaxis@generic{-\sseq at yaxisstartoffset}{\sseq at yaxisendoffset}{ \sseq at yaxisgap}{\sseq at ymin}{\sseq at ymax}{\sseq at xmax}
+    \pgfusepath{stroke}%
     \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
+
+\ExplSyntaxOn
+\def\sseq at intdivceiling#1#2{%
+    \ifnum#1>\z@ % \int_div_truncate:nn rounds towards 0. We want \int_div_ceiling
+        \int_div_truncate:nn{#1+#2-1}{#2} % if positive, use ceil(p/q)=floor((p+q-1)/q) for p,q integers
+    \else
+        \int_div_truncate:nn{#1}{#2} % if we are negative, towards 0 is ceiling
+    \fi
+}
+\def\sseq at intdivfloor#1#2{%
+    \ifnum#1<\z@ % \int_div_truncate:nn rounds towards 0. We want \int_div_floor
+        \int_div_truncate:nn{#1-#2+1}{#2} % if we are negative, use floor(p/q) = ceil(p-q+1/q) for p,q integers
+    \else
+        \int_div_truncate:nn{#1}{#2} % if positive, towards 0 is floor
+    \fi
+}
+\ExplSyntaxOff
+
+% #1 -- xmin
+% #2 -- xmax
+% #3 -- step
+% #4 -- offset
+% #5 -- ymin
+% #6 -- xaxisgap
+% #7 -- code
+\def\sseq at tickloop@generic#1#2#3#4#5#6#7{
+    \sseq at tempx=\numexpr % min
+        \sseq at intdivceiling{#1}{#3} * #3
+        -
+        \sseq at intdivceiling{#4}{#3} * #3 + #4
+    \relax
+    \ifnum\sseq at tempx<#1\relax
+        \advance\sseq at tempx#3\relax
+    \fi
+    \sseq at tempxb=\numexpr#2+1\relax % max
     \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
+        \pgftransformshift{\sseq at qpointxy{\sseq at tempx}{#5}}%
+        \pgftransformshift{\pgfqpoint{0pt}{#6}}
+        #7
+        \egroup
+        \advance\sseq at tempx#3\relax
+    \ifnum\sseq at tempx<\sseq at tempxb\repeat
+}
+
+
+\def\sseq at drawxticks{%
+    \sseq at tickloop@generic{\sseq at xmin}{\sseq at xmax}{\sseq at xtickstep}{\sseq at xtickstepoffset}{\sseq at yaxisorigin}{-\sseq at xaxisgap}{
         \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
+        \pgftransformshift{\pgfqpoint{0pt}{-\sseq at ylabelgap}}
+        \pgftext{\hbox{$\sseq at xtickfn{\the\sseq at tempx}$}}%
+    }
+    \ifnum\sseq at xmajortickstep>\z@
+        \sseq at tickloop@generic{\sseq at xmin}{\sseq at xmax}{\sseq at xmajortickstep}{\sseq at xtickstepoffset}{\sseq at yaxisorigin}{-\sseq at xaxisgap}{
+            \pgfpathmoveto{\pgfpointorigin}
+            \pgfpathlineto{\pgfpoint{0}{-0.4*\sseq at xaxisgap}}
+        }
+    \fi
+    \ifnum\sseq at xminortickstep>\z@
+        \sseq at tickloop@generic{\sseq at xmin}{\sseq at xmax}{\sseq at xminortickstep}{\sseq at xtickstepoffset}{\sseq at yaxisorigin}{-\sseq at xaxisgap}{
+            \pgfpathmoveto{\pgfpointorigin}
+            \pgfpathlineto{\pgfpoint{0}{-0.2*\sseq at xaxisgap}}
+        }
+    \fi
+    \pgfusepath{stroke}
 }
-\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
+\def\sseq at drawyticks{%
+    \sseq at transform@xymirror
+    \sseq at tickloop@generic{\sseq at ymin}{\sseq at ymax}{\sseq at ytickstep}{\sseq at ytickstepoffset}{\sseq at xaxisorigin}{-\sseq at yaxisgap}{
         \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
+        \pgftransformshift{\pgfqpoint{0pt}{-\sseq at ylabelgap}}
+        \pgftransformresetnontranslations
+        \pgftext{\hbox{$\sseq at ytickfn{\the\sseq at tempx}$}}%
+    }
+    \ifnum\sseq at ymajortickstep>\z@
+        \sseq at tickloop@generic{\sseq at ymin}{\sseq at ymax}{\sseq at ymajortickstep}{\sseq at ytickstepoffset}{\sseq at xaxisorigin}{-\sseq at yaxisgap}{
+            \pgfpathmoveto{\pgfpointorigin}
+            \pgfpathlineto{\pgfpoint{0}{-0.4*\sseq at yaxisgap}}
+        }
+    \fi
+    \ifnum\sseq at yminortickstep>\z@
+        \sseq at tickloop@generic{\sseq at ymin}{\sseq at ymax}{\sseq at yminortickstep}{\sseq at ytickstepoffset}{\sseq at xaxisorigin}{-\sseq at yaxisgap}{
+            \pgfpathmoveto{\pgfpointorigin}
+            \pgfpathlineto{\pgfpoint{0}{-0.2*\sseq at yaxisgap}}
+        }
+    \fi
+    \pgfusepath{stroke}
 }
+
+
 \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}}
+            \def\xmin{\pgftransformshift{\pgfqpoint{\sseq at leftclippadding}{0pt}}}
+            \def\ymin{\pgftransformshift{\pgfqpoint{0pt}{\sseq at bottomclippadding}}}
+            \def\xmax{\pgftransformshift{\pgfqpoint{\sseq at rightclippadding}{0pt}}}
+            \def\ymax{\pgftransformshift{\pgfqpoint{0pt}{\sseq at topclippadding}}}
             \bgroup
-            \xmin\ymin\sseq at globalscaletransform
-            \pgfpathmoveto{\pgfpoint{\sseq at xmin cm}{\sseq at ymin cm}}
+            \xmin\ymin
+            \pgfpathmoveto{\pgfqpointxy{\numexpr\sseq at xmin+\sseq at xoffset\relax}{\numexpr\sseq at ymin+\sseq at yoffset\relax}}
             \egroup
             \bgroup
-            \xmin\ymax\sseq at globalscaletransform
-            \pgfpathlineto{\pgfpoint{\sseq at xmin cm}{\sseq at ymax cm}}
+            \xmin\ymax
+            \pgfpathlineto{\pgfqpointxy{\numexpr\sseq at xmin+\sseq at xoffset\relax}{\numexpr\sseq at ymax+\sseq at yoffset\relax}}
             \egroup
             \bgroup
-            \xmax\ymax\sseq at globalscaletransform
-            \pgfpathlineto{\pgfpoint{\sseq at xmax cm}{\sseq at ymax cm}}
+            \xmax\ymax
+            \pgfpathlineto{\pgfqpointxy{\numexpr\sseq at xmax+\sseq at xoffset\relax}{\numexpr\sseq at ymax+\sseq at yoffset\relax}}
             \egroup
             \bgroup
-            \xmax\ymin\sseq at globalscaletransform
-            \pgfpathlineto{\pgfpoint{\sseq at xmax cm}{\sseq at ymin cm}}
+            \xmax\ymin
+            \pgfpathlineto{\pgfqpointxy{\numexpr\sseq at xmax+\sseq at xoffset\relax}{\numexpr\sseq at ymin+\sseq at yoffset\relax}}
             \egroup
             \egroup
             \pgfpathclose
-            \pgfgetpath\sseq at theclippath % This stores the clipping so I can find intersections later
+            \pgfgetpath\sseq at theclippath % This stores the clipping so I can apply it later
             \pgfusepath{discard}% This has to be after the egroup or else the clipping gets screwed up
+%
             \bgroup
-                %\sseq 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}}
+                \pgfpathmoveto{\pgfqpointxy{\numexpr\sseq at xmin+\sseq at xoffset\relax}{\numexpr\sseq at ymin+\sseq at yoffset\relax}}
+                \pgfpathlineto{\pgfqpointxy{\numexpr\sseq at xmin+\sseq at xoffset\relax}{\numexpr\sseq at ymax+\sseq at yoffset\relax}}
+                \pgfpathlineto{\pgfqpointxy{\numexpr\sseq at xmax+\sseq at xoffset\relax}{\numexpr\sseq at ymax+\sseq at yoffset\relax}}
+                \pgfpathlineto{\pgfqpointxy{\numexpr\sseq at xmax+\sseq at xoffset\relax}{\numexpr\sseq at ymin+\sseq at yoffset\relax}}
                 \pgfpathclose
             \egroup
             \pgfgetpath\sseq at therangepath % Only for deciding whether to draw "tricky edges"
@@ -188,66 +337,194 @@
     \fi
 }
 \def\sseq at useclip{\ifx\sseq at theclippath\relax\else\pgfsetpath\sseq at theclippath\pgfusepath{clip}\fi}
+
+
+% sets \pgf at xa and \pgf at ya equal to the coordinates of (1,1), sets \pgf at xb and \pgf at xb equal to (x grid step, y grid step)
+\def\sseq at grid@setstepandgridstep{
+    \pgf at process{\pgfqpointxy{1}{1}}
+    \pgf at xa=\pgf at x
+    \pgf at ya=\pgf at y
+    \pgf at process{\pgfqpointxy{\sseq at xgridstep}{\sseq at ygridstep}}
+    \pgf at xb=\pgf at x
+    \pgf at yb=\pgf at y
+}
+
+% #1 -- macro to store result in
+% #2 -- "x" or "y" as appropriate
+% #3 -- length (with units)
+% #4 -- fraction of gridstep
+% If #2 is x, then it either sets #1 to #3/(x scale) or xgridstep*#4, whichever is smaller
+% The output is intended for use with \pgfpointxy.
+\def\sseq at grid@atmostgridstep#1#2#3#4{
+    \ifdim#3<\dimexpr\csname pgf@#2b\endcsname*#4\relax
+        \pgfmathparse{#3/\csname pgf@#2a\endcsname}
+        \let#1\pgfmathresult
+    \else
+        \edef#1{\csname sseq@#2gridstep\endcsname*#4}
+    \fi
+}
+
+% This grid was a huge pain in the ass to get right...
 \def\sseq 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
+    \bgroup
+    \pgfscope
+    % Pad on the right and top by either the grid padding, or the remaining piece of the checkerboard before it would start a new square
+    % (it looks ugly to have a tiny sliver). Annoyingly, mod returns its result with the same sign as its input, so in order to reduce mod
+    % \sseq at xgridstep and get a positive result, we have to do it twice. The 0.5cm*scale here matches the -0.5 in the \pgfpathgrid call.
+    \pgfmathsetmacro\sseq at rightpadding{min(
+        \sseq at rightgridpadding,
+        1cm*  mod(mod(-\sseq at xmax,\sseq at xgridstep)+\sseq at xgridstep,\sseq at xgridstep)+0.5cm*\sseq at xscale-0.05cm
+    )}
+    \pgfmathsetmacro\sseq at toppadding{min(
+        \sseq at topgridpadding,
+        1cm * mod(mod(-\sseq at ymax,\sseq at ygridstep)+\sseq at ygridstep,\sseq at ygridstep)+0.5cm*\sseq at yscale-0.02cm
+    )}
+    % Because of complicated aliasing issues that arise when misusing the \pgfgrid command in this way,
+    % it's more convenient to add a clip than to actually stop things in the right place.
+    \clip        (\sseq at xmin-\sseq at xoffset,\sseq at ymin-\sseq at yoffset) ++ (-0.48, -0.48)
+        rectangle ([shift={(\sseq at rightpadding pt,\sseq at toppadding pt)}]\sseq at xmax,\sseq at ymax);
+%
+    \sseq at useclip
+    \pgfsetcolor{\sseq at gridcolor}
+    \pgfsetstrokeopacity{0.3} % We don't set low opacity for the other grids, but this one is visible even if it is very faint.
+    \sseq at grid@setstepandgridstep
+%
+%  Use ifdim with cm to compare real scalars b/c tex is dumb.
+    % okay, now we need to be careful in order to avoid overflows. The hack we are using requires that the xvec and the yvec are equal
+    % because we can't apply these via lowlevelsynccm. However, xvec and yvec are the things that prevent overflows.
+    % What we need to do is set them both equal to the smaller value. Now the scale factor determines the size of the squares,
+    % so we mix in the grid steps. We also need to scale the larger scaled coordinate by the ratio of the two scales.
+    \ifdim\sseq at xscale cm<\sseq at yscale cm\relax
+        % x is smaller so set both x and y vecs to \sseq at xscale cm.
+        \pgfsetxvec{\pgfpoint{\sseq at xscale cm}{0cm}}
+        \pgfsetyvec{\pgfpoint{0cm}{\sseq at xscale cm}}
+        \def\sseq at xadjustscale{\sseq at xgridstep}
+        \def\sseq at yadjustscale{\sseq at yscale/\sseq at xscale*\sseq at ygridstep}
+        \def\sseq at stepscale{\sseq at xscale}
+    \else
+        \pgfsetxvec{\pgfpoint{\sseq at yscale cm}{0cm}}
+        \pgfsetyvec{\pgfpoint{0cm}{\sseq at yscale cm}}
+        \def\sseq at xadjustscale{(\sseq at xscale/\sseq at yscale*\sseq at xgridstep)}
+        \def\sseq at yadjustscale{\sseq at ygridstep}
+        \def\sseq at stepscale{\sseq at yscale}
+    \fi
+    \pgftransformxscale{\sseq at xadjustscale}
+    \pgftransformyscale{\sseq at yadjustscale}
+    % Now we have to put in some ridiculously complicated shift in order to get the bottom corner in the right place.
+    % I found this formula mostly by trial and error.
+    % The basic idea that we should be making something divisible by twice the grid step (which is the actual period of our grid)
+    % is reasonable enough, but what the heck are these other two terms for? I don't know either, thank god it works.
+    \pgftransformshift{\pgfpointxy{
+            floor((\sseq at xgridstep-1)/2)/\sseq at xgridstep
+            + \ifodd\sseq at xgridstep\space 0 \else 0.5/\sseq at xgridstep\fi
+            + mod(1+\sseq at xmin/\sseq at xgridstep,2*\sseq at xgridstep)
+        }{
+            floor((\sseq at ygridstep-1)/2)/\sseq at ygridstep
+            + \ifodd\sseq at ygridstep\space 0\else 0.5/\sseq at ygridstep\fi
+            + mod(1+\sseq at ymin/\sseq at ygridstep,2*\sseq at ygridstep)
+        }
+    }
+    % We use lowlevelsynccm to make the scale adjust the line width. Normally scaling doesn't affect line width, text size, etc, which is sensible.
+    % When you apply \pgflowlevelsynccm, pgf loses track of the coordinate matrix and it gets indiscriminately applied to everything.
+    % This is good for us, because we're doing this absurd thing where we make a checkerboard by drawing a really really fat line.
+    \pgflowlevelsynccm
+    \pgfsetlinewidth{1cm*\sseq at stepscale}
+    \pgfsetdash{{1cm*\sseq at stepscale}{1cm*\sseq at stepscale}}{1cm*\sseq at stepscale}
+%
+    % Naturally some trial and error occurred here too.
+    % Note the huge multiples of \sseq at xgridstep I added in -- they probably aren't necessary, but I don't understand what's going on so whatever.
+    % The basic idea is that things need to be divisible by twice the grid step. The part I added in the shift above
+    % was the remainder when you divide \sseq at xmin by twice the grid step, now we need to add in the multiple of twice the grid step.
+    % The -0.5 is ensuring that the checkerboard boundaries lie at half-integer coordinates (I think).
+    \pgfpathgrid[stepx= 2cm*\sseq at stepscale,stepy=2cm*\sseq at stepscale]
+    { \pgfpointxy
+        { -0.5 + \sseq at intdivfloor{\numexpr\sseq at xmin - \sseq at xgridstep\relax}{2*\sseq at xgridstep}*2*\sseq at xgridstep + \sseq at xoffset - 50*\sseq at xgridstep }
+        { -0.5 + \sseq at intdivfloor{\numexpr\sseq at ymin - \sseq at ygridstep\relax}{2*\sseq at ygridstep}*2*\sseq at ygridstep + \sseq at yoffset - 50*\sseq at ygridstep}
+    }{ \pgfpointxy
+        { \sseq at xmax + \sseq at xoffset + 50*\sseq at xgridstep }
+        { \sseq at ymax + \sseq at yoffset + 50*\sseq at ygridstep  }
+    }
+    \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
+    \bgroup
+    \pgfscope
+    \sseq at useclip
+    \pgfsetcolor{\sseq at gridcolor}
+    \pgfsetlinewidth{\the\sseq at gridstrokethickness}
+    \sseq at grid@setstepandgridstep
+%
+    % We don't want the grid to end with an extra line, so extend it by one half the step distance or
+    % \sseq at ---gridpadding, whichever is shorter.
+    \sseq at grid@atmostgridstep\sseq at xminpadding{x}{\sseq at leftgridpadding}{1/2}
+    \sseq at grid@atmostgridstep\sseq at xmaxpadding{x}{\sseq at rightgridpadding}{1/2}
+    \sseq at grid@atmostgridstep\sseq at yminpadding{y}{\sseq at bottomgridpadding}{1/2}
+    \sseq at grid@atmostgridstep\sseq at ymaxpadding{y}{\sseq at topgridpadding}{1/2}
+%
+    \pgftransformshift{\pgfpointxy{-\sseq at xgridstep/2}{-\sseq at ygridstep/2}}
+    \pgfpathgrid[stepx=\pgf at xb,stepy=\pgf at yb]
+    { \pgfpointxy
+        { \sseq at xmin - \sseq at xminpadding + 0.01 + \sseq at xoffset + \sseq at xgridstep/2 }
+        { \sseq at ymin - \sseq at yminpadding + 0.01 + \sseq at yoffset + \sseq at ygridstep/2 } }
+    { \pgfpointxy
+        { \sseq at xmax + \sseq at xmaxpadding - 0.01 + \sseq at xoffset + \sseq at xgridstep/2 }
+        { \sseq at ymax + \sseq at ymaxpadding - 0.01 + \sseq at yoffset + \sseq at ygridstep/2 } }
+    \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
+    \bgroup
+    \pgfscope
+    \sseq at useclip
+    \pgfsetcolor{\sseq at gridcolor}
+    \pgfsetlinewidth{\the\sseq at gridstrokethickness}
+    \sseq at grid@setstepandgridstep
+%
+    % We don't want the grid to end with an extra line, so extend it by one step distance or
+    % \sseq at ---gridpadding, whichever is shorter.
+    \sseq at grid@atmostgridstep\sseq at xminpadding{x}{\sseq at leftgridpadding}{1}
+    \sseq at grid@atmostgridstep\sseq at xmaxpadding{x}{\sseq at rightgridpadding}{1}
+    \sseq at grid@atmostgridstep\sseq at yminpadding{y}{\sseq at bottomgridpadding}{1}
+    \sseq at grid@atmostgridstep\sseq at ymaxpadding{y}{\sseq at topgridpadding}{1}
+%
+    \pgfpathgrid[stepx=\pgf at xb,stepy=\pgf at yb]
+    { \pgfpointxy
+        { \sseq at xmin - \sseq at xminpadding + 0.01 + \sseq at xoffset }
+        { \sseq at ymin - \sseq at yminpadding + 0.01 + \sseq at yoffset } }
+    { \pgfpointxy
+        { \sseq at xmax + \sseq at xmaxpadding - 0.01 + \sseq at xoffset }
+        { \sseq at ymax + \sseq at ymaxpadding - 0.01 + \sseq at yoffset }
+    }
+    \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
+    \bgroup
+    \pgfscope
+    \pgfgettransform\sseq at savetransform
+    \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
+    \pgftransformshift{\pgfqpoint{-1.5cm}{-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{\pgfpointxy{\sseq at xmin + 0.5/\sseq at a}{\the\sseq at tempy}}
+    \pgfpathlineto{\pgfpointxy{\sseq at xmax + 1.01 }{\the\sseq at tempy}}
+    \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
@@ -261,6 +538,7 @@
     (-0.16,-0.16)(0.16,-0.16)(-0.16,0.16)(0.16,0.16)(0,0);
     (-0.13,-0.2)(-0.13,0)(-0.13,0.2)(0.13,-0.2)(0.13,0)(0.13,0.2);
 }
+
 \sseqnewclasspattern{linear}{
     (0,0);
     (-0.13,0)(0.13,0);
@@ -270,7 +548,11 @@
     (-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}}}
+    \sseq at eval{\@nx\pgftransformshift{
+        \@nx\pgfqpointxy
+            { \csname sseq@\sseq at classpattern xoffset#1/#2\endcsname }
+            { \csname sseq@\sseq at classpattern yoffset#1/#2\endcsname }
+    }}
 }
 \def\sseq at class@getparts#1(#2,#3,#4)[#5].{
     \sseq at seterrorannotation@drawing{#1}{#2}{#3}{#4}{#5}
@@ -277,8 +559,10 @@
     \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}
+    \edef\sseq at thisposnum{\sseq at obj{class.(#2,#3,#4).n}}
     \def\sseq at thisclassnum{#5}
+    \sseq at tempx=#2\relax
+    \sseq at tempy=#3\relax
 }
 
 \def\sseqtooltip#1#2{%
@@ -298,11 +582,14 @@
 }
 
 % #1 -- the name of the node object
+% Someday I should document this horrible mess of code here
+\newif\ifsseq at permanentcycle
+\newcount\sseq at totalclassesdrawn
+\AtEndDocument{\message{Total classes: \the\sseq at totalclassesdrawn}}
 \def\sseq at class@drawnode#1{%
+    \global\advance\sseq at totalclassesdrawn\@ne
     \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
@@ -318,7 +605,7 @@
         \the\sseq at scope@toks
         \sseq at obj{#1.needstikz}
 %
-    \sseq at outofrangetrue
+    \sseq at outofrangetrue\relax % Mysterious that we need this \relax here...
     \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
@@ -329,17 +616,19 @@
             \sseq at thesseqstyle
             \sseq at theclassstyle
             \ifnum\sseq at obj{#1.page}=\sseq at infinitycount
+                \sseq at permanentcycletrue % This is to communicate with family style code...
                 \sseq at thepermanentcyclestyle
             \else
+                \sseq at permanentcyclefalse
                 \sseq at thetransientcyclestyle
                 \ifsseq at thispage
                     \sseq at thethispagecyclestyle
                 \fi
             \fi
+            \def\sseq at collections@featuretype{class}
             \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}}}
+        \pgftransformshift{\pgfqpointxy{\numexpr\sseq at tempx +\sseq at xoffset-\sseq at x\relax}{\numexpr\sseq at tempy + \sseq at yoffset-\sseq at y\relax}}
         \iftikz at fullytransformed\pgfgettransform{\savetransform}\fi
         \pgftransformresetnontranslations
         \sseq at globalrotatetransform
@@ -351,24 +640,23 @@
         \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}}}%
+            \tikzset{every text node part/.code/.expand once={\sseq at globalrotatetransform\sseq at obj@ifdef{#1.nodetext.options}{\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};
+                ] (\sseq at thisnodename) {\sseq at obj@ifdef{#1.nodetext}{\unexpanded\@xpthree{\sseq at obj{#1.nodetext}}}{}}
+                [every text node part/.code={}];
             }%
         \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
+            \edef\sseq at classnodetextoptions{\sseq at obj@ifdef{#1.nodetext.options}{\@xptwo\@nx\sseq at obj{#1.nodetext.options}}{}}
+            \edef\sseq at classnodetext{\sseq at obj@ifdef{#1.nodetext}{\@xptwo\@nx\sseq at obj{#1.nodetext}}{}}
+            \sseq at setnodetext{\sseq at classnodetext}{\sseq at classnodetextoptions}
             \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{#1.labelnodes}
         \sseq at obj@ifdef{#1.tooltip}{
             \pgfpointanchor{\sseq at thisnodename}{west}
             \pgf at xa=\pgf at x
@@ -386,7 +674,7 @@
                 \endpgfinterruptpicture
             }
             {%
-                \pgftransformshift{\pgfpoint{\pgf at xa}{\pgf at ya}}%
+                \pgftransformshift{\pgfqpoint{\pgf at xa}{\pgf at ya}}%
                 \pgfapproximatenonlineartransformation%
                 \pgfqboxsynced{\tikz at tempbox}%
             }%
@@ -394,8 +682,7 @@
         \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}}}
+        \sseq at eval{\@nx\pgftransformshift{\@nx\pgfqpointxy{\numexpr\sseq at tempx+\sseq at xoffset-\sseq at x\relax}{\numexpr\sseq at tempy+\sseq at yoffset-\sseq at y\relax}}}%
         \pgftransformresetnontranslations
         \sseq at globalrotatetransform
         \sseq at classplacementtransform
@@ -404,11 +691,14 @@
     \fi
     \endgroup
 }
-\def\sseq at setnodetext{%
+
+% #1 -- label text
+% #2 -- options
+\def\sseq at setnodetext#1#2{%
     \setbox\pgfnodeparttextbox=\hbox{%
         \pgfscope%
+        #2
         \tikzset{every text node part/.try}%
-        \sseq at classnodetextoptions
         \ifx\tikz at textopacity\pgfutil at empty%
         \else%
          \pgfsetfillopacity{\tikz at textopacity}%
@@ -430,7 +720,7 @@
         \fi%
         \pgfsetcolor{.}%
           \tikz at atbegin@node%
-          \sseq at classnodetext%
+          #1%
           \tikz at atend@node%
            \ifx\tikz at text@width\pgfutil at empty%
            \else%
@@ -489,6 +779,51 @@
   \global\pgflinewidth=\pgfutil at tempdima%
 }
 
+%%% Labels
+
+% #1 -- label text
+% #2 -- options
+\def\sseq at drawlabel#1#2{
+    \bgroup\pgfscope
+    \def\tikz at mode{}
+    \let\sseq at tikz@transform at save\tikz at transform
+    \pgfkeyssetvalue{/pgf/inner xsep}{2pt}
+    \pgfkeyssetvalue{/pgf/inner ysep}{2pt}
+    \def\tikz at shape{rectangle}
+    \let\tikz at transform\empty % The next line was set up to fix the classlabelstyle glitch
+    \sseq at options@secondpassmode
+    \sseq at thesseqstyle\sseq at thelabelstyle\sseq at theclasslabelstyle#2
+    \tikz at options
+    \pgftransformreset
+    \pgftransformshift{\tikz at node@at}
+    \tikz at lib@pos at call
+    \tikz at transform
+    \tikz at mode
+    \let\tikz at transform\sseq at tikz@transform at save
+    \sseq at setnodetext{\sseq at labeltextfn{#1}}{}
+    \pgfmultipartnode{\tikz at shape}{\tikz at anchor}{label}{\sseq at drawnode}%
+    \ifsseq at pin
+        \def\sseq at pinoptions{}
+        \let\tikz at options\empty
+        \let\tikz at mode\empty
+        \sseq at thepinstyle
+        #2
+        \sseq at pinoptions
+        \tikz at options
+        \tikz at mode
+        \sseq at drawedge@findsourcetarget{\tikz at fig@name}{}{label}{}
+        \pgfpathmoveto{\sseq at sourcecoord}%
+        \pgfpathlineto{\sseq at targetcoord}%
+        \sseq at eval{\noexpand\pgfusepath{%
+            draw
+            \iftikz at mode@fill fill,\fi
+            \iftikz at mode@draw draw,\fi
+        }}%
+    \fi
+    \endpgfscope\egroup
+}
+
+
 %%%
 %%% Drawing edges
 %%%
@@ -506,6 +841,34 @@
     \fi
 }
 
+% #1 -- source node
+% #2 -- source anchor
+% #3 -- target node
+% #4 -- target anchor
+% Calculate actual start and end of the edge (node borders), return the results stored in \sseq at sourcecoord, \sseq at targetcoord
+\def\sseq at drawedge@findsourcetarget#1#2#3#4{
+    \edef\sseq at edgesourceanchor{#2}
+    \edef\sseq at edgetargetanchor{#4}
+    \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{#1}{center}}% if so, start by taking the center of that coordinate
+    \else
+        \edef\tempa{\@nx\pgfpointanchor{#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{#3}{\tempa}}% if so, our end point is the point on the boundary of node b that is in the direction of our initial start coordinate
+    \else
+        \edef\tempb{\@nx\pgfpointanchor{#3}{\sseq at edgetargetanchor}}% If it has a specified anchor, use that
+    \fi
+    \let\tempbf\tempb
+    \ifx\tempaf\pgfutil at empty%
+        \def\tempaf{\pgfpointshapeborder{#1}{\tempb}}%
+    \fi
+    \let\sseq at sourcecoord\tempaf
+    \let\sseq at targetcoord\tempbf
+}
+
 \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)
@@ -514,7 +877,15 @@
 % #4 -- options
 \def\sseq at drawedge(#1)(#2)#3#4{%
     \begingroup\pgfscope
+    % If either class is part of a family we aren't drawing, don't draw the edge either.
+    \expandafter\ifx\csname pgf at sh@pi at sseq{#1}\endcsname\pgfpictureid\else
+        \@xp\sseq at break
+    \fi    
+    \expandafter\ifx\csname pgf at sh@pi at sseq{#2}\endcsname\pgfpictureid\else
+        \@xp\sseq at break
+    \fi    
     \def\sseq at edgetype{#3}
+    \let\sseq at collections@featuretype\sseq at edgetype
     \let\sseq at edgesourceanchor\pgfutil at empty
     \let\sseq at edgetargetanchor\pgfutil at empty
 %
@@ -524,40 +895,34 @@
     \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
+    \csname sseq at collections@#3 at hook\endcsname
+    \pgftransformshift{\pgfqpointxy{-\the\sseq at x}{-\the\sseq at y}}%
+    % puts results into \sseq at sourcecoord and \sseq at targetcoord
+    \sseq at drawedge@findsourcetarget{sseq{#1}}{\sseq at edgesourceanchor}{sseq{#2}}{\sseq at edgetargetanchor}
 %
     \tikz at options
     \tikz at mode
     \def\temparrowstartspec{}%
     \def\temparrowendspec{}%
-    \pgfcoordinate{tempa}{\tempaf}%
-    \pgfcoordinate{tempb}{\tempbf}%
+    \pgfcoordinate{tempa}{\sseq at sourcecoord}%
+    \pgfcoordinate{tempb}{\sseq at targetcoord}%
     \pgftransformreset
-    \sseq at ifinrange(#1){\sseq at ifinrange(#2){\sseq at outofrangefalse}{\sseq at outofrangetrue}}{\sseq at outofrangetrue}%
+    \sseq at outofrangefalse
+    \sseq at ifinrange(#1){}{
+        \edef\temparrowstartspec{\@nx\pgfsetarrowsstart{\csname sseq at runoffarrow@start@#3 at spec\endcsname}}
+        \sseq at outofrangetrue
+    }%
+    \sseq at ifinrange(#2){}{
+        \edef\temparrowendspec{\@nx\pgfsetarrowsend{\csname sseq at runoffarrow@end@#3 at spec\endcsname}}
+        \sseq at outofrangetrue
+    }
     \ifsseq at outofrange
-        \sseq at handleoffpageedge{#1}{#2}{#3}%
+        \sseq at handleoffpageedge{#1}{#2}%
     \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}
+        \pgfpointdiff{\sseq at targetcoord}{\sseq at sourcecoord}
         \pgfmathveclen{\pgf at x}{\pgf at y}%
         \@xp\pgfmathint\@xp{\pgfmathresult}%
         \ifnum\pgfmathresult<10\relax%%17? % TODO: Fix this predicate
@@ -591,10 +956,10 @@
     \endpgfscope\endgroup
 }
 
-% TODO: this macro is super expensive. Make it faster (avoid
-\def\sseq at handleoffpageedge#1#2#3{
-    \pgfpathmoveto{\tempaf}%
-    \pgfpathlineto{\tempbf}%
+% TODO: this macro is super expensive. Make it faster
+\def\sseq at handleoffpageedge#1#2{
+    \pgfpathmoveto{\sseq at sourcecoord}%
+    \pgfpathlineto{\sseq at targetcoord}%
     \pgfgetpath\thispath
     \pgfusepath{discard}%
     \pgfintersectionofpaths{\pgfsetpath\sseq at theclippath}{\pgfsetpath\thispath}%
@@ -603,20 +968,16 @@
         \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
+            \sseq at ifinrange(#2){}{\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}
+            \def\sseq at targetcoord{\pgfpointintersectionsolution{1}}
+            \pgfcoordinate{tempb}{\sseq at targetcoord}
         }{%
             \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}%
+                \def\sseq at sourcecoord{\pgfpointintersectionsolution{1}}%
+                \pgfcoordinate{tempa}{\sseq at sourcecoord}%
             }{\sseq at drawedge@handletrickyedge}% Uh-oh, both ends are out of range.
         }
     \or% an orphan
@@ -653,26 +1014,33 @@
 
 
 \def\sseq at drawedge@handleorphan{%
-    \def\tempaf{\pgfpointintersectionsolution{1}}%
-    \def\tempbf{\pgfpointintersectionsolution{2}}%
+    \def\sseq at sourcecoord{\pgfpointintersectionsolution{1}}%
+    \def\sseq at targetcoord{\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}%
+    \pgfcoordinate{tempa}{\sseq at sourcecoord}%
+    \pgfcoordinate{tempb}{\sseq at targetcoord}%
 }
 
 
-%
-% #1 -- first coordinate
-% #2 -- second coordinate
-% #3 -- uid
+% #1 -- uid
+% #2 -- first coordinate
+% #3 -- second coordinate
 \def\sseq at circleclass@draw#1#2#3{
     \begingroup
+        % If either class is part of a family we aren't drawing, don't draw the fit either.
+        \expandafter\ifx\csname pgf at sh@pi at sseq{#2}\endcsname\pgfpictureid\else
+            \@xp\sseq at break
+        \fi
+        \expandafter\ifx\csname pgf at sh@pi at sseq{#3}\endcsname\pgfpictureid\else
+            \@xp\sseq at break
+        \fi
         \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
+        \sseq at options@secondpassmode
         \node[
             rotate fit=\tempangle,
             /utils/exec={\sseq at thesseqstyle\sseq at thecircleclassstyle\the\sseq at scope@toks\sseq at savedoptioncode
@@ -681,6 +1049,7 @@
                 \@xp\pgfkeysalso\@xp{\romannumeral0\sseq at obj{#1.tikzprimoptions}}
             }
         ] {};
+        \sseq at breakpoint
     \endgroup
 }
 % Modifies tikz commands \tikz at lib@fit at scan@handle from \pgf\frontendlayer\tikz\libraries\tikzlibraryfit.code.tex line 81 and
@@ -711,6 +1080,94 @@
 }
 
 
+%%
+%% Patch tikz coords
+%%
+
+\def\sseq at patchtikzcoords{
+    \let\sseq at tikz@scan at one@point at noshift\sseq at tikz@scan at one@point at noshift@active
+    \tikzoption{shift}{\sseq at tikzshift{##1}}
+    \let\tikz@@@parse at regular\sseq at tikz@@@parse at regular
+    \let\tikz at to@curve at path\sseq at tikz@to at curve@path
+    \let\tikz@@@to at compute@relative\sseq at tikz@@@to at compute@relative
+
+    \let\tikz at grid\sseq at tikz@grid
+    \let\tikz at scan@handle at options\sseq at tikz@scan at handle@options
+    \let\tikz@@@parse at polar\sseq at tikz@@@parse at polar
+}
+
+% Some of the stuff in tikzlibrarycalc will probably be broken, hopefully not too much
+\let\sseq at tikz@scan at one@point at noshift\tikz at scan@one at point
+\let\sseq at tikz@@@parse at regular@save\tikz@@@parse at regular
+
+\def\sseq at tikz@scan at one@point at noshift@active#1{%
+    \let\tikz@@@parse at regular\sseq at tikz@@@parse at regular@save
+    \def\sseq at scanonepoint@cmd{\let\tikz@@@parse at regular\sseq at tikz@@@parse at regular#1}
+    \tikz at scan@one at point\sseq at scanonepoint@cmd%
+}
+
+% Probably there are more places that shouldn't have shifts inserted.
+\def\sseq at tikzshift#1{\tikz at addtransform{\sseq at tikz@scan at one@point at noshift\pgftransformshift#1\relax}}
+
+
+\def\sseq at tikz@to at curve@path{%
+  [every curve to]
+  \pgfextra{
+    \let\tikz@@@parse at regular\sseq at tikz@@@parse at regular@save % I added this to prevent repeated offsets from screwing us up
+    %\let\sseq at tikz@scan at one@point at noshift\tikz at scan@one at point
+    \iftikz at to@relative\tikz at to@compute at relative\else\tikz at to@compute\fi
+  }
+  \tikz at computed@path
+  \tikztonodes%
+}
+
+\let\sseq at tikz@@@to at compute@relative\tikz@@@to at compute@relative
+
+
+\patchcmd\sseq at tikz@@@to at compute@relative{%
+    \let\tikz at second@point=\tikz at toto
+}{%
+    \pgf at process{\pgfpointadd{\tikz at toto}{\pgfqpointxy{\sseq at xoffset}{\sseq at yoffset}}}%
+    \edef\tikz at toto{\@nx\pgfpoint{\the\pgf at x}{\the\pgf at y}}%
+    \let\tikz at second@point=\tikz at toto
+}{}{\error}
+
+
+
+
+% \tikz at parse@splitxyz: we should set up an error to make this unreachable?
+\let\sseq at tikz@grid\tikz at grid % line 3158
+\let\sseq at tikz@scan at handle@options\tikz at scan@handle at options % 4959
+\let\sseq at tikz@@@parse at polar\tikz@@@parse at polar % 5063
+
+\def\sseq at tikz@@@parse at regular#1#2#3){%
+  \pgfutil at in@,{#3}%
+  \ifpgfutil at in@%
+    \tikz at parse@splitxyz{#1}{#2}#3,%
+  \else%
+    \tikz at checkunit{#2}%
+    \iftikz at isdimension%
+      \tikz at checkunit{#3}%
+      \iftikz at isdimension%
+        \def\@next{#1{\pgfpointxy{(#2)/1cm+\sseq at xoffset}{(#3)/1cm+\sseq at yoffset}}}%
+      \else%
+        \def\@next{#1{\pgfpointxy{(#2)/1cm+\sseq at xoffset}{#3+\sseq at yoffset}}}%
+      \fi%
+    \else%
+      \tikz at checkunit{#3}%
+      \iftikz at isdimension%
+        \def\@next{#1{\pgfpointxy{#2+\sseq at xoffset}{(#3)/1cm+\sseq at yoffset}}}%
+      \else%
+        \def\@next{#1{\pgfpointxy{#2+\sseq at xoffset}{#3+\sseq at yoffset}}}%
+      \fi%
+    \fi%
+  \fi%
+  \@next%
+}
+
+
+
+
 %% New shapes and arrows
 %% These use lots of keys with spaces so it's convenient to turn off ExplSyntax.
 
@@ -987,4 +1444,5 @@
         \pgfusepathqfill
     },
     defaults = { length = 0.3cm }
-} 
\ No newline at end of file
+}
+

Modified: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqforeach.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqforeach.code.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqforeach.code.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,31 +1,218 @@
 %%
-%% Package: spectralsequences.sty version 1.0
+%% Package: spectralsequences v1.1.0
 %% Author: Hood Chatham
 %% Email: hood at mit.edu
-%% Date: 2017-06-18
+%% Date: 2017-08-02
 %% License: Latex Project Public License
 %%
 %% File: sseqforeach.code.tex
 %%
 %%    Patches the \foreach command to obtain better error reporting
+%%    Also defines some of my own looping commands, \Do, \DoUntilOutOfBounds, \DoUntilOutOfBoundsThenNMore
+%%    All of the \foreach stuff we are modifying is defined by tikz in the file /pgf/utilities/pgffor.code.tex
 %%
 
-
-% All of this \foreach stuff is defined by tikz in the file /pgf/utilities/pgffor.code.tex
-
-\def\sseq 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@savemacro at noslash#1{\sseq at d@addto at macro\sseq at for@vars{\sseq at for@vars at do@noslash#1}}
 \def\sseq at for@vars at do#1{; \string#1 = #1}
-\def\sseq at for@vars at donx#1{; \string#1= #1}
+\def\sseq at for@vars at do@noslash#1{; \sseq at macroname#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}
+
+\newcount\sseq at Do@depth
+
+\def\sseq at save@Do at var{
+    \sseq at atbeginforeach@msgsetup
+    \advance\sseq at Do@depth\@ne
+    \exp_args:Nc \sseq at for@savemacro at noslash { iteration ~ \the \sseq at Do@depth }
+    \def\iteration{0}
+}
+
+\def\sseq at stepiteration{
+    \edef\iteration{\the\numexpr\iteration+1}
+    \cs_set_eq:cN { iteration ~ \the \sseq at Do@depth } \iteration
+}
+
+\protected\def\sseq at Do{
+    \begingroup
+    \edef\sseq at inputline{\the\inputlineno}
+    \sseq at callas{\Do}
+    \sseq at call{\sseq at Do@}
+}
+
+\def\sseq at Do@#1#2{
+    \sseq at esetthiscall{\string\Do\unexpanded{#1}}
+    \sseq at opushstacktrace{\string\Do{#1}}
+    \sseq at ifintexpr{#1}{
+        \sseq at savestack
+        \sseq at save@Do at var
+        \prg_replicate:nn {#1} {
+            \sseq at stepiteration
+            #2
+            \relax
+        }
+        \sseq at restorestack
+    }{\sseq at error@xx{Do-invalid-int-expr}{\string\Do}{\unexpanded{#1}}}
+    \endgroup
+}
+
+\protected\def\sseq at DoUntilOutOfBounds{
+    \begingroup
+    \edef\sseq at inputline{\the\inputlineno}
+    \sseq at callas{\DoUntilOutOfBounds}
+    \sseq at call{\sseq at DoUntilOutOfBounds@}
+}
+
+\def\sseq at DoUntilOutOfBounds@ #1 {
+    \sseq at esetthiscall{\string\DoUntilOutOfBoundsThenNMore}
+    \sseq at opushstacktrace{\string\DoUntilOutOfBounds}
+    \ifx\xmin\sseq at xmin\else\ifx\ymin\sseq at ymin\else
+        \sseq at error@x{DoUntil-no-bound}{\string\DoUntilOutOfBounds}
+        \sseq at breakfifi
+    \fi\fi
+    \def\sseq at commandname{\string\DoUntilOutOfBounds}
+    \sseq at savestack % so we can nest these
+    \sseq at DoUntilOutOfBounds@body{#1}
+    \sseq at restorestack
+    \sseq at breakpoint
+    \endgroup
+}
+
+\protected\def\sseq at DoUntilOutOfBoundsThenNMore{
+    \begingroup
+    \edef\sseq at inputline{\the\inputlineno}
+    \sseq at callas{\DoUntilOutOfBoundsThenNMore}
+    \sseq at call{\sseq at DoUntilOutOfBoundsThenNMore@}
+}
+
+\def\sseq at DoUntilOutOfBoundsThenNMore@ #1#2 {
+    \sseq at esetthiscall{\string\DoUntilOutOfBoundsThenNMore\unexpanded{#1}}
+    \sseq at opushstacktrace{\string\DoUntilOutOfBoundsThenNMore{#1}}
+    \ifx\xmin\sseq at xmin\else\ifx\ymin\sseq at ymin\else
+        \sseq at error@n{DoUntil-no-bound}{\DoUntilOutOfBoundsThenNMore}
+        \sseq at breakfifi
+    \fi\fi
+    \sseq at ifintexpr{#1}{}{
+        \sseq at error@xx{Do-invalid-int-expr}{\string\DoUntilOutOfBoundsThenNMore}{\unexpanded{#1}}
+        \sseq at break
+    }
+    \def\sseq at commandname{\string\DoUntilOutOfBoundsThenNMore}
+    \sseq at savestack
+    \sseq at DoUntilOutOfBounds@body{#2}
+    \prg_replicate:nn {#1} {
+        \sseq at stepiteration
+        #2
+        \relax
+    }
+    \sseq at restorestack
+    \sseq at breakpoint
+    \endgroup
+}
+
+\def\sseq at DoUntilOutOfBounds@body#1{
+    \sseq at save@Do at var % Set iteration so that \DoUntilOutOfBoundsThenNMore doesn't get upset if we're already out of bounds
+    % If we're already out of bounds, we'll just do nothing.
+    \sseq_if_out_of_bounds_noparse:nnTF{\lastx{0}}{\lasty{0}}{
+        \bool_set_true:N \l_tmpa_bool
+    }{
+        \bool_set_false:N \l_tmpa_bool
+        % Now we need to set up the loop descent condition.
+        \sseq at tempxb=\lastx{0}\relax % Record current x and y values
+        \sseq at tempyb=\lasty{0}\relax
+        \sseq at stepiteration
+        #1 % run loop body once
+        \relax % protect from \d page grabber
+        \sseq_if_out_of_bounds_noparse:nnTF{\lastx{0}}{\lasty{0}}{ % If we're out of bounds now, we can quit
+            \bool_set_true:N \l_tmpa_bool
+        }{ % Otherwise, determine descent check
+            \sseq at tempx=\lastx{0}\relax % store new last value for comparison
+            \sseq at tempy=\lasty{0}\relax
+            \bool_set_false:N \l_tmpb_bool % This is to record whether there is a defined x range or y range. If neither, we'll throw an error.
+%            \def\sseq at checkbound{\bool_set_false:N \l_tmpb_bool}
+            \ifx\xmin\sseq at xmin
+                \ifnum\sseq at tempx>\sseq at tempxb
+                    \bool_set_true:N \l_tmpb_bool % We have a descent condition
+%                    \sseq at d@addto at macro\sseq at checkbound{
+%                        \ifnum\sseq at tempx>\sseq at tempxb % Any stage of the loop is okay as long as it increases x
+%                            \bool_set_true:N \l_tmpb_bool
+%                        \fi
+%                    }
+                \else
+                    \ifnum\sseq at tempx<\sseq at tempxb
+                        \bool_set_true:N \l_tmpb_bool
+%                        \sseq at d@addto at macro\sseq at checkbound{ % Any stage of the loop is okay as long as it decreases x
+%                            \ifnum\sseq at tempx<\sseq at tempxb
+%                                \bool_set_true:N \l_tmpb_bool
+%                            \fi
+%                        }
+                    \fi
+                \fi
+            \fi
+            \ifx\ymin\sseq at ymin
+                \ifnum\sseq at tempy>\sseq at tempyb
+                    \bool_set_true:N \l_tmpb_bool
+%                    \sseq at d@addto at macro\sseq at checkbound{
+%                        \ifnum\sseq at tempy>\sseq at tempyb
+%                            \bool_set_true:N \l_tmpb_bool
+%                        \fi
+%                    }
+                \else
+                    \ifnum\sseq at tempy<\sseq at tempyb
+                        \bool_set_true:N \l_tmpb_bool
+%                        \sseq at d@addto at macro\sseq at checkbound{
+%                            \ifnum\sseq at tempy<\sseq at tempyb
+%                                \bool_set_true:N \l_tmpb_bool
+%                            \fi
+%                        }
+                    \fi
+                \fi
+            \fi
+            \if_bool:N \l_tmpb_bool\else:
+                \sseq at error@x{DoUntil-no-progress}{\sseq at commandname}
+            \fi:
+        }
+    }
+    \bool_until_do:Nn \l_tmpa_bool {
+        \sseq at stepiteration
+        #1
+        \relax
+        \sseq_if_out_of_bounds_noparse:nnTF{\lastx{0}}{\lasty{0}}{% we're done
+            \bool_set_true:N \l_tmpa_bool
+        }{% Check descent condition
+%            \ifnum\iteration/10*10-\iteration=\z@
+%                \sseq at tempx=\lastx{0}\relax % store new last value for comparison
+%                \sseq at tempy=\lasty{0}\relax
+%                \bool_set_false:N \l_tmpb_bool
+%                \sseq at checkbound
+%                \if_bool:N \l_tmpb_bool\else:
+%                    \sseq at error{DoUntilOutOfBounds-descent-failed}
+%                \fi:
+%                \sseq at tempxb=\sseq at tempx
+%                \sseq at tempyb=\sseq at tempx
+%            \fi
+        }
+    }
+}
+
+
+
 \ExplSyntaxOff
 
 
+\def\sseq at for@nopatch{\sseq at error{foreach-patch-failed}\def\sseq at patchfor{}\endinput}
+
+\newtoks\sseq at foreachcall
+
+\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
+}
+
+
 \def\sseq at patchfor{%
     \let\pgffor at atbeginforeach\sseq at pgffor@atbeginforeach
     \let\pgffor@@vars at opt\sseq at pgffor@@vars at opt
@@ -47,17 +234,8 @@
 }
 
 
-
 \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}
 

Modified: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqkeys.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqkeys.code.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqkeys.code.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,8 +1,8 @@
 %%
-%% Package: spectralsequences.sty version 1.0
+%% Package: spectralsequences v1.1.0
 %% Author: Hood Chatham
 %% Email: hood at mit.edu
-%% Date: 2017-06-18
+%% Date: 2017-08-02
 %% License: Latex Project Public License
 %%
 %% File: sseqkeys.code.tex
@@ -12,7 +12,7 @@
 %%
 
 
-
+% Run \pgfqkeys{directory}{keys} but for a list of directories. Helps to avoid code duplication.
 \def\sseq at pgfqkeysdirlist#1#2{%
     \sseq at temptoks{#2}%
     \sseq at pgfqkeysdirlist@#1,\sseq at nil
@@ -27,7 +27,7 @@
 % 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}}
+\protected\def\sseqset#1{\pgfqkeys{/sseqpages/userstyles}{#1}}
 
 \def\sseq at sseqsetdirectory{/sseqpages/global/default}
 
@@ -60,7 +60,7 @@
 % on the first pass. Some only do things on the first pass or only do things on the second pass.
 % For example, shifts: shifts apply a coordinate transform on the second pass, but also need to factor into the coordinates of
 % classes etc which are computed at specification time not at draw time. So xshift=2 increases \sseq at x by 2 on it's first pass and
-% applies a coordinate transfrom by 2cm on the second pass.
+% applies a coordinate transform by 2cm on the second pass.
 
 % normal mode does the firstpass options now and saves the secondpass options in \sseq at savedoptioncode for later use.
 % firstpass mode does the firstpass options and throws away the secondpass options.
@@ -131,24 +131,33 @@
 % This is for .unknown handlers. Try same key in different directory #1.
 \def\sseq at passoptionto#1{\sseq at eval{\@nx\pgfqkeys{#1}{\pgfkeyscurrentname={\unexpanded\@xp{\pgfkeyscurrentvalue}}}}}
 
+% Immediately execute a key that is either a tikz or pgf key.
+% #1 -- key
+% #2 -- value
 \def\sseq 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?
+    \sseq at pgfkeysdocommand@try{/tikz}{#1}{#2}
+    \sseq at pgfkeysdocommand@try{/pgf}{#1}{#2}
     \ifsseq at tempif\else\sseq at error@internal at nn{do-command-failed}{#1}{#2}\fi
 }
 
-\def\sseq at pgfkeysdocommand@try#1#2{
+% Execute a key if \sseq at tempif is true and it is defined, if so set \sseq at tempif to false.
+% These are meant to cascade.
+% #1 -- directory
+% #2 -- key
+% #3 -- value
+\def\sseq at pgfkeysdocommand@try#1#2#3{
     \ifsseq at tempif\else
-        \pgfkeysifdefined{#1/. at cmd}{
+        \pgfkeysifdefined{#1/#2/. at cmd}{
             \sseq at tempiftrue
-            \pgfkeysgetvalue{#1/. at cmd}{\pgfkeys at code}%
-            \pgfkeys at code#2\pgfeov
+            \def\pgfkeysdefaultpath{#1/}
+            \edef\pgfkeyscurrentkey{#1/#2}
+            \pgfkeysgetvalue{#1/#2/. at cmd}{\pgfkeys at code}%
+            \pgfkeys at code#3\pgfeov
         }{
-            \pgfkeysifdefined{#1}{
+            \pgfkeysifdefined{#1/#2}{
                 \sseq at tempiftrue
-                \pgfkeyssetvalue{#1}{#2}
+                \pgfkeyssetvalue{#1/#2}{#3}
             }{}
         }
     \fi
@@ -180,13 +189,13 @@
             \@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}}%
+              \sseq at add@tikzkey at to@options{\@nx\sseq at options@secondpass{\@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}}%
+                \sseq at add@tikzkey at to@options{\@nx\sseq at options@secondpass{\def\@nx\tikz at shape{\tikz at key}}}%
               \fi%
             \fi%
           }%
@@ -195,8 +204,8 @@
 }
 
 \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 add@tikzkey at to@options{\@nx\sseq at options@secondpass{\@nx\tikz at addoption{\@nx\tikz at compat@color at set{\tikz at key}}}}%
+  \sseq at add@tikzkey at to@options{\@nx\sseq at options@secondpass{\def\@nx\tikz at textcolor{\tikz at key}}}%
 }
 
 %%% \sseq at keys@try at addtooptions
@@ -223,9 +232,10 @@
     \def\pgfkeysdefaultpath{#1/}%
     \def\next{\egroup\@ifnextchar\sseq at nil{\@xp\@secondoftwo\@gobble}{\sseq at keys@try at addtooptions@}}%
     \pgfkeysifdefined{#1/\pgfkeyscurrentname/. at cmd}{%
+        \edef\pgfkeyscurrentkey{#1/\pgfkeyscurrentname}%
         \ifx\pgfkeyscurrentvalue\pgfkeysnovalue at text% Hmm... no value
           \pgfkeysifdefined{#1/\pgfkeyscurrentname/. at def}%
-          {\pgfkeysgetvalue{#1/\pgfkeyscurrentname/. at def}{\pgfkeyscurrentvalue}}
+          {\pgfkeysgetvalue{#1/\pgfkeyscurrentname/. at def}{\pgfkeyscurrentvalue}}%
           {}% no default, so leave it
         \fi%
         \pgfkeysgetvalue{#1/\pgfkeyscurrentname/. at cmd}{\pgfkeys at code}%
@@ -236,7 +246,7 @@
     }{%
         \pgfkeysifdefined{#1/\pgfkeyscurrentname}{%
             \egroup
-            \sseq at add@tikzkey at to@options{\@nx\pgfkeyssetvalue{#1/\pgfkeyscurrentname}{\unexpanded\@xp{\pgfkeyscurrentvalue}}}%
+            \sseq at add@tikzkey at to@options{\@nx\sseq at options@secondpass{\@nx\pgfkeyssetvalue{#1/\pgfkeyscurrentname}{\unexpanded\@xp{\pgfkeyscurrentvalue}}}}%
             \def\next{\@xp\@firstoftwo\sseq at gobble@to at nil}%
         }{}%
     }%
@@ -243,22 +253,63 @@
     \next
 }
 
+% Iterate over list and run \pgfkeysalso's when we find them. Note that we use our variants of \pgfkeys at case@... which hand control back to this command,
+% so this is recursive -- the result is guaranteed not to have any instance of \pgfkeysalso in it!
 \def\sseq 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%
+    \def\sseq at tempa{/tikz/}%
+    \def\sseq at tempb{/pgf/}%
+    % This is an extra hook I needed to add so that my own keys can execute code when they need to...
+    \sseq at keys@addtooptions at checkdo#1\sseq at keys@do\sseq at nil
+    \ifx\sseq at nil#2% We're done, restore pgfkeys.
         \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@
+        \ifx\expandafter#2 % if they wanted to expand the first token, handle that
+            \sseq at add@tikzkey at to@options{\sseq at options@secondpass at iftikz{\relax\relax}}% The last token was an \expandafter, we need to keep it from doing anything
+            \@xptwo\sseq at keys@addtooptions at checkalso@xp
+        \else
+            \pgfkeysalso{#2}%
+            \@xptwo\sseq at keys@addtooptions at checkalso@
+        \fi
     \fi
 }
 
+\def\sseq at keys@addtooptions at checkalso@xp#1{%
+    \@xp\pgfkeysalso\@xp{#1}%
+    \sseq at keys@addtooptions at checkalso@
+}
+
+% Used to get collections code to run right.
+\def\sseq at keys@addtooptions at checkdo#1\sseq at keys@do#2{%
+    \sseq at add@tikzkey at to@options{\sseq at options@secondpass at iftikz{\unexpanded{#1}}}%
+    \ifx#2\sseq at nil\else
+        #2%
+        \@xp\sseq at keys@addtooptions at checkdo
+    \fi
+}
+
+% This has to be expandable, so \sseq at tempa and \sseq at tempb are set to "/tikz/" and "/pgf/" ahead of time
+% Defer the command if it is in directories /pgf or /tikz, otherwise run it now. TODO: explain here why we need this.
+\def\sseq at options@secondpass at iftikz{%
+    \ifx\pgfkeysdefaultpath\sseq at tempa
+        \@nx\sseq at options@secondpass
+    \else
+        \ifx\pgfkeysdefaultpath\sseq at tempb
+            \@nx\sseq at options@secondpass
+        \else
+            \@xptwo\@firstofone
+        \fi
+    \fi
+}
+
+
+% Here we hook into pgfkeys. This is remarkably easy!
 \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{%
@@ -275,7 +326,7 @@
   \else%
     % The following line is the only change, it used to be (roughly) \pgfkeyssetvalue{\pgfkeyscurrentkey}{\pgfkeyscurrentvalue}
     % which would immediately set the value. Instead we store in it \sseq at savedoptioncode
-    \sseq at add@tikzkey at to@options{\@nx\pgfkeyssetvalue{\pgfkeyscurrentkey}{\unexpanded\@xp{\pgfkeyscurrentvalue}}}%
+    \sseq at add@tikzkey at to@options{\@nx\sseq at options@secondpass{\@nx\pgfkeyssetvalue{\pgfkeyscurrentkey}{\unexpanded\@xp{\pgfkeyscurrentvalue}}}}%
   \fi%
 }
 
@@ -296,6 +347,7 @@
     /sseqpages/class/.is family,
     /sseqpages/class/label/.is family,
     /sseqpages/class/label/.unknown/.code={\sseq at keys@unknown},
+    /sseqpages/class/label/pin/.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,
@@ -307,6 +359,7 @@
     /sseqpages/tikz primitives/.is family,
     /sseqpages/tikz primitives/.unknown/.code={\sseq at keys@unknown},
     % One off directories
+    /sseqpages/fit/.is family,
     /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}}
@@ -314,10 +367,18 @@
 
 \pgfqkeys{/sseqpages/class}{shape/.code={\edef\tikz at shape{\pgfkeyscurrentname}}} % shape=whatever shape passing
 
+\newif\ifsseq at pin
 \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}
+    inside/.sseq @ first pass code={\sseq at classlabelfalse},
+    pin/.sseq @ first pass code = {
+        \let\sseq at savedoptioncode@save\sseq at savedoptioncode
+        \sseq at processoptions{class/label/pin}{#1}
+        \edef\sseq at savedoptioncode{\unexpanded\@xp{\sseq at savedoptioncode@save}\@nx\sseq at d@addto at macro\@nx\sseq at pinoptions{\unexpanded\@xp{\sseq at savedoptioncode}}}
+    },
+    pin/.sseq @ second pass append code = {\sseq at pintrue}
 }
+\def\sseq at pinoptions{}
 
 %% label directions
 \def\sseq at labeldirectionlist{\\{above}\\{below}\\{left}\\{right}\\{above left}\\{above right}\\{below left}\\{below right}}
@@ -342,8 +403,7 @@
 
 
 
-\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 @ first pass code]{\sseq at classlabeltrue}
 \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}}
@@ -355,12 +415,12 @@
     label distance/.code={\sseq at setdefaultlabeldistances{#1}}
 }
 
-\def\sseq at class@positionlabel#1#2{\sseq at pgfkeysdocommand{#1}{#2}}
+\def\sseq at class@positionlabel#1#2{\ifx\tikz at fig@name\undefined\else\sseq at pgfkeysdocommand{#1}{#2 of \tikz at fig@name}\fi}
 
 
 
 \sseq at addtostorelist\sseq at classlabeltextfn{} % \sseq at classlabeltextfn is public via "class label handler"
-\let\sseq at classlabeltextfn@default\@gobble
+\def\sseq at classlabeltextfn@default#1{\def\processedlabel{#1}}
 \def\sseq at labeltextfn#1{#1} % labeltextfn is private
 \def\sseq at labeltextfn@rotatescale#1{%
     \@nx\ifmmode
@@ -403,8 +463,15 @@
 
 \def\sseq at edgeoptionhook{}% This is just to make description work.
 
+%%  Labels
+%%  The code for this that actually does most of the work is inside of sseqmain.code.tex -- search for "Labels"
+%%  This just handles the interface with the keyvalue system here.
+
+
 %% Quote handling
 % \sseq at handlequote will be installed later as the 'first char syntax' for ".
+% Problem is that 'first char syntax' isn't allowed to care what directory it is in, but we need different handling
+% for classes versus edges versus scopes. Solution is to use \pgfkeysalso and then define the handler in a key.
 \def\sseq at protectlabel{\@nx\sseq at protectlabel\@nx}
 \def\sseq at handlequote#1{\pgfkeysalso{handle quote=#1}}
 \pgfkeys{%
@@ -415,20 +482,13 @@
         \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}%
+        \let\tikz at quotes@as\tikz at quotes@as at save
     }
 }
 
 
-\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%
@@ -442,105 +502,8 @@
 % 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
 
@@ -550,6 +513,7 @@
     \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
+    % TODO: This needs fixing:
     %((((((((((((((((((
     \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}}%
@@ -560,6 +524,7 @@
     \def\structlineoptions##1)##2){\sseq at setthiscall{\string\structlineoptions##1)##2)}\sseq at error@x{standard-parse}{\string\structlineoptions}}%
 }
 
+% I don't think this is ever actually used...
 \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
@@ -596,10 +561,12 @@
     background/.sseq @ first pass code={\sseq at error@n{option-tikz-prims-only}{background}}
 }
 
+% Some class options. All of these will make changes local to the current \class command. They are communicated to \class via these commands,
+% which we initialize here as empty.
 \def\sseq 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 namehandler{}
 \def\sseq at currenttag{\sseq at class@tag}% for the user ??
 \def\sseq at tooltip{}
 \pgfqkeys{/sseqpages/scope}{
@@ -607,14 +574,16 @@
     tag prefix/.code={\pgfkeys at spdef\temp{#1}\sseq at e@addto at macro\sseq at class@tagprefix{\unexpanded\@xp{#1}}}
 }
 
+\def\sseq at classinsert{}
 \pgfqkeys{/sseqpages/class}{
     name/.code={\def\sseq at class@name{#1}\pgfkeysalso{/sseqpages/alias=#1}},
-    show name/.code={\def\sseq at class@showname{#1}},
+    show name/.store in=\sseq at class@showname,
     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}}
+    offset/.store in=\sseq at tempoffset,
+    tooltip/.sseq @ first pass code={\def\sseq at tooltip{#1}},
+    insert/.store in=\sseq at classinsert
 }
 
 \pgfqkeys{/sseqpages/struct line}{
@@ -647,8 +616,9 @@
 }
 
 \pgfqkeys{/sseqpages}{needs tikz/.code=\sseq at needstikztrue}
+% All of these things need tikz to draw but otherwise require no special handling.
 \sseq at needstikzandpass{/sseqpages}{%
-    shade, blend mode, pattern, path picture, path fading, decorate, pin, label
+    shade, blend mode, pattern, path picture, path fading, decorate, pin, label % should pin be here?
 }
 
 \sseq at needstikzandpass{/sseqpages/differential}{%
@@ -671,8 +641,8 @@
 %    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 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}{
@@ -704,11 +674,24 @@
 %% Add key code to \sseq at savedoptioncode
 % #1 -- a list of directories to search
 % #2 -- keys
+%
+% This is pretty similar in basic concept to \sseq at processoptions, but instead of using the .unknown handlers to walk up the directory,
+% it just tries the key in each directory in the list. I'm not actually sure anymore why it was important to do it this way, but there probably was a good reason...
+%
 % This is a faster and sloppier way of doing:
-%\def\sseq at temp{#1}
-%\pgfqkeys{/sseqpages/alwaysunknown}{#2}
+% \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}
+% That basically takes advantage of the pgfkeys parser but gives me back control over what to do with the parsed things.
+%
+% For some reason I made the probably misguided decision that that approach was too slow, even though this isn't performance
+% critical code. Maybe I had a better reason for doing this that I can't remember. Instead I copied pgfkeys but deleted all the
+% parts that are useless in this context, which is most of it. Occasionally bugs crop up here when it turns out I deleted a little too much.
+%
+% This uses a hook \sseq at addstylecodetooptions@unknown to allow the sseqs style to sift out the nonglobal keys and handle them differently.
+%
 % Copied with modification from /pgf/utilities/pfgkeys.code.tex
+
 \def\sseq at addstylecodetooptions#1#2{%
     \def\sseq at directorylist{#1}%
     \sseq at simple@pgfkeys at parse#2,\pgfkeys at mainstop
@@ -733,6 +716,7 @@
   \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}}%
+      % We deleted the general "first char syntax" handler, so we need to do our own check for the quote.
       \sseq at simple@pgfkeys at checkquote#1\sseq at nil{%
             \def\pgfkeyscurrentname{handle quote}%
             \def\pgfkeyscurrentvalue{#1}%
@@ -747,6 +731,7 @@
       \@xp\next
   \fi
 }
+% This is a hook for the "sseqs" style.
 \let\sseq at addstylecodetooptions@unknown\sseq at keys@unknown
 
 \long\def\sseq at simple@pgfkeys at checkquote#1#2\sseq at nil{%
@@ -757,18 +742,43 @@
     \fi
 }
 
-\def\sseq at sseqstyle@globalpart{}
 
-
 \def\sseq at stylelist{}
 \def\sseq at clearchangestyles{}
 
+% The basic idea here is we make a tokens list \sseq at structlinestyle and define a key "struct lines" that takes a list of keys
+% and adds the keys to \sseq at structlinestyle. In order to do this, I need some special trick to delete spaces.
+% The macro \sseq at setmacronospaces defined in spectralsequences.sty accomplishes this.
 
 \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 set@newstyle#1{\pgfqkeys{/sseqpages}{#1}\pgfqkeys{/sseqpages/global}{#1}\pgfqkeys{/sseqpages/global/default}{#1}}
 
+% Here are two useful wrappers around addstylecodetotoks.
+
+% #1 -- token list
+% #2 -- path
+% #3 -- code
+\def\sseq at addstylecodetotoks#1#2#3{%
+    \let\sseq at savedoptioncode@store\sseq at savedoptioncode
+    \edef\sseq at savedoptioncode{\the#1}%
+    \sseq at addstylecodetooptions{#2}{#3}%
+    #1\@xp{\sseq at savedoptioncode}%
+    \let\sseq at savedoptioncode\sseq at savedoptioncode@store
+}
+
+% #1 -- macro
+% #2 -- path
+% #3 -- code
+\def\sseq at addstylecodetomacro#1#2#3{%
+    \let\sseq at savedoptioncode@store\sseq at savedoptioncode
+    \let\sseq at savedoptioncode#1%
+    \sseq at addstylecodetooptions{#2}{#3}%
+    \let#1\sseq at savedoptioncode
+    \let\sseq at savedoptioncode\sseq at savedoptioncode@store
+}
+
 \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}%
@@ -780,23 +790,15 @@
     \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\sseq at addstylecodetotoks{\sseq at tempcmd}{\sseq at temppath}{##1}
             \@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
+            \@nx\sseq at addstylecodetotoks{\sseq at tempcmdb}{\sseq at temppath}{##1}
         }
     }%
 }
@@ -808,12 +810,13 @@
 
 % sseqs has to be handled separately, because it must decide whether an option is a global option or not
 % and handle them at different times. This makes the code a little trickier.
+\def\sseq at sseqstyle@globalpart{}
 \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
+        % This will get called on each key that isn't a defined global option. Then we add it to \sseq at sseqstyle to be applied
+        % locally to absolutely everything.
         \def\sseq at addstylecodetooptions@unknown{%
             \let\sseq at sseqstyle@globalpart\sseq at savedoptioncode
             \edef\sseq at savedoptioncode{\the\sseq at sseqstyle}%
@@ -821,26 +824,23 @@
             \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
+        \sseq at addstylecodetomacro\sseq at sseqstyle@globalpart{/sseqpages/global}{#1}%
         \ifsseq at inprogress
             \sseq at savedpaths@xadd{\sseq at sseqstyle{\the\sseq at sseqstyle}}%
         \fi
+        % Restore hook
         \let\sseq at addstylecodetooptions@unknown\sseq at keys@unknown
-        \let\sseq at savedoptioncode\sseq at savedoptioncode@store
     },%
+    % It's not clear to me that "change sseqs" should even exist as an option.
     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 addstylecodetotoks{\sseq at sseqstyle@page}{\sseq at temppath}{#1}%
     }
 }
 
 
+% sseq needs special handling, so is done by hand above.
 %\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}
@@ -847,6 +847,7 @@
 \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/class/label/pin}{pin}
 \sseq at newstyles{/sseqpages/tikz primitives}{tikz primitive}
 \sseq at newstyles{/sseqpages/fit}{circle class}
 
@@ -860,11 +861,6 @@
     permanent classes/.code={\pgfkeysalso{permanent cycles={#1}}},
     transient classes/.code={\pgfkeysalso{transient cycles={#1}}},
     this page classes/.code={\pgfkeysalso{this page cycles={#1}}},
-    cycle style/.code={\pgfkeysalso{class style={#1}}},
-    permanent class style/.code={\pgfkeysalso{permanent cycle style={#1}}},
-    transient class style/.code={\pgfkeysalso{transient cycle style={#1}}},
-    this page class style/.code={\pgfkeysalso{this page cycle style={#1}}},
-    class label position/.code={\pgfkeysalso{class label positions={#1}}}
 }%
 
 \def\sseq at newplotstyle#1{
@@ -874,21 +870,13 @@
     \@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}
+            \@nx\sseq at addstylecodetomacro{\@xp\@nx\sseq at tempcmd}{/tikz}{##1}
         }
     }
     % 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}
+            \@nx\sseq at addstylecodetomacro{\@xp\@nx\sseq at tempcmdb}{/tikz}{##1}
         }
     }
 }
@@ -896,10 +884,152 @@
 
 \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}
 
 
+%%
+%%
+%%  Families (also called collections in code)
+%%
+%%    These are supposed to make it easy to display / hide and change appearance of logically connected families of classes.
+%%    In order to allow a set of options to be given that applies uniformly to all features, we separately apply the options in each of these bins.    
+%%    
+
+
+\def\sseq at featurelist{\\{class}\\{differential}\\{structline}\\{circleclass}\\{tikzprimitive}}
+\def\sseq at mapfeaturelist#1{\def\\##1{#1}\sseq at featurelist}
+
+\def\sseq at familylist{}
+
+\def\sseq at collections@featuretype{}
+\def\sseqnewfamily#1{%
+    % Make five bins associated to the new family, one for each feature type. Add them to storelist with empty defaults.
+    \sseq at mapfeaturelist{
+        \@xp\sseq at setmacronospaces\csname sseq at tempcmd@##1\endcsname{sseq at user@#1@##1 at style}
+        \@xp\sseq at setmacronospaces\csname sseq at tempcmd@##1 at default\endcsname{sseq at user@#1@##1 at style@default}
+        \sseq at eval{\@nx\sseq at addtostorelist\@xptwo\@nx\csname sseq at tempcmd@##1\endcsname{\@xptwo\@nx\csname sseq at tempcmd@##1 at default\endcsname}}
+        \@xptwo\def\csname sseq at user@#1@##1 at style@default\endcsname{}
+    }
+    % This is for deciding what set of options to apply to a feature
+    \@xp\sseq at setnospaces\csname sseq at tempcmd\endcsname{sseq at user@#1}
+%
+    % A flag to decide whether to draw the family. Set/unset using "draw family" and "no family".
+    \@xp\sseq at addtostorelist\csname sseq@#1 at maybedraw\endcsname{}
+    \pgfqkeys{/sseqpages/global}{%
+        #1 style/.ecode={%
+            \@nx\sseq at addstylecodetomacro\@xp\@nx\sseq at tempcmd@class{/sseqpages/class,/sseqpages/collections/class}{##1}%
+            \@nx\sseq at addstylecodetomacro\@xp\@nx\sseq at tempcmd@differential{/sseqpages/differential,/sseqpages/collections/differential}{##1}%
+            \@nx\sseq at addstylecodetomacro\@xp\@nx\sseq at tempcmd@structline{/sseqpages/struct line,/sseqpages/collections/struct line}{##1}%
+            \@nx\sseq at addstylecodetomacro\@xp\@nx\sseq at tempcmd@circleclass{/sseqpages/fit,/sseqpages/collections/fit}{##1}%
+            \@nx\sseq at addstylecodetomacro\@xp\@nx\sseq at tempcmd@tikzprimitive{/sseqpages/tikz primitives,/sseqpages/collections/tikz primitives}{##1}%
+        },
+        draw #1/.ecode = {\def\@xp\@nx\csname sseq@#1 at maybedraw\endcsname{\@nx\sseq at drawtrue}},
+        no #1/.ecode = {\def\@xp\@nx\csname sseq@#1 at maybedraw\endcsname{\@nx\sseq at drawfalse}}
+    }%
+    \pgfqkeys{/sseqpages/global/default}{%
+        #1 style/.ecode={%
+            \@nx\sseq at addstylecodetomacro\@xp\@nx\sseq at tempcmd@class at default{/sseqpages/class}{##1}%
+            \@nx\sseq at addstylecodetomacro\@xp\@nx\sseq at tempcmd@differential at default{/sseqpages/differential}{##1}%
+            \@nx\sseq at addstylecodetomacro\@xp\@nx\sseq at tempcmd@structline at default{/sseqpages/struct line}{##1}%
+            \@nx\sseq at addstylecodetomacro\@xp\@nx\sseq at tempcmd@circleclass at default{/sseqpages/fit}{##1}%
+            \@nx\sseq at addstylecodetomacro\@xp\@nx\sseq at tempcmd@tikzprimitive at default{/sseqpages/tikz primitives}{##1}%
+        },
+        draw #1/.ecode = {\def\@xp\@nx\csname sseq@#1 at maybedraw@default\endcsname{\@nx\sseq at drawtrue}},
+        no #1/.ecode = {\def\@xp\@nx\csname sseq@#1 at maybedraw@default\endcsname{\@nx\sseq at drawfalse}}
+    }%
+%
+    \pgfqkeys{/sseqpages}{
+        #1/.ecode={
+            \@nx\sseq at d@addto at macro\@nx\sseq at familylist{\@nx\csname sseq@#1 at maybedraw\endcsname}
+            \@nx\sseq at options@secondpass{
+                \unexpanded\@xp{\@xp\csname\sseq at tempcmd @\sseq at collections@featuretype @style\endcsname}
+            }
+        }
+    }
+}
+
+
+
+
+\def\sseq at collections@classlabels at hook{}
+\def\sseq at collections@innerclasslabels at hook{}
+\def\sseq at collections@outerclasslabels at hook{}
+\def\sseq at collections@pins at hook{}
+
+\def\sseq at collections@labels at hook{}
+\def\sseq at collections@edgelabels at hook{}
+\def\sseq at collections@differentiallabels at hook{}
+\def\sseq at collections@structlinelabels at hook{}
+
+\def\sseq at collections@setempty#1{\sseq at collections@setempty@#1,\sseq at nil}
+\def\sseq at collections@setempty@#1,{
+    \pgfqkeys{/sseqpages/collections}{
+        class/#1/.code={},
+        differential/#1/.code={},
+        struct line/#1/.code={},
+        fit/#1/.code={},
+        tikz primitives/#1/.code={}
+    }
+    \@ifnextchar\sseq at nil{\@gobble}{\sseq at collections@setempty@}
+}
+
+\sseq at collections@setempty{%
+    classes, cycles, permanent classes, permanent cycles, transient classes, transient cycles, this page classes, this page cycles,
+    edges, differentials,struct lines, this page struct lines,circleclasses, tikz primitives,
+    labels, edge labels, differential labels, struct line labels,
+    class labels, inner class labels, outer class labels,pins
+}
+
+% #1 -- path
+% #2 -- hook name
+% #3 -- code
+\def\sseq at collections@addtohook#1#2#3{
+    \sseq at keys@do{
+        \let\sseq at savedoptioncode@store\sseq at savedoptioncode\let\sseq at savedoptioncode\empty
+        \pgfqkeys{#1}{#3}
+        \edef\sseq at savedoptioncode{\unexpanded\@xp{\sseq at savedoptioncode@store}\def\@nx#2{\unexpanded\@xp{\sseq at savedoptioncode}}}
+    }
+}
+
+\pgfqkeys{/sseqpages/collections}{
+    class/classes/.style={/sseqpages/class/.cd,#1},
+    class/cycles/.style={/sseqpages/class/.cd,#1},
+    class/permanent classes/.code={\ifsseq at permanentcycle\pgfkeysalso{/sseqpages/class/.cd,#1}\fi},
+    class/permanent cycles/.code={\ifsseq at permanentcycle\pgfkeysalso{/sseqpages/class/.cd,#1}\fi},
+    class/transient classes/.code={\ifsseq at permanentcycle\else\pgfkeysalso{/sseqpages/class/.cd,#1}\fi},
+    class/transient cycles/.code={\ifsseq at permanentcycle\else\pgfkeysalso{/sseqpages/class/.cd,#1}\fi},
+    class/this page classes/.code={\ifsseq at thispage\pgfkeysalso{/sseqpages/class/.cd,#1}\fi},
+    class/this page cycles/.code={\ifsseq at thispage\pgfkeysalso{/sseqpages/class/.cd,#1}\fi},
+    differential/edges/.style={/sseqpages/differential/.cd,#1},
+    differential/differentials/.style={/sseqpages/differential/.cd,#1},
+    struct line/edges/.style={/sseqpages/struct line/.cd,#1},
+    struct line/struct lines/.style={/sseqpages/struct line/.cd,#1},
+    struct line/this page struct lines/.code={\ifsseq at thispage\pgfkeysalso{/sseqpages/struct line/.cd,#1}\fi},
+    fit/circleclasses/.style={/sseqpages/fit/.cd,#1},
+    tikz primitives/tikz primitives/.style={/sseqpages/tikz primitives/.cd,#1},
+% labels
+    class/class labels/.code/.expanded={\unexpanded\@xp{\sseq at collections@addtohook{/sseqpages/class/label}{\sseq at collections@classlabels at hook}{#1}}},
+    class/inner class labels/.code/.expanded={\unexpanded\@xp{\sseq at collections@addtohook{/sseqpages/class/label}{\sseq at collections@innerclasslabels at hook}{#1}}},
+    class/outer class labels/.code/.expanded={\unexpanded\@xp{\sseq at collections@addtohook{/sseqpages/class/label}{\sseq at collections@outerclasslabels at hook}{#1}}},
+    class/pins/.code/.expanded={\unexpanded\@xp{\sseq at collections@addtohook{/sseqpages/class/label/pin}{\sseq at collections@pins at hook}{#1}}},
+%
+    class/labels/.code/.expanded={\unexpanded\@xp{\sseq at collections@addtohook{/sseqpages/label}{\sseq at collections@labels at hook}{#1}}},
+    differential/labels/.code/.expanded={\unexpanded\@xp{\sseq at collections@addtohook{/sseqpages/label}{\sseq at collections@labels at hook}{#1}}},
+    struct line/labels/.code/.expanded={\unexpanded\@xp{\sseq at collections@addtohook{/sseqpages/label}{\sseq at collections@labels at hook}{#1}}},
+%
+    differential/edge labels/.code/.expanded=
+        {\unexpanded\@xp{\sseq at collections@addtohook{/sseqpages/label}{\sseq at collections@edgelabels at hook}{#1}}},
+    struct line/edge labels/.code/.expanded=
+        {\unexpanded\@xp{\sseq at collections@addtohook{/sseqpages/label}{\sseq at collections@edgelabels at hook}{#1}}},
+    differential/differential labels/.code/.expanded=
+        {\unexpanded\@xp{\sseq at collections@addtohook{/sseqpages/label}{\sseq at collections@differentiallabels at hook}{#1}}},
+    struct line/struct line labels/.code/.expanded=
+        {\unexpanded\@xp{\sseq at collections@addtohook{/sseqpages/label}{\sseq at collections@structlinelabels at hook}{#1}}},
+}
+
+
+
+
 %%% Global keys handlers and infrastructure
 
 \def\sseq at keys@lastpart{%
@@ -909,6 +1039,50 @@
     \edef\sseq at temp@ii{\pgfkeyscurrentkey}%
 }
 
+\def\sseq at sanitize@intexpr#1#2{
+    \sseq at ifintexpr{#1}{
+        \edef\sseq at sanitize@output{\the\numexpr#1}
+    }{
+        \sseq at error@xx{invalid-intexpr}{\unexpanded{#2}}{#1}
+        \sseq at break
+    }
+}
+
+\def\sseq at sanitize@positiveintexpr#1#2{
+    \sseq at sanitize@intexpr{#1}{#2}
+    \ifnum\sseq at sanitize@output<1\relax
+        \sseq at error@xx{invalid-positive-intexpr}{\unexpanded{#2}}{#1}
+        \@xp\sseq at break
+    \fi
+}
+
+\def\sseq at sanitize@dimenexpr#1#2{
+    \sseq at ifpgfmathexpr{#1}{
+        \ifpgfmathunitsdeclared\else
+            \sseq at error@xx{invalid-dimenexpr}{\unexpanded{#2}}{#1}
+            \@xp\sseq at break
+        \fi
+        \edef\sseq at sanitize@output{\sseq at mathresult}
+    }{
+        \sseq at error@xx{invalid-dimenexpr}{\unexpanded{#2}}{#1}
+        \sseq at break
+    }
+}
+
+\def\sseq at sanitize@color#1#2{
+    \begingroup
+        \global\sseq at gtempiffalse
+        \def\c at lor@error##1{\global\sseq at gtempiftrue}
+        \color{#1}
+    \endgroup
+    \ifsseq at gtempif
+        \sseq at error@xx{invalid-color}{\unexpanded{#2}}{#1}
+        \@xp\sseq at break
+    \else
+        \def\sseq at sanitize@output{#1}
+    \fi
+}
+
 \pgfqkeys{/handlers}{
     .sseq store in/.code 2 args={%
         \sseq at addtostorelist#1{#2}%
@@ -918,6 +1092,44 @@
             /sseqpages/global/default/\sseq at temp/.store in/.expand once=\csname \sseq at macroname#1 at default\endcsname
         }%
     },
+    .sseq store in sanitize/.code n args={3}{%
+        \sseq at addtostorelist#1{#2}%
+        \sseq at keys@lastpart
+        \pgfkeys{%
+            \sseq at temp@ii/.code/.expanded={%
+                \unexpanded{#3{##1}}{\sseq at temp=\unexpanded{##1}}%
+                \unexpanded{\edef#1{\unexpanded\@xp{\sseq at sanitize@output}}}%
+                %\show\@nx#1
+                \sseq at breakpoint
+            },
+            \sseq at temp@ii/.value required,
+            /sseqpages/global/default/\sseq at temp/.code/.expanded={%
+                \unexpanded{#3{##1}}{\sseq at temp=\unexpanded{##1}}%
+                \edef\@xp\@nx\csname \sseq at macroname#1 at default\endcsname\unexpanded{{\unexpanded\@xp{\sseq at sanitize@output}}}%
+                \sseq at breakpoint
+            },
+            /sseqpages/global/default/\sseq at temp/.value required
+        }%
+
+    },
+    .sseq store int in/.code 2 args={
+        \sseq at keys@lastpart
+        \pgfkeysalso{%
+            \sseq at temp@ii/.sseq store in sanitize={#1}{#2}\sseq at sanitize@intexpr
+        }
+    },
+    .sseq store positive int in/.code 2 args={
+        \sseq at keys@lastpart
+        \pgfkeysalso{%
+            \sseq at temp@ii/.sseq store in sanitize={#1}{#2}\sseq at sanitize@positiveintexpr
+        }
+    },
+    .sseq store dimen in/.code 2 args={
+        \sseq at keys@lastpart
+        \pgfkeysalso{%
+            \sseq at temp@ii/.sseq store in sanitize={#1}{#2}\sseq at sanitize@dimenexpr
+        }
+    },
     .sseq append to style/.code 2 args={%
         \sseq at addkeytostorelist{#1}{\pgfkeysalso{#2}}%
         \sseq at keys@lastpart
@@ -970,8 +1182,8 @@
             \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}}}%
+            /sseqpages/global/\sseq at temp/.code/.expanded={\@nx\pgfkeysalso{\sseq at tempb{x}=\unexpanded{{##1}},\sseq at tempb{y}=\unexpanded{{##1}}}},%
+            /sseqpages/global/default/\sseq at temp/.code/.expanded={\@nx\pgfkeysalso{\sseq at tempb{x}=\unexpanded{{##1}},\sseq at tempb{y}=\unexpanded{{##1}}}}%
         }%
     }
 }
@@ -987,32 +1199,35 @@
     }
 }
 
-\def\sseq at add@tikzkey at to@options at forstylehander#1{\sseq at e@addto at options{\@nx\sseq at options@secondpass{#1}}}
+\def\sseq at patchrepeat#1#2#3{%
+    \patchcmd#1{#2}{#3}{\sseq at patchrepeat{#1}{#2}{#3}}{}%
+}
+
+\def\sseq at stylehandler@processpath#1#2{%
+    \def\sseq at savedoptioncode{}%
+    \sseq at eval{\@nx\sseq at addstylecodetooptions{/sseqpages/#1}{\unexpanded\@xp{\sseq at keybody{*1}}}}%
+    \edef\sseq at savedoptioncode##1{\unexpanded\@xp{\sseq at savedoptioncode}}%
+    \sseq at patchrepeat\sseq at savedoptioncode{*1}{##1}%
+    \sseq at eval{\@nx\pgfqkeys{/sseqpages/#1}{\sseq at temp/.#2={\unexpanded\@xp{\sseq at savedoptioncode{##1}}}}}%
+}
+
+\def\sseq at add@tikzkey at to@options at forstylehander#1{\sseq at e@addto at options{#1}}
 \pgfqkeys{/handlers}{ % defines sseq style, etc
     sseq @@ make style handler/.style 2 args={%
         .sseq #1/.code={%
+            \def\sseq at keybody####1{##1}%
             \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}}}}%
+%
+            \sseq at stylehandler@processpath{scope}{#2}%
+            \sseq at stylehandler@processpath{class}{#2}%
+            \sseq at stylehandler@processpath{differential}{#2}%
+            \sseq at stylehandler@processpath{struct line}{#2}%
+            \sseq at stylehandler@processpath{circle classes}{#2}%
+            \sseq at stylehandler@processpath{tikz primitives}{#2}%
+%
             \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
@@ -1036,7 +1251,7 @@
     sseq @@ make code handler=code,
     sseq @@ make code handler=prefix code,
     sseq @@ make code handler=append code,
-%
+% these just are the same as /.style, etc.
     .global sseq style/.code={\pgfkeys{\pgfkeyscurrentpath/.code=\pgfkeysalso{#1}}},
     .global sseq prefix style/.code={\pgfkeys{\pgfkeyscurrentpath/.add code={\pgfkeysalso{#1}}{}}},
     .global sseq append style/.code={\pgfkeys{\pgfkeyscurrentpath/.add code={}{\pgfkeysalso{#1}}}},
@@ -1147,11 +1362,19 @@
     name/.sseq default error,
     ~page/.code={
         \ifsseq 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}
-            }
+            \sseq at getnumrange\sseq at thepage{#1}
+            \sseq at thepagecount=\sseq at thepage\relax
+            \let\page\sseq at thepage
+            \edef\sseq at thepagemm{\the\numexpr\sseq at thepagecount-1\relax}
+            \ifx\sseq at thepagemax\undefined
+                \edef\sseq at thepagemaxpp{\the\numexpr\sseq at thepagecount+1\relax}
+            \else
+                \ifnum\sseq at thepagemax=\z@
+                    \let\sseq at thepagemaxpp\sseq at infinity
+                \else
+                    \edef\sseq at thepagemaxpp{\the\numexpr\sseq at thepagemax+1\relax}
+                \fi
+            \fi
         \else
             \sseq at error{page-no-name}
         \fi
@@ -1168,6 +1391,11 @@
     },
     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},
+    grid color/.sseq store in sanitize=\sseq at gridcolor{gray}\sseq at sanitize@color,
+    grid step/.sseq x y alias,
+    grid step/.value required,
+    x grid step/.sseq store positive int in=\sseq at xgridstep{1},
+    y grid step/.sseq store positive int in=\sseq at ygridstep{1},
     math nodes/.sseq is if=mathnodes, % TODO: make this locally toggleable
     custom clip/.sseq store in=\sseq at customclip{},
     clip/.sseq is if=clip,
@@ -1178,7 +1406,7 @@
     draw orphan edges/.sseq is if=draworphanedges,
     no orphan edges/.sseq is if false={draworphanedges},
     class pattern/.sseq store in=\sseq at classpattern{standard},
-    class pattern/.append code={\ifcsname sseq@\sseq at classpattern xoffset1/1\endcsname\else\sseq at error{unknown-class-pattern}\fi},
+    class pattern/.add code={\ifcsname sseq@#1xoffset1/1\endcsname\else\sseq at error{unknown-class-pattern}\@xp\sseq at break\fi}{\sseq at breakpoint},
     class placement transform/.code={%
         \bgroup
         \let\tikz at transform\pgfutil at empty
@@ -1218,8 +1446,6 @@
 \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{%
@@ -1249,18 +1475,27 @@
 \@xp\sseq at addtostorelist\@xp\sseq at xmaxpp\@xp{\sseq at infinity}
 \@xp\sseq at addtostorelist\@xp\sseq at ymaxpp\@xp{\sseq at infinity}
 
+\sseq at addiftostorelist{specifiedxrange}
+\sseq at addiftostorelist{specifiedyrange}
 \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}%
+    \global\sseq at specifiedxrangetrue
+    \sseq at sanitize@intexpr{#1}{x range={#1}{#2}}
+    \sseq at sanitize@intexpr{#2}{x range={#1}{#2}}
+    \xdef\sseq at xmin{\the\numexpr#1}%
+    \xdef\sseq at xmax{\the\numexpr#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}%
+    \sseq at breakpoint
 }
 \def\sseq at yrange#1#2{%
     \global\let\sseq at yminmax\@gobbletwo %
+    \sseq at sanitize@intexpr{#1}{x range={#1}{#2}}
+    \sseq at sanitize@intexpr{#2}{x range={#1}{#2}}
+    \global\sseq at specifiedyrangetrue
     \gdef\sseq at ymin{#1}%
     \gdef\sseq at ymax{#2}%
     \let\ymin\sseq at ymin
@@ -1340,6 +1575,7 @@
 %%% 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)}},
@@ -1358,13 +1594,9 @@
     no labels/.sseq x y alias=no #1 label,
     draw labels/.sseq x y alias=draw #1 label,
 %
-    no x axis/.sseq is if false={drawxaxis},
-    no y axis/.sseq is if false={drawyaxis},
-    no axes/.value forbidden,
-    no axes/.sseq x y alias=no #1 axis,
-    draw x axis/.sseq is if=drawxaxis,
-    draw y axis/.sseq is if=drawyaxis,
-    draw axes/.sseq x y alias=draw #1 axis,
+    no x axis/.style={x axis type=none},
+    no y axis/.style={y axis type=none},
+    no axes/.style={axes type=none},
     rotate labels/.sseq is if=rotatelabels,
 %
     draw x ticks/.sseq is if=drawxaxisticks,
@@ -1377,62 +1609,135 @@
     draw ticks/.default=true,
     tick step/.sseq x y alias,
     tick step/.value required,
-    x tick step/.sseq store in=\sseq at xtickstep{1},
-    y tick step/.sseq store in=\sseq at ytickstep{1},
+    x tick step/.sseq store positive int in=\sseq at xtickstep{1},
+    y tick step/.sseq store positive int in=\sseq at ytickstep{1},
+    tick offset/.sseq x y alias,
+    tick offset/.value required,
+    x tick offset/.sseq store int in=\sseq at xtickstepoffset{0},
+    y tick offset/.sseq store int in=\sseq at ytickstepoffset{0},
+    major tick step/.sseq x y alias,
+    x major tick step/.sseq store int in=\sseq at xmajortickstep{0},
+    y major tick step/.sseq store int in=\sseq at ymajortickstep{0},
+    minor tick step/.sseq x y alias,
+    x minor tick step/.sseq store int in=\sseq at xminortickstep{0},
+    y minor tick step/.sseq store int in=\sseq at yminortickstep{0},
     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}},
+    class label handler/.code = { % \long so that \ifx\classlabeltextfn\@gobble compares true if this is empty (\@gobble is long...)
+        \long\def\sseq at classlabeltextfn##1{#1}
+        \ifx\sseq at classlabeltextfn\@gobble
+            \def\sseq at classlabeltextfn##1{\def\processedlabel{##1}}
+        \else
+            \edef\sseq at tempa{\unexpanded\@xp{\sseq at classlabeltextfn{}}}
+            \edef\sseq at tempb{\unexpanded\@xp{\sseq at classlabeltextfn{blah}}}
+            \ifx\sseq at tempa\sseq at tempb
+                \long\def\sseq at classlabeltextfn##1{#1{##1}}
+            \fi
+        \fi
+    },
+    class label handler/.sseq default code={
+        \long\def\sseq at classlabeltextfn@default##1{#1}
+        \ifx\sseq at classlabeltextfn@default\@gobble
+            \def\sseq at classlabeltextfn@default##1{\def\processedlabel{##1}}
+        \else
+            \edef\sseq at tempa{\unexpanded\@xp{\sseq at classlabeltextfn@default{}}}
+            \edef\sseq at tempb{\unexpanded\@xp{\sseq at classlabeltextfn@default{blah}}}
+            \ifx\sseq at tempa\sseq at tempb
+                \long\def\sseq at classlabeltextfn@default##1{#1{##1}}
+            \fi
+        \fi
+    },
     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 type/.sseq x y alias=axis type,
+    axes type/.add code={\let\sseq at axistypesanitizer\sseq at axistypesanitizerb}{\let\sseq at axistypesanitizer\sseq at axistypesanitizera},
+    axes type/.value required,
+    x axis type/.sseq store in sanitize=\sseq at xaxistype{border}\sseq at axistypesanitizer,
+    x axis type/.value required,
+    y axis type/.sseq store in sanitize=\sseq at yaxistype{border}\sseq at axistypesanitizer,
+    y axis type/.value required,
+    x axis origin/.sseq store int in=\sseq at xaxisorigin@center@{0},
+    y axis origin/.sseq store int in=\sseq at yaxisorigin@center@{0},
     axes origin/.sseq x y alias=axis origin,
 }
+
+\def\sseq at validaxestypesa{border, center, or none. The value frame only works with the 'axes type' key.}
+\def\sseq at validaxestypesb{border, center, frame, or none.}
+\let\sseq at validaxestypes\sseq at validaxestypesa
+
+\let\sseq at axistypekeya\@firstofone
+\def\sseq at axistypekeyb#1{axes type}
+\let\sseq at axistypekey\sseq at axistypekeya
+
+\def\sseq at uptoequal#1{\sseq at uptoequal@#1\sseq at nil}
+\def\sseq at uptoequal@#1=#2\sseq at nil{#1}
+\def\sseq at axistypesanitizerb#1#2{
+    \let\sseq at validaxestypes\sseq at validaxestypesb
+    \let\sseq at axistypekey\sseq at axistypekeyb
+    \@xp\ifx\csname sseq at leftgridpadding@y#1\endcsname\relax
+        \sseq at error@xx{invalid-axis-type}{#1}{\sseq at uptoequal{#2}}
+        \sseq at breakfi
+    \else
+        \def\sseq at sanitize@output{#1}
+    \fi
+    \let\sseq at validaxestypes\sseq at validaxestypesa
+    \let\sseq at axistypekey\sseq at axistypekeya
+}
+
+\def\sseq at axistype@frame{frame}
+\def\sseq at axistypesanitizera#1#2{
+    \def\temp{#1}
+    \ifx\sseq at axistype@frame\temp
+        \sseq at error@xx{invalid-axis-type}{#1}{\sseq at uptoequal{#2}}
+        \sseq at breakfi
+    \fi
+    \sseq at axistypesanitizerb{#1}{#2}
+}
+\let\sseq at axistypesanitizer\sseq at axistypesanitizera
+
 \pgfqkeys{/sseqpages}{%
-    class label handler/.code = {\long\def\sseq at classlabeltextfn##1{#1}}
+    class label handler/.code = { % \long so that \ifx\classlabeltextfn\@gobble compares true if this is empty (\@gobble is long...)
+        \long\def\sseq at classlabeltextfn##1{#1}
+        \ifx\sseq at classlabeltextfn\@gobble
+            \def\sseq at classlabeltextfn##1{\def\processedlabel{##1}}
+        \else
+            \edef\sseq at tempa{\unexpanded\@xp{\sseq at classlabeltextfn{}}}
+            \edef\sseq at tempb{\unexpanded\@xp{\sseq at classlabeltextfn{blah}}}
+            \ifx\sseq at tempa\sseq at tempb
+                \long\def\sseq at classlabeltextfn##1{#1{##1}}
+            \fi
+        \fi
+    }
 }
 
 \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},
+    x axis gap/.sseq store dimen in=\sseq at xaxisgap{0.5cm},
+    y axis gap/.sseq store dimen 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},
+    x tick gap/.sseq store dimen in=\sseq at xlabelgap{0.5cm},
+    y tick gap/.sseq store dimen in=\sseq at ylabelgap{0.5cm},
+    x axis tail/.sseq store dimen in=\sseq at xaxis@tail{0.9cm},
+    y axis tail/.sseq store dimen in=\sseq at yaxis@tail{0.9cm},
+    x axis extend start/.sseq store dimen in=\sseq at xaxis@start at extend{0.5cm},
+    y axis extend start/.sseq store dimen in=\sseq at yaxis@start at extend{0.5cm},
     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},
+    x axis extend end/.sseq store dimen in=\sseq at xaxis@end at extend{0.5cm},
+    y axis extend end/.sseq store dimen 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},
+    x axis clip padding/.sseq store dimen in=\sseq at xclip@axisgap{0.1cm},
+    y axis clip padding/.sseq store dimen 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}
+    right clip padding/.sseq store dimen in=\sseq at clip@padding at right{0.1cm},
+    left clip padding/.sseq store dimen in=\sseq at clip@padding at left{0.1cm},
+    top clip padding/.sseq store dimen in=\sseq at clip@padding at top{0.1cm},
+    bottom clip padding/.sseq store dimen in=\sseq at clip@padding at bottom{0.1cm}
 }
 
 %%%
@@ -1445,6 +1750,9 @@
 \sseq at addtostorelist\sseq at globalrotatetransform{}
 \sseq at addtostorelist\sseq at globalscaletransform{}
 
+\sseq at addtostorelist\sseq at xscale{1}
+\sseq at addtostorelist\sseq at yscale{1}
+
 \def\sseq at globaldetoneoption#1#2{%
     \ifsseq at globaldetone\else
         \sseq at error@n{det-one-after-scale}{#2}
@@ -1454,7 +1762,7 @@
 }
 \def\sseq at globalscaleoption#1{%
     \sseq at globaldetonefalse
-    \@xp\gdef\@xp\sseq at globalscaletransform\@xp{\sseq at globalscaletransform#1}#1%
+    \@xp\gdef\@xp\sseq at globalscaletransform\@xp{\sseq at globalscaletransform#1}%
 }
 \pgfqkeys{/sseqpages/global}{%
     x/.sseq @ illegal,
@@ -1481,28 +1789,44 @@
     mirror/.forward to=/sseqpages/global/xmirror,
     mirror/.forward to=/sseqpages/global/ymirror,
     xscale/.code={%
-        \pgfmathparse{int(#1-1)}%
-        \ifnum\pgfmathresult<\z@%
+        \sseq at ifpgfmathexpr{int(#1-1)}{}{
+            \sseq at error@nn{invalid-scale}{x}{#1}%
+            \sseq at break
+        }
+        \ifpgfmathunitsdeclared
+            \sseq at error@nn{unit-scale}{x}{#1}%
+            \sseq at break
+        \fi
+        \ifnum\sseq at mathresult<\z@
             \sseq at error@nn{negative-scale}{x}{#1}%
+            \sseq at break
         \fi
-        \sseq at globalscaleoption{\pgftransformxscale{#1}}%
+        \sseq at globalscaleoption{\pgfsetxvec{\pgfpointxy{#1}{0}}}
+        \pgfmathparse{\sseq at xscale*#1}
+        \edef\sseq at xscale{\pgfmathresult}
+        \sseq at breakpoint
     },
     xscale/.value required,
     yscale/.code={%
-        \pgfmathparse{int(#1-1)}%
-        \ifnum\pgfmathresult<\z@
+        \sseq at ifpgfmathexpr{int(#1-1)}{}{
+            \sseq at error@nn{invalid-scale}{y}{#1}%
+            \sseq at break
+        }
+        \ifpgfmathunitsdeclared
+            \sseq at error@nn{unit-scale}{y}{#1}%
+            \sseq at break
+        \fi
+        \ifnum\sseq at mathresult<\z@
             \sseq at error@nn{negative-scale}{y}{#1}%
+            \sseq at break
         \fi
-        \sseq at globalscaleoption{\pgftransformyscale{#1}}%
+        \sseq at globalscaleoption{\pgfsetyvec{\pgfpointxy{0}{#1}}}
+        \pgfmathparse{\sseq at yscale*#1}
+        \edef\sseq at yscale{\pgfmathresult}
+        \sseq at breakpoint
     },
     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/.sseq x y alias=#1scale,
     scale/.value required
 }
 
@@ -1520,11 +1844,11 @@
     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/.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/.append code=\sseq at options@scopeshiftsecondpass{\sseq at tikz@shifttransform{x}{#1}},%% Note special scopeshiftsecondpass command
+    yshift/.append code=\sseq at options@scopeshiftsecondpass{\sseq at tikz@shifttransform{y}{#1}},%%
     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,
@@ -1541,7 +1865,6 @@
     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{
@@ -1556,6 +1879,15 @@
     \sseq at tikz@shifttransform{y}{#2}
 }
 
+% special second pass handler for scopes to prevent shifts from causing out of memory style errors,
+% see the longer comment at the definition of sseq at scope in main.code.tex
+\def\sseq at options@scopeshiftsecondpass{\sseq at options@secondpass}
+
+\sseq at pgfqkeysdirlist{/sseqpages/scope,/sseqpages/tikz primitives,/sseqpages,/sseqpages/label,/sseqpages/class/label}{
+    align/.sseq @ second pass code=\tikzset{align/#1},
+    align/.sseq @ first pass append code={\sseq at needstikztrue\def\sseq at classquotes@smugglehook at inner{\sseq at needstikztrue\tikzset{align/#1}}}
+}
+
 \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}
@@ -1563,8 +1895,8 @@
     },
     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},
+    xshift/.append code=\sseq at options@scopeshiftsecondpass{\sseq at tikz@shifttransform{x}{#1}},%% Note special scopeshiftsecondpass command
+    yshift/.append code=\sseq at options@scopeshiftsecondpass{\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,
@@ -1589,7 +1921,7 @@
 \let\sseq at firstpass@shifttransform\sseq at firstpass@checkshifttransform
 
 \def\sseq at checkshifttransform#1#2{%
-    \pgfmathparse{#2}%
+    \pgfmathparse{(#2)}%
     \sseq at ifpgfmathresultisunitlessint{%
         \@xp\pgfmathint\@xp{\pgfmathresult}%
         \@xp\advance\csname sseq@#1\endcsname\pgfmathresult\relax
@@ -1619,7 +1951,7 @@
     \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 pgfkeysdocommand{#1shift}{#2cm*\csname sseq@#1scale\endcsname}
     }{
         \sseq at standardparse
         \ifpgfmathunitsdeclared

Modified: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqloadstore.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqloadstore.code.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqloadstore.code.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,8 +1,8 @@
 %%
-%% Package: spectralsequences.sty version 1.0
+%% Package: spectralsequences v1.1.0
 %% Author: Hood Chatham
 %% Email: hood at mit.edu
-%% Date: 2017-06-18
+%% Date: 2017-08-02
 %% License: Latex Project Public License
 %%
 %% File: sseqloadstore.code.tex
@@ -21,6 +21,7 @@
     \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}%
 }
+% TODO: is this used?
 \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}%
@@ -68,7 +69,6 @@
     \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}
 
@@ -82,18 +82,19 @@
 \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@let#1{\@xptwo\let\sseq at obj{#1}} % This shouldn't be used anywhere because all object assignments should be global...
+\def\sseq at obj@glet#1{\global\@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@undef#1{\global\@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@useifdef at else#1#2{\@ifundefined{\sseq at obj@fullname{#1}}{#2}{\sseq at obj{#1}}}
 \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@gaddto#1{\sseq at obj@ifundef{#1}{\sseq at obj@gdef{#1}}{\@xptwo\sseq at g@addto at macro\sseq at obj{#1}}}
+\def\sseq at obj@xaddto#1{\sseq at obj@ifundef{#1}{\sseq at obj@xdef{#1}}{\@xptwo\sseq at x@addto at macro\sseq at obj{#1}}}
+\def\sseq at obj@xoaddto#1{\sseq at obj@ifundef{#1}{\sseq at obj@xodef{#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}}
 
 
@@ -126,6 +127,7 @@
 \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@xaddtikzpath at standard#1{\sseq at x@addto at macro\sseq at savedpaths{#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}
@@ -134,6 +136,7 @@
 \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@xaddtikzpath at temporary#1{\sseq at x@addto at macro\sseq at tempsavedpaths{#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}
@@ -143,6 +146,7 @@
 \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@xaddtikzpath at background#1{\sseq at x@addto at macro\sseq at savedbackgroundpaths{#1}}
 \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}
@@ -150,6 +154,7 @@
 \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@xaddtikzpath 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{}
@@ -159,6 +164,7 @@
     \@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@xaddtikzpath  \csname sseq at savedpaths@xaddtikzpath@#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}{}{%
@@ -167,9 +173,14 @@
     }%
 }
 
-\def\sseq at usesavedpaths{%
-    \sseq at savedpaths
-    \sseq at clearchangestyles
-    \sseq at tempsavedpaths
-    \gdef\sseq at tempsavedpaths{}%
-} 
\ No newline at end of file
+% We don't want to add anything to paths except for tikz paths in background mode
+% We need to draw those because they might affect the bounding box.
+\def\sseq at setsavedpaths@draftmode{
+    \sseq at setsavedpaths{ignore}     % Don't add stuff to paths
+    % Only add tikzpaths if in background mode (so ignore in standard or temporary)
+    \let\sseq at savedpaths@xaddtikzpath at standard\@gobble
+    \let\sseq at savedpaths@xaddtikzpath at temporary\@gobble
+    % Only update mode for tikzpath
+    \def\sseq at setsavedpaths##1{\@xp\let\@xp\sseq at savedpaths@xaddtikzpath  \csname sseq at savedpaths@xaddtikzpath@##1\endcsname}
+}
+

Modified: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmacromakers.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmacromakers.code.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmacromakers.code.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,8 +1,8 @@
 %%
-%% Package: spectralsequences.sty version 1.0
+%% Package: spectralsequences v1.1.0
 %% Author: Hood Chatham
 %% Email: hood at mit.edu
-%% Date: 2017-06-18
+%% Date: 2017-08-02
 %% License: Latex Project Public License
 %%
 %% File: sseqmacromakers.code.tex
@@ -25,17 +25,6 @@
 %%% Install user commands
 % copy commands into user namespace by removing sseq@ prefixes
 % given a list of commands, \let\thiscommand\sseq 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
@@ -44,29 +33,75 @@
     \fi %
 }
 
-
 % Capital U argument type is "Until" but puts back the token when it's done.
-\cs_new_protected:Npn \sseq__xparse_add_type_U:w #1
-  {
-    \__xparse_flush_m_args:
-    \__xparse_add_grabber_mandatory:N U
-    \tl_put_right:Nn \l__xparse_signature_tl { {#1} }
-    \__xparse_prepare_signature:N
-  }
 
-\cs_new_protected:Npn \sseq__xparse_grab_U:w #1#2 \l__xparse_args_tl
-  { \sseq__xparse_grab_U_aux:nnN {#1} {#2} \cs_set_protected_nopar:Npn }
-
-\cs_new_protected:Npn \sseq__xparse_grab_U_aux:nnN #1#2#3
-  {
-    \exp_after:wN #3 \l__xparse_fn_tl ##1 #1
+% So xparse changed a bunch between the copy pushed to CTAN on February 7th and the copy pushed on February 9th
+\@ifpackagelater{xparse}{2017/02/08}{
+    \ifsseq at patchxparseU
+        % NEW CODE
+        \cs_new_protected:Npn \sseq__xparse_grab_U:w #1#2 \__xparse_run_code:
+          { \sseq__xparse_grab_U_aux:nnN {#1} {#2} \cs_set_protected_nopar:Npn }
+        \cs_new_protected:Npn \sseq__xparse_grab_U_aux:nnN #1#2#3
+          {
+            \tl_set:Nn \l__xparse_signature_tl {#2}
+            \exp_after:wN #3 \l__xparse_fn_tl ##1 #1
+              { \__xparse_add_arg:n {##1} #1 }
+            \l__xparse_fn_tl
+          }
+        \cs_new_protected:Npn \sseq__xparse_add_type_U:w #1
+          {
+            \__xparse_flush_m_args:
+            \__xparse_add_default:
+            \__xparse_add_grabber_mandatory:N U
+            \tl_put_right:Nn \l__xparse_signature_tl { {#1} }
+            \__xparse_prepare_signature:N
+          }
+    \else
+        % Assumptions failed, so just make U give an error (this isn't such a big deal since we don't use it for \d anymore).
+        \cs_new_protected:Npn \sseq__xparse_add_type_U:w #1
+          {
+            \sseq at error{U-xparse-incompatible}
+          }
+    \fi
+}{
+    % OLD CODE
+    \cs_new_protected:Npn \sseq__xparse_grab_U:w #1#2 \l__xparse_args_tl
+      { \sseq__xparse_grab_U_aux:nnN {#1} {#2} \cs_set_protected_nopar:Npn }
+    \cs_new_protected:Npn \sseq__xparse_grab_U_aux:nnN #1#2#3
       {
-        \__xparse_add_arg:n {##1}
-        #2\l__xparse_args_tl #1
+        \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
       }
-    \l__xparse_fn_tl
-  }
+    \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
+      }
+}% END \@ifpackagelater
 
+
+\cs_new_protected:Npn \sseq__xparse_normalize_type_U:w #1 {
+    \quark_if_recursion_tail_stop_do:nn {#1} { \__xparse_bad_arg_spec:wn }
+    \__xparse_normalize_check_lu:N U
+    \__xparse_add_arg_spec:n { U {#1} }
+    \int_incr:N \l__xparse_mandatory_args_int
+    \tl_clear:N \l__xparse_last_delimiters_tl
+    \__xparse_normalize_arg_spec_loop:n
+}
+
+% Expandable commands are a menace to us because they define a bunch of helper commands that we then have to keep track of.
+% We are too lazy to do this, so force \l__xparse_grab_expandably_bool to be false.
+% This is backwards compatible (I think) because \bool_set_false:N just performs a chardef (no existence check)
+% so in old versions, \l__xparse_grab_expandably_bool will be created harmlessly.
+\let\sseq__xparse_prepare_signature:n\__xparse_prepare_signature:n
+\pretocmd\sseq__xparse_prepare_signature:n { \bool_set_false:N \l__xparse_grab_expandably_bool } {}{\error}
+
 % I would like to patch the \__xparse_grab_U:w's in my commands into \sseq__xparse_grab_U:w's but I can't because of -NoValue-.
 \def\sseq at install@xparse at Uarggrabber{ \cs_set_eq:NN \__xparse_grab_U:w \sseq__xparse_grab_U:w }
 
@@ -77,10 +112,15 @@
 % so the result is that it defines \sseq 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
+    \exp_args:Nc \sseq at DeclareDocumentCommandAs@setinputline { sseq @ \cs_to_str:N #1 }#1
 }
 
-%%% \sseq at DeclareDocumentCommandAS
+\cs_new_protected:Npn\sseq at DeclareDocumentCommandAs@setinputline#1{
+   \protected\edef #1 { \@nx\sseq at setinputline \@xp\@nx\csname \cs_to_str:N #1 @@unique@@ start \endcsname }
+    \exp_args:Nc \sseq at DeclareDocumentCommandAs { \cs_to_str:N #1 @@unique@@ start }
+}
+
+%%% \sseq at DeclareDocumentCommandAs
 %
 % #1 - the command to define
 % #2 - the command to use in argument parsing errors
@@ -89,13 +129,12 @@
 %
 % See my stack exchange question: https://tex.stackexchange.com/questions/350596/control-error-messages-made-by-commands-defined-with-newdocumentcommand
 
-
-
 \cs_new_protected:Npn\sseq 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
+    \cs_set_eq:NN \__xparse_normalize_type_U:w \sseq__xparse_normalize_type_U:w
+    \cs_set_eq:NN \__xparse_prepare_signature:n \sseq__xparse_prepare_signature:n
+    %\cs_set:Npn   \__xparse_declare_cmd_code:Nnn {\bool_set_false:N \l__xparse_grab_expandably_bool\__xparse_declare_cmd_code_aux:Nnn}
     \sseq at installmsghooks
     \def\sseq at error@setup{}
     \def\sseq at error@cleanup{\sseq at errortrue}
@@ -109,16 +148,25 @@
     \cs_if_exist:cTF{ \cs_to_str:N #2 \c_space_tl code }{
         \cs_gset:Npx #1{
             \begingroup
+            \exp_not:N \cs_set_eq:NN  % force xparse to always ignore spaces!
+                \exp_not:N \peek_meaning:NTF
+                \exp_not:N \peek_meaning_ignore_spaces:NTF
+            \exp_not:N \cs_set_eq:NN  % force xparse to always ignore spaces!
+                \exp_not:N \peek_meaning_remove:NTF
+                \exp_not:N \peek_meaning_remove_ignore_spaces:NTF
+            % Not sure why we use set_eq:cc and exp_not:n here but I'm concerned that something will break if I change it...
+            \exp_not:N \cs_set_eq:cc
+                \exp_not:n {{ \cs_to_str:N #2 \c_space_tl code }}
+                \exp_not:n {{ \cs_to_str:N #1 \c_space_tl code }}
             \exp_not:N \cs_set_eq:NN
-                \exp_not:c { \cs_to_str:N #2 \c_space_tl code }
-                \exp_not:c { \cs_to_str:N #1 \c_space_tl code }
+                \exp_not:c { \cs_to_str:N #2 \c_space_tl }
+                \exp_not:c { \cs_to_str:N #1 \c_space_tl }
             \exp_not:c { \cs_to_str:N #1 \c_space_tl inner }
         }
-        \pretocmd:cnnn { \cs_to_str:N #2 \c_space_tl code } { \endgroup } { } { \sseq at error@x { macro-patch-failed } { \string#1 } }
+        \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:cc { \cs_to_str:N #1 \c_space_tl }{ \cs_to_str:N #2 \c_space_tl } % sometimes the new version of xparse stores stuff in #2<space>
     }{
         \cs_gset_eq:NN #1 #2
     }
@@ -135,7 +183,8 @@
 \cs_new_protected:Npn\NewSseqCommand#1{%
     \cs_if_free:cTF { sseq @ usermacro @ \cs_to_str:N #1 } { \DeclareSseqCommand#1 } { \sseq at error@x{usermacro-not-free}{\string#1} \use_none:nn }
 }
-
+\let\begingroupa\begingroup
+\let\begingroupb\begingroup
 \cs_new_protected:Npn\DeclareSseqCommand#1#2#3{%
     \cs_if_exist:cTF { sseq @ builtin @ \cs_to_str:N #1 } {\sseq at error@x{wont-override-system-macro}{\string#1}\sseq at break} {}
     \cs_if_free:cT { sseq @ usermacro @ \cs_to_str:N #1 } {
@@ -143,8 +192,10 @@
     }
     % Make sure \cs_if_exist doesn't pass because there was a previously defined user macro with same name
     \cs_undefine:c { sseq @ usermacro @ \cs_to_str:N #1 \c_space_tl code }
-    \exp_args:Nc \sseq at DeclareDocumentCommandAs { sseq @ usermacro @ \cs_to_str:N #1 } #1 { #2 } {
-                #3
+    \exp_args:Nc \sseq at DeclareDocumentCommandAs@setinputline { sseq @ usermacro @ \cs_to_str:N #1 } #1 { #2 } {%
+            \sseq at loadinputline
+            \sseq at atbeginusermacro@msgsetup
+                {}#3{} % prevent space patching space hazards with these {}'s
             \endgroup
         }%
     \ifsseq at error
@@ -155,22 +206,22 @@
     % You might think we could skip this patching, and it's probably possible.
     % However, this is responsible for turning the #'s of catcode other into #'s of catcode arg. I don't have as good of a way to do that.
     % Also, this allows me to use \sseq 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}{
+    % because if the argspec is invalid, \DeclareDocumentCommand will let me know.\sseq at temptoks
+    \cs_if_exist:cTF{ sseq @ usermacro @ \cs_to_str:N #1 @@unique@@ start \c_space_tl code }{
+        \patchcmd:cnfnn{ sseq @ usermacro @ \cs_to_str:N #1 @@unique@@ start \c_space_tl code }{\endgroup{}}{
             \@xp\endgroup
-            \@xp\begingroup
+            \@xp\begingroupa
             \the\sseq at temptoks
-            \sseq at atbeginusermacro@msgsetup
-        }{}{\error\sseq at error@x{usermacro-failed-patch}{\string#1}}
+        }{}{\sseq at error@x{usermacro-failed-patch}{\string#1}}
+        \cs_gset_eq:cc { sseq @ usermacro @ \cs_to_str:N #1 @@unique@@ start \c_space_tl code } { sseq @ usermacro @ \cs_to_str:N #1 @@unique@@ start \c_space_tl code}
     }{
-        \pretocmd:cfnn{ sseq @ usermacro @ \cs_to_str:N #1 }{
-            \@xp\begingroup
+        \pretocmd:cfnn{ sseq @ usermacro @ \cs_to_str:N #1 @@unique@@ start }{
+            \@xp\begingroupb
             \the\sseq at temptoks
-            \sseq at atbeginusermacro@msgsetup
-        }{}{\error\sseq at error@x{usermacro-failed-patch}{\string#1}}
+        }{}{\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 }
+    \cs_gset_eq:cc { sseq @ usermacro @ \cs_to_str:N #1 @@unique@@ start } { sseq @ usermacro @ \cs_to_str:N #1 @@unique@@ start}
     \ifsseq at inprogress
         \cs_set_eq:Nc #1 { sseq @ usermacro @ \cs_to_str:N #1 }
     \fi
@@ -178,12 +229,6 @@
 }
 
 %%% Commands to help the user define "groups" of commands to be reused
-\def\sseqnewgroup 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)
@@ -197,8 +242,7 @@
 \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
-%
+% why are we doing these things here?
     \sseq at installmsghooks
     \def\sseq at error@setup{}
     \def\sseq at error@cleanup{\sseq at errortrue}
@@ -206,39 +250,43 @@
 %
 % undefine so we can tell whether we need to patch \command<space>code or \command
     \cs_undefine:c { sseq @ usermacro @ \cs_to_str:N #2 @ helper  \c_space_tl code }
-    \exp_args:Nc \DeclareDocumentCommand { sseq @ usermacro @ \cs_to_str:N #2 @ helper } { #3 } {
-            #4
+    \exp_args:Nc \sseq at DeclareDocumentCommandAs { sseq @ usermacro @ \cs_to_str:N #2 @ helper } #2 { #3 } {
+        \sseq at loadinputline
+        \sseq at usermacro@esetthiscall{\the\sseq at groupthiscalltoks}
+        \sseq at atbeginusermacro@msgsetup % the stack push happens in here
+        \sseq at scopecall
+            {}#4{}
         \end{scope}
+        \endgroup
     }%
     \ifsseq at error
         \@xp\sseq at break
     \fi
+    \sseq at temptoks\@xp{\sseq at SseqGroup@argspec} % This gets added to the command by DeclareSseqCommand
     #1#2{od()}{%
+        %can't use \sseq at atbeginusermacro@msgsetup until next spot b/c don't know what the whole call looks like yet
         \IfNoValueTF{##1}{\def\sseq at options{}}{\def\sseq at options{##1}}%
         \IfNoValueTF{##2}{%
-            \sseq at eval{
-                \@nx\begin{scope}[\unexpanded\@xp{\sseq at options}]
-            }%
+            \edef\sseq at scopecall{\@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
+        \csname sseq @ usermacro @ \sseq at macroname #2 @ helper \@xp\endcsname\@gobbletwo % 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.    
+    % 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
+        }{}{\sseq at error@x{usermacro-failed-patch}{\string#1}}
+        % globalize definition:
+        \cs_gset_eq:cc { sseq @ usermacro @ \cs_to_str:N #2 @ helper \c_space_tl code } { sseq @ usermacro @ \cs_to_str:N #2 @ helper \c_space_tl code }
     }{
         \pretocmd:cfnn { sseq @ usermacro @ \cs_to_str:N #2 @ helper }{
             \the\sseq at temptoks
-            \sseq at atbeginusermacro@msgsetup
-        }{}{\error\sseq at error@x{usermacro-failed-patch}{\string#1}}
+        }{}{\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
@@ -245,11 +293,21 @@
     \sseq at breakpoint
     \group_end:
 }
-\let\sseqnewgroup\NewSseqGroup
 
+\def\sseqnewgroup at splitcoord#1,#2\sseq at nil{%
+    \edef\sseq at scopecall{
+        \@nx\begin{scope}[xshift=#1,yshift=#2,\unexpanded\@xp{\sseq at options}]
+    }
+}
 
+
+\newtoks\sseq at groupargspectoks
+\newtoks\sseq at groupthiscalltoks
 \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 SseqGroup@argspec{
+        \sseq at eval{\global\sseq at groupargspectoks{\IfNoValueF{#1}{\unexpanded{[#1]}}\IfNoValueF{#2}{\unexpanded{(#2)}}}}
+        \@gobbletwo
+    }
     \gdef\sseq at thearg{#\the\sseq at tempcount}
 \egroup
 
@@ -271,7 +329,18 @@
     \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}}}
+    % What's the second temptoks for?
+    \sseq at eval{
+        \sseq at temptoks{
+            \the\sseq at temptoksii
+            \@nx\sseq at esetthiscall{
+                \@nx\@nx\@nx#1
+                \@nx\the\sseq at groupargspectoks
+                \the\sseq at temptoks
+            }
+            \global\sseq at groupthiscalltoks\@nx\@xp{\@nx\the\sseq at thiscalltoks}
+        }
+    }
 }
 
 
@@ -308,6 +377,8 @@
     }
 }
 
+% v, E, and e are illegal
+
 % Mandatory
 \def\sseq at parseargspec@m{%
     \sseq at e@addto at temptoks{{\@nx\unexpanded{\sseq at thearg}}}
@@ -360,8 +431,8 @@
     \sseq at parseargspec@
 }
 
+% Optional with default
 
-
 \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]}}}%
@@ -383,7 +454,6 @@
     \sseq at parseargspec@
 }
 
-
 \ExplSyntaxOff
 
-%
+% 
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,8 +1,8 @@
 %%
-%% Package: spectralsequences.sty version 1.0
+%% Package: spectralsequences v1.1.0
 %% Author: Hood Chatham
 %% Email: hood at mit.edu
-%% Date: 2017-06-18
+%% Date: 2017-08-02
 %% License: Latex Project Public License
 %%
 %% File: sseqmain.code.tex
@@ -16,14 +16,21 @@
 %%%  Environment definitions
 %%%
 %%%%%%%
+\def\sseq at usesavedpaths{%
+    \sseq at savedpaths
+    \sseq at clearchangestyles
+    \sseq at tempsavedpaths
+    \gdef\sseq at tempsavedpaths{}%
+}
 
 \sseq at addtostorelist\sseq at savedbackgroundpaths{}
 \sseq at addtostorelist\sseq at restorestyles{}
 
+\def\sseq at page{\protect\sseq at thepage}
+
+
 \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!
@@ -91,14 +98,18 @@
     }
     \sseq at savedpaths@xadd{\sseq at stylelist}
     \sseq at savedpaths@add{\begingroup} % prevent some of the two-pass user macros horrors
+    \let\sseq at error@setup\sseq at error@setup at withinfo
 }
 
 % Just store all the settings
 \def\endsseqdata{
+    \let\sseq at error@setup\sseq at error@setup at noinfo
+    \sseq at checkend{sseqdata}
     \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
+    \sseq at breakpoint
 }
 
 \def\sseqpage{\@ifnextchar[{\sseqpage@}{\sseqpage@[]}} %]
@@ -118,11 +129,9 @@
     \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
+%    \ifsseq at mathnodes
+%        \let\sseq at maybemathswitch=$\@gobble$
+%    \fi
 %
     % Copy commands into user namespace
     \sseq at installmacros
@@ -176,19 +185,78 @@
                 \@xp\@nx\csname pgfk@/sseqpages/global/{\sseq at currentoptionpath} options/. at cmd\endcsname
         }
     \fi
+%
+    \ifsseq at specifiedxrange
+        \let\sseq at xminmax\@gobbletwo
+    \else
+        \let\sseq at xminmax\sseq at xminmax@active
+    \fi
+    \ifsseq at specifiedyrange
+        \let\sseq at yminmax\@gobbletwo
+    \else
+        \let\sseq at yminmax\sseq at yminmax@active
+    \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
+    \let\sseq at error@setup\sseq at error@setup at withinfo
 }
 
 % Here we do all of the work to actually print the page
 \def\endsseqpage{
+    \let\sseq at error@setup\sseq at error@setup at noinfo
+    \sseq at checkend{sseqpage}
     \sseq at savedpaths@add{\endgroup} % prevent some of the two-pass user macros horrors
+%
+    \sseq at xscalecm=\sseq at xscale cm
+    \sseq at yscalecm=\sseq at yscale cm
+%
+% check that range is okay
+%
     \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
 %
+    \ifnum\numexpr\sseq at xmax-\sseq at xmin\relax>\numexpr\maxdimen/\dimexpr1pt\relax-1\relax
+        \sseq at error@xx{range-super-overflow}{x}
+            {from \sseq at xmin\space to \sseq at xmax\space (xmax - xmin = \the\numexpr\sseq at xmax-\sseq at xmin)}
+        \@xp\sseq at break
+    \fi
+    \ifnum\numexpr\sseq at ymax-\sseq at ymin\relax>\numexpr\maxdimen/\dimexpr1pt\relax-1\relax
+        \sseq at error@xx{range-super-overflow}{y}
+            {from \sseq at ymin\space to \sseq at ymax\space (ymax - ymin = \the\numexpr\sseq at ymax-\sseq at ymin)}
+        \@xp\sseq at break
+    \fi
+%
+    \sseq at tempdimen = \dimexpr \textwidth -\sseq at clip@padding at right - \sseq at xaxis@end at extend - \sseq at xaxis@start at extend - \sseq at yaxisgap \relax
+    \sseq at tempcount = \numexpr \sseq at tempdimen /\sseq at xscalecm \relax
+    \ifnum \numexpr\sseq at xmax-\sseq at xmin + 1 > \sseq at tempcount
+      \pgfmathparse{\sseq at tempdimen/1cm/(\sseq at xmax-\sseq at xmin+1)}
+      \sseq at error@xxxx{range-overflow}{x}
+            {from \sseq at xmin\space to \sseq at xmax\space (xmax - xmin = \the\numexpr\sseq at xmax-\sseq at xmin)}
+            {\the\sseq at tempcount}% max x range
+            {\pgfmathresult}% max xscale
+        \@xp\sseq at break
+    \fi
+%
+    \sseq at tempdimen = \dimexpr \textheight - \sseq at clip@padding at top - \sseq at yaxis@end at extend - \sseq at yaxis@start at extend - \sseq at xaxisgap \relax
+    \sseq at tempcount = \numexpr \sseq at tempdimen /\sseq at yscalecm \relax
+    \ifnum \numexpr\sseq at ymax-\sseq at ymin +1 > \sseq at tempcount
+        \pgfmathparse{\sseq at tempdimen/1cm/(\sseq at ymax-\sseq at ymin+1)}
+        \sseq at error@xxxx{range-overflow}{y}
+            {from \sseq at ymin\space to \sseq at ymax\space (ymax - ymin = \the\numexpr\sseq at ymax-\sseq at ymin)}
+            {\the\sseq at tempcount}% max x range
+            {\pgfmathresult}% max xscale
+        \@xp\sseq at break
+    \fi
+%
+    % Really this could be anything between -\sseq at xmin and -\sseq at xmax and it wouldn't matter. We'll split the difference.
+    \sseq at xoffset=\numexpr\sseq at intdivceiling{\numexpr-\sseq at xmin-\sseq at xmax\relax}{\numexpr4*\sseq at xgridstep\relax}*(2*\sseq at xgridstep)\relax
+    \sseq at yoffset=\numexpr\sseq at intdivceiling{\numexpr-\sseq at ymin-\sseq at ymax\relax}{\numexpr4*\sseq at ygridstep\relax}*(2*\sseq at ygridstep)\relax
+%
+%
     \tikzset{
         z=0pt,
         every path/.style={},
@@ -195,9 +263,10 @@
         every node/.style={}
     }
     \let\errmessage\sseq at errmessage@std
+    \sseq at setlayoutparameters
     \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
+    %\pgftransformreset
     \sseq at globaldetonetransform
     \sseq at globalscaletransform
 %
@@ -205,26 +274,42 @@
     \let\sseq at shifttransform\sseq at checkshifttransform % Allow shifts as long as they are by integers and have no units.
 %
     \sseq at setupclip
+%
+    \sseq at patchtikzcoords
+%
     \pgfonlayer{background}%
     % Axes labels only occur once per page, so the cost of typesetting them with tikz doesn't matter ... THANK GOD
     \ifx\sseq at title\pgfutil at empty\else
         \ifsseq at drawtitle
-            \sseq at eval{\unexpanded{\path (0.5*\xmin+0.5*\xmax,\ymax) node[
+            \sseq at eval{\@nx\path (0,-\sseq at yoffset) node[
                 /sseqpages/global/every title,
-                above=\sseq at clip@padding at top+\sseq at yaxis@end at extend+10pt
-            ]} {\unexpanded\expandafter{\sseq at title}};}
+                above=\sseq at topclippadding+5pt
+                ] {\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}};}
+        \sseq at eval{\noexpand\node[
+            align=center,
+            /sseqpages/global/every x axis label,
+            below,
+            shift={\sseq at xlabelposition},
+        ] {\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}};}
+        \sseq at eval{\noexpand\node[
+            align=center,
+            /sseqpages/global/every y axis label,
+            above,
+            rotate=90,
+            shift={\sseq at ylabelposition},
+        ] {\unexpanded\expandafter{\sseq at yaxislabel}};}
     \fi\fi
+%
+    \sseq at grid
     \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
@@ -231,6 +316,7 @@
         \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
@@ -267,11 +353,18 @@
 
 %%% Scope
 \newcount\sseq at scope@savestackid
+\def\sseq at scope@secondpasstoks{}
 \def\sseq at scope{\@ifnextchar[{\sseq at scope@}{\sseq at scope@[]}}%]
 \def\sseq at scope@[#1]{%
     \sseq at scope@savedpaths at add{\begin{scope}}%
+    % This is a funky hack to fix a problem with shifts. On tmfass, if we don't handle shifts specially, we actually put so much stuff into
+    % this \sseq at scope@secondpasstoks macro that we exceed TeX's upper bound for the maximum total macro memory. Or something like that -- I don't understand the error,
+    % but it definitely only depends on how much stuff there is overall and on there being lots of scopes, not on any particular part of the diagram.
+    % Anyways, to avoid this excessive storage demand, we don't put the shifts into the scope toks and apply them tons of times, we just do them once.
+    \let\sseq at options@scopeshiftsecondpass\sseq at scope@savedpaths at add
     \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}}}}%
+    \edef\sseq at scope@secondpasstoks{\unexpanded\@xp{\sseq at scope@secondpasstoks}\unexpanded\@xp{\sseq at savedoptioncode}}
+    \sseq at eval{\@nx\sseq at scope@savedpaths at add{\sseq at scope@toks{\unexpanded\@xp{\sseq at scope@secondpasstoks}}}}%
     %\advance\sseq at scope@savestackid\@ne
     %\sseq at savestack@name{scope at save\the\sseq at scope@savestackid}
 }
@@ -284,25 +377,13 @@
 
 
 \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@
-    }
-
-
+    % Only add tikz background paths to the savedpaths. We need to draw background paths because they might change the bounding box!
+    \sseq at setsavedpaths@draftmode
+%
     % All we want to do here is record the range. Have to process options in order to figure out where it is.
     \sseq at DeclareDocumentCommand\class{or()}{%
         \begingroup
+        \sseq at loadinputline
         \IfNoValueT{#2}{\sseq at break}%
         \sseq at xsetthiscall{\string\class\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}%
         \sseq at options@firstpassmode
@@ -317,13 +398,10 @@
         \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}{%
@@ -344,12 +422,11 @@
     }
 
     % 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\classoptions{od()}{}
+    \sseq at DeclareDocumentCommand\replaceclass{od()}{}
+    \def\sseq at d@main#1#2#3#4#5{} % makes both \d and \doptions do nothing
+    \sseq at DeclareDocumentCommand\structline{od()d()}{}
+    \sseq at DeclareDocumentCommand\structlineoptions{od()d()}{}
     \sseq at DeclareDocumentCommand\circleclasses{or()r()}{}
     \endinput
 \fi
@@ -365,6 +442,7 @@
 %%% \class, \classoptions, \replaceclass
 \sseq at DeclareDocumentCommand\class{or()}{%
     \begingroup
+    \sseq at loadinputline
     \IfNoValueT{#2}{\sseq at break}
     \sseq at xsetthiscall{\string\class\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}%
     \sseq at options@firstpassmode
@@ -384,18 +462,33 @@
         \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
+%%%% No more breaks after this point
 %
+    \ifx\sseq at classinsert\empty
+        % by default, just insert to the right of previous classes
+        \edef\sseq at classinsert{\nodenum}
+    \else
+        \ifnum\sseq at classinsert<\z@
+            % negative 1 is where we would normally insert things
+            \edef\sseq at classinsert{\the\numexpr\nodenum+\sseq at classinsert+1}
+        \fi
+        \ifnum\sseq at classinsert<\@ne
+            \def\sseq at classinsert{1}
+        \fi
+        \ifnum\sseq at classinsert>\nodenum\relax
+            \edef\sseq at classinsert{\nodenum}
+        \fi
+        \ifnum\nodenum>\@ne
+            \@xp\sseq at class@adjustclasses\@xp{\partialcoord} % Adjust all of the indices of the classes to the right of the one we're inserting
+        \fi
+    \fi
+%
+    \sseq at processlabels % This sets up the label nodes, now that we know the position of the class (I think that's what we needed?)
+%
     \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}{
@@ -421,14 +514,25 @@
 %
     \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}%
+    \sseq at obj@xdef{class.\coord.n}{\sseq at classinsert}
+    \ifx\sseq at familylist\pgfutil at empty\else
+        \sseq at obj@xodef{\classname.familylist}{\sseq at familylist}
+    \fi
+    \ifx\sseq at savedoptioncode\pgfutil at empty\else
+        \sseq at obj@xodef{\classname.options}{\sseq at savedoptioncode}%
+    \fi
+    \ifx\sseq at classnodetext\pgfutil at empty\else
+        \sseq at obj@xodef{\classname.nodetext}{\sseq at classnodetext}
+    \fi
+    \ifx\sseq at classnodetextoptions\pgfutil at empty\else
+        \sseq at obj@xodef{\classname.nodetext.options}{\sseq at classnodetextoptions}
+    \fi
+    \ifx\sseq at classlabelnodes\pgfutil at empty\else
+        \sseq at obj@xodef{\classname.labelnodes}{\sseq at classlabelnodes}%
+    \fi
+    \ifsseq at needstikz
+        \sseq at obj@xdef{\classname.needstikz}{\sseq at needstikztrue}%
+    \fi
     \@ifundefined{sseq at tempoffset}{}{%
         \tikz at scan@one at point\sseq at setoffset\sseq at tempoffset
     }%
@@ -437,17 +541,31 @@
     \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()}{%
+% This is for use with "insert" key. Add one to offset index of each class later than the one currently being inserted
+% Takes the partial coordinate "x,y" in #1, and the position that the new class is being inserted into in \sseq at classinsert.
+\def\sseq at class@adjustclasses#1{
+    \sseq at tempcount=\z@
+    \sseq at tempcountb=\sseq at obj{partcoord.(#1).numnodes}
+    \loop
+        \advance\sseq at tempcount\@ne
+        \ifnum\sseq at obj{class.(#1,\the\sseq at tempcount).n}<\sseq at classinsert\relax\else
+            \sseq at cleanup@obj{class.(#1,\the\sseq at tempcount).n}
+            \sseq at eval{\@nx\sseq at obj@inc{class.(#1,\the\sseq at tempcount).n}} % unfortunately, \sseq at obj@inc uses \sseq at tempcount so we need this eval
+        \fi
+    \ifnum\sseq at tempcount<\sseq at tempcountb\repeat
+
+}
+
+\sseq at DeclareDocumentCommand\classoptions{od()}{%
     \begingroup
-    \sseq at xsetthiscall{\classoptions\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}%
+    \sseq at loadinputline
+    \sseq at xsetthiscall{\string\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
@@ -456,15 +574,21 @@
     \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}%
+    \IfNoValueTF{#2}{
+        \def\sseq at coord{\lastclass0}
+    }{
+        \def\sseq at coord{#2}
+    }
+    \sseq at parsecoord\coord{\sseq at coord}{\string\classoptions}%
 %
     \sseq at processlabels
 %
     \let\partialcoord\coord at partial
+    \edef\sseq at classnum{\sseq at obj@ifdef{class.\coord.num}{\sseq at obj{class.\coord.num}}{0}}
     \@ifundefined{sseq at class@page}{%
         \@ifundefined{sseq at gen}{
             \@ifundefined{sseq at thepage}{
-                \edef\sseq at gen{\sseq at obj{class.\coord.num}}
+                \let\sseq at gen\sseq at classnum
             }{
                 \sseq at obj@pagetogen{class.\coord}{\sseq at thepage} % stores in \sseq at gen
             }
@@ -471,10 +595,10 @@
             \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}
+                \edef\sseq at gen{\the\numexpr\sseq at classnum+\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}
+                \edef\sseq at genmax{\the\numexpr\sseq at classnum+\sseq at genmax+1}
             }
         }
     }{
@@ -482,7 +606,7 @@
         \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 genmax\sseq at classnum%
             \let\sseq at class@pagemax\sseq at infinity % ensure if "page" is defined, "pagemax" is defined too
         }{
             \let\sseq at genmin\sseq at gen
@@ -494,7 +618,7 @@
         \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}}
+        \let\sseq at gen\sseq at classnum
     \fi
     \edef\classname{class.\coord[\sseq at gen]}
     \ifsseq at keepchanges\else
@@ -552,6 +676,10 @@
             \sseq at cleanup@obj{\classname.labelnodes}
             \sseq at classoptions@obj at addto@withpagerange{\classname.labelnodes}{\sseq at classlabelnodes}
         \fi
+        \ifx\sseq at familylist\pgfutil at empty\else
+            \sseq at cleanup@obj{\classname.familylist}
+            \sseq at classoptions@obj at addto@withpagerange{\classname.familylist}{\sseq at familylist}
+        \fi
         \@ifundefined{sseq at tempoffset}{}{
             \sseq at cleanup@obj{\classname.offset}
             \tikz at scan@one at point\sseq at setoffset\sseq at tempoffset
@@ -586,7 +714,7 @@
 }
 \def\sseq at class@getgen#1{
     \bgroup
-        \ifnum\sseq at obj{class.\coord.num}>\z@
+        \ifnum\sseq at classnum>\z@
             \sseq at eval{\unexpanded{\sseq at obj@pagetogen{class.\coord}}{#1}} % stores in \sseq at gen
         \else
             \def\sseq at gen{0}
@@ -594,8 +722,9 @@
         \sseq at smuggle@macro\sseq at gen
     \egroup
 }
-\sseq at DeclareDocumentCommand\replaceclass{or()}{%
+\sseq at DeclareDocumentCommand\replaceclass{od()}{%
     \begingroup
+    \sseq at loadinputline
     \sseq at xsetthiscall{\string\replaceclass\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}
     \sseq at options@firstpassmode
     \the\sseq at sseqstyle
@@ -606,10 +735,15 @@
         \sseq at processoptions{class}{#1}% Outputs result into \sseq at savedoptioncode
     }%
 %
-    \sseq at parsecoord\coord{#2}{\string\replaceclass}
+    \IfNoValueTF{#2}{
+        \def\sseq at coord{\lastclass0}
+    }{
+        \def\sseq at coord{#2}
+    }
+    \sseq at parsecoord\coord{\sseq at coord}{\string\classoptions}%
     \sseq at processlabels
 %
-    \sseq at ifundefcoord\coord{\sseq at error@x{replaceclass-no-class}{\coordname}\sseq at break}{}
+    \sseq at obj@ifundef{class.\coord.num}{\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
@@ -647,13 +781,20 @@
     \fi
     \edef\classname{class.\coord[\sseq at obj{class.\coord.num}]}
 %
+    \sseq at obj@xodef{\classname.familylist}{\sseq at familylist}
     \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}
+    \ifx\sseq at classnodetext\pgfutil at empty\else
+        \sseq at obj@xodef{\classname.nodetext}{\sseq at classnodetext}
+    \fi
+    \ifx\sseq at classnodetextoptions\pgfutil at empty\else
+        \sseq at obj@xodef{\classname.nodetext.options}{\sseq at classnodetextoptions}
+    \fi
     \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}
+    \ifsseq at needstikz
+        \sseq at obj@xdef{\classname.needstikz}{\sseq at needstikztrue}
+    \fi
     \@ifundefined{sseq at tempoffset}{}{\tikz at scan@one at point\sseq at setoffset\sseq at tempoffset}
 %
     \sseq at breakpoint
@@ -666,8 +807,12 @@
         \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]}
+        \sseq at drawtrue
+        \sseq at obj{#1[\sseq at gen].familylist}
+        \ifsseq at draw
+            \sseq at gsetthiscall{class #1}
+            \sseq at class@drawnode{#1[\sseq at gen]}
+        \fi
     \fi
     \egroup
 }
@@ -690,25 +835,76 @@
     \egroup
 }
 %%%
-%%% \d and \doptions
+%%% \kill, \d and \doptions
 %%%
 
-\sseq at DeclareDocumentCommand\d{oU(r()d()}{%
-    \sseq at d@{d}{#1}{#2}{#3}{#4}%
+% Because \kill doesn't take options, there's no need to use \sseq at DeclareDocumentCommand for the outer command.
+% Rather than use \sseq at DeclareDocumentCommand with no arguments, we just do the normal stuff that \sseq at DeclareDocumentCommand would do,
+% Then call \sseq at d@grabpage, the command that is responsible for handling the strange syntax of the page argument for \d.
+\protected\def\sseq at kill{%
+    \begingroup
+    \sseq at setinputline % These two lines normally would happen inside of \sseq at DeclareDocumentCommand.
+    \sseq at loadinputline
+    \sseq at d@grabpage\sseq at kill@
 }
-\sseq at DeclareDocumentCommand\doptions{oU(r()d()}{%
+
+% Now we need to parse a potential coordinate.
+\sseq at DeclareDocumentCommandAs\sseq at kill@\kill {d()} {
+    \sseq at xsetthiscall{\string\kill\unexpanded\@xp{\sseq at dpage}\IfNoValueF{#1}{(#1)}}%
+    \sseq at parsecoord\coordinate{\IfNoValueTF{#1}{\lastclass}{#1}}{}%
+    \sseq at ifintexpr{\sseq at dpage}{%
+        \sseq at tempcount=\numexpr\sseq at dpage\relax % this is a convenient way to get rid of spaces because #3 has to be a number
+    }{%
+        \sseq at error@x{d-invalid-page}{\unexpanded\@xp{\sseq at dpage}}\sseq at break%
+    }%
+    \sseq at d@setpageminrec{class.\coordinate}{\the\sseq at tempcount}{coordinate}%  automatically handles \sseq at cleanup@obj
+    \sseq at breakpoint
+    \endgroup
+}
+
+% \sseq at d@grabpage is defined in sseqparsers.
+\sseq at DeclareDocumentCommand\d{o}{%
     \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 loadinputline
+    \def\sseq at dtype{d}
+    \def\sseq at d@theoptions{#1}
+    \sseq at d@grabpage\sseq at d@
+}
+
+\sseq at DeclareDocumentCommand\doptions{o}{%
+    \begingroup
+    \sseq at loadinputline
+    \def\sseq at dtype{doptions}
+    \def\sseq at d@theoptions{#1}
+    \sseq at d@grabpage\sseq at d@
+}
+
+\def\sseq at d@{
+    \ifsseq at tempif
+        \csname sseq@\sseq at dtype @grabcoord\@xp\endcsname
+    \else
+        \sseq at eval{\@nx\sseq at d@main{\sseq at dtype}{\unexpanded\@xp{\sseq at d@theoptions}}{\sseq at dpage}{\sseq at NoValue}{\sseq at NoValue}}
+        \sseq at breakpoint
+        \endgroup
+    \fi
+}
+
+\sseq at DeclareDocumentCommandAs\sseq at d@grabcoord\d{d()d()}{
+    \sseq at eval{\@nx\sseq at d@main{\sseq at dtype}{\unexpanded\@xp{\sseq at d@theoptions}}{\sseq at dpage}}{#1}{#2}
     \sseq at breakpoint
     \endgroup
 }
-\def\sseq at d@#1#2#3#4#5{%
-    \begingroup
+
+\sseq at DeclareDocumentCommandAs\sseq at doptions@grabcoord\doptions{d()d()}{
+    \sseq at eval{\@nx\sseq at d@main{\sseq at dtype}{\unexpanded\@xp{\sseq at d@theoptions}}{\sseq at dpage}}{#1}{#2}
+    \sseq at breakpoint
+    \endgroup
+}
+
+
+\def\sseq at d@main#1#2#3#4#5{%
     \sseq at options@firstpassmode
+    \def\sseq at edgetype{differential}
     \the\sseq at sseqstyle
     \the\sseq at edgestyle
     \the\sseq at differentialstyle
@@ -717,16 +913,15 @@
     \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 xsetthiscall{\@xp\string\csname#1\endcsname\IfNoValueF{#2}{\unexpanded{[#2]}}\unexpanded{#3}\IfNoValueF{#4}{\unexpanded{(#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{\@nx\sseq at dparsecoord{\the\sseq at tempcount}{\IfNoValueTF{#4}{\lastclass0}{\unexpanded{#4}}}{\unexpanded{#5}}}
     \sseq at eval{\unexpanded{\csname sseq at d@#1\endcsname{#2}}{\the\sseq at tempcount}}%
     \sseq at breakpoint
-    \endgroup
 }
 
 % #1 -- options
@@ -736,9 +931,9 @@
     \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
+    \ifsseq at drawdifferential % TODO: probably should get rid of invisible now that we have \kill...
+        \sseq at obj@xodef{d.#2\source\target.familylist}{\sseq at familylist}
         \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}}
@@ -759,6 +954,8 @@
         }%
     \fi
 %
+    \sseq at cleanup@obj{d.#2\source\target.familylist}
+    \sseq at obj@xoaddto{d.#2\source\target.familylist}{\sseq at familylist}
     \sseq at cleanup@obj{d.#2\source\target.options}
     \sseq at obj@xoaddto{d.#2\source\target.options}{\sseq at savedoptioncode}
 }
@@ -823,9 +1020,9 @@
     \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
+        on input line \sseq at inputline\sseq at error@inforeachloop
     }
-    \sseq at obj@xdef{\sseq at classgenname.deathline}{\the\inputlineno}
+    \sseq at obj@xdef{\sseq at classgenname.deathline}{\sseq at inputline}
     \sseq at tempiffalse
     \edef\sseq at temp{\the\sseq at foreachcall}
     \ifx\sseq at temp\pgfutil at empty\else\sseq at tempiftrue\fi
@@ -843,7 +1040,7 @@
 \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}
+    \edef\sseq at temp@ii{\sseq at inputline}
     \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
@@ -860,11 +1057,17 @@
     \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 drawtrue
+    \sseq at obj{#1.familylist}
+    \ifsseq at draw
+        \ifnum\sseq at thepagecount=\z@
             \sseq at drawdifferential{#1}
+        \else
+            \ifnum\sseq at obj{#1.page}>\sseq at thepagemm\relax
+                \ifnum\sseq at obj{#1.page}<\sseq at thepagemaxpp\relax
+                    \sseq at drawdifferential{#1}
+                \fi
+            \fi
         \fi
     \fi
 }
@@ -880,19 +1083,39 @@
 %%%
 %%% \structline and \structlineoptions
 %%%
-\sseq at DeclareDocumentCommand\structline{or()r()}{%
+
+\sseq at DeclareDocumentCommand\structline{od()}{%
     \begingroup
-    \sseq at xsetthiscall{\string\structline\IfNoValueF{#1}{\unexpanded{[#1]}}\unexpanded{(#2)(#3)}}%
-    \sseq at structline@main{structline}{#1}{#2}{#3}%
+    \sseq at loadinputline
+    \IfNoValueTF{#2}{
+        \sseq at structline@main{structline}{#1}{#2}{#2}
+    }{
+        \def\next{\sseq at structline@@{structline}{#1}{#2}}%
+        \@xptwo\next\sseq at trimleadingspaces
+    }
 }
-\sseq at DeclareDocumentCommand\structlineoptions{or()r()}{%
+\sseq at DeclareDocumentCommand\structlineoptions{od()}{%
     \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
+    \sseq at loadinputline
+    \IfNoValueTF{#2}{
+        \sseq at structline@main{structlineoptions}{#1}{#2}{#2}
+    }{
+        \def\next{\sseq at structlineoptions@@{structlineoptions}{#1}{#2}}%
+        \@xptwo\next\sseq at trimleadingspaces
+    }
 }
-\def\sseq at structline@main#1#2#3#4{%
+
+\sseq at DeclareDocumentCommandAs\sseq at structline@@\structline{mmmd()}{%
+    \sseq at structline@main{#1}{#2}{#3}{#4}
+}
+
+\sseq at DeclareDocumentCommandAs\sseq at structlineoptions@@\structlineoptions{mmmd()}{%
+    \sseq at structline@main{#1}{#2}{#3}{#4}
+}
+
+\def\sseq at structline@main#1#2#3#4{
+    \sseq at xsetthiscall{\string\structline\IfNoValueF{#2}{\unexpanded{[#2]}}\IfNoValueF{#3}{\unexpanded{(#3)}\IfNoValueF{#4}{\unexpanded{(#4)}}}}%
+    \def\sseq at edgetype{structline}
     \sseq at options@firstpassmode
     \the\sseq at sseqstyle
     \the\sseq at edgestyle
@@ -902,8 +1125,38 @@
     \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}%
+    \def\sourcename{#3}%
+    \def\targetname{#4}%
+    \IfNoValueTF{#3}{%
+        \def\sourcename{\lastclass1}%
+        \def\targetname{\lastclass}%
+    }{%
+        \IfNoValueT{#4}{%
+            \def\targetname{\lastclass}%
+        }%
+    }%
+    \sseq at parsecoord\source{\sourcename}{source of structure line}%
+    \sseq at parsecoord\target{\targetname}{target of structure line}%
+    \ifnum\xsource>\xtarget\relax
+        \sseq at parsedcoords@swap\source\target
+    \else
+        \ifnum\xsource=\xtarget\relax
+            \ifnum\ysource>\ytarget\relax
+                \sseq at parsedcoords@swap\source\target
+            \else
+                \ifnum\ysource=\ytarget\relax
+                    \ifnum\nsource>\ntarget\relax
+                        \sseq at parsedcoords@swap\source\target
+                    \else
+                        \ifnum\nsource=\ntarget\relax
+                            \sseq at error{structline-source-target-equal}%
+                            \@xp\sseq at break\romannumeral-`0
+                        \fi
+                    \fi
+                \fi
+            \fi
+        \fi
+    \fi
     \@ifundefined{sseq at structline@page}{%this is repeated in circleclasses
         \def\sseq at pagemin{0}
         \ifnum\sseq at obj{class.\source.num}>\z@
@@ -938,17 +1191,22 @@
         \sseq at cleanup@obj{structline.\source\target.num}
         \sseq at obj@inc{structline.\source\target.num}
     }{
+        \sseq at cleanup@obj{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}]}
+    % The following cleanup call is needed to prevent a glitch where if a \structline is made inside of a temporary sseqpage environment, then later attempts
+    % to put a structline throw a "structline already exists" error
+    \sseq at cleanup@obj{\sseq at structlinename.page}
     \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@xodef{\sseq at structlinename.familylist}{\sseq at familylist}
+    \sseq at cleanup@obj{\sseq at structlinename.options}
     \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{
@@ -980,6 +1238,7 @@
         \advance\sseq at tempcount\@ne
         \edef\sseq at structlinename{structline.\source\target[\the\sseq at tempcount]}
         \sseq at cleanup@obj{\sseq at structlinename.options}
+        \sseq at cleanup@obj{\sseq at structlinename.familylist}
         \ifsseq at needstikz
             \sseq at obj@gaddto{\sseq at structlinename.options}{\sseq at needstikztrue}
         \fi
@@ -986,14 +1245,17 @@
         \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}
+                \edef\sseq at familylist{\@nx\ifnum\sseq at thepagecount>\sseq at structline@page\relax\unexpanded\@xp{\sseq at familylist}\@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}
+                \edef\sseq at familylist{\@nx\ifnum\sseq at thepagecount<\sseq at structline@pagemax\relax\unexpanded\@xp{\sseq at familylist}\@nx\fi}
             }
         \fi
         \sseq at obj@xoaddto{\sseq at structlinename.options}{\sseq at savedoptioncode}
+        \sseq at obj@xoaddto{\sseq at structlinename.familylist}{\sseq at familylist}
     \ifnum\sseq at tempcount<\sseq at genmax\repeat
 }
 \def\sseq at structline@getgen#1{
@@ -1032,7 +1294,11 @@
     \bgroup
     \ifnum\sseq at thepagecount=\z@
         \ifnum\sseq at obj{#1[0].pagemin}=\z@
-            \sseq at structline@draw{#1[0]}
+            \sseq at drawtrue
+            \sseq at obj{#1[0].familylist}
+            \ifsseq at draw
+                \sseq at structline@draw{#1[0]}
+            \fi
         \fi
     \else
         \sseq at obj@pagetogen{#1}{\sseq at thepage} % sets \sseq at gen
@@ -1041,7 +1307,11 @@
                 \sseq at thispagetrue
             \fi
             \ifnum\sseq at obj{#1[\sseq at gen].pagemin}<\sseq at thepagecount
-                \sseq at structline@draw{#1[\sseq at gen]}
+                \sseq at drawtrue
+                \sseq at obj{#1[\sseq at gen].familylist}
+                \ifsseq at draw
+                    \sseq at structline@draw{#1[\sseq at gen]}
+                \fi
             \fi
         \fi
     \fi
@@ -1052,11 +1322,10 @@
 
 
 
-
-
 \newcount\sseq at circleclassuid
 \sseq at DeclareDocumentCommand\circleclasses{or()r()}{
     \begingroup
+    \sseq at loadinputline
     \def\sseq at keysfortikzprim{}
     \IfNoValueF{#1}{
         \sseq at processoptions{fit}{#1}
@@ -1089,6 +1358,7 @@
 %
 %
     \sseq at obj@xodef{\circleclassobjname.options}{\sseq at savedoptioncode}
+    \sseq at obj@xodef{\circleclassobjname.familylist}{\sseq at familylist}
     \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}}}
@@ -1112,12 +1382,115 @@
 \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
+    \sseq at drawtrue
+    \sseq at obj{#1.familylist}
+    \ifsseq at draw
+        \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
-        \ifnum\sseq at obj{#1.pagemin}<\sseq at thepagecount
-            \sseq at circleclass@draw{#1}{#2}{#3}
-        \fi
     \fi
-} 
\ No newline at end of file
+}
+
+%%
+%%  Labels
+%%
+%%    This code is called from the key value handler, but it has more to do with the code in this file so I am putting it here. Search in sseqkeys.code.tex for "Labels"
+%%
+
+\def\sseq 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
+
+% I can't remember why we need to defer this. If at some point I figure this out, I should explain why here and in the definition of \class...
+\def\sseq at handleclassquotes@inner#1#2{%
+    \begingroup\pgfscope
+    \def\sseq at classquotes@smugglehook{}
+    \def\sseq at classquotes@smugglehook at inner{}
+    \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}%
+    \sseq at classlabeltextfn{#1}% labeltextfn is a private handler, classlabeltextfn is exposed via "class label handler"
+    \ifsseq at classlabel
+        \sseq at options@firstpassmode
+        \the\sseq at outerclasslabelstyle
+        \sseq at x@addto at macro\sseq at classlabelnodes{%
+            \@nx\sseq at drawlabel{%
+                \sseq at maybemathswitch\unexpanded\@xp{\processedlabel}\sseq at maybemathswitch}%
+                {% This is setup to prevent a bug where \classoptions and class label style don't work correctly together
+                    \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
+                    \@nx\sseq at collections@labels at hook
+                    \@nx\sseq at collections@classlabels at hook
+                    \@nx\sseq at collections@outerclasslabels at hook
+                    \unexpanded\@xp{\sseq at savedoptioncode}%
+                }%
+        }%
+    \else
+        \let\sseq at classquotes@smugglehook\sseq at classquotes@smugglehook at inner
+        \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{\sseq at maybemathswitch\processedlabel\sseq at maybemathswitch}%
+        \xdef\sseq at classnodetextoptions{%
+            %\unexpanded{\def\pgfkeysdefaultpath{/sseqpages/class/node texts/}}%
+            \sseq at thelabelstyle\sseq at theclasslabelstyle\sseq at theinnerclasslabelstyle
+            \@nx\sseq at collections@labels at hook
+            \@nx\sseq at collections@classlabels at hook
+            \@nx\sseq at collections@innerclasslabels at hook
+            \unexpanded\@xp{\sseq at savedoptioncode}%
+        }%
+    \fi
+    \@xp\endpgfscope\@xp\endgroup
+    \sseq at classquotes@smugglehook
+}
+
+\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.
+        \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 collections@labels at hook
+                                \@nx\sseq at theedgelabelstyle
+                                \@nx\sseq at collections@edgelabels at hook
+                                \@xp\@nx\csname sseq at the\sseq at edgetype labelstyle\endcsname
+                                \@xp\@nx\csname sseq at collections@\sseq at edgetype labels at hook\endcsname
+                                \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}}
+                   }
+                }
+            }
+        }
+    }
+}
+
+

Modified: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmessages.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmessages.code.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqmessages.code.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,8 +1,8 @@
 %%
-%% Package: spectralsequences.sty version 1.0
+%% Package: spectralsequences v1.1.0
 %% Author: Hood Chatham
 %% Email: hood at mit.edu
-%% Date: 2017-06-18
+%% Date: 2017-08-02
 %% License: Latex Project Public License
 %%
 %% File: sseqmessages.code.tex
@@ -43,7 +43,7 @@
 %%
 %%    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 %%    !
-%%    ! sseqpages error: "index-too-large"
+%%    ! spectralsequences error: "index-too-large"
 %%    !
 %%    ! Index '-3' provided for target of structure line is too large -- only 1
 %%    ! classes exist at position (32,8).
@@ -55,7 +55,7 @@
 %%    !    \towergroupb (8*\n ,4*\n )                                           % Produced by \sseq at printstacktrace
 %%    !    \foreach \n in {2,3,4}
 %%    !
-%%    ! See the sseqpages documentation for further information.
+%%    ! See the spectralsequences documentation for further information.
 %%    !
 %%    ! Type <return> to continue.
 %%    !...............................................
@@ -66,6 +66,16 @@
 % Stack, thiscall, foreachcall.
 % Here we record what the user has said (as best we can tell)
 \newtoks\sseq at thiscalltoks
+
+% These guys are set up because I want \sseq at DeclareDocumentCommandAs@setinputline to work
+% but I want the definition of \sseq at inputline to be local, and it would be really bad to
+% open a group inside of sseq at DeclareDocumentCommandAs that has to be closed in the code.
+% So what I do is globally put it into \sseq at globalinputline using \sseq at setinputline
+% and then after starting the group at the beginning of the actual macro body,
+% call \sseq at loadinputline
+\def\sseq at setinputline{\xdef\sseq at globalinputline{\the\inputlineno}}
+\def\sseq at loadinputline{\let\sseq at inputline\sseq at globalinputline}
+
 \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}}}
@@ -85,7 +95,9 @@
     \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}
+    \sseq at eval{\sseq at topofstacktrace{\unexpanded{#1}\sseq at possibleoninputlinedash}}
+    \let\sseq at possibleoninputlinedash\empty
+    \let\sseq at possibleoninputlinepar\empty
 }
 \def\sseq at opushstacktrace#1{\@xp\sseq at pushstacktrace\@xp{#1}}
 \def\sseq at stack@unexpanded#1{\@nx\sseq at stack@unexpanded\unexpanded{{#1}}}
@@ -116,11 +128,14 @@
 
 \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 inputline{\the\inputlineno}
+\def\sseq at error@inforeachloop{\sseq at possibleoninputlinepar\sseq at possibleperiod}
+\def\sseq at error@inforeachloop at active{\sseq at possiblecomma in loop 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 possibleoninputlinepar{ (on input line \sseq at inputline)} % let this to a no-op at beginning of usermacros
+\def\sseq at possibleoninputlinedash{ -- on input line \sseq at inputline}
+
 \def\sseq at possiblecomma{,\space}
 \def\sseq at possibleperiod{.}
 \def\sseq at possibleperiodb{.}
@@ -151,7 +166,7 @@
     \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}
+\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.
 
@@ -195,10 +210,11 @@
 
 \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@setup at errorinfo\sseq at error@setup at errorinfo@active
     \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
+    \sseq at foreachcall\@xp{\string\foreach} % Stack gets pushed at the beginning of the body of the foreach loop once we know what the call looks like
 }
 
 
@@ -219,6 +235,18 @@
     \fi
 }
 
+%%
+%%  \sseq at checkend
+%%
+\def\sseq at checkend#1{
+    \def\sseq at tempa{#1}
+    \ifx\sseq at tempa\@currenvir\else % mismatch
+        \sseq at error@n{endenv-mismatch}{#1}
+        \csname end\@currenvir\endcsname % run the \end code for the correct environment
+        \def\@currenvir{#1} % Prevent \@checkend from throwing a second redundant error
+        \@xp\sseq at break % don't run the code \end for this environment
+    \fi
+}
 
 
 
@@ -232,21 +260,21 @@
 \ExplSyntaxOn
 \char_set_catcode_space:N\ % Needed to make pretocmd work -- there are always spaces after every command, and they need to be retokenized as spaces
 
-\def\sseqerrortowarning#1{ \msg_redirect_name:nnn { sseqpages } { #1 } { warning } }
+\def\sseqerrortowarning#1{ \msg_redirect_name:nnn { spectralsequences } { #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 error     {\msg_error:nn    {spectralsequences}}
+\def\sseq at error@n   {\msg_error:nnn   {spectralsequences}}
+\def\sseq at error@nn  {\msg_error:nnnn  {spectralsequences}}
+\def\sseq at error@nnn {\msg_error:nnnnn {spectralsequences}}
+\def\sseq at error@nnnn{\msg_error:nnnnnn{spectralsequences}}
+\def\sseq at error@x   {\msg_error:nnx   {spectralsequences}}
+\def\sseq at error@xx  {\msg_error:nnxx  {spectralsequences}}
+\def\sseq at error@xxx {\msg_error:nnxxx {spectralsequences}}
+\def\sseq at error@xxxx{\msg_error:nnxxxx{spectralsequences}}
+\def\sseq at warning   {\msg_warning:nn{spectralsequences}}
 
-\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}}
+\def\sseq at newerror#1#2{\msg_new:nnn{spectralsequences}{#1}{#2}}
+\def\sseq at newerror@internal#1#2{\msg_new:nnn{spectralsequences}{#1}{Internal error: #2 \sseq at contactpackageauthor}}
 \edef\sseq at contactpackageauthor{Contact package author \sseq at authorname\space at \sseq at authoremail.}
 
 
@@ -269,7 +297,7 @@
 \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}
+    \msg_error:nn{spectralsequences}{msg-patch-failed}
     \def\sseq at installmsghooks{}
     \sseq at break
 }
@@ -307,20 +335,20 @@
 %%
 %%
 \@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{pgfkeys-patch-failed}{Failed to patch the key value system. Setting all commands to do nothing and quitting. Your copy of tikz is newer than the version spectralsequences was designed for and seems to be incompatible with core features.}
+    \sseq at newerror@internal{fit-patch-failed}{Failed to patch fit. \@nx\circleclasses won't work. Your copy of tikz is newer than the version spectralsequences was designed for and seems to be incompatible with \string\circleclasses.}
+    \sseq at newerror@internal{foreach-patch-failed}{Failed to patch \string\foreach. The errors spectralsequences provides will be less comprehensive. Your copy of tikz is newer than the version spectralsequences was designed for and seems to be incompatible with parts of the error handling system.}
     \sseq 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{pgfkeys-patch-failed}{Failed to patch the key value system. Setting all commands to do nothing and quitting. Your copy of tikz is older than the version spectralsequences was designed for and seems to be incompatible with core features. Update tikz!}
+    \sseq at newerror{fit-patch-failed}{Failed to patch fit. \@nx\circleclasses won't work. Your copy of tikz is older than the version spectralsequences was designed for and seems to be incompatible with \string\circleclasses. Update tikz!}
+    \sseq at newerror{foreach-patch-failed}{Failed to patch \string\foreach. The errors spectralsequences provides will be less comprehensive. Your  copy of tikz is older than the version spectralsequences was designed for and seems to be incompatible with parts of the error handling system.}
     \sseq 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 }
+    \msg_critical:nn { spectralsequences } { pgfkeys-patch-failed }
 }
 
 
@@ -332,10 +360,20 @@
 
 %%
 %%
+%% loadstore
+%%
+%%
+\sseq at newerror@internal{illegal-add-background-mode}{\string#1 occurred in background mode.}
+
+
+
+%%
+%%
 %% 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@internal{U-xparse-incompatible}{The 'U' argument type is incompatible with the current version of xparse.}
+\sseq at newerror{won't-override-builtin}{Macro '#1' is a spectralsequences 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.}
@@ -357,10 +395,10 @@
     If you need to have this many classes in this position, you can make your own class pattern with \string\sseqnewclasspattern, but you might want to consider alternatives like using one class to represent multiple generators in some way -- it is hard to make a diagram look good with large numbers of classes in one position.%
 }
 
-\sseq 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{invalid-coordinate}{Invalid #1coordinate\sseq at printforerrortype.}
+\sseq at newerror{no-classes}{No classes yet exist in #1\sseq at printerrortype{, the }.}
+\sseq at newerror{index-too-large}{Index '#1' provided\sseq at printforerrortype\ is too large -- only #2 classes exist at position #3.}
+\sseq at newerror{undefined-tag}{Index '#1' provided\sseq at printforerrortype\ 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.}
@@ -378,14 +416,18 @@
 \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
+%% foreach
 %%
 %%
-\sseq at newerror{illegal-add-background-mode}{\string#1 occurred in background mode.} % Should be impossible to trigger
+\sseq at newerror{DoUntil-no-bound}{You used #1 but specified neither an x range nor a y range.}
+\sseq at newerror{DoUntil-no-progress}{You used #1 but the loop body you provided seems to be making no progress towards the boundary.}
+\sseq at newerror{Do-invalid-int-expr}{Argument "#2" to #1 is not a valid integer expression.}
 
+
+
+
 %%
 %%
 %% keys
@@ -416,12 +458,20 @@
     You can only use '#1' as an option for tikz primitives, not for \@nx\class, \@nx\replaceclass, \@nx\classoptions, \@nx\d, \@nx\doptions, \@nx\structline, or \@nx\structlineoptions.%
 }
 
+\sseq at newerror{invalid-intexpr}{The value '#2' provided for key '#1' is not a valid integer expression.}
+\sseq at newerror{invalid-positive-intexpr}{The value '#2' provided for key '#1' does not evaluate to a positive integer.}
+\sseq at newerror{invalid-dimenexpr}{The value '#2' provided for key '#1' is not a valid dimension expression.}
+\sseq at newerror{invalid-color}{The value '#2' provided for key '#1' is not a valid color or color expression.}
+\sseq at newerror{invalid-axis-type}{The value '#1' provided for '\sseq at axistypekey{#2}' is not valid. Valid values for '\sseq at axistypekey{#2}' are: \sseq at validaxestypes}
+
 \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{invalid-scale}{You said '#1scale=#2' as a global option, but '#2' is not a valid pgf math expression.}
+\sseq at newerror{unit-scale}{You said '#1scale=#2' as a global option, but '#2' is not a scalar.}
 \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
+    no coordinate transforms are allowed in the body of sseqpage or sseqdata other than shifts by unit-free integers
     except as options for tikz primitives or for scopes that only contain tikz primitives. If you need a coordinate transformation,
     first use the option 'standard parse'.%
 }
@@ -451,6 +501,7 @@
 %%
 %%
 
+\sseq at newerror{endenv-mismatch}{\string\begin {\@currenvir }\@currenvline \space ended by \string\end {#1}. I'm going to run the code for \string\end{\@currenvir} instead.}
 \sseq 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'.}
@@ -462,7 +513,10 @@
 
 \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{range-overflow}{The #1 range #2 is too large. The maximum #1 range to fit on the page with the current #1scale and plot options is #1max - #1min = #3. The maximum #1scale possible with the current #1range is #4. Either change the scale or the range as appropriate.}
+\sseq at newerror{range-super-overflow}{The #1 range #2 is too large. The maximum range possible is #1max - #1min = 16383 because of internal limitations of etex. }
+
+\sseq at newerror{index-out-of-bounds}{Index #1 is greater than or equal to the current stack depth #2. Valid indices must be strictly less than the stack depth.}
 \sseq 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.}
 
 
@@ -477,7 +531,6 @@
 \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.}
@@ -503,6 +556,7 @@
 \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?}
+\sseq at newerror{structline-source-target-equal}{The source and target of a \@nx\structline cannot be equal.}
 
 
 \ExplSyntaxOff

Modified: trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqparsers.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqparsers.code.tex	2017-08-03 00:17:47 UTC (rev 44941)
+++ trunk/Master/texmf-dist/tex/latex/spectralsequences/sseqparsers.code.tex	2017-08-03 21:07:30 UTC (rev 44942)
@@ -1,8 +1,8 @@
 %%
-%% Package: spectralsequences.sty version 1.0
+%% Package: spectralsequences v1.1.0
 %% Author: Hood Chatham
 %% Email: hood at mit.edu
-%% Date: 2017-06-18
+%% Date: 2017-08-02
 %% License: Latex Project Public License
 %%
 %% File: sseqparsers.code.tex
@@ -11,11 +11,32 @@
 %%    ExplSyntaxOn for this whole file!
 
 \ExplSyntaxOn
+\let\sseq at NoValue\c__xparse_no_value_tl
 
+\protected\def\sseqparseint#1#2{
+    \sseq at ifintexpr{#2+0}{ % +0 here to prevent \lastx from freaking out if it's at the end of #2.
+        \edef#1{\the\numexpr#2\relax}
+    }{
+        \sseq at error{invalid-int-expr}
+    }
+}
 
+% WARNING: doesn't work =(
+\def\sseq at ifint#1{
+    \ifcat$\romannumeral0#1$
+        \prg_return_true:
+    \else
+        \ifcat$\romannumeral-0#1$
+            \prg_return_true:
+        \else
+            \prg_return_false:
+        \fi
+    \fi
+}
+
 % Prevent \protect from causing trouble for \pgfmathparse
 \let\sseq at pgfmathparse@orig\pgfmathparse
-\def\sseq at pgfmathparse#1{\let\@@protect\protect\def\protect{}\sseq at pgfmathparse@orig{#1}\restore at protect}
+\protected\def\sseq at pgfmathparse#1{\let\@@protect\protect\def\protect{}\sseq at pgfmathparse@orig{#1}\restore at protect}
 
 
 %%% ifpgfmathexpr
@@ -24,17 +45,20 @@
 % #3 -- false case
 % This tests true if \pgfmathparse{#1} throws an error or not. Luckily, \pgfmathparse pipes its errors through \pgfmath at error so this is easy.
 \def\sseq at ifpgfmathexpr#1{
-    \bgroup
+    \begingroup
     \let\protect\pgfutil at empty
     \global\sseq at gtempiftrue
-    \def\pgfmath at error##1##2{\global\sseq at gtempiffalse}
+    \def\pgfmath at error##1##2{\global\sseq at gtempiffalse\sseq at closegroups\sseq at break}
+    \def\sseq at groupflag{}
     \pgfmathparse{#1}
+    \global\let\ifpgfmathunitsdeclared\ifpgfmathunitsdeclared
     \ifpgfmathunitsdeclared
         \xdef\sseq at mathresult{\pgfmathresult pt}
     \else
         \xdef\sseq at mathresult{\pgfmathresult}
     \fi
-    \egroup
+    \endgroup
+    \sseq at breakpoint
     \ifsseq at gtempif
         \@xp\@firstoftwo
     \else
@@ -42,7 +66,9 @@
     \fi
 }
 
+\def\sseq at closegroups{\ifx\sseq at groupflag\empty\endgroup\@xp\sseq at closegroups\fi}
 
+
 % Test if single token input is a digit
 \def\sseq at ifdigit#1{
     \ifodd0
@@ -75,21 +101,13 @@
 % 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}%
+    \sseq at ifintexpr@{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
-
+% also we use it to detect spaces. Store the state in \sseq at ifintexpr@state first.
 \def\sseq at ifintexpr@#1{\def\sseq at ifintexpr@state{#1}\futurelet\testtok\sseq at ifintexpr@@}
 \def\sseq at ifintexpr@@{%
     \ifx\testtok\bgroup%
@@ -98,12 +116,10 @@
         \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}
+            % This messes up \sseq at ifintexpr@@@ because it doesn't expect \string#1 to produce no characters.
+            \@xp\ifx\space\testtok
+                \def\next{\sseq at ifintexpr@next{\space}\@xp\next\romannumeral-`0}
             \else
                 \let\next\sseq at ifintexpr@@@
             \fi
@@ -116,28 +132,24 @@
     \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
+        % This is a macro, so fexpand it
         % Then use f expansion.
-        \@xp\@xp\@xp\sseq at ifintexpr@@@fexpcs\@xp\@xp\@xp#1\@xp\@gobble
+        \@xp\sseq at ifintexpr@@@fexpcs\@xp#1
     \fi
 }
 
-% Unfortunately, if we have a macro that takes an argument inside another macro that takes an argument, this will fail (the inside macro will get a space) but such is life.
 \def\sseq 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
+        \@xp\sseq at ifintexpr@false % We already tested for groups above, so we need to check if this expanded to a group
     \else
-        \@xp\sseq at ifintexpr@@@@
+        \@xp\sseq at ifintexpr@@@@ % If it's still a control sequence, then this will fail in the \pgfutil at ifundefined step
     \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,
@@ -161,7 +173,9 @@
                             \ifx#1/%
                                 \sseq at ifintexpr@next{*/}
                             \else
-                                \pgfutil at ifundefined{sseq at ifintexpr@@\sseq at ifintexpr@state @#1}%
+                                % This extra \string here is so that if a control sequence fexpanded and still gave a control sequence,
+                                % we don't get a missing \endcsname error here, it just returns false
+                                \pgfutil at ifundefined{sseq at ifintexpr@@\sseq at ifintexpr@state @\string#1}%
                                     {\let\next\sseq at ifintexpr@false}%
                                     {\sseq at ifintexpr@next{#1}}%
                             \fi
@@ -173,11 +187,9 @@
     \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 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}
 
@@ -220,7 +232,96 @@
 \sseq at makeifint{nointallowed}{\space}{\sseq at ifintexpr@{nointallowed}}
 
 %%
+%% This parser defines the syntax for the page argument of \d.
 %%
+\def\sseq at d@grabpage#1{
+    \let\sseq at grabdpage@return#1
+    \futurelet\testtok\sseq at grabdpage@
+}
+
+\def\sseq at grabdpage@{
+    \sseq at tempiftrue
+    \ifx\testtok\bgroup
+        \let\next\sseq at grabdpage@group
+    \else
+        \def\sseq at dpage{}
+        \let\next\sseq at grabdpage@norm
+    \fi
+    \next
+}
+
+\def\sseq at grabdpage@group#1{\def\sseq at dpage{#1}\sseq at grabdpage@return}
+
+\def\sseq at grabdpage@norm{
+    \futurelet\testtok\sseq at grabdpage@norm@
+}
+
+\def\sseq at grabdpage@norm@{
+    \let\next\sseq at grabdpage@token
+    \ifx\testtok\bgroup
+        \sseq at tempiffalse
+        \let\next\sseq at grabdpage@return
+    \else
+        \ifx\testtok\par
+            \sseq at tempiffalse
+            \let\next\sseq at grabdpage@return
+        \else
+            \ifx\testtok(
+                \let\next\sseq at grabdpage@return
+            \else
+                \@xp\ifx\space\testtok
+                    \let\next\sseq at grabdpage@space
+                \fi
+            \fi
+        \fi
+    \fi
+    \next
+}
+
+\def\sseq at grabdpage@space{\sseq at d@addto at macro\sseq at dpage{~}\@xp\sseq at grabdpage@norm\romannumeral-`0}
+
+\def\sseq at grabdpage@token#1{
+    \ifcat$\@xp\@gobble\string#1$%
+        \sseq at d@addto at macro\sseq at dpage{#1}
+        \@xp\sseq at grabdpage@norm
+    \else
+        \ifx#1\end
+            \sseq at tempiffalse
+            \@xp\sseq at grabdpage@return\@xp#1\romannumeral-`0
+        \else
+            \ifx#1\begin
+                \sseq at tempiffalse
+                \@xp\sseq at grabdpage@return\@xp#1\romannumeral-`0
+            \else
+                \@xp\sseq at grabdpage@token at fexpcs\@xp#1\romannumeral-`0
+            \fi
+        \fi
+    \fi
+}
+
+\def\sseq at grabdpage@token at fexpcs{\exp_last_unbraced:Nf\sseq at grabdpage@token at fexpcs@}
+\def\sseq at grabdpage@token at fexpcs@{\futurelet\testtok\sseq at grabdpage@token at fexpcs@@}
+\def\sseq at grabdpage@token at fexpcs@@{
+    \ifx\testtok\bgroup
+        \sseq at tempiffalse
+        \@xp\sseq at grabdpage@return
+    \else
+        \@xp\sseq at grabdpage@token at fexpcs@@@
+    \fi
+}
+\def\sseq at grabdpage@token at fexpcs@@@#1{
+    \ifcat$\@xp\@gobble\string#1$%
+        \sseq at d@addto at macro\sseq at dpage{#1}
+        \@xp\sseq at grabdpage@norm
+    \else
+        \sseq at tempiffalse
+        \@xp\sseq at grabdpage@return
+    \fi
+}
+
+
+%%
+%%
 %%          New Class Pattern
 %%
 %%
@@ -354,11 +455,6 @@
 %%                                                    %%
 %%%%%%                                            %%%%%%
 
-% Only works for full coordinates. Used for error checking in \replaceclass and \d.
-\def\sseq 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}
 
@@ -378,7 +474,8 @@
 %      inside of an hbox.
 
 \def\sseq at errortype{}
-\def\sseq at printerrortype{\@xp\sseq at ifempty\@xp{\sseq at errortype}{}{~ for ~ \sseq at errortype}}
+\def\sseq at printerrortype#1{\@xp\sseq at ifempty\@xp{\sseq at errortype}{}{#1 \sseq at errortype}}
+\def\sseq at printforerrortype{\sseq at printerrortype{~for~}}
 
 %% Pulls off x,y and evaluates them, puts n or empty into a separate variable.
 % #1 -- a coordinate of the form {x,y} or {x,y,stuff}
@@ -390,7 +487,7 @@
     \pgfutil at in@ \sseq at protecterror { #1 }
     \ifpgfutil at in@
         \bgroup
-        \sseq at restorefont
+        \sseq at restorefont % This prevents "Missing character" stuff from being written to the log.
         \let\sseq at protecterror\relax
         \setbox0=\hbox{#1} % Trigger the error message
         \egroup
@@ -498,8 +595,11 @@
     \ifx\sseq at index\pgfutil at empty
         \@xp\sseq at parsecoord@index
     \fi
+    % TODO: clean this up a bit? it's pretty ad-hoc.
+    % Whenever you update this, make sure to update sseq at paredcoords@swap below too.
     \@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 n\sseq at macroname#1\endcsname\sseq at index
     \@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}
@@ -508,6 +608,26 @@
     \@xp\edef\csname\sseq at macroname#1 at internalname\endcsname{sseq{\sseq at xycoord,\sseq at index}}%
 }
 
+% #1 & #2 -- the two base commands that were handed to \sseq at parsecoord to swap.
+% This is only used in \structline to normalize the name of structure lines, so that sseqpages knows what you are talking about
+% if you say \structline(coorda)(coordb) and then later \structline(coordb)(coorda)
+\cs_new:Npn \sseq_swapmacros:NN #1#2 {
+    \let\sseq at temp#1 \let#1#2 \let#2\sseq at temp
+}
+\cs_generate_variant:Nn \sseq_swapmacros:NN { cc }
+
+\def\sseq at parsedcoords@swap#1#2{
+    \sseq_swapmacros:cc { x\sseq at macroname#1 } { x\sseq at macroname#2 }
+    \sseq_swapmacros:cc { y\sseq at macroname#1 } { y\sseq at macroname#2 }
+    \sseq_swapmacros:cc { n\sseq at macroname#1 } { n\sseq at macroname#2 }
+    \sseq_swapmacros:cc { \sseq at macroname#1 at partial } { \sseq at macroname#2 at partial }
+    \sseq_swapmacros:NN #1 #2
+    \sseq_swapmacros:cc { \sseq at macroname#1nopar } { \sseq at macroname#2nopar }
+    \sseq_swapmacros:cc { \sseq at macroname#1name } { \sseq at macroname#2name }
+    \sseq_swapmacros:cc { \sseq at macroname#1nameunbraced } { \sseq at macroname#2nameunbraced }
+    \sseq_swapmacros:cc { \sseq at macroname#1 at internalname } { \sseq at macroname#2 at internalname }
+}
+
 % 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}%
@@ -522,7 +642,7 @@
     \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\nodenum{\sseq at obj@ifundef{partcoord.(\partialcoord).numnodes}{1}{\the\numexpr\sseq at obj{partcoord.(\partialcoord).numnodes}+1}}%
     \edef\coordnopar{\xcoord,\ycoord,\nodenum}
     \edef\coord{(\coordnopar)}%
 }
@@ -540,7 +660,7 @@
         \@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.
@@ -553,6 +673,11 @@
         \fi
     \fi
     \let\sourcecoord\sseq at xycoord
+%
+    \let\xsource\sseq at xcoord
+    \let\ysource\sseq at ycoord
+    \let\nsource\sseq at index
+%
     \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)}
@@ -565,6 +690,9 @@
         \sseq at parsecoord@index
         \let\targetcoord\sseq at xycoord
         \edef\target{(\sseq at xycoord,\sseq at index)}%
+        \let\xtarget\sseq at xcoord
+        \let\ytarget\sseq at ycoord
+        \let\ntarget\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
@@ -587,7 +715,7 @@
 \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}}}}
+\protected\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}
@@ -600,14 +728,15 @@
     }%
 }
 
-\def\sseq at parsecoordinate#1#2{%
+% EXPOSE: a wrapper around \sseq at parsecoord.
+\sseq at DeclareDocumentCommand\parsecoordinate { m r() }{%
     \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}%
+% EXPOSE: a wrapper around \sseq at dparsecoord.
+\sseq at DeclareDocumentCommand \parsedifferential { m r() d() }{%
+    \sseq at dparsecoord{#1}{#2}{#3}%
 }
 
 % Expandable coordinate parsing for \isalive.
@@ -659,23 +788,25 @@
 %%% 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
+% This maybe should be moved into sseqmain.code.tex...
+\sseq at addtostorelist\sseq at stacktop{}
+\def\sseq at stackitem#1#2{\csname sseq.\sseq at thename.stack.#1.#2\endcsname} % gobble #2 which we added in for the error message
+\def\sseq at getstackentry#1#2{
+    \ifnum#1<\sseq at stackdepth
+        \exp_args:No\sseq at getstackentry@{\sseq at stacktop}{#1}{#2}
+    \else
+        \sseq at protecterror{\sseq at error@xx{index-out-of-bounds}{#1}{\the\sseq at stackdepth}}
+    \fi
 }
 
 \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}
-        }}
+        { \sseq at stackitem{#1} }
+        { \exp_args:Nco\sseq at getstackentry@ { sseq.\sseq at thename.stack.#1.next } { \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){
+\protected\def\sseq at pushstack(#1){
     \bgroup
     \sseq at parsecoord\temp{#1}{}
     \sseq at pushstack@\temp
@@ -682,6 +813,7 @@
     \egroup
 }
 
+% Note that \class directly calls pushstack@ to avoid reparsing the coordinate
 \def\sseq at pushstack@{\@xp\sseq at pushstack@@}
 
 \def\sseq at pushstack@@(#1,#2,#3){
@@ -696,11 +828,11 @@
 
 
 \newcount\sseq at userstacksavecount
-\def\sseq at savestack{
+\protected\def\sseq at savestack{
     \global\advance\sseq at userstacksavecount\@ne
     \sseq at savestack@name{usersave@\the\sseq at userstacksavecount}
 }
-\def\sseq at restorestack{
+\protected\def\sseq at restorestack{
     \sseq at restorestack@name{usersave@\the\sseq at userstacksavecount}
     \global\advance\sseq at userstacksavecount\m at ne
 }
@@ -714,17 +846,19 @@
     % if #1 consists of a single nonnegative integer then -0#1 will be turned into some nonpositive integer
     % and romannumeral produces no output when handed a nonpositive integer, so the result will be empty.
     % If #1 has any nonnumerical tokens or is negative, there will be left over stuff.
+    %
+    % We also have to subtract off \sseq at x so that this behaves correctly inside of a scope (the \lastx value should be unshifted)
     \@xp\sseq at ifempty\@xp{\romannumeral-0#1}{
-        \sseq at getstackentry{#1}{lastx}
+        \the\numexpr\sseq at getstackentry{#1}{lastx}-\sseq at x\relax
     }{
-        \sseq at getstackentry{0}{lastx}#1 % #1 isn't a number so put it back
+        \the\numexpr\sseq at getstackentry{0}{lastx}-\sseq at x\relax#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}
+        \the\numexpr\sseq at getstackentry{#1}{lasty}-\sseq at y\relax
     }{
-        \sseq at getstackentry{0}{lasty}#1 % #1 isn't a number so put it back
+        \the\numexpr\sseq at getstackentry{0}{lasty}-\sseq at y\relax#1 % #1 isn't a number so put it back
     }
 }
 
@@ -737,16 +871,22 @@
 }
 
 
-\def\sseq at nameclass#1(#2){
+\sseq at DeclareDocumentCommand\nameclass {mr()} {
     \bgroup
+    \sseq at setthiscall{\sseq at nameclass#1(#2)}
+    \let\sseq at possibleoninputlinepar\empty
     \sseq at parsecoord\coord{#2}{}
     \sseq at cleanup@obj{class.namedclass.#1}
     \sseq at obj@xdef{class.namedclass.#1}{\coordnopar}
+    \sseq at breakpoint
     \egroup
 }
 
-\def\sseq at tagclass#1(#2){%
+\sseq at DeclareDocumentCommand\tagclass{mr()}{
     \bgroup
+    \sseq at setthiscall{\tagclass#1(#2)}
+    \let\sseq at possibleoninputlinepar\empty
+    \def\sseq at class@tag{#1}
     \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
@@ -755,11 +895,14 @@
     \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}%
+    \sseq at breakpoint
     \egroup
 }
 
-\def\sseq at gettag#1(#2){
+\sseq at DeclareDocumentCommand\gettag{mr()}{
     \bgroup
+    \sseq at setthiscall{\gettag#1(#2)}
+    \let\sseq at possibleoninputlinepar\empty
     \sseq at parsecoord\coord{#2}{}
     \sseq at obj@ifdef{class.\coord.tag}{
         \xdef#1{\sseq at obj{class.\coord.tag}}
@@ -766,13 +909,46 @@
     }{
         \sseq at error@n{class-no-tag}{(#2)}
     }
+    \sseq at breakpoint
     \egroup
 }
 
+\prg_new_conditional:Npnn \sseq_if_out_of_bounds:n #1 { T ,  F , TF } {
+    \bgroup
+    \sseq at tempiftrue
+    \sseq at parsecoord\coord{#1}{}
+    \@gobbletwo\sseq at breakpoint\sseq at tempiffalse % this executes \sseq at tempiffalse if we broke, otherwise it gets gobbled
+    \ifsseq at tempif
+        \sseq_if_out_of_bounds_noparse:nnTF { \xcoord } { \ycoord }{\egroup\prg_return_true:}{\egroup\prg_return_false:}
+    \else
+        \egroup
+        \prg_return_false
+    \fi
+}
 
+% For internal use b/c it's faster not to call \sseq at parsecoord
+% There's no noticeable performance boost though... =(
+\prg_new_conditional:Npnn \sseq_if_out_of_bounds_noparse:nn #1#2 {TF} {
+    \sseq at tempiftrue
+    \ifnum#1<\sseq at xmaxpp\relax\ifnum#1>\sseq at xminmm\relax\ifnum#2<\sseq at ymaxpp\relax\ifnum#2>\sseq at yminmm\relax
+        \sseq at tempiffalse
+    \fi\fi\fi\fi
+    \ifsseq at tempif
+        \prg_return_true:
+    \else
+        \prg_return_false:
+    \fi
+}
 
 
+\sseq at DeclareDocumentCommand \IfOutOfBoundsTF { r() } { \sseq_if_out_of_bounds:nTF { #1 } }
+\sseq at DeclareDocumentCommand \IfOutOfBoundsT  { r() } { \sseq_if_out_of_bounds:nT  { #1 } }
+\sseq at DeclareDocumentCommand \IfOutOfBoundsF  { r() } { \sseq_if_out_of_bounds:nF  { #1 } }
+\sseq at DeclareDocumentCommand \IfInBoundsTF { r() mm } { \sseq_if_out_of_bounds:nTF { #1 } { #3 } { #2 } }
+\sseq at DeclareDocumentCommand \IfInBoundsT  { r() } { \sseq_if_out_of_bounds:nF  { #1 } }
+\sseq at DeclareDocumentCommand \IfInBoundsF  { r() } { \sseq_if_out_of_bounds:nT  { #1 } }
 
+
 %%%%%%
 %%%
 %%%   Tikz Primitives
@@ -788,7 +964,7 @@
 }
 \def\sseq at modtikzcommands@#1{%
     \ifx#1\sseq at nil\else
-        \edef#1{\@xp\@nx\csname\sseq at macroname#1\space\endcsname\@nx#1}%
+        \protected\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
@@ -797,6 +973,8 @@
 \def\sseq at defer@tikzcommand#1{%
     \begingroup
     \let\sseq at isaliveprotect\sseq at isaliveprotect@protect
+    \sseq at setinputline
+    \sseq at loadinputline
     \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}
@@ -836,7 +1014,7 @@
 \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}}]}%
+        \sseq at x@addto at macro\sseq at thepathsofar{[/utils/exec={\unexpanded\@xp{\@xp\sseq at options@bothpassmode\sseq at savedoptioncode}}]}%
     \fi
     \sseq at g@addto at macro\sseq at whattheusersaid{[#1]}
     \sseq at defer@tikzcommand@
@@ -927,14 +1105,14 @@
     \sseq at defer@tikzcommand at finish@
 }
 
-% If the expression was incomplete, we'll jump here
+% If the expression was incomplete, we'll jump here to avoid adding the semicolon to the error printout
 \def\sseq 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}}%
+        \sseq at savedpaths@xaddtikzpath{\unexpanded\@xp{\sseq at thepathsofar}}%
     \else
-        \sseq at savedpaths@xadd{%
+        \sseq at savedpaths@xaddtikzpath{%
             \@nx\sseq at tikzcommand@conditionaldraw{\unexpanded\@xp{\sseq at thepathsofar}}{\unexpanded\@xp{\sseq at pageconstraint}}
         }%
     \fi
@@ -1151,7 +1329,6 @@
 }
 
 
-%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)%
@@ -1262,17 +1439,6 @@
     \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
@@ -1281,12 +1447,8 @@
         \egroup
         \let\next\@gobble
     \else
-        \@xp\ifx\space\testtok % not sure why I have to test for spaces like this -- figured it out with trial and error, like in \ifintexpr
-            % I'm not really sure why a space can show up here, but it crashes the macro and we don't care about spaces.
-            % I can't \@gobble the space because it will ignore it and take the next argument. What I can do is \@firstofone it away, but that deletes braces
-            % and in our case it's safe to put in extra braces but not to delete them. So I have \sseqnormalizemonomial at id...
-            % LaTeX is really really weird.
-            \def\next{\@xp\futurelet\@xp\testtok\@xp\sseqnormalizemonomial at testend\romannumeral-`0\sseqnormalizemonomial at id}
+        \@xp\ifx\space\testtok
+            \def\next{\@xp\futurelet\@xp\testtok\@xp\sseqnormalizemonomial at testend\romannumeral-`0}
         \else
             \let\next\sseqnormalizemonomial@
         \fi



More information about the tex-live-commits mailing list