summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/spectralsequences/manual
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/pgf/contrib/spectralsequences/manual
Initial commit
Diffstat (limited to 'graphics/pgf/contrib/spectralsequences/manual')
-rw-r--r--graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-KORP8.tex34
-rw-r--r--graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-class-page2a.tex24
-rw-r--r--graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-class-page2b.tex18
-rw-r--r--graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-imJ.tex32
-rw-r--r--graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-insert.tex33
-rw-r--r--graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-tikz.tex25
-rw-r--r--graphics/pgf/contrib/spectralsequences/manual/pgfmanual-en-macros.tex1762
-rw-r--r--graphics/pgf/contrib/spectralsequences/manual/spectralsequences-howitworks.pdfbin0 -> 238471 bytes
-rw-r--r--graphics/pgf/contrib/spectralsequences/manual/spectralsequences-howitworks.tex121
-rwxr-xr-xgraphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual-draftmode.pdfbin0 -> 902727 bytes
-rw-r--r--graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual-layoutcharts.tex205
-rw-r--r--graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual.pdfbin0 -> 842250 bytes
-rw-r--r--graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual.tex2087
-rw-r--r--graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanualpreamble.tex546
-rwxr-xr-xgraphics/pgf/contrib/spectralsequences/manual/sseqmanualtest.tex0
15 files changed, 4887 insertions, 0 deletions
diff --git a/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-KORP8.tex b/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-KORP8.tex
new file mode 100644
index 0000000000..f5a767b2de
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-KORP8.tex
@@ -0,0 +1,34 @@
+
+
+\NewSseqCommand \KOstar {m}{
+ \begin{scope}[ xshift = -#1, xshift = 8*\b, yshift = #1 ]
+ \class[rectangle, name = b^{\b}[0]](0,0)
+ \class[name = b^{\b} e[0]](1,0) \structline
+ \class[name = b^{\b} e^2[0]](2,0) \structline
+ \class[rectangle, fill = none, name = b^{\b} u[0]](4,0)
+ \end{scope}
+}
+\NewSseqCommand \KOpcell {m}{
+ \d1(b^{\b}[#1]) \replacetarget
+ \d1(b^{\b} u[#1]) \replacetarget
+ \structline(b^{\b}[#1+1])(b^{\b} e[#1+1])
+ \structline[page = 2, dashed](b^{\b} e[#1])(b^{\b} e^2[#1+1])
+ \structline[page = 2, dashed](b^{\b} e^2[#1])(b^{\b} u[#1+1])
+}
+\NewSseqCommand \KOetacell {m}{
+ \DrawIfValidDifferential2(b^{\b}[#1])
+ \d2(b^{\b} e[#1])
+ \DrawIfValidDifferential3(b^{\b} e^2[#1])
+}
+\begin{sseqdata}[ name = KO^*RP^8, Adams grading, class name handler = \SseqAHSSNameHandler,
+ classes = fill, x range = {-8}{10}, xscale = 0.7, yscale = 0.5, x tick step = 4 ]
+\foreach \b in {-2,...,2}{
+ \foreach \n in {0,...,6}{\KOstar{\n}}
+ \foreach \n in {1,3,...,5}{\KOpcell{\n}}
+ \foreach \n in {2,3}{\KOetacell{\n}}
+ \structline[dashed](b^{\b}e^2[2])(b^{\b}u[4])
+ \structline[dashed](b^{\b}[4])(b^{\b}e[5])
+}
+\end{sseqdata}
+\printpage[ name = KO^*RP^8, title = AHSS for $KO^*\mathbb{R}P^8$ ] \vskip6pt
+\printpage[ name = KO^*RP^8, page = 6 ] \ No newline at end of file
diff --git a/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-class-page2a.tex b/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-class-page2a.tex
new file mode 100644
index 0000000000..90a9b9bc3c
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-class-page2a.tex
@@ -0,0 +1,24 @@
+\begin{sseqdata}[ name = page_example2, Adams grading, xscale = 0.6, yscale = 0.5 ]
+\class(0,2)\class(1,0)
+\d2(1,0)
+\replacesource
+\class(0,3)
+\d3(1,0)
+\replacesource
+\classoptions[fill, red](1,0) % (a) applies to most recent (last) generation.
+\end{sseqdata}
+
+\printpage[ name = page_example2, page = 1 ] % generation 0 of (1,0), not styled
+\quad
+\begin{sseqpage}[ name = page_example2, page = 1, keep changes ]
+\classoptions[fill, blue](1,0) % (b) applies to the generation present on page 1, that is, generation 0.
+\end{sseqpage} \quad
+
+% generation 0 of (1,0), so class is blue from (b)
+\printpage[ name = page_example2, page = 2 ] \quad
+
+% generation 1 of (1,0), class is not styled
+\printpage[ name = page_example2, page = 3 ] \quad
+
+% generation 2 of (1,0), class is red from (a)
+\printpage[ name = page_example2, page = 4 ] \ No newline at end of file
diff --git a/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-class-page2b.tex b/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-class-page2b.tex
new file mode 100644
index 0000000000..3d5854f054
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-class-page2b.tex
@@ -0,0 +1,18 @@
+\begin{sseqdata}[ name = page_example2, Adams grading, update existing ]
+% (c) applies to all generations, overwrites (b) and (a):
+\classoptions[fill, red, generation = 0 ---- -1](1,0)
+\end{sseqdata}
+
+\printpage[ name = page_example2, page = 1 ]% generation 0 of (1,0), so class is red
+\quad
+\begin{sseqpage}[ name = page_example2, page = 1, keep changes ]
+\classoptions[fill, blue](1,0) % (d) applies to the generation present on page 1, that is, generation 0.
+\end{sseqpage} \quad
+
+% generation 0 of (1,0), class is blue from (d)
+\printpage[ name = page_example2, page = 2 ] \quad
+
+% generation 1 of (1,0), class is red from (c)
+\printpage[ name = page_example2, page = 3 ]
+\quad
+\printpage[ name = page_example2, page = 4 ] % generation 2 of (1,0), class is red from (c) \ No newline at end of file
diff --git a/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-imJ.tex b/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-imJ.tex
new file mode 100644
index 0000000000..20335a33f2
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-imJ.tex
@@ -0,0 +1,32 @@
+\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] \ No newline at end of file
diff --git a/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-insert.tex b/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-insert.tex
new file mode 100644
index 0000000000..2784ca0d3c
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-insert.tex
@@ -0,0 +1,33 @@
+\DeclareSseqGroup \tower {} {
+ \class(0,0)
+ \DoUntilOutOfBounds {
+ \class(\lastx,\lasty+1)
+ \structline
+ }
+}
+
+\begin{sseqdata}[ name = insert-example, y range = {0}{4}, class pattern = linear ]
+\tower(0,2)
+\tower(0,3)
+\tower(0,1)
+\end{sseqdata}
+\qquad
+\begin{sseqpage}[ name = insert-example ]
+\tower[ red, classes = { insert = 1 } ](0,0)
+\end{sseqpage}
+\qquad
+\begin{sseqpage}[ name = insert-example ]
+\tower[ red, classes = { insert = 2 } ](0,0)
+\end{sseqpage}
+\qquad
+\begin{sseqpage}[ name = insert-example ]
+\tower[ red, classes = { insert = 3 } ](0,0)
+\end{sseqpage}
+\qquad
+\begin{sseqpage}[ name = insert-example ]
+\tower[ red, classes = { insert = -2 } ](0,0)
+\end{sseqpage}
+\qquad
+\begin{sseqpage}[ name = insert-example ]
+\tower[ red, classes = { insert = -3 } ](0,0)
+\end{sseqpage} \ No newline at end of file
diff --git a/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-tikz.tex b/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-tikz.tex
new file mode 100644
index 0000000000..d12a0c0242
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/examples/spectralsequencesmanual-tikz.tex
@@ -0,0 +1,25 @@
+\begin{sseqdata}[ name = tikz example, Adams grading, math nodes = false,
+ tikz primitives = { blue, font = \tiny, <- }, circle classes = tikz primitive style,
+ x range = {0}{2}, x axis extend end = 2em ]
+\class(0,0)
+\class(1,0)
+\class(0,2)
+\d2(1,0)
+\end{sseqdata}
+%
+\begin{sseqpage}[ name = tikz example ]
+\circleclasses[ name path = myellipse, inner sep = 3pt, ellipse ratio = 1.6 ] (1,0) (0,2)
+\path[ name path = myline ] (1.3,1.25) -- (0.6,1);
+\draw[ name intersections = { of = myellipse and myline } ]
+ (intersection-1) to (1.3,1.25) node[ right, text width = 1.6cm ] {Consider this differential};
+\end{sseqpage} \qquad
+%
+\begin{sseqpage}[ name = tikz example ]
+\draw[ xshift = 1 ] (0,0) to (0.6,0.2) node[ right, text width = 1.1cm ] {This is the source};
+\draw[ yshift = 2 ] (0,0) to (0.6,0.2) node[ right, text width = 1.1cm ] {This is the target};
+\end{sseqpage} \qquad
+%
+\begin{sseqpage}[ page = 3, name = tikz example ]
+\circleclasses[ inner sep = 3pt, ellipse ratio = 1.6 ] (1,0)(0,2)
+\node[ right, font = \tiny ] at (1.2,1.2) {Now it's gone!};
+\end{sseqpage} \ No newline at end of file
diff --git a/graphics/pgf/contrib/spectralsequences/manual/pgfmanual-en-macros.tex b/graphics/pgf/contrib/spectralsequences/manual/pgfmanual-en-macros.tex
new file mode 100644
index 0000000000..ab7022b1e4
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/pgfmanual-en-macros.tex
@@ -0,0 +1,1762 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Free Documentation License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+% $Header: /cvsroot/pgf/pgf/doc/generic/pgf/macros/pgfmanual-en-macros.tex,v 1.81 2014/03/20 10:07:44 tantau Exp $
+
+
+\providecommand\href[2]{\texttt{#1}}
+\providecommand\hypertarget[2]{\texttt{#1}}
+\providecommand\hyperlink[2]{\texttt{#1}}
+
+
+\colorlet{examplefill}{yellow!80!black}
+\definecolor{graphicbackground}{rgb}{0.96,0.96,0.8}
+\definecolor{codebackground}{rgb}{0.9,0.9,1}
+
+\newenvironment{pgfmanualentry}{\list{}{\leftmargin=2em\itemindent-\leftmargin\def\makelabel##1{\hss##1}}}{\endlist}
+\newcommand\pgfmanualentryheadline[1]{\itemsep=0pt\parskip=0pt{\raggedright\item\strut{#1}\par}\topsep=0pt}
+\newcommand\pgfmanualbody{\parskip3pt}
+
+\let\origtexttt=\texttt
+\def\texttt#1{{\def\textunderscore{\char`\_}\def\textbraceleft{\char`\{}\def\textbraceright{\char`\}}\origtexttt{#1}}}
+\def\exclamationmarktext{!}
+\def\atmarktext{@}
+
+{
+ \catcode`\|=12
+ \gdef\pgfmanualnormalbar{|}
+ \catcode`\|=13
+ \AtBeginDocument{\gdef|{\ifmmode\pgfmanualnormalbar\else\expandafter\verb\expandafter|\fi}}
+}
+
+
+
+\newenvironment{pgflayout}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \texttt{\string\pgfpagesuselayout\char`\{\declare{#1}\char`\}}\oarg{options}%
+ }
+ \index{#1@\protect\texttt{#1} layout}%
+ \index{Page layouts!#1@\protect\texttt{#1}}%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+
+\newenvironment{command}[1]{
+ \begin{pgfmanualentry}
+ \extractcommand#1\@@
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\makeatletter
+
+\def\includeluadocumentationof#1{
+ \directlua{require 'pgf.manual.DocumentParser'}
+ \directlua{pgf.manual.DocumentParser.include '#1'}
+}
+
+\newenvironment{luageneric}[4]{
+ \pgfmanualentry
+ \pgfmanualentryheadline{#4 \texttt{#1\declare{#2}}#3}
+ \index{#2@\protect\texttt{#2} (Lua)}%
+ \def\temp{#1}
+ \ifx\temp\pgfutil@empty\else
+ \index{#1@\protect\texttt{#1}!#2@\protect\texttt{#2} (Lua)}%
+ \fi
+ \pgfmanualbody
+}{\endpgfmanualentry}
+
+\newenvironment{luatable}[3]{
+ \medskip
+ \luageneric{#1}{#2}{ (declared in \texttt{#3})}{\textbf{Lua table}}
+}{\endluageneric}
+
+\newenvironment{luafield}[1]{
+ \pgfmanualentry
+ \pgfmanualentryheadline{Field \texttt{\declare{#1}}}
+ \pgfmanualbody
+}{\endpgfmanualentry}
+
+
+\newenvironment{lualibrary}[1]{
+ \pgfmanualentry
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Graph Drawing Library} \texttt{\declare{#1}}%
+ }
+ \index{#1@\protect\texttt{#1} graph drawing library}%
+ \index{Libraries!#1@\protect\texttt{#1}}%
+ \index{Graph drawing libraries!#1@\protect\texttt{#1}}%
+ \vskip.25em
+ {\ttfamily\char`\\usegdlibrary\char`\{\declare{#1}\char`\}\space\space \char`\%\space\space \LaTeX\space and plain \TeX}\\
+ {\ttfamily\char`\\usegdlibrary[\declare{#1}]\space \char`\%\space\space Con\TeX t}\smallskip\par
+ \pgfmanualbody
+}{\endpgfmanualentry}
+
+\newenvironment{luadeclare}[4]{
+ \pgfmanualentry
+ \def\manual@temp@default{#3}%
+ \def\manual@temp@initial{#4}%
+ \def\manual@temp@{#3#4}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ {\ttfamily/graph
+ drawing/\declare{#1}\opt{=}}\opt{#2}\hfill%
+ \ifx\manual@temp@\pgfutil@empty\else%
+ (\ifx\manual@temp@default\pgfutil@empty\else%
+ default {\ttfamily #3}\ifx\manual@temp@initial\pgfutil@empty\else, \fi%
+ \fi%
+ \ifx\manual@temp@initial\pgfutil@empty\else%
+ initially {\ttfamily #4}%
+ \fi%
+ )\fi%
+ }%
+ \index{#1@\protect\texttt{#1} key}%
+ \pgfmanualbody
+ \gdef\myname{#1}%
+% \keyalias{tikz}
+% \keyalias{tikz/graphs}
+}{\endpgfmanualentry}
+
+\newenvironment{luadeclarestyle}[4]{
+ \pgfmanualentry
+ \def\manual@temp@para{#2}%
+ \def\manual@temp@default{#3}%
+ \def\manual@temp@initial{#4}%
+ \def\manual@temp@{#3#4}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ {\ttfamily/graph drawing/\declare{#1}}\ifx\manual@temp@para\pgfutil@empty\else\opt{\texttt=}\opt{#2}\fi\hfill%
+ (style\ifx\manual@temp@\pgfutil@empty\else, %
+ \ifx\manual@temp@default\pgfutil@empty\else%
+ default {\ttfamily #3}\ifx\manual@temp@initial\pgfutil@empty\else, \fi%
+ \fi%
+ \ifx\manual@temp@initial\pgfutil@empty\else%
+ initially {\ttfamily #4}%
+ \fi%
+ \fi)%
+ }%
+ \index{#1@\protect\texttt{#1} key}%
+ \pgfmanualbody%
+ \gdef\myname{#1}%
+% \keyalias{tikz}
+% \keyalias{tikz/graphs}
+}{\endpgfmanualentry}
+
+\newenvironment{luanamespace}[2]{
+ \luageneric{#1}{#2}{}{\textbf{Lua namespace}}
+}{\endluageneric}
+
+\newenvironment{luafiledescription}[1]{}{}
+
+\newenvironment{luacommand}[4]{
+ \hypertarget{pgf/lua/#1}{\luageneric{#2}{#3}{\texttt{(#4)}}{\texttt{function}}}
+}{\endluageneric}
+
+\newenvironment{luaparameters}{\par\emph{Parameters:}%
+ \parametercount=0\relax%
+ \let\item=\parameteritem%
+ \let\list=\restorelist%
+}
+{\par
+}
+
+\newenvironment{luareturns}{\par\emph{Returns:}%
+ \parametercount=0\relax%
+ \let\item=\parameteritem%
+ \let\list=\restorelist%
+}
+{\par
+}
+
+\newcount\parametercount
+
+\newenvironment{parameterdescription}{\unskip%
+ \parametercount=0\relax%
+ \let\item=\parameteritem%
+ \let\list=\restorelist%
+}
+{\par
+}
+\let\saveditemcommand=\item
+\let\savedlistcommand=\list
+\def\denselist#1#2{\savedlistcommand{#1}{#2}\parskip0pt\itemsep0pt}
+\def\restorelist{\let\item=\saveditemcommand\denselist}
+\def\parameteritem{\pgfutil@ifnextchar[\parameteritem@{}}%}
+\def\parameteritem@[#1]{\advance\parametercount by1\relax\hskip0.15em plus 1em\emph{\the\parametercount.}\kern1ex\def\test{#1}\ifx\test\pgfutil@empty\else#1\kern.5em\fi}
+
+\makeatother
+\newenvironment{commandlist}[1]{%
+ \begin{pgfmanualentry}
+ \foreach \xx in {#1} {%
+ \expandafter\extractcommand\xx\@@
+ }%
+ \pgfmanualbody
+}{%
+ \end{pgfmanualentry}
+}%
+\makeatletter
+
+% \begin{internallist}[register]{\pgf@xa}
+% \end{internallist}
+%
+% \begin{internallist}[register]{\pgf@xa,\pgf@xb}
+% \end{internallist}
+\newenvironment{internallist}[2][register]{%
+ \begin{pgfmanualentry}
+ \foreach \xx in {#2} {%
+ \expandafter\extractinternalcommand\expandafter{\xx}{#1}%
+ }%
+ \pgfmanualbody
+}{%
+ \end{pgfmanualentry}
+}%
+\def\extractinternalcommand#1#2{%
+ \removeats{#1}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{\textbackslash\strippedat}{}%
+ Internal #2 \declare{\texttt{\string#1}}}%
+ \index{Internals!\strippedat @\protect\myprintocmmand{\strippedat}}%
+ \index{\strippedat @\protect\myprintocmmand{\strippedat}}%
+}
+
+%% MW: START MATH MACROS
+\def\mvar#1{{\ifmmode\textrm{\textit{#1}}\else\rmfamily\textit{#1}\fi}}
+
+\makeatletter
+
+\def\extractmathfunctionname#1{\extractmathfunctionname@#1(,)\tmpa\tmpb}
+\def\extractmathfunctionname@#1(#2)#3\tmpb{\def\mathname{#1}}
+
+\makeatother
+
+\newenvironment{math-function}[1]{
+ \def\mathdefaultname{#1}
+ \extractmathfunctionname{#1}
+ \edef\mathurl{{math:\mathname}}\expandafter\hypertarget\expandafter{\mathurl}{}%
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{\texttt{#1}}%
+ \index{\mathname @\protect\texttt{\mathname} math function}%
+ \index{Math functions!\mathname @\protect\texttt{\mathname}}%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\def\pgfmanualemptytext{}
+\def\pgfmanualvbarvbar{\char`\|\char`\|}
+
+\newenvironment{math-operator}[4][]{%
+ \begin{pgfmanualentry}
+ \csname math#3operator\endcsname{#2}{#4}
+ \def\mathtest{#4}%
+ \ifx\mathtest\pgfmanualemptytext%
+ \def\mathtype{(#3 operator)}
+ \else%
+ \def\mathtype{(#3 operator; uses the \texttt{#4} function)}
+ \fi%
+ \pgfmanualentryheadline{\mathexample\hfill\mathtype}%
+ \def\mathtest{#1}%
+ \ifx\mathtest\pgfmanualemptytext%
+ \index{#2@\protect\texttt{#2} #3 math operator}%
+ \index{Math operators!#2@\protect\texttt{#2}}%
+ \fi%
+ \pgfmanualbody
+}
+{\end{pgfmanualentry}}
+
+\newenvironment{math-operators}[5][]{%
+ \begin{pgfmanualentry}
+ \csname math#4operator\endcsname{#2}{#3}
+ \def\mathtest{#5}%
+ \ifx\mathtest\pgfmanualemptytext%
+ \def\mathtype{(#4 operators)}
+ \else%
+ \def\mathtype{(#4 operators; use the \texttt{#5} function)}
+ \fi%
+ \pgfmanualentryheadline{\mathexample\hfill\mathtype}%
+ \def\mathtest{#1}%
+ \ifx\mathtest\pgfmanualemptytext%
+ \index{#2#3@\protect\texttt{#2\protect\ #3} #4 math operators}%
+ \index{Math operators!#2#3@\protect\texttt{#2\protect\ #3}}%
+ \fi%
+ \pgfmanualbody
+}
+{\end{pgfmanualentry}}
+
+\def\mathinfixoperator#1#2{%
+ \def\mathoperator{\texttt{#1}}%
+ \def\mathexample{\mvar{x}\space\texttt{#1}\space\mvar{y}}%
+}
+
+\def\mathprefixoperator#1#2{%
+ \def\mathoperator{\texttt{#1}}%
+ \def\mathexample{\texttt{#1}\mvar{x}}%
+}
+
+\def\mathpostfixoperator#1#2{%
+ \def\mathoperator{\texttt{#1}}
+ \def\mathexample{\mvar{x}\texttt{#1}}%
+}
+
+\def\mathgroupoperator#1#2{%
+ \def\mathoperator{\texttt{#1\ #2}}%
+ \def\mathexample{\texttt{#1}\mvar{x}\texttt{#2}}%
+}
+
+\expandafter\let\csname matharray accessoperator\endcsname=\mathgroupoperator
+\expandafter\let\csname matharrayoperator\endcsname=\mathgroupoperator
+
+\def\mathconditionaloperator#1#2{%
+ \def\mathoperator{#1\space#2}
+ \def\mathexample{\mvar{x}\ \texttt{#1}\ \mvar{y}\ {\texttt{#2}}\ \mvar{z}}
+}
+
+\newcommand\mathcommand[1][\mathdefaultname]{%
+ \expandafter\makemathcommand#1(\empty)\stop%
+ \expandafter\extractcommand\mathcommandname\@@%
+ \medskip
+}
+\makeatletter
+
+\def\makemathcommand#1(#2)#3\stop{%
+ \expandafter\def\expandafter\mathcommandname\expandafter{\csname pgfmath#1\endcsname}%
+ \ifx#2\empty%
+ \else%
+ \@makemathcommand#2,\stop,
+ \fi}
+\def\@makemathcommand#1,{%
+ \ifx#1\stop%
+ \else%
+ \expandafter\def\expandafter\mathcommandname\expandafter{\mathcommandname{\ttfamily\char`\{#1\char`\}}}%
+ \expandafter\@makemathcommand%
+ \fi}
+\makeatother
+
+\def\calcname{\textsc{calc}}
+
+\newenvironment{math-keyword}[1]{
+ \extracttikzmathkeyword#1@
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{\texttt{\color{red}\mathname}\mathrest}%
+ \index{\mathname @\protect\texttt{\mathname} tikz math function}%
+ \index{TikZ math functions!\mathname @\protect\texttt{\mathname}}%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\def\extracttikzmathkeyword#1#2@{%
+ \def\mathname{#1}%
+ \def\mathrest{#2}%
+}
+
+%% MW: END MATH MACROS
+
+
+\def\extractcommand#1#2\@@{%
+ \removeats{#1}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{\textbackslash\strippedat}{}%
+ \declare{\texttt{\string#1}}#2%
+ }%
+ \index{\strippedat @\protect\myprintocmmand{\strippedat}}
+}
+
+\def\luaextractcommand#1#2\relax{%
+ \declare{\texttt{\string#1}}#2\par%
+% \removeats{#1}%
+ % \index{\strippedat @\protect\myprintocmmand{\strippedat}}
+ % \pgfmanualpdflabel{\textbackslash\strippedat}{}%
+}
+
+
+% \begin{environment}{{name}\marg{arguments}}
+\renewenvironment{environment}[1]{
+ \begin{pgfmanualentry}
+ \extractenvironement#1\@@
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\def\extractenvironement#1#2\@@{%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ {\ttfamily\char`\\begin\char`\{\declare{#1}\char`\}}#2%
+ }%
+ \pgfmanualentryheadline{{\ttfamily\ \ }\meta{environment contents}}%
+ \pgfmanualentryheadline{{\ttfamily\char`\\end\char`\{\declare{#1}\char`\}}}%
+ \index{#1@\protect\texttt{#1} environment}%
+ \index{Environments!#1@\protect\texttt{#1}}
+}
+
+
+\newenvironment{plainenvironment}[1]{
+ \begin{pgfmanualentry}
+ \extractplainenvironement#1\@@
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\def\extractplainenvironement#1#2\@@{%
+ \pgfmanualentryheadline{{\ttfamily\declare{\char`\\#1}}#2}%
+ \pgfmanualentryheadline{{\ttfamily\ \ }\meta{environment contents}}%
+ \pgfmanualentryheadline{{\ttfamily\declare{\char`\\end#1}}}%
+ \index{#1@\protect\texttt{#1} environment}%
+ \index{Environments!#1@\protect\texttt{#1}}%
+}
+
+
+\newenvironment{contextenvironment}[1]{
+ \begin{pgfmanualentry}
+ \extractcontextenvironement#1\@@
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\def\extractcontextenvironement#1#2\@@{%
+ \pgfmanualentryheadline{{\ttfamily\declare{\char`\\start#1}}#2}%
+ \pgfmanualentryheadline{{\ttfamily\ \ }\meta{environment contents}}%
+ \pgfmanualentryheadline{{\ttfamily\declare{\char`\\stop#1}}}%
+ \index{#1@\protect\texttt{#1} environment}%
+ \index{Environments!#1@\protect\texttt{#1}}}
+
+
+\newenvironment{shape}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Shape} {\ttfamily\declare{#1}}%
+ }%
+ \index{#1@\protect\texttt{#1} shape}%
+ \index{Shapes!#1@\protect\texttt{#1}}
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{pictype}[2]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Pic type} {\ttfamily\declare{#1}#2}%
+ }%
+ \index{#1@\protect\texttt{#1} pic type}%
+ \index{Pic Types!#1@\protect\texttt{#1}}
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{shading}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Shading} {\ttfamily\declare{#1}}}%
+ \index{#1@\protect\texttt{#1} shading}%
+ \index{Shadings!#1@\protect\texttt{#1}}
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+
+\newenvironment{graph}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Graph} {\ttfamily\declare{#1}}}%
+ \index{#1@\protect\texttt{#1} graph}%
+ \index{Graphs!#1@\protect\texttt{#1}}
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{gdalgorithm}[2]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Layout} {\ttfamily/graph drawing/\declare{#1}\opt{=}}\opt{\meta{options}}}%
+ \index{#1@\protect\texttt{#1} layout}%
+ \index{Layouts!#1@\protect\texttt{#1}}%
+ \foreach \algo in {#2}
+ {\edef\marshal{\noexpand\index{#2@\noexpand\protect\noexpand\texttt{#2} algorithm}}\marshal}%
+ \index{Graph drawing layouts!#1@\protect\texttt{#1}}
+ \item{\small alias {\ttfamily/tikz/#1}}\par
+ \item{\small alias {\ttfamily/tikz/graphs/#1}}\par
+ \item{\small Employs {\ttfamily algorithm=#2}}\par
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{dataformat}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Format} {\ttfamily\declare{#1}}}%
+ \index{#1@\protect\texttt{#1} format}%
+ \index{Formats!#1@\protect\texttt{#1}}
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{stylesheet}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Style sheet} {\ttfamily\declare{#1}}}%
+ \index{#1@\protect\texttt{#1} style sheet}%
+ \index{Style sheets!#1@\protect\texttt{#1}}
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{handler}[1]{
+ \begin{pgfmanualentry}
+ \extracthandler#1\@nil%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\def\gobble#1{}
+\def\extracthandler#1#2\@nil{%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{/handlers/#1}{}%
+ \textbf{Key handler} \meta{key}{\ttfamily/\declare{#1}}#2}%
+ \index{\gobble#1@\protect\texttt{#1} handler}%
+ \index{Key handlers!#1@\protect\texttt{#1}}
+}
+
+
+\makeatletter
+
+
+\newenvironment{stylekey}[1]{
+ \begin{pgfmanualentry}
+ \def\extrakeytext{style, }
+ \extractkey#1\@nil%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\def\choicesep{$\vert$}%
+\def\choicearg#1{\texttt{#1}}
+
+\newif\iffirstchoice
+
+% \mchoice{choice1,choice2,choice3}
+\newcommand\mchoice[1]{%
+ \begingroup
+ \firstchoicetrue
+ \foreach \mchoice@ in {#1} {%
+ \iffirstchoice
+ \global\firstchoicefalse
+ \else
+ \choicesep
+ \fi
+ \choicearg{\mchoice@}%
+ }%
+ \endgroup
+}%
+
+% \begin{key}{/path/x=value}
+% \begin{key}{/path/x=value (initially XXX)}
+% \begin{key}{/path/x=value (default XXX)}
+\newenvironment{key}[1]{
+ \begin{pgfmanualentry}
+ \def\extrakeytext{}
+ %\def\altpath{\emph{\color{gray}or}}%
+ \extractkey#1\@nil%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+% \insertpathifneeded{a key}{/pgf} -> assign mykey={/pgf/a key}
+% \insertpathifneeded{/tikz/a key}{/pgf} -> assign mykey={/tikz/a key}
+%
+% #1: the key
+% #2: a default path (or empty)
+\def\insertpathifneeded#1#2{%
+ \def\insertpathifneeded@@{#2}%
+ \ifx\insertpathifneeded@@\empty
+ \def\mykey{#1}%
+ \else
+ \insertpathifneeded@#2\@nil
+ \ifpgfutil@in@
+ \def\mykey{#2/#1}%
+ \else
+ \def\mykey{#1}%
+ \fi
+ \fi
+}%
+\def\insertpathifneeded@#1#2\@nil{%
+ \def\insertpathifneeded@@{#1}%
+ \def\insertpathifneeded@@@{/}%
+ \ifx\insertpathifneeded@@\insertpathifneeded@@@
+ \pgfutil@in@true
+ \else
+ \pgfutil@in@false
+ \fi
+}%
+
+% \begin{keylist}[default path]
+% {/path/option 1=value,/path/option 2=value2}
+% \end{keylist}
+\newenvironment{keylist}[2][]{%
+ \begin{pgfmanualentry}
+ \def\extrakeytext{}%
+ \foreach \xx in {#2} {%
+ \expandafter\insertpathifneeded\expandafter{\xx}{#1}%
+ \expandafter\extractkey\mykey\@nil%
+ }%
+ \pgfmanualbody
+}{%
+ \end{pgfmanualentry}
+}%
+
+\def\extractkey#1\@nil{%
+ \pgfutil@in@={#1}%
+ \ifpgfutil@in@%
+ \extractkeyequal#1\@nil
+ \else%
+ \pgfutil@in@{(initial}{#1}%
+ \ifpgfutil@in@%
+ \extractequalinitial#1\@nil%
+ \else
+ \pgfmanualentryheadline{%
+ \def\mykey{#1}%
+ \def\mypath{}%
+ \gdef\myname{}%
+ \firsttimetrue%
+ \pgfmanualdecomposecount=0\relax%
+ \decompose#1/\nil%
+ {\ttfamily\declare{#1}}\hfill(\extrakeytext no value)}%
+ \fi
+ \fi%
+}
+
+\def\extractkeyequal#1=#2\@nil{%
+ \pgfutil@in@{(default}{#2}%
+ \ifpgfutil@in@%
+ \extractdefault{#1}#2\@nil%
+ \else%
+ \pgfutil@in@{(initial}{#2}%
+ \ifpgfutil@in@%
+ \extractinitial{#1}#2\@nil%
+ \else
+ \pgfmanualentryheadline{%
+ \def\mykey{#1}%
+ \def\mypath{}%
+ \gdef\myname{}%
+ \firsttimetrue%
+ \pgfmanualdecomposecount=0\relax%
+ \decompose#1/\nil%
+ {\ttfamily\declare{#1}=}#2\hfill(\extrakeytext no default)}%
+ \fi%
+ \fi%
+}
+
+\def\extractdefault#1#2(default #3)\@nil{%
+ \pgfmanualentryheadline{%
+ \def\mykey{#1}%
+ \def\mypath{}%
+ \gdef\myname{}%
+ \firsttimetrue%
+ \pgfmanualdecomposecount=0\relax%
+ \decompose#1/\nil%
+ {\ttfamily\declare{#1}\opt{=}}\opt{#2}\hfill (\extrakeytext default {\ttfamily#3})}%
+}
+
+\def\extractinitial#1#2(initially #3)\@nil{%
+ \pgfmanualentryheadline{%
+ \def\mykey{#1}%
+ \def\mypath{}%
+ \gdef\myname{}%
+ \firsttimetrue%
+ \pgfmanualdecomposecount=0\relax%
+ \decompose#1/\nil%
+ {\ttfamily\declare{#1}=}#2\hfill (\extrakeytext no default, initially {\ttfamily#3})}%
+}
+
+\def\extractequalinitial#1 (initially #2)\@nil{%
+ \pgfmanualentryheadline{%
+ \def\mykey{#1}%
+ \def\mypath{}%
+ \gdef\myname{}%
+ \firsttimetrue%
+ \pgfmanualdecomposecount=0\relax%
+ \decompose#1/\nil%
+ {\ttfamily\declare{#1}}\hfill (\extrakeytext initially {\ttfamily#2})}%
+}
+
+% Introduces a key alias '/#1/<name of current key>'
+% to be used inside of \begin{key} ... \end{key}
+\def\keyalias#1{\vspace{-3pt}\item{\small alias {\ttfamily/#1/\myname}}\vspace{-2pt}\par
+ \pgfmanualpdflabel{/#1/\myname}{}%
+}
+
+\newif\iffirsttime
+\newcount\pgfmanualdecomposecount
+
+\makeatother
+
+\def\decompose/#1/#2\nil{%
+ \def\test{#2}%
+ \ifx\test\empty%
+ % aha.
+ \index{#1@\protect\texttt{#1} key}%
+ \index{\mypath#1@\protect\texttt{#1}}%
+ \gdef\myname{#1}%
+ \pgfmanualpdflabel{#1}{}
+ \else%
+ \advance\pgfmanualdecomposecount by1\relax%
+ \ifnum\pgfmanualdecomposecount>2\relax%
+ \decomposetoodeep#1/#2\nil%
+ \else%
+ \iffirsttime%
+ \begingroup%
+ % also make a pdf link anchor with full key path.
+ \def\hyperlabelwithoutslash##1/\nil{%
+ \pgfmanualpdflabel{##1}{}%
+ }%
+ \hyperlabelwithoutslash/#1/#2\nil%
+ \endgroup%
+ \def\mypath{#1@\protect\texttt{/#1/}!}%
+ \firsttimefalse%
+ \else%
+ \expandafter\def\expandafter\mypath\expandafter{\mypath#1@\protect\texttt{#1/}!}%
+ \fi%
+ \def\firsttime{}%
+ \decompose/#2\nil%
+ \fi%
+ \fi%
+}
+
+\def\decomposetoodeep#1/#2/\nil{%
+ % avoid too-deep nesting in index
+ \index{#1/#2@\protect\texttt{#1/#2} key}%
+ \index{\mypath#1/#2@\protect\texttt{#1/#2}}%
+ \decomposefindlast/#1/#2/\nil%
+}
+\makeatletter
+\def\decomposefindlast/#1/#2\nil{%
+ \def\test{#2}%
+ \ifx\test\pgfutil@empty%
+ \gdef\myname{#1}%
+ \else%
+ \decomposefindlast/#2\nil%
+ \fi%
+}
+\makeatother
+\def\indexkey#1{%
+ \def\mypath{}%
+ \decompose#1/\nil%
+}
+
+\newenvironment{predefinedmethod}[1]{
+ \begin{pgfmanualentry}
+ \extractpredefinedmethod#1\@nil
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+\def\extractpredefinedmethod#1(#2)\@nil{%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ Method \declare{\ttfamily #1}\texttt(#2\texttt) \hfill(predefined for all classes)}
+ \index{#1@\protect\texttt{#1} method}%
+ \index{Methods!#1@\protect\texttt{#1}}
+}
+
+
+\newenvironment{ooclass}[1]{
+ \begin{pgfmanualentry}
+ \def\currentclass{#1}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Class} \declare{\texttt{#1}}}
+ \index{#1@\protect\texttt{#1} class}%
+ \index{Class #1@Class \protect\texttt{#1}}%
+ \index{Classes!#1@\protect\texttt{#1}}
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{method}[1]{
+ \begin{pgfmanualentry}
+ \extractmethod#1\@nil
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+\def\extractmethod#1(#2)\@nil{%
+ \def\test{#1}
+ \ifx\test\currentclass
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ Constructor \declare{\ttfamily #1}\texttt(#2\texttt)}
+ \else
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ Method \declare{\ttfamily #1}\texttt(#2\texttt)}
+ \fi
+ \index{#1@\protect\texttt{#1} method}%
+ \index{Methods!#1@\protect\texttt{#1}}
+ \index{Class \currentclass!#1@\protect\texttt{#1}}%
+}
+
+\newenvironment{attribute}[1]{
+ \begin{pgfmanualentry}
+ \extractattribute#1\@nil
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+\def\extractattribute#1=#2;\@nil{%
+ \def\test{#2}%
+ \ifx\test\@empty
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ Private attribute \declare{\ttfamily #1} \hfill (initially empty)}
+ \else
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ Private attribute \declare{\ttfamily #1} \hfill (initially {\ttfamily #2})}
+ \fi
+ \index{#1@\protect\texttt{#1} attribute}%
+ \index{Attributes!#1@\protect\texttt{#1}}
+ \index{Class \currentclass!#1@\protect\texttt{#1}}%
+}
+
+
+
+\newenvironment{predefinednode}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Predefined node} {\ttfamily\declare{#1}}}%
+ \index{#1@\protect\texttt{#1} node}%
+ \index{Predefined node!#1@\protect\texttt{#1}}
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{coordinatesystem}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Coordinate system} {\ttfamily\declare{#1}}}%
+ \index{#1@\protect\texttt{#1} coordinate system}%
+ \index{Coordinate systems!#1@\protect\texttt{#1}}
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{snake}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{\textbf{Snake} {\ttfamily\declare{#1}}}%
+ \index{#1@\protect\texttt{#1} snake}%
+ \index{Snakes!#1@\protect\texttt{#1}}
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{decoration}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{\textbf{Decoration} {\ttfamily\declare{#1}}}%
+ \index{#1@\protect\texttt{#1} decoration}%
+ \index{Decorations!#1@\protect\texttt{#1}}
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+
+\def\pgfmanualbar{\char`\|}
+\makeatletter
+\newenvironment{pathoperation}[3][]{
+ \begin{pgfmanualentry}
+ \def\pgfmanualtest{#1}%
+ \pgfmanualentryheadline{%
+ \ifx\pgfmanualtest\@empty%
+ \pgfmanualpdflabel{#2}{}%
+ \fi%
+ \textcolor{gray}{{\ttfamily\char`\\path}\
+ \ \dots}
+ \declare{\texttt{\noligs{#2}}}#3\ \textcolor{gray}{\dots\texttt{;}}}%
+ \ifx\pgfmanualtest\@empty%
+ \index{#2@\protect\texttt{#2} path operation}%
+ \index{Path operations!#2@\protect\texttt{#2}}%
+ \fi%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+\newenvironment{datavisualizationoperation}[3][]{
+ \begin{pgfmanualentry}
+ \def\pgfmanualtest{#1}%
+ \pgfmanualentryheadline{%
+ \ifx\pgfmanualtest\@empty%
+ \pgfmanualpdflabel{#2}{}%
+ \fi%
+ \textcolor{gray}{{\ttfamily\char`\\datavisualization}\
+ \ \dots}
+ \declare{\texttt{\noligs{#2}}}#3\ \textcolor{gray}{\dots\texttt{;}}}%
+ \ifx\pgfmanualtest\@empty%
+ \index{#2@\protect\texttt{#2} (data visualization)}%
+ \index{Data visualization!#2@\protect\texttt{#2}}%
+ \fi%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+\makeatother
+
+\def\doublebs{\texttt{\char`\\\char`\\}}
+
+
+\newenvironment{package}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ {\ttfamily\char`\\usepackage\char`\{\declare{#1}\char`\}\space\space \char`\%\space\space \LaTeX}}
+ \index{#1@\protect\texttt{#1} package}%
+ \index{Packages and files!#1@\protect\texttt{#1}}%
+ \pgfmanualentryheadline{{\ttfamily\char`\\input \declare{#1}.tex\space\space\space \char`\%\space\space plain \TeX}}
+ \pgfmanualentryheadline{{\ttfamily\char`\\usemodule[\declare{#1}]\space\space \char`\%\space\space Con\TeX t}}
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+
+\newenvironment{pgfmodule}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ {\ttfamily\char`\\usepgfmodule\char`\{\declare{#1}\char`\}\space\space\space
+ \char`\%\space\space \LaTeX\space and plain \TeX\space and pure pgf}}
+ \index{#1@\protect\texttt{#1} module}%
+ \index{Modules!#1@\protect\texttt{#1}}%
+ \pgfmanualentryheadline{{\ttfamily\char`\\usepgfmodule[\declare{#1}]\space\space \char`\%\space\space Con\TeX t\space and pure pgf}}
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{pgflibrary}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{\tikzname\ Library} \texttt{\declare{#1}}}
+ \index{#1@\protect\texttt{#1} library}%
+ \index{Libraries!#1@\protect\texttt{#1}}%
+ \vskip.25em%
+ {{\ttfamily\char`\\usepgflibrary\char`\{\declare{#1}\char`\}\space\space\space
+ \char`\%\space\space \LaTeX\space and plain \TeX\space and pure pgf}}\\
+ {{\ttfamily\char`\\usepgflibrary[\declare{#1}]\space\space \char`\%\space\space Con\TeX t\space and pure pgf}}\\
+ {{\ttfamily\char`\\usetikzlibrary\char`\{\declare{#1}\char`\}\space\space
+ \char`\%\space\space \LaTeX\space and plain \TeX\space when using \tikzname}}\\
+ {{\ttfamily\char`\\usetikzlibrary[\declare{#1}]\space
+ \char`\%\space\space Con\TeX t\space when using \tikzname}}\\[.5em]
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{purepgflibrary}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{{\small PGF} Library} \texttt{\declare{#1}}}
+ \index{#1@\protect\texttt{#1} library}%
+ \index{Libraries!#1@\protect\texttt{#1}}%
+ \vskip.25em%
+ {{\ttfamily\char`\\usepgflibrary\char`\{\declare{#1}\char`\}\space\space\space
+ \char`\%\space\space \LaTeX\space and plain \TeX}}\\
+ {{\ttfamily\char`\\usepgflibrary[\declare{#1}]\space\space \char`\%\space\space Con\TeX t}}\\[.5em]
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{tikzlibrary}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{\tikzname\ Library} \texttt{\declare{#1}}}
+ \index{#1@\protect\texttt{#1} library}%
+ \index{Libraries!#1@\protect\texttt{#1}}%
+ \vskip.25em%
+ {{\ttfamily\char`\\usetikzlibrary\char`\{\declare{#1}\char`\}\space\space \char`\%\space\space \LaTeX\space and plain \TeX}}\\
+ {{\ttfamily\char`\\usetikzlibrary[\declare{#1}]\space \char`\%\space\space Con\TeX t}}\\[.5em]
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+
+
+\newenvironment{filedescription}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{File {\ttfamily\declare{#1}}}%
+ \index{#1@\protect\texttt{#1} file}%
+ \index{Packages and files!#1@\protect\texttt{#1}}%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+
+\newenvironment{packageoption}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{{\ttfamily\char`\\usepackage[\declare{#1}]\char`\{pgf\char`\}}}
+ \index{#1@\protect\texttt{#1} package option}%
+ \index{Package options for \textsc{pgf}!#1@\protect\texttt{#1}}%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+
+
+\newcommand\opt[1]{{\color{black!50!green}#1}}
+\newcommand\ooarg[1]{{\ttfamily[}\meta{#1}{\ttfamily]}}
+
+\def\opt{\afterassignment\pgfmanualopt\let\next=}
+\def\pgfmanualopt{\ifx\next\bgroup\bgroup\color{black!50!green}\else{\color{black!50!green}\next}\fi}
+
+
+
+\def\beamer{\textsc{beamer}}
+\def\pdf{\textsc{pdf}}
+\def\eps{\texttt{eps}}
+\def\pgfname{\textsc{pgf}}
+\def\tikzname{Ti\emph{k}Z}
+\def\pstricks{\textsc{pstricks}}
+\def\prosper{\textsc{prosper}}
+\def\seminar{\textsc{seminar}}
+\def\texpower{\textsc{texpower}}
+\def\foils{\textsc{foils}}
+
+{
+ \makeatletter
+ \global\let\myempty=\@empty
+ \global\let\mygobble=\@gobble
+ \catcode`\@=12
+ \gdef\getridofats#1@#2\relax{%
+ \def\getridtest{#2}%
+ \ifx\getridtest\myempty%
+ \expandafter\def\expandafter\strippedat\expandafter{\strippedat#1}
+ \else%
+ \expandafter\def\expandafter\strippedat\expandafter{\strippedat#1\protect\printanat}
+ \getridofats#2\relax%
+ \fi%
+ }
+
+ \gdef\removeats#1{%
+ \let\strippedat\myempty%
+ \edef\strippedtext{\stripcommand#1}%
+ \expandafter\getridofats\strippedtext @\relax%
+ }
+
+ \gdef\stripcommand#1{\expandafter\mygobble\string#1}
+}
+
+\def\printanat{\char`\@}
+
+\def\declare{\afterassignment\pgfmanualdeclare\let\next=}
+\def\pgfmanualdeclare{\ifx\next\bgroup\bgroup\color{red!75!black}\else{\color{red!75!black}\next}\fi}
+
+
+\let\textoken=\command
+\let\endtextoken=\endcommand
+
+\def\myprintocmmand#1{\texttt{\char`\\#1}}
+
+\def\example{\par\smallskip\noindent\textit{Example: }}
+\def\themeauthor{\par\smallskip\noindent\textit{Theme author: }}
+
+
+\def\indexoption#1{%
+ \index{#1@\protect\texttt{#1} option}%
+ \index{Graphic options and styles!#1@\protect\texttt{#1}}%
+}
+
+\def\itemcalendaroption#1{\item \declare{\texttt{#1}}%
+ \index{#1@\protect\texttt{#1} date test}%
+ \index{Date tests!#1@\protect\texttt{#1}}%
+}
+
+
+
+\def\class#1{\list{}{\leftmargin=2em\itemindent-\leftmargin\def\makelabel##1{\hss##1}}%
+\extractclass#1@\par\topsep=0pt}
+\def\endclass{\endlist}
+\def\extractclass#1#2@{%
+\item{{{\ttfamily\char`\\documentclass}#2{\ttfamily\char`\{\declare{#1}\char`\}}}}%
+ \index{#1@\protect\texttt{#1} class}%
+ \index{Classes!#1@\protect\texttt{#1}}}
+
+\def\partname{Part}
+
+\makeatletter
+\def\index@prologue{\section*{Index}\addcontentsline{toc}{section}{Index}
+ This index only contains automatically generated entries. A good
+ index should also contain carefully selected keywords. This index is
+ not a good index.
+ \bigskip
+}
+\c@IndexColumns=2
+ \def\theindex{\@restonecoltrue
+ \columnseprule \z@ \columnsep 29\p@
+ \twocolumn[\index@prologue]%
+ \parindent -30pt
+ \columnsep 15pt
+ \parskip 0pt plus 1pt
+ \leftskip 30pt
+ \rightskip 0pt plus 2cm
+ \small
+ \def\@idxitem{\par}%
+ \let\item\@idxitem \ignorespaces}
+ \def\endtheindex{\onecolumn}
+\def\noindexing{\let\index=\@gobble}
+
+
+\newenvironment{arrowtipsimple}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{\textbf{Arrow Tip Kind} {\ttfamily#1}}
+ \index{#1@\protect\texttt{#1} arrow tip}%
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
+ \def\currentarrowtype{#1}
+ \pgfmanualbody}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{arrowtip}[4]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{\textbf{Arrow Tip Kind} {\ttfamily#1}}
+ \index{#1@\protect\texttt{#1} arrow tip}%
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
+ \pgfmanualbody
+ \def\currentarrowtype{#1}
+ \begin{minipage}[t]{10.25cm}
+ #2
+ \end{minipage}\hskip5mm\begin{minipage}[t]{4.75cm}
+ \leavevmode\vskip-2em
+ \tikz{
+ \draw [black!50,line width=5mm,-{#1[#3,color=black]}] (-4,0) -- (0,0);
+ \foreach \action in {#4}
+ { \expandafter\processaction\action\relax }
+ }
+ \end{minipage}\par\smallskip
+ }
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{arrowcap}[5]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{\textbf{Arrow Tip Kind} {\ttfamily#1}}
+ \index{#1@\protect\texttt{#1} arrow tip}%
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
+ \pgfmanualbody
+ \def\currentarrowtype{#1}
+ \begin{minipage}[t]{10.25cm}
+ #2
+ \end{minipage}\hskip5mm\begin{minipage}[t]{4.75cm}
+ \leavevmode\vskip-2em
+ \tikz{
+ \path [tips, line width=10mm,-{#1[#3,color=black]}] (-4,0) -- (0,0);
+ \draw [line width=10mm,black!50] (-3,0) -- (#5,0);
+ \foreach \action in {#4}
+ { \expandafter\processaction\action\relax }
+ }
+ \end{minipage}\par\smallskip
+ }
+{
+ \end{pgfmanualentry}
+}
+
+\def\processaction#1=#2\relax{
+ \expandafter\let\expandafter\pgf@temp\csname manual@action@#1\endcsname
+ \ifx\pgf@temp\relax\else
+ \pgf@temp#2/0/\relax
+ \fi
+}
+\def\manual@action@length#1/#2/#3\relax{%
+ \draw [red,|<->|,semithick,xshift=#2] ([yshift=4pt]current bounding
+ box.north -| -#1,0) coordinate (last length) -- node
+ [above=-2pt] {|length|} ++(#1,0);
+}
+\def\manual@action@width#1/#2/#3\relax{%
+ \draw [overlay, red,|<->|,semithick] (.5,-#1/2) -- node [below,sloped] {|width|} (.5,#1/2);
+}
+\def\manual@action@inset#1/#2/#3\relax{%
+ \draw [red,|<->|,semithick,xshift=#2] ([yshift=-4pt]current bounding
+ box.south -| last length) -- node [below] {|inset|} ++(#1,0);
+}
+
+\newenvironment{arrowexamples}
+{\begin{tabbing}
+ \hbox to \dimexpr\linewidth-5.5cm\relax{\emph{Appearance of the below at line width} \hfil} \=
+ \hbox to 1.9cm{\emph{0.4pt}\hfil} \= \hbox to 2cm{\emph{0.8pt}\hfil} \= \emph{1.6pt} \\
+ }
+{\end{tabbing}\vskip-1em}
+
+\newenvironment{arrowcapexamples}
+{\begin{tabbing}
+ \hbox to \dimexpr\linewidth-5.5cm\relax{\emph{Appearance of the below at line width} \hfil} \=
+ \hbox to 1.9cm{\emph{1ex}\hfil} \= \hbox to 2cm{\emph{1em}\hfil} \\
+ }
+{\end{tabbing}\vskip-1em}
+
+\def\arrowcapexample#1[#2]{\def\temp{#1}\ifx\temp\pgfutil@empty\arrowcapexample@\currentarrowtype[{#2}]\else\arrowcapexample@#1[{#2}]\fi}
+\def\arrowcapexample@#1[#2]{%
+ {\sfcode`\.1000\small\texttt{#1[#2]}} \>
+ \kern-.5ex\tikz [baseline,>={#1[#2]}] \draw [line
+ width=1ex,->] (0,.5ex) -- (2em,.5ex); \>
+ \kern-.5em\tikz [baseline,>={#1[#2]}] \draw [line
+ width=1em,->] (0,.5ex) -- (2em,.5ex); \\
+}
+
+\def\arrowexample#1[#2]{\def\temp{#1}\ifx\temp\pgfutil@empty\arrowexample@\currentarrowtype[{#2}]\else\arrowexample@#1[{#2}]\fi}
+\def\arrowexample@#1[#2]{%
+ {\sfcode`\.1000\small\texttt{#1[#2]}} \>
+ \tikz [baseline,>={#1[#2]}] \draw [line
+ width=0.4pt,->] (0,.5ex) -- (2em,.5ex); thin \>
+ \tikz [baseline,>={#1[#2]}] \draw [line
+ width=0.8pt,->] (0,.5ex) -- (2em,.5ex); \textbf{thick} \>
+ \tikz [baseline,>={#1[#2]}] \draw [line
+ width=1.6pt,->] (0,.5ex) -- (3em,.5ex); \\
+}
+\def\arrowexampledup[#1]{\arrowexample[{#1] \currentarrowtype[}]}
+\def\arrowexampledupdot[#1]{\arrowexample[{#1] . \currentarrowtype[}]}
+
+\def\arrowexampledouble#1[#2]{\def\temp{#1}\ifx\temp\pgfutil@empty\arrowexampledouble@\currentarrowtype[{#2}]\else\arrowexampledouble@#1[{#2}]\fi}
+\def\arrowexampledouble@#1[#2]{%
+ {\sfcode`\.1000\small\texttt{#1[#2]} on double line} \>
+ \tikz [baseline,>={#1[#2]}]
+ \draw [double equal sign distance,line width=0.4pt,->] (0,.5ex) -- (2em,.5ex); thin \>
+ \tikz [baseline,>={#1[#2]}]
+ \draw [double equal sign distance,line width=0.8pt,->] (0,.5ex) -- (2em,.5ex); \textbf{thick} \>
+ \tikz [baseline,>={#1[#2]}]
+ \draw [double equal sign distance, line width=1.6pt,->] (0,.5ex) -- (3em,.5ex); \\
+}
+
+
+
+\newcommand\symarrow[1]{%
+ \index{#1@\protect\texttt{#1} arrow tip}%
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
+ \texttt{#1}& yields thick
+ \begin{tikzpicture}[arrows={#1-#1},thick,baseline]
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+ \draw (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture} and thin
+ \begin{tikzpicture}[arrows={#1-#1},thin,baseline]
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+ \draw (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture}
+}
+\newcommand\symarrowdouble[1]{%
+ \index{#1@\protect\texttt{#1} arrow tip}%
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
+ \texttt{#1}& yields thick
+ \begin{tikzpicture}[arrows={#1-#1},thick,baseline]
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+ \draw (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture}
+ and thin
+ \begin{tikzpicture}[arrows={#1-#1},thin,baseline]
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+ \draw (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture}, double
+ \begin{tikzpicture}[arrows={#1-#1},thick,baseline]
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+ \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture} and
+ \begin{tikzpicture}[arrows={#1-#1},thin,baseline]
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+ \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture}
+}
+
+\newcommand\sarrow[2]{%
+ \index{#1@\protect\texttt{#1} arrow tip}%
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
+ \index{#2@\protect\texttt{#2} arrow tip}%
+ \index{Arrow tips!#2@\protect\texttt{#2}}%
+ \texttt{#1-#2}& yields thick
+ \begin{tikzpicture}[arrows={#1-#2},thick,baseline]
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+ \draw (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture} and thin
+ \begin{tikzpicture}[arrows={#1-#2},thin,baseline]
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+ \draw (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture}
+}
+
+\newcommand\sarrowdouble[2]{%
+ \index{#1@\protect\texttt{#1} arrow tip}%
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
+ \index{#2@\protect\texttt{#2} arrow tip}%
+ \index{Arrow tips!#2@\protect\texttt{#2}}%
+ \texttt{#1-#2}& yields thick
+ \begin{tikzpicture}[arrows={#1-#2},thick,baseline]
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+ \draw (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture} and thin
+ \begin{tikzpicture}[arrows={#1-#2},thin,baseline]
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+ \draw (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture}, double
+ \begin{tikzpicture}[arrows={#1-#2},thick,baseline]
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+ \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture} and
+ \begin{tikzpicture}[arrows={#1-#2},thin,baseline]
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+ \draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
+ \end{tikzpicture}
+}
+
+\newcommand\carrow[1]{%
+ \index{#1@\protect\texttt{#1} arrow tip}%
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
+ \texttt{#1}& yields for line width 1ex
+ \begin{tikzpicture}[arrows={#1-#1},line width=1ex,baseline]
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.6cm,2ex);
+ \fill [black!15] (1.5cm,-.5ex) rectangle (1.6cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
+ \draw (0pt,.5ex) -- (1.5cm,.5ex);
+ \end{tikzpicture}
+}
+\def\myvbar{\char`\|}
+\newcommand\plotmarkentry[1]{%
+ \index{#1@\protect\texttt{#1} plot mark}%
+ \index{Plot marks!#1@\protect\texttt{#1}}
+ \texttt{\char`\\pgfuseplotmark\char`\{\declare{\noligs{#1}}\char`\}} &
+ \tikz\draw[color=black!25] plot[mark=#1,mark options={fill=examplefill,draw=black}] coordinates{(0,0) (.5,0.2) (1,0) (1.5,0.2)};\\
+}
+\newcommand\plotmarkentrytikz[1]{%
+ \index{#1@\protect\texttt{#1} plot mark}%
+ \index{Plot marks!#1@\protect\texttt{#1}}
+ \texttt{mark=\declare{\noligs{#1}}} & \tikz\draw[color=black!25]
+ plot[mark=#1,mark options={fill=examplefill,draw=black}]
+ coordinates {(0,0) (.5,0.2) (1,0) (1.5,0.2)};\\
+}
+
+
+
+\ifx\scantokens\@undefined
+ \PackageError{pgfmanual-macros}{You need to use extended latex
+ (elatex) or (pdfelatex) to process this document}{}
+\fi
+
+\begingroup
+\catcode`|=0
+\catcode`[= 1
+\catcode`]=2
+\catcode`\{=12
+\catcode `\}=12
+\catcode`\\=12 |gdef|find@example#1\end{codeexample}[|endofcodeexample[#1]]
+|endgroup
+
+% define \returntospace.
+%
+% It should define NEWLINE as {}, spaces and tabs as \space.
+\begingroup
+\catcode`\^=7
+\catcode`\^^M=13
+\catcode`\^^I=13
+\catcode`\ =13%
+\gdef\returntospace{\catcode`\ =13\def {\space}\catcode`\^^I=13\def^^I{\space}}
+\gdef\showreturn{\show^^M}
+\endgroup
+
+\begingroup
+\catcode`\%=13
+\catcode`\^^M=13
+\gdef\commenthandler{\catcode`\%=13\def%{\@gobble@till@return}}
+\gdef\@gobble@till@return#1^^M{}
+\gdef\@gobble@till@return@ignore#1^^M{\ignorespaces}
+\gdef\typesetcomment{\catcode`\%=13\def%{\@typeset@till@return}}
+\gdef\@typeset@till@return#1^^M{{\def%{\char`\%}\textsl{\char`\%#1}}\par}
+\endgroup
+
+% Define tab-implementation functions
+% \codeexample@tabinit@replacementchars@
+% and
+% \codeexample@tabinit@catcode@
+%
+% They should ONLY be used in case that tab replacement is active.
+%
+% This here is merely a preparation step.
+%
+% Idea:
+% \codeexample@tabinit@catcode@ will make TAB active
+% and
+% \codeexample@tabinit@replacementchars@ will insert as many spaces as
+% /codeexample/tabsize contains.
+{
+\catcode`\^^I=13
+% ATTENTION: do NOT use tabs in these definitions!!
+\gdef\codeexample@tabinit@replacementchars@{%
+ \begingroup
+ \count0=\pgfkeysvalueof{/codeexample/tabsize}\relax
+ \toks0={}%
+ \loop
+ \ifnum\count0>0
+ \advance\count0 by-1
+ \toks0=\expandafter{\the\toks0\ }%
+ \repeat
+ \xdef\codeexample@tabinit@replacementchars@@{\the\toks0}%
+ \endgroup
+ \let^^I=\codeexample@tabinit@replacementchars@@
+}%
+\gdef\codeexample@tabinit@catcode@{\catcode`\^^I=13}%
+}%
+
+% Called after any options have been set. It assigns
+% \codeexample@tabinit@catcode
+% and
+% \codeexample@tabinit@replacementchars
+% which are used inside of
+%\begin{codeexample}
+% ...
+%\end{codeexample}
+%
+% \codeexample@tabinit@catcode is either \relax or it makes tab
+% active.
+%
+% \codeexample@tabinit@replacementchars is either \relax or it inserts
+% a proper replacement sequence for tabs (as many spaces as
+% configured)
+\def\codeexample@tabinit{%
+ \ifnum\pgfkeysvalueof{/codeexample/tabsize}=0\relax
+ \let\codeexample@tabinit@replacementchars=\relax
+ \let\codeexample@tabinit@catcode=\relax
+ \else
+ \let\codeexample@tabinit@catcode=\codeexample@tabinit@catcode@
+ \let\codeexample@tabinit@replacementchars=\codeexample@tabinit@replacementchars@
+ \fi
+}
+
+\newif\ifpgfmanualtikzsyntaxhilighting
+
+\pgfqkeys{/codeexample}{%
+ width/.code= {\setlength\codeexamplewidth{#1}},
+ graphic/.code= {\colorlet{graphicbackground}{#1}},
+ code/.code= {\colorlet{codebackground}{#1}},
+ execute code/.is if=code@execute,
+ code only/.code= {\code@executefalse},
+ pre/.store in=\code@pre,
+ post/.store in=\code@post,
+ % #1 is the *complete* environment contents as it shall be
+ % typeset. In particular, the catcodes are NOT the normal ones.
+ typeset listing/.code= {#1},
+ render instead/.store in=\code@render,
+ vbox/.code= {\def\code@pre{\vbox\bgroup\setlength{\hsize}{\linewidth-6pt}}\def\code@post{\egroup}},
+ ignorespaces/.code= {\let\@gobble@till@return=\@gobble@till@return@ignore},
+ leave comments/.code= {\def\code@catcode@hook{\catcode`\%=12}\let\commenthandler=\relax\let\typesetcomment=\relax},
+ tabsize/.initial=0,% FIXME : this here is merely used for indentation. It is just a TAB REPLACEMENT.
+ every codeexample/.style={width=4cm+7pt, tikz syntax=true},
+ from file/.code={\codeexamplefromfiletrue\def\codeexamplesource{#1}},
+ tikz syntax/.is if=pgfmanualtikzsyntaxhilighting,
+}
+
+
+\newread\examplesource
+
+
+% Opening, reading and closing the results file
+
+\def\opensource#1{
+ \immediate\openin\examplesource=#1
+}
+\def\do@codeexamplefromfile{%
+ \immediate\openin\examplesource\expandafter{\codeexamplesource}%
+ \def\examplelines{}%
+ \readexamplelines
+ \closein\examplesource
+ \expandafter\endofcodeexample\expandafter{\examplelines}%
+}
+
+\def\readexamplelines{
+ \ifeof\examplesource%
+ \else
+ \immediate\read\examplesource to \exampleline
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\examplelines\expandafter\expandafter\expandafter{\expandafter\examplelines\exampleline}
+ \expandafter\readexamplelines%
+ \fi
+}
+
+\let\code@pre\pgfutil@empty
+\let\code@post\pgfutil@empty
+\let\code@render\pgfutil@empty
+\def\code@catcode@hook{}
+
+\newif\ifcodeexamplefromfile
+\newdimen\codeexamplewidth
+\newif\ifcode@execute
+\newbox\codeexamplebox
+\def\codeexample[#1]{%
+ \begingroup%
+ \code@executetrue
+ \pgfqkeys{/codeexample}{every codeexample,#1}%
+ \pgfmanualswitchoncolors%
+ \ifcodeexamplefromfile\begingroup\fi
+ \codeexample@tabinit% assigns \codeexample@tabinit@[catcode,replacementchars]
+ \parindent0pt
+ \begingroup%
+ \par%
+ \medskip%
+ \let\do\@makeother%
+ \dospecials%
+ \obeylines%
+ \@vobeyspaces%
+ \catcode`\%=13%
+ \catcode`\^^M=13%
+ \code@catcode@hook%
+ \codeexample@tabinit@catcode
+ \relax%
+ \ifcodeexamplefromfile%
+ \expandafter\do@codeexamplefromfile%
+ \else%
+ \expandafter\find@example%
+ \fi}
+\def\endofcodeexample#1{%
+ \endgroup%
+ \ifcode@execute%
+ \setbox\codeexamplebox=\hbox{%
+ \ifx\code@render\pgfutil@empty%
+ {%
+ {%
+ \returntospace%
+ \commenthandler%
+ \xdef\code@temp{#1}% removes returns and comments
+ }%
+ \catcode`\^^M=9%
+ \colorbox{graphicbackground}{\color{black}\ignorespaces%
+ \code@pre\expandafter\scantokens\expandafter{\code@temp\ignorespaces}\code@post\ignorespaces}%
+ }%
+ \else%
+ \colorbox{graphicbackground}{\color{black}\ignorespaces%
+ \code@render}%
+ \fi%
+ }%
+ \ifdim\wd\codeexamplebox>\codeexamplewidth%
+ \def\code@start{\par}%
+ \def\code@flushstart{}\def\code@flushend{}%
+ \def\code@mid{\parskip2pt\par\noindent}%
+ \def\code@width{\linewidth-6pt}%
+ \def\code@end{}%
+ \else%
+ \def\code@start{%
+ \linewidth=\textwidth%
+ \parshape \@ne 0pt \linewidth
+ \leavevmode%
+ \hbox\bgroup}%
+ \def\code@flushstart{\hfill}%
+ \def\code@flushend{\hbox{}}%
+ \def\code@mid{\hskip6pt}%
+ \def\code@width{\linewidth-12pt-\codeexamplewidth}%
+ \def\code@end{\egroup}%
+ \fi%
+ \code@start%
+ \noindent%
+ \begin{minipage}[t]{\codeexamplewidth}\raggedright
+ \hrule width0pt%
+ \footnotesize\vskip-1em%
+ \code@flushstart\box\codeexamplebox\code@flushend%
+ \vskip-1ex
+ \leavevmode%
+ \end{minipage}%
+ \else%
+ \def\code@mid{\par}
+ \def\code@width{\linewidth-6pt}
+ \def\code@end{}
+ \fi%
+ \code@mid%
+ \colorbox{codebackground}{%
+ \pgfkeysvalueof{/codeexample/prettyprint/base color}%
+ \begin{minipage}[t]{\code@width}%
+ {%
+ \let\do\@makeother
+ \dospecials
+ \frenchspacing\@vobeyspaces
+ \normalfont\ttfamily\footnotesize
+ \typesetcomment%
+ \codeexample@tabinit@replacementchars
+ \@tempswafalse
+ \def\par{%
+ \if@tempswa
+ \leavevmode \null \@@par\penalty\interlinepenalty
+ \else
+ \@tempswatrue
+ \ifhmode\@@par\penalty\interlinepenalty\fi
+ \fi}%
+ \obeylines
+ \everypar \expandafter{\the\everypar \unpenalty}%
+ \pgfkeysvalueof{/codeexample/typeset listing/.@cmd}{#1}\pgfeov
+ }
+ \end{minipage}}%
+ \code@end%
+ \par%
+ \medskip
+ \endcodeexample\endgroup
+}
+
+\def\endcodeexample{\endgroup}
+
+
+\makeatother
+
+\usepackage{pgfmanual}
+
+
+% autoxref is now always on
+
+% \makeatletter
+% % \pgfautoxrefs will be defined by 'make dist'
+% \pgfutil@ifundefined{pgfautoxrefs}{%
+% \renewcommand\pgfmanualpdflabel[3][]{#3}% NO-OP
+% \def\pgfmanualpdfref#1#2{#2}%
+% \pgfkeys{
+% /pdflinks/codeexample links=false,% DISABLED.
+% }%
+% }{}
+% \makeatother
+
+\newdimen\pgfmanualcslinkpreskip
+
+% Styling of the pretty printer
+\pgfkeys{
+ /codeexample/syntax hilighting/.style={
+ /codeexample/prettyprint/key name/.code={\textcolor{keycolor}{\pgfmanualpdfref{##1}{\noligs{##1}}}},
+ /codeexample/prettyprint/key name with handler/.code 2 args={\textcolor{keycolor}{\pgfmanualpdfref{##1}{\noligs{##1}}}/\textcolor{blue!70!black}{\pgfmanualpdfref{/handlers/##2}{\noligs{##2}}}},
+ /codeexample/prettyprint/key value display only/.code={\textcolor{keycolor}{{\itshape{\let\pgfmanualwordstartup\relax\pgfmanualprettyprintcode{##1}}}}},
+ /codeexample/prettyprint/cs/.code={\textcolor{cscolor}{\pgfmanualcslinkpreskip4.25pt\pgfmanualpdfref{##1}{\noligs{##1}}}},
+ /codeexample/prettyprint/cs with args/.code 2 args={\textcolor{black}{\pgfmanualcslinkpreskip4.25pt\pgfmanualpdfref{##1}{\noligs{##1}}}\{\textcolor{black}{\pgfmanualprettyprintcode{##2}}\pgfmanualclosebrace},
+ /codeexample/prettyprint/cs arguments/pgfkeys/.initial=1,
+ /codeexample/prettyprint/cs/pgfkeys/.code 2 args={\textcolor{black}{\pgfmanualcslinkpreskip4.25pt\pgfmanualpdfref{##1}{\noligs{##1}}}\{\textcolor{black}{\pgfmanualprettyprintpgfkeys{##2}}\pgfmanualclosebrace},
+ /codeexample/prettyprint/cs arguments/begin/.initial=1,
+ /codeexample/prettyprint/cs/begin/.code 2 args={\textcolor{black}{##1}\{\textcolor{cscolor}{\pgfmanualpdfref{##2}{\noligs{##2}}}\pgfmanualclosebrace},
+ /codeexample/prettyprint/cs arguments/end/.initial=1,
+ /codeexample/prettyprint/cs/end/.code 2 args={\textcolor{black}{##1}\{\textcolor{cscolor}{\pgfmanualpdfref{##2}{\noligs{##2}}}\pgfmanualclosebrace},
+ /codeexample/prettyprint/word/.code={\pgfmanualwordstartup{\begingroup\pgfkeyssetvalue{/pdflinks/search key prefixes in}{}\pgfmanualpdfref{##1}{\noligs{##1}}\endgroup}},
+ /codeexample/prettyprint/point/.code={\textcolor{pointcolor}{\noligs{##1}}},%
+ /codeexample/prettyprint/point with cs/.code 2 args={\textcolor{pointcolor}{(\pgfmanualpdfref{##1}{\noligs{##1}}:\noligs{##2}}},%
+ /codeexample/prettyprint/comment font=\itshape,
+ /codeexample/prettyprint/base color/.initial=\color{basecolor},
+ /pdflinks/render hyperlink/.code={%
+ {\setbox0=\hbox{##1}%
+ \rlap{{\color{linkcolor}\dimen0\wd0\advance\dimen0by-\pgfmanualcslinkpreskip\hskip\pgfmanualcslinkpreskip\vrule width\dimen0 height-1pt depth1.6pt}}%
+ \box0%
+ }%
+ }
+ },/codeexample/syntax hilighting
+}
+
+\colorlet{keycolor}{black}
+\colorlet{cscolor}{black}
+\colorlet{pointcolor}{black}
+\colorlet{basecolor}{black}
+\colorlet{linkcolor}{black!8}
+
+\def\pgfmanualswitchoncolors{%
+ \colorlet{keycolor}{green!50!black}%
+ \colorlet{cscolor}{blue!70!black}
+ \colorlet{pointcolor}{violet}
+ \colorlet{basecolor}{black!55}
+ \colorlet{linkcolor}{white}
+}
+
+\makeatletter
+
+\def\pgfmanualwordstartup{\textcolor{black}}
+
+\def\noligs#1{\pgfmanualnoligs#1\kern0pt--\pgf@stop}%
+\def\pgfmanualnoligs#1--{%
+ \pgfutil@ifnextchar\pgf@stop{#1\pgfutil@gobble}{#1-\kern0pt-\kern0pt\pgfmanualnoligs}%
+}
+\makeatother
+
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: "beameruserguide"
+%%% End:
diff --git a/graphics/pgf/contrib/spectralsequences/manual/spectralsequences-howitworks.pdf b/graphics/pgf/contrib/spectralsequences/manual/spectralsequences-howitworks.pdf
new file mode 100644
index 0000000000..054c2d2347
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/spectralsequences-howitworks.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/spectralsequences/manual/spectralsequences-howitworks.tex b/graphics/pgf/contrib/spectralsequences/manual/spectralsequences-howitworks.tex
new file mode 100644
index 0000000000..ab2722bd55
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/spectralsequences-howitworks.tex
@@ -0,0 +1,121 @@
+\input spectralsequencesmanualpreamble
+
+\def\eatclnifpresent#1{#1}
+\def\pgfkeysname{pgfkeys}
+\def\file#1{\path{#1.code.tex}}
+\begin{document}
+\title{A brief overview of the \\ \sseqpages\ code}
+\author{Hood Chatham\\\mailtoHC}
+\maketitle
+\section{Introduction}
+The basic idea is comparable to a more elaborate version of \tikzcdpkg.
+We plan to draw multiple copies of a spectral sequence, so the commands are not issued inside of a picture environment.
+Instead, all information must be stored to draw later. The |\sseq@savedpaths| is responsible for storing the collection of objects of the spectral sequence.
+
+The user defines ``classes'' (which correspond roughly to generators of the spectral sequence $E_2$ / $E_1$ page).
+From the point of view of the programmer, a class is an object with a death page (either infinite or finite) signalling on which page it is the source or target of a differential
+and some pile of information on how to draw it. When the user calls the |\class| command, it makes a new class object with an appropriate name and stores the
+information to tell \spectralsequences\ how to draw the class later, and sets the page to be infinite. A macro informing spectralsequences about the class
+is added to |\sseq@savedpaths| so that it can be drawn later if appropriate.
+
+The |\d| command is similar -- we set the page of the source and target to be the current page and also the pages of any relevant structlines, store the page of the differential and the data needed to draw it, and add the differential to |\sseq@savedpaths|.
+
+The |\structline| command saves code to draw a line, and also figures out what page it should die on based on the smaller of the two death pages of the source and target. If the source and target haven't been killed yet, it hooks into them so that |\d| knows to set the page of this structline too.
+
+Now to draw a page of the spectral sequence, we start up a \tikzpictureenv\ environment, draw some axes,
+walk across |\sseq@savedpaths|, and for each class, we check whether the death page of the class is greater than or equal to the current page and if so we draw a corresponding
+pgf/tikz node. Similarly, we draw the differentials that lie on exactly the current page, and the subset of the structure lines with death page later than the current one.
+
+This is the core idea of the package. In addition to these core features are many important reusability features. For instance, we need a way to define reusable user macros that draw collections of classes and we need looping constructs.
+
+So, having heard this simple description, a reasonable question to ask is: why does it take in excess of 8000 lines of TeX code to accomplish these simple tasks? There are a few reasons. Firstly, the package handles a lot of use cases and has a quite a few different features and there is a large amount of intrinsic complexity to getting these things right. Another huge reason is that \TeX\ is a completely unreasonable coding environment. This is responsible for a good deal of the complexity in \file{sseqparsers}, for example.
+
+Perhaps the biggest single contributor to code complexity is performance. \tikzname\ is very robust, but it is not fast. \spectralsequences\ draws roughly cubically many classes in large diagrams, and my larger test examples have as many as 5,000 classes. If each class takes an extra millisecond to draw, that comes out to an extra five seconds of compilation time. Because of this, unless the performance critical drawing code is super optimized, the package will be way too slow on large diagrams. Most of the added complexity due to performance considerations is contained in \file{sseqdrawing}, but the hard parts of the key value code are all related to performance too.
+
+The last major source of complexity is the robust error handling code. Most \LaTeX\ packages have crappy error handling and result in inscrutable errors even in relatively reasonable use conditions. There are a two main reasons for this as far as I can tell: \LaTeX\ doesn't have good error handling tools and most people who write \LaTeX\ packages are not primarily programmers and have other priorities than ensuring that their packages have clean failure modes. The files \file{sseqmessages} and \file{sseqforeach} are entirely devoted to error handling, and almost all of the complexity of \file{sseqmacromakers} is tied up in error handling too.
+
+
+
+\section{Load Store}
+The file \file{sseqloadstore} defines two storage systems. The point of these systems is to ensure that unrelated spectral sequences do not interfere with each other. One system is faster and relatively storage intensive, and it is for macros that contain global information about the spectral sequence. These macros have default values which can be changed using |\sseqset|. The other system is for storing the data about the spectral sequence objects (classes, differentials, structlines, etc). This file is short and simple, but the seemingly innocuous features provided here lead to huge simplifications in much of the rest of the code.
+
+The first system works by making a list |\sseq@storelist| of the commands that need to be stored. It defines commands |\sseq@storecmds| and |\sseq@getcmds| which iterate over |\sseq@storelist| and copy each command between |\sseq@whatevercommand| and |\sseq@whatevercommand@@@\metatt{sseqname}|. Each command also has a default value stored in |\sseq@whatevercommand@@default|. This default can be changed by the user using |\sseqset| outside of a spectral sequence. There is also a command |\sseq@storelist@setdefaults| which loads the default values of all of the commands in |\sseq@storelist|. At the beginning of a \sseqdataenv\ or \sseqpageenv\ environment, if the spectral sequence is new then |\sseq@storelist@setdefaults| is run, and otherwise |\sseq@getcmds| is run. At the end of the \sseqdataenv\ environment, |\sseq@storecmds| is run.
+
+The second system basically is just semantic sugar for indexing into a command that has the name of the current spectral sequence inserted into it: the command |\sseq@obj{some name}| just expands to |\csname sseq.\sseq@thename.some name\endcsname|. This allows different spectral sequences to have different name spaces. A large number of commands to manipulate this are provided. All changes to objects are made global, so at the end of a \sseqpageenv\ environment, any changes that have been made must be reverted. The command |\sseq@cleanup@obj| checks if we are in a context where changes will have to be reverted, checks if an old value of the current object has been stored yet, and if neither of these are true, it adds reverting the current object to a ``cleanup'' command to be run at the end of the current environment.
+
+\section{Messages}
+The file \file{sseqmessages} defines the error handling code. It uses the delightful l3msg infrastructure which separates message content from the position the errors are triggered in and makes much more attractive error messages. One deficiency for my purposes in l3msg though is that it doesn't have very many hooks. My package knows a lot about the circumstances under which most errors trigger and wants to tell the user about this. The basic idea for this approach came from \tikzcdpkg. At the beginning of the \tikzcdenv\ environment, the |\errmessage| command is patched to add an annotation explaining what cell in the matrix the error occurred in. This is because \tikzcdenv\ has a two-pass algorithm, and so errors can occur far away from the code that triggered them.
+
+Anyways, I have a fairly complicated pile of extra information to add into the picture. Firstly, I reconstruct what the user said as closely as possible. This is done inside of \file{sseqmacromakers} and \file{sseqmain}. I also assemble a stack trace that indicates all loops and user macros and all loop variable values. I assemble all this context information and a little more, and then make an annotation message accordingly. All of the many cases here are handled using a pile of horrible spaghetti code.
+
+The annotation setup code is not expandable, so it cannot happen as the error is written to stderr. We need a setup hook before the error is triggered, we need a hook inside the body of the message, and we need a cleanup hook after the error is done to remove any local changes the setup code made. I make a copy of |\__msg_error_code:nnnnnn| and add these two hooks to the beginning and end. The annotation itself is prepended to |\__sseq_hooked_msg_see_documentation_text:n| which is conveniently located inside of the message text.
+
+The other interesting thing in this file is my code for handling |\end| mismatches. Because of the need for nested environment definitions, \LaTeX\ only checks that the environment being |\end|ed matches the current environment after running the |\end| code. However, the code for |\end{sseqpage}| tries to draw a picture, and drawing this picture depends on a large amount of state. If the current environment isn't \sseqpageenv, none of this state is actually present and so hundreds of incomprehensible low level errors happen before the check end code is run and \LaTeX\ gives the environment mismatch error. The fix for my package is to run my own checkend code, which is pretty simple. See my \href{https://tex.stackexchange.com/questions/378174/why-does-checkend-occur-after-running-endenvironment}{tex stack exchange question} for more details.
+
+\section{Loops}
+The file \file{sseqforeach} is responsible for defining looping constructs. It's mostly pretty simple. The first half defines |\DoUntilOutOfBounds|, which repeats some block of stack based code until the top of the stack is out of bounds. The most complicated part of this is the descent check -- it periodically checks that the top of the stack has moved towards the boundary of the page to prevent infinite loops.
+
+The other part of this file patches the |\foreach| command from \tikzname\ in order to make it inform \sseqpages\ what the user said for the foreach loop (as best as I can approximate) and what the loop variables are. This is for error messages -- the ``what the user said'' part will go into the stack trace, and the loop variables will be listed.
+
+
+\section{Macro Makers}
+The file \file{sseqmacromakers} defines commands to define commands. It is built on top of \xparsepkg\ but adds a large number of features specific to my package. Unfortunately, it depends on \xparsepkg\ internals and \xparsepkg\ is not yet stable. None of these dependencies are mission critical, but they significantly increase usability. I have attempted to make fallback code that will work even if incompatible \xparsepkg\ changes are made, but this is incomplete.
+
+Like \tikzname, \spectralsequences\ defines a bunch of commands that only make sense to use inside of certain environments. Thus, we define the command |\class| as |\sseq@class| and at the beginning of the \sseqdataenv\ or \sseqpageenv\ environments, we run a command |\sseq@installmacros| that does a bunch of things like |\let\class\sseq@class|. I want to use \xparsepkg\ to define |\sseq@class|, but the problem I run into is that \xparsepkg\ stores the name of the command being defined and uses that name in certain error messages. These error messages would refer incorrectly to |\sseq@class| instead of |\class|. The fix for this is pretty boring -- it just involves redefining macros back and forward. Anyways, I make a command |\sseq@DeclareDocumentCommandAs| that defines a command using \xparsepkg\ that gives errors as if it were named a specific other command. I use this for defining most of the user-facing macros.
+
+The rest of the file is responsible for defining |\NewSseqCommand| and |\NewSseqGroup|. These commands are relatively simple in principle -- the point of |\NewSseqCommand| is almost already accomplished by \xparsepkg\ already. Most of the complexity is introduced in order to improve the error messages that \spectralsequences\ produces. In particular, I want to reconstruct as closely as possible what the user said when they ran the command. This way, if an error occurs nested several commands deep, or inside of a loop, the user can still get a decent idea about where the error is coming from.
+
+
+\section{Keys}
+There are different options that make sense for the |\class| command versus for the |\d| command, and some options that do make sense for both need distinct handling. However, there are also overlaps. Thus, the key value system is naturally a tree structure. \pgfkeysname\ has support for ``directories'' which proves extremely valuable. Each directory has an unknown option handler, which by default throws an error. I have a command |\sseq@passoptionto| that hands the keys to the parent directory.
+% The directory structure is as follows:
+%\begin{tikzpicture}
+%\node {sseq@keys@unknown} child {
+% node { /sseqpages } child {
+% node {/sseqpages/class}
+% node {/sseqpages/differential}
+% }
+%\end{tikzpicture}
+
+\sseqpages\ is a two-pass algorithm. On the first pass, it creates the data structures necessary to encode the spectral sequence, and on the second pass, the spectral sequence is actually drawn. The second basic design feature of the \sseqpages\ key value system is that keys need to be able to do different things on the first and second pass. This is accomplished very simply -- I use two wrapper macros |\sseq@options@firstpass| and |\sseq@options@secondpass| for code that should only happen respectively on the first and second pass. To use them, I basically just define |\sseq@options@firstpass| as a no-op and |\sseq@options@secondpass| to add its argument to a macro to be stored for later use at draw time. However, in some circumstances I need to redefine these two hooks, either to delete their argument or to evaluate there arguments.
+
+Once we have this basic design, we can implement many of the basic features of \sseqpages. There is a problem, which is that I want to mix \tikzname\ keys with keys that my package defines gracefully. However, \tikzname\ keys execute code that assumes that we are in the middle of drawing something. One early design approach I used was to define my package's unknown option handler to do validation only on \tikzname\ keys on the first pass, and then store the keys and run |\pgfkeys| again to evaluate them at draw time.
+
+The third major design goal is to allow ``styles'' that change the display of logical collections of classes. That is, the user should be able to say something ``permanent cycles = red'' and change all permanent cycles (as identified by \spectralsequences) to red. Originally I implemented this by storing the keys that the user provided and using |\pgfkeys| at draw time to evaluate them each time I made a class. Here I ran into a problem: |\pgfkeys| is very slow. When I used this design and compiled a 5,000 class spectral sequence, saying \codeverb|classes = {red, red, red}| took over a second longer than not saying it. This was obviously an unsatisfactory state of affairs. The solution to this problem sped up the package tremendously, but at the cost of a large increase in design complexity of the key value system.
+
+The solution of course is to only run |\pgfkeys| on any given key once and store the result, rather than repeatedly using |\pgfkeys| on the same input. In order to do this, I needed to hook into |\pgfkeys| and change it so that every time that it would normally evaluate code, it should just store it into |\sseq@savedoptioncode|. Conveniently enough, there are only two places where |\pgfkeys| emits code, so this basic idea is easy enough. The problem is that many keys execute recursive calls to |\pgfkeys| that are state-dependent. Normally, the key code is executed instantly, so it can reasonably expect the state it needs to be preserved. However, if I defer the body of a key that makes such a recursive call, pieces of the necessary state are lost before the code is executed and it breaks. Thankfully, all such state-dependent recursive calls are made using the command |\pgfkeysalso|. So the fix is to first walk across the key code and find any instances of |\pgfkeysalso| that occur in it, and run these |\pgfkeysalso|s. Once this recursive expansion has taken place, the resulting code is independent of the state of the key value system's state and is safe to store for later use.
+
+\section{Main}
+The \file{sseqmain} defines the main environments and user commands. The logic is pretty much as described in the overview section, and nothing super notable happens beyond that. There are a lot of details to get right, in particular a lot of the mess in this file is due to the complicated interfacing with \file{sseqkeys}.
+
+
+
+\section{Parsers}
+The file \file{sseqparsers} is a bit of a grab bag. The code is grouped by structure more than by content, hence the name. Most importantly, it has all of the coordinate parsers that define the coordinate syntax. This file uses some amount of \LaTeX3 programming, though it is a bit of a chimera. There are three main reasons I did not use \LaTeX3 programming more broadly or consistently. The first is inexperience: I simply haven't used \LaTeX3 much. The second is that \LaTeX3 and \tikzname\ do not get along all that well. This is fixable but a pain. The third is that \LaTeX3 has a lot of fancy convenient robust macros, but I generally need sloppy fast macros. If I can write a faster macro that adds a large number of weird preconditions, for the purposes of \spectralsequences\ that is probably better.
+
+One very good reason to use |\ExplSyntax| in this file is that it gets rid of a lot of space hazards. In this file, I really just make use of the variants of |\exp_args| and |\exp_last_unbraced|. These macros are tremendous innovations that greatly improve expandable macro writing.
+
+One major annoyance is the need for |\sseq@ifintexpr|. This is a sanitizer for |\numexpr|. I don't understand why the \eTeX\ source doesn't contain an input sanitizer! \TeX\ does not support catch blocks or exceptions, so because we can't ask forgiveness we have to ask for permission. Anyways |\sseq@ifintexpr| was difficult to write and is slow. Together, |\sseq@ifintexpr| and |\numexpr| are still much faster than |\pgfmathparse| though, and the input sanitization only has to occur at the user input stage, so all of the internal uses of |\numexpr| don't pay this cost. Contrast the case for |\sseq@ifpgfmathexpr| which is my sanitizer for |\pgfmathparse|. All it does is redefine |\pgfmath@error| to throw away the error, set a flag, and quit out of |\pgfmathparse|. It was orders of magnitude easier to write.
+
+There is a parser that does some manipulation on \tikzname\ commands to process the options and the coordinates. The options processing is primarily for speed purposes, and the coordinate parsing I do because I want to make several changes to the way that tikz processes coordinates for the sake of better interoperability with the rest of the \spectralsequences\ feature set (these changes are unfortunately quite involved...). A third thing gained by this is that \sseqpages\ can know that the path looks reasonably close to being syntactically correct at compile time (though I don't run much of the tikz parser, so there's only so much it can tell).
+
+There are a few tricks in here that I think are relatively interesting. The one that I find the most interesting is as follows: suppose you have an expandable macro that needs error handling. The problem with errors in expandable macros is that the errors themselves are not expandable. My solution is to write the macro so that it either a) satisfies whatever the postcondition of the macro was supposed to be or b) is of the form |\protecterror{\someerror}|. Before the |\edef| occurs, the |\protecterror| is defined to expand to |\noexpand\protecterror\unexpanded{#1}|, so that it hangs around after being |\edef|'d. Suppose we are writing |\edef\theoutput{\somemacro{some input}}|. Then when you want to check for the error, redefine |\protecterror| to globally set some error flag, then say |\setbox0=\hbox{\theoutput}| in a local scope. Because |\hbox| evaluates its argument, this throws an error if |\theoutput| contains an error, and also |\protecterror| sets the error flag. However, |\theoutput| can have other random junk in it, which won't leak into the output. This solution doesn't depend on the error being in the top level of |\theoutput|, it can be in as deeply nested braces as necessary and doesn't require |\scantokens| hacking. It doesn't rely on any particular structure features other than the presence or absence of the error.
+Anyways, this is how I manage to have robust error messages with expandable macros. Obviously this isn't applicable to many circumstances, but in my code, my need for expandable macros is always in situations where I have a macro whose evaluation depends on temporary state, but whose result needs to be stored inside of a command (not an |\hbox|) for later handling.
+
+
+\section{Drawing}
+The most notable aspect of the \file{sseqdrawing} is that significant chunks of it need to be highly optimized. The command that is used the most times in a normal spectral sequence is the one that prints a class. It is important to be aware of differences between the efficiency of different low level pdf commands. It is worth pointing out that I have fallen into the trap in some places of optimizing code that didn't need optimization.
+
+In order to maintain all the features of \tikzname\ while being as fast as possible, all drawing code is done in two ways -- one way that is fast and uses low level \pgfpkg, and a second way that is slow and uses \tikzname\. Certain options the user asks for cause the fallback slow code to be run instead of the fast code. It is actually surprising to me how easy it has actually been to maintain this two-method code. It's unusual for the class drawing code to have to resort to the fallback, but if an edge is bent or has a label on it, \sseqpages\ uses \tikzname\ to draw it. Both of these are reasonably standard use cases, but hopefully they will only ever apply to a small percentage of edges in any diagram.
+
+In order to build the relevant chunks of the fast code, I copied the \tikzname\ main loop and deleted stuff until I got to the minimal subset of code that works for my purposes.
+One of the main enemies of speed in this section (other than the \tikzname\ parser and main loop which I avoid by using \pgfpkg) is the |\pgfmathparse| command, which comes up a lot even in \pgfpkg\ code and is quite slow. As much as possible, I try to get away with using the \eTeX\ |\numexpr| and |\dimexpr| commands, both of which are implemented in the \eTeX\ binary and so are very fast. These two commands both have annoying limitations, and it can be difficult to accomplish certain tasks with them. However, it is worth it in interest of speed. In fact, |\numexpr| is actually preferable to |\pgfmathparse| for most of the code outside of the drawing file, because \sseqpages\ deals primarily with integers and basic arithmetic |+-*/()| that |\numexpr| handles, and because |\pgfmathparse| has the unfortunate property of turning all integers into floats.
+
+The other difficulty that arises here is that \spectralsequences\ needs to be able to handle very large diagrams. In a normal |\tikzpicture|, the distance from |(0,0)| to |(1,0)| is 1cm. If you use |scale=0.5| for instance, and use a coordinate |(3,0)|, then the order that multiplications are performed in is $(3\times 1\textup{cm})\times 0.5$. The issue is that 600cm is an overflow, and this overflow occurs even if you have a very small scaling factor that would make that coordinate fit onto the page (which is probably a bit less than 600cm long). The solution is instead of applying a scaling transformation, I adjust the position of the coordinate (1,0), say to be 0.01cm. Then $600*0.01\textup{cm}= 6\textup{cm}$ leads to no overflow. This leads to various complications in the drawing code.
+
+There's a second more problematic issue though. Suppose that I want to zoom in on the range from 600 to 700 on a very large spectral sequence. The scale I want to use to fit this to the page will cause an overflow. To fix this I subtract an offset between the minimum and maximum value of x from every single coordinate. This adjusts the range so that it actually goes from say 0 to 100, and then no overflow occurs.
+
+The issue then is how to make this offset also apply to \tikzname\ primitives. In order to do this I patch into the \tikzname\ coordinate parser and every time it parses a coordinate add in the offsets in the appropriate place. There are a few spots where this goes awry and offsets are added to coordinates that are calculated relative to a another coordinate with the offset already calculated in (the |to| keyword is the main offender here), so there are second order fixes to prevent this.
+
+
+\end{document} \ No newline at end of file
diff --git a/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual-draftmode.pdf b/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual-draftmode.pdf
new file mode 100755
index 0000000000..f517d3ad93
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual-draftmode.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual-layoutcharts.tex b/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual-layoutcharts.tex
new file mode 100644
index 0000000000..480f7559c4
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual-layoutcharts.tex
@@ -0,0 +1,205 @@
+\sseqset{
+ distance label/.sseq style = {orange,{<[width = 4pt]}-},
+ description/.sseq style = {black, align = center},
+ title style={yshift=35pt,font=\Large}
+}
+\catcode`\| = 12 % | is active to be verbatim, but we need to use it here for our arrowhead specification.
+%
+\begin{sseqpage}[ grid = chess,
+ x range = {0}{5}, y range = {0}{5}, math nodes = false,
+ x axis clip padding = 0.15cm, y axis clip padding = 0.15cm,
+ right clip padding = 0.2cm, top clip padding = 0.2cm, axes gap = 25pt,
+ title = {Axis type border layout}
+]
+\begin{scope}[background]
+\sseq@savedpaths@add{\color{red}\pgfsetpath\sseq@theclippath\pgfusepath{draw}}
+\path (\sseq@xmin-3,\sseq@ymin-3) -- (\sseq@xmax+3,\sseq@ymax+3);
+\end{scope}
+
+\begin{scope}[background,|-|,blue]
+% axis clip padding
+\draw[shift = {(1,-\sseq@xaxisgap)}] (0,0)--(0,\sseq@xclip@axisgap-0);
+\draw[distance label,shift = {(1,-\sseq@xaxisgap+\sseq@xclip@axisgap/2)}] (0,0) .. controls (0.5,0) .. (0.5,-1.5)
+ node[description, below] {x axis\\ clip padding};
+%
+\draw[shift = {(-\sseq@yaxisgap,1)}] (0,0)--(\sseq@yclip@axisgap,0);
+\draw[distance label,shift = {(-\sseq@yaxisgap+\sseq@yclip@axisgap/2,1)}] (0,0) .. controls (0,0.3) .. (-0.7,0.3)
+node[description, left] {y axis\\ clip padding};
+
+
+% border clip padding
+\draw[shift = {(\sseq@xmax cm + \sseq@xaxis@end@extend-0.02cm,\sseq@ymax - 1)}] (-0.02cm,0)--(\sseq@clip@padding@right,0);
+\draw[distance label, shift = {(\sseq@xmax cm + \sseq@xaxis@end@extend+\sseq@clip@padding@right/2,\sseq@ymax-1)}] (0,0) .. controls (0,-0.7) ..(0.7,-0.7)
+ node[description, right] {right clip\\ padding};
+%
+\draw[shift = {(\sseq@xmax - 1,\sseq@ymax cm+\sseq@yaxis@end@extend)}] (0,0)--(0,\sseq@clip@padding@top);
+\draw[distance label, shift = {(\sseq@xmax -1,\sseq@ymax cm+\sseq@yaxis@end@extend+\sseq@clip@padding@top/2)}] (0,0) .. controls (0.2,0) .. (0.2,0.3)
+ node[description, above] {top clip\\ padding};
+
+% axis tail
+\draw[shift = {(\sseq@xmin-\sseq@yaxisgap-0.02cm,\sseq@ymin-\sseq@xaxisgap+0.1cm)}] (0,0) -- (-\sseq@xaxis@tail, 0);
+\draw[distance label,shift = {(\sseq@xmin-\sseq@yaxisgap-0.02cm-\sseq@xaxis@tail/2,\sseq@ymin-\sseq@xaxisgap+0.1cm)}] (0,0) .. controls (0,0.5) .. (-1,0.5)
+ node[description, left]{x axis\\ tail};
+%
+\draw[shift = {(\sseq@xmin-\sseq@yaxisgap+0.1cm,\sseq@ymin-\sseq@xaxisgap-0.02cm)}] (0,0) -- (0, -\sseq@yaxis@tail);
+\draw[distance label,shift = {(\sseq@xmin-\sseq@yaxisgap+0.1cm,\sseq@ymin-\sseq@xaxisgap-0.02cm-\sseq@yaxis@tail/2)}] (0,0) .. controls (0.5,0) .. (0.5,-1)
+ node[description, below]{y axis\\ tail};
+
+% extend end axis
+\draw[shift = {(\sseq@xmax,\sseq@ymin-\sseq@xaxisgap-0.1cm)}] (0,0)--(\sseq@xaxis@end@extend,0);
+\draw[distance label,shift = {(\sseq@xmax cm+\sseq@xaxis@end@extend/2,\sseq@ymin-\sseq@xaxisgap-0.1cm)}] (0,0) -- (0,-0.8)
+ node[description, below] {x axis\\ extend end};
+%
+\draw[shift = {(\sseq@xmin cm-\sseq@yaxisgap-0.1cm,\sseq@ymax)}] (0,0)--(0,\sseq@yaxis@end@extend);
+\draw[distance label,shift = {(\sseq@xmin cm- \sseq@yaxisgap-0.1cm,\sseq@ymax cm+\sseq@yaxis@end@extend/2)}] (0,0) -- (-0.6,0)
+ node[description, left] {y axis\\ extend end};
+
+
+% tick gap
+\draw[shift = {(\sseq@xmin+\sseq@xmax/2+0.2,-0.5-\sseq@xaxisgap)}] (0,0)--(0,-\sseq@xlabelgap);
+\draw[distance label,shift = {(\sseq@xmin+\sseq@xmax/2+0.2,-\sseq@xlabelgap/2-\sseq@xaxisgap)}] (0,0) .. controls (0.5 ,0) .. (0.5,-0.8)
+ node[below,black]{x tick gap};
+%
+\draw[shift = {(-0.5-\sseq@yaxisgap,\sseq@ymin+\sseq@ymax/2+0.2)}] (0,0)--(-\sseq@ylabelgap,0);
+\draw[distance label,shift = {(-\sseq@yaxisgap -\sseq@ylabelgap/2,\sseq@ymin+\sseq@ymax/2+0.2)}] (0,0) .. controls (0, -0.3) .. (-0.5,-0.3)
+node[left,black]{y tick gap};
+
+% axis gap
+\draw[shift = {(\sseq@xmax cm+0.17cm,\sseq@ymin cm-\sseq@xaxisgap+0.02cm)}] (0,0) -- (0, \sseq@xaxisgap);
+\draw[distance label,shift = {(\sseq@xmax cm+0.17cm,\sseq@ymin cm-\sseq@xaxisgap/2+0.02cm)}](0,0) .. controls (2,0) .. (2,0.5)
+node[above,description]{x axis gap};
+%
+\draw[shift = {(\sseq@xmin cm-\sseq@yaxisgap+0.02cm,\sseq@ymax cm+0.17cm)}] (0,0) -- (\sseq@yaxisgap,0);
+\draw[distance label,shift = {(\sseq@xmin cm-\sseq@yaxisgap/2+0.02cm,\sseq@ymax cm+0.17cm)}](0,0)--(0,1) %.. controls (0,1) .. (0.5,1);
+node[above,description]{y axis gap};
+\end{scope}
+
+\class(0,0)
+\class(5,0)
+\class(0,5)
+\end{sseqpage}
+
+\vskip20pt
+
+\begin{sseqpage}[ grid = chess, axes type=frame,
+ title = {Axes type frame layout},
+ x range = {0}{5}, y range = {0}{5}, math nodes = false,
+ x axis clip padding = 0.15cm, y axis clip padding = 0.15cm,
+ right clip padding = 0.2cm, top clip padding = 1cm, axes gap = 25pt
+]
+\begin{scope}[background]
+\sseq@savedpaths@add{\color{red}\pgfsetpath\sseq@theclippath\pgfusepath{draw}}
+\path (\sseq@xmin-3,\sseq@ymin-3) -- (\sseq@xmax+3,\sseq@ymax+3);
+\end{scope}
+
+\begin{scope}[background,|-|,blue]
+% axis clip padding
+\draw[shift = {(\sseq@xmax+0.5,-\sseq@xaxisgap)}] (0,0)--(0,\sseq@xclip@axisgap);
+\draw[shift = {(-\sseq@yaxisgap,\sseq@ymax+0.5)}] (0,0)--(\sseq@yclip@axisgap,0);
+\draw[distance label,shift = {(\sseq@xmax+0.5,-\sseq@xaxisgap+\sseq@xclip@axisgap/2)}] (0,0) .. controls (1,0) .. (1,-0.3)
+node[description, below] {x axis\\ clip padding};
+\draw[distance label,shift = {(-\sseq@yaxisgap+\sseq@yclip@axisgap/2,\sseq@ymax+0.5)}] (0,0) .. controls (0,0.5) .. (-0.5,0.5)
+node[description, left] {y axis\\ clip padding};
+
+\draw[shift = {(\sseq@xmax+0.5,\sseq@ymax cm+\sseq@xaxisgap)}] (0,0)--(0,-\sseq@xclip@axisgap);
+\draw[distance label,shift = {(\sseq@xmax+0.5,\sseq@ymax cm+\sseq@xaxisgap-\sseq@xclip@axisgap/2)}] (0,0) .. controls (-0.5,0) .. (-0.5,0.2)
+node[description, above] {x axis\\ clip padding};
+
+
+\draw[shift = {(\sseq@xmax cm +\sseq@yaxisgap,\sseq@ymax +0.5)}] (-\sseq@yclip@axisgap,0)--(0,0);
+\draw[distance label,shift = {(\sseq@xmax cm +\sseq@yaxisgap-\sseq@yclip@axisgap/2,\sseq@ymax +0.5)}] (0,0) .. controls (0,-0.5) .. (0.2,-0.5)
+node[description, right] {y axis\\ clip padding};
+
+
+% tick gap
+\draw[shift = {(\sseq@xmin+\sseq@xmax/2+0.2,-0.5-\sseq@xaxisgap)}] (0,0)--(0,-\sseq@xlabelgap);
+\draw[shift = {(-0.5-\sseq@yaxisgap,\sseq@ymin+\sseq@ymax/2+0.2)}] (0,0)--(-\sseq@ylabelgap,0);
+\draw[distance label,shift = {(\sseq@xmin+\sseq@xmax/2+0.2,-\sseq@xlabelgap/2-\sseq@xaxisgap)}] (0,0) .. controls (0.5 ,0) .. (0.5,-0.8)
+ node[below,black]{x tick gap};
+\draw[distance label,shift = {(-\sseq@yaxisgap -\sseq@ylabelgap/2,\sseq@ymin+\sseq@ymax/2+0.2)}] (0,0) .. controls (0, -0.3) .. (-0.5,-0.7)
+node[left,black]{y tick gap};
+
+% axis gap
+\draw[shift = {(\sseq@xmax cm+0.17cm,\sseq@ymin cm-\sseq@xaxisgap+0.02cm)}] (0,0) -- (0, \sseq@xaxisgap);
+\draw[shift = {(\sseq@xmin cm-\sseq@yaxisgap+0.02cm,\sseq@ymax cm+0.17cm)}] (0,0) -- (\sseq@yaxisgap,0);
+\draw[distance label,shift = {(\sseq@xmax cm+0.17cm,\sseq@ymin cm-\sseq@xaxisgap/2+0.02cm)}](0,0) .. controls (2,0) .. (2,0.5)
+node[above,description]{x axis gap};
+\draw[distance label,shift = {(\sseq@xmin cm-\sseq@yaxisgap/2+0.02cm,\sseq@ymax cm+0.17cm)}](0,0)--(0,1) %.. controls (0,1) .. (0.5,1);
+node[above,description]{y axis gap};
+
+\draw[shift = {(\sseq@xmax cm-0.02cm,\sseq@ymin cm+0.17cm)}] (0,0) -- (\sseq@yaxisgap,0);
+\draw[distance label,shift = {(\sseq@xmax cm-0.02cm+\sseq@yaxisgap/2,\sseq@ymin cm+0.17cm)}](0,0) .. controls (0,1) .. (0.8,1)
+ node[right,description]{y axis gap};
+\draw[shift = {(\sseq@xmin cm+0.17cm,\sseq@ymax cm-0.02cm)}] (0,0) -- (0,\sseq@xaxisgap);
+\draw[distance label,shift = {(\sseq@xmin cm+0.17cm,\sseq@ymax cm-0.02cm+\sseq@xaxisgap/2)}](0,0) .. controls (1.3,0) .. (1.3,0.75)
+ node[above,description]{x axis gap};
+\end{scope}
+
+\class(0,0)
+\class(5,0)
+\class(0,5)
+\end{sseqpage}
+
+
+\begin{sseqpage}[ grid = chess, axes type=center,
+ title = {Axes type center layout},
+ x range = {-3}{3}, y range = {-3}{3}, math nodes = false,
+ x axis clip padding = 0.15cm, y axis clip padding = 0.15cm,
+ right clip padding = 0.2cm, top clip padding = 0.2cm,
+ left clip padding = 0.2cm, bottom clip padding = 0.2cm %axes gap = 25pt
+]
+\begin{scope}[background]
+\sseq@savedpaths@add{\color{red}\pgfsetpath\sseq@theclippath\pgfusepath{draw}}
+\path (\sseq@xmin-3,\sseq@ymin-3) -- (\sseq@xmax+3,\sseq@ymax+3);
+\end{scope}
+
+\begin{scope}[background,|-|,blue]
+
+% tick gap
+\draw[shift = {(\sseq@xmin-0.4,-\sseq@xaxisgap-0.02cm)}] (0,0)--(0,-\sseq@xlabelgap);
+\draw[distance label,shift = {(\sseq@xmin-0.4,-\sseq@xaxisgap-0.02cm-\sseq@xlabelgap/2)}] (0,0) -- (-0.5,0)
+ node[left,black]{x tick gap};
+
+\draw[shift = {(-0.02cm-\sseq@yaxisgap,\sseq@ymin-0.4)}] (0,0)--(-\sseq@ylabelgap,0);
+\draw[distance label,shift = {(-0.02cm-\sseq@yaxisgap -\sseq@ylabelgap/2,\sseq@ymin-0.4)}] (0,0) -- (0,-0.6)
+ node[below,black]{y tick gap};
+
+% border clip padding
+\draw[shift = {(\sseq@xmin cm - \sseq@xaxis@start@extend+0.02cm,\sseq@ymin +1)}] (0,0)--(-\sseq@clip@padding@left,0);
+\draw[distance label, shift = {(\sseq@xmin cm - \sseq@xaxis@start@extend-\sseq@clip@padding@left/2,\sseq@ymin +1)}] (0,0) .. controls (0,-0.5) ..(-0.5,-0.5)
+ node[description, left] {left clip\\ padding};
+%
+\draw[shift = {(\sseq@xmax cm + \sseq@xaxis@end@extend-0.02cm,\sseq@ymin +1)}] (0,0)--(\sseq@clip@padding@right,0);
+\draw[distance label, shift = {(\sseq@xmax cm + \sseq@xaxis@end@extend+\sseq@clip@padding@right/2,\sseq@ymin +1)}] (0,0) .. controls (0,-0.5) ..(0.5,-0.5)
+ node[description, right] {right clip\\ padding};
+%
+\draw[shift = {(\sseq@xmin+1 ,\sseq@ymax cm+\sseq@yaxis@end@extend-0.02cm)}] (0,0)--(0,\sseq@clip@padding@top);
+\draw[distance label, shift = {(\sseq@xmin+1,\sseq@ymax cm -0.02cm+\sseq@yaxis@end@extend+\sseq@clip@padding@top/2)}] (0,0) .. controls (-0.9,0)..(-0.9,0.3)
+ node[description, above] {top clip\\ padding};
+%
+\draw[shift = {(\sseq@xmin +1 ,\sseq@ymin cm-\sseq@yaxis@start@extend+0.02cm)}] (0,0)--(0,-\sseq@clip@padding@bottom);
+\draw[distance label, shift = {(\sseq@xmin +1 ,\sseq@ymin cm +0.02cm - \sseq@yaxis@start@extend-\sseq@clip@padding@bottom/2)}] (0,0) .. controls (-0.9,0)..(-0.9,-0.4)
+ node[description, below] {bottom clip\\ padding};
+
+% extend axis
+\draw[shift = {(\sseq@xmax,-\sseq@xaxisgap+0.1cm)}] (0,0)--(\sseq@xaxis@end@extend,0);
+\draw[distance label,shift = {(\sseq@xmax cm+\sseq@xaxis@end@extend/2,-\sseq@xaxisgap+0.1cm)}] (0,0) .. controls (0,0.5) .. (0.9,0.5)
+ node[description, right] {x axis\\ extend end};
+%
+\draw[shift = {(-\sseq@yaxisgap+0.1cm,\sseq@ymax)}] (0,0)--(0,\sseq@yaxis@end@extend);
+\draw[distance label,shift = {(-\sseq@yaxisgap+0.1cm,\sseq@ymax cm+\sseq@yaxis@end@extend/2)}] (0,0) .. controls (0.4,0)..(0.4,0.7)
+ node[description, above] {y axis\\ extend end};
+%
+\draw[shift = {(\sseq@xmin,-\sseq@xaxisgap+0.1cm)}] (0,0)--(-\sseq@xaxis@start@extend,0);
+\draw[distance label,shift = {(\sseq@xmin cm-\sseq@xaxis@start@extend/2,-\sseq@xaxisgap+0.1cm)}] (0,0) .. controls (0,0.5) .. (-0.7,0.5)
+ node[description, left] {x axis\\ extend start};
+%
+\draw[shift = {(-\sseq@yaxisgap+0.1cm,\sseq@ymin)}] (0,0)--(0,-\sseq@yaxis@start@extend);
+\draw[distance label,shift = {(-\sseq@yaxisgap+0.1cm,\sseq@ymin cm-\sseq@yaxis@start@extend/2)}] (0,0) .. controls (2,0)..(2,-0.7)
+ node[description, below] {y axis\\ extend start};
+\end{scope}
+
+\class(0,0)
+\class(5,0)
+\class(0,5)
+\end{sseqpage} \ No newline at end of file
diff --git a/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual.pdf b/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual.pdf
new file mode 100644
index 0000000000..d5cbde1a3c
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual.tex b/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual.tex
new file mode 100644
index 0000000000..4681bd03df
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanual.tex
@@ -0,0 +1,2087 @@
+%%
+%% Package: spectralsequences v1.2.2 2017-09-16 2017-09-16
+%% Author: Hood Chatham
+%% Email: hood@mit.edu
+%% Date: 2019-02-18
+%% License: Latex Project Public License
+%%
+%% File: spectralsequencesmanual.tex
+%%
+%% Manual content
+%%
+
+%
+% TODO:
+%
+% maybe move more examples into external files?
+%
+% consistency issues?
+% perhaps think about ordering, particularly of "Misc commands" section
+% tutorial
+% explain / cross reference examples folder?
+% \sseqlastlabel is not currently documented.
+%
+\def\version{Version 1.2.2}
+
+
+\input spectralsequencesmanualpreamble
+
+
+\begin{document}
+\newgeometry{margin = 4cm,nohead}
+\begin{titlepage}
+\title{\sseqpages}
+\author{Hood Chatham\\\mailtoHC}
+\date{\version\\\today}
+ \maketitle \thispagestyle{empty}
+
+\begin{abstract}
+\noindent
+The \sseqpages\ 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\ 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}
+
+\restoregeometry
+\stepcounter{page}
+\newpage
+\thispagestyle{empty} % Should the table of contents have a page number?
+\tableofcontents
+\newpage
+\section{Introduction}
+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 = 8.7cm]
+\begin{sseqdata}[ name = basic, xscale = 0.6,
+ cohomological Serre grading ]
+\class(0,0)
+\class(0,2)
+\class(3,0)
+\class(3,2)
+\d3(0,2)
+\end{sseqdata}
+\printpage[ name = basic, page = 3 ] \quad
+\printpage[ name = basic, page = 4 ]
+\end{codeexample}
+\codeverb|\begin{sseqdata}[name = basic, cohomological Serre grading]| starts the declaration of the data of a spectral sequence named |basic| with cohomological Serre grading -- that is, the page $\mathtt{r}$ differentials go $\mathtt{r}$ to the right and down $\mathtt{r-1}$. Then we specify four classes and one page 3 differential, and we ask \sseqpages\ to print the third and fourth pages of the spectral sequence. Note that on the fourth page, the source and target of the differential have disappeared.
+
+\subsection{Installation}
+In both \miktex\ and \texlive\ installation should be automatic -- your \TeX\ distribution should automatically install the package the first time you include |\usepackage{spectralsequences}| in a document and compile it. However, in 2016, \texlive\ made an incompatible change to their database, so no new packages will run on versions of \texlive\ from before 2016. This includes \sseqpages. If you have an old version of \texlive, you can either perform a manual install,
+or, better, you should install an up to date version of \texlive. If you want to do a manual install, see \href{https://tex.stackexchange.com/a/73017}{this \TeX stack exchange post} for instructions.
+
+\subsection{Memory Constraints}
+In a default \TeX\ install, \pdfLaTeX\ has small static memory caps that prevent it from using more than about 60 megabytes of total ram. However, \spectralsequences\ and \pgfpkg/\tikzpkg\ use a large amount of memory. For this reason, using \pdfLaTeX\ with a default install, you cannot draw more than about 2500 classes across all of your diagrams (fewer if you include differentials, structure lines, and other features). There are a few solutions to this.
+
+The easiest solution is to run \LuaLaTeX. \LuaLaTeX\ dynamically allocates memory and so is unlikely to run out of it. Using \LuaLaTeX\ on my computer, I can compile a document that draws two copies of a diagram with 20,000 classes in it (so a total of 40,000 classes). This takes about 50 seconds and 250 megabytes of ram. I expect any real-world use case will compile fine on a modern computer using \LuaLaTeX. This option has the advantage that any modern \TeX\ install comes with a copy of \LuaLaTeX, and that \LuaLaTeX\ is the designated successor to \pdfLaTeX. It has the disadvantage that there are some incompatibilities between \LuaLaTeX\ and \pdfLaTeX\ so if your document depends on \pdfLaTeX-specific features, it might be a pain to switch to \LuaLaTeX.
+
+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 might be why. The solution is to convert fragile macros into robust ones. Common examples of fragile macros include |\widehat| and |\underline|. My suggested solution to this is to add the following code to your preamble for each fragile macro (example given for |\mathbb|):
+\begin{codeexample}[code only]
+\let\oldwidehat\widehat
+\protected\def\widehat{\oldwidehat}
+\end{codeexample}
+
+
+\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\ 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\ 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}
+
+\begin{command}{\printpage\moptions}
+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}
+\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\ will automatically arrange them in a pre-specified pattern. This pattern may be altered using the |class pattern| option.
+\begin{codeexample}[]
+\begin{sseqpage}[ no axes, ymirror, yscale = 0.8 ]
+\class(0,0)
+\class(1,0) \class(1,0)
+\class(0,1) \class(0,1) \class(0,1)
+\class(1,1) \class(1,1) \class(1,1) \class(1,1)
+\class(0,2) \class(0,2) \class(0,2) \class(0,2) \class(0,2)
+\class(1,2) \class(1,2) \class(1,2) \class(1,2) \class(1,2) \class(1,2)
+\end{sseqpage}
+\end{codeexample}
+
+The effect of the |\class| command is to print a \tikzpkg\ node on a range of pages. Any option that would work for a \tikzpkg\ |\node| command will also work in the same way for the |\class|, |\replaceclass|, and |\classoptions| commands.
+
+If a class is the source or the target of a differential on a certain page, then the page of the class is set to that page, and the class is only rendered on pages up to that number:
+\begin{codeexample}[width = 8cm]
+\begin{sseqdata}[ name = class example,
+ Adams grading,
+ yscale = 0.53 ]
+\class(1,0)
+\class(0,2)
+\class(0,3)
+\d2(1,0)
+\end{sseqdata}
+\printpage[ name = class example, page = 2 ]
+\quad
+\printpage[ name = class example, page = 3 ]
+\end{codeexample}
+
+See the \pgfmanualpdfref{class options}{class options} section for a list of the sort of options available for classes.
+\end{command}
+
+\begin{commandlist}{{\replaceclass\ooptions\parargthreeopt{x}{y}{n}},\replaceclass\ooptions\pararg{classname}, \replacesource\ooptions, \replacetarget\ooptions}
+After a class is the source or target of a differential, it disappears on the next page. However, some differentials are not injective or not surjective. Using the command |\replaceclass| causes a new symbol to appear on the page after a class supported or accepted a differential (or both). If there are multiple classes at the coordinate |(x,y)| you may specify which using an integer or a |tag| $n$. By default, this command will affect the first class placed in that position. You can also provide the |class:name| of a class. The variants |\replacesource| and |\replacetarget| replace the source and target respectively of the most recent differential.
+\begin{codeexample}[]
+\begin{sseqdata}[name = replace class example, Adams grading, classes = {draw = none } ]
+\class["\mathbb{Z}"](0,3)
+\class["\mathbb{Z}"](1,1)
+\class["\mathbb{Z}"](1,0)
+\d["\cdot 2"]2(1,1)
+\replacetarget["\mathbb{Z}/2"] %\replaceclass["\mathbb{Z}/2"](0,3)
+\d[->>]3(1,0)
+\replacesource["2\mathbb{Z}"] % \replaceclass["2\mathbb{Z}"](1,0)
+\end{sseqdata}
+\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 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}, \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 no coordinate is indicated at all, then |\lastclass| is used.
+\begin{codeexample}[width = 6cm]
+\begin{sseqdata}[ name = class options example,
+ classes = fill ]
+\class(2,1)
+\foreach \x in {0,...,2} \foreach \y in {0,1} {
+ \class(\x,\y)
+}
+\end{sseqdata}
+\begin{sseqpage}[ name = class options example,
+ right clip padding = 0.6cm ]
+\classoptions[red](2,1,2) % Only is red on this page!
+\node[ background ] at (0.3,-2.2)
+ {\textup{The red class is the problem}};
+\end{sseqpage}
+\end{codeexample}
+Another reason to use this is to give a label to one instance of a class that shows up in a loop or a command defined using |\NewSseqGroup|:
+\begin{codeexample}[width = 6cm]
+\NewSseqGroup\mygroup {} {
+ \class(0,0)
+ \class(0,1)
+ \class(0,2)
+ \class(1,1)
+ \class(2,2)
+ \structline(0,0)(0,1)
+ \structline(0,1)(0,2)
+ \structline(0,0)(1,1)
+ \structline(1,1)(2,2)
+}
+\begin{sseqpage}[ classes = fill, class labels = { left = 0.3em } ]
+\mygroup(0,0)
+\mygroup(1,2)
+\classoptions["2"](0,1)
+\classoptions["\eta"](1,1)
+\end{sseqpage}
+\end{codeexample}
+See the \pgfmanualpdfref{class options}{class options} section for a list of the sort of options available for classes.
+\end{commandlist}
+
+\begin{commandlist}{
+ {\d\ooptions\meta{page}},
+ {\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\ 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\ 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 ]
+\class(0,2)
+\class(1,2)
+\class(1,1)
+\class(1,0)
+\structline(1,2)(0,2)
+\structline(1,2)(1,1)
+\structline(1,1)(1,0)
+\d2(1,0)
+\end{sseqdata}
+\printpage[ name = d example, page = 2 ] \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:
+|\d\meta{page}\pars{\meta{x},\meta{y}\opt{,\sourcen,\targetn}}|
+\begin{codeexample}[width = 7.5cm]
+\begin{sseqpage}[ Adams grading, yscale = 0.8 ]
+\class(1,0) \class(1,0)
+\class(0,2) \class(0,2)
+\d2(1,0,1,2)
+\class(2,0) \class(2,0)
+\class(1,2)
+\d2(2,0,2)
+\class(3,0)
+\class(2,2) \class(2,2)
+\d2(3,0,,2)
+\end{sseqpage}
+\end{codeexample}
+Negative indices will count from the most recent class in the coordinate (so 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)
+\class(0,2) \class(0,2)
+\d[blue]2(1,0,-1,-1)
+\class(1,0)
+\class(0,2)
+\d[orange]2(1,0,-1,-1)
+\class(1,0)
+\d[red]2(1,0,-1,-2)
+\end{sseqpage}
+\end{codeexample}
+\end{commandlist}
+
+\begin{commandlist}{
+ {\doptions\moptions\meta{page}\pars{\meta{x},\meta{y}\opt{,\sourcen,\targetn}}},
+ {\doptions\moptions\meta{page}\pars{\sourcename\opt{,\targetn}}},
+ {\doptions\moptions\meta{page}\pars{\sourcecoord}\pars{\targetcoord}}%
+}
+This command adds options to an existing differential, just like |\classoptions| except for differentials. Its syntax is identical to that of |\d|.
+\end{commandlist}
+
+\begin{command}{\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 = 7.5cm]
+\DeclareSseqGroup\tower {} {
+ \class(0,0)
+ \foreach \y in {1,...,5} {
+ \class(0,\y)
+ \structline
+ }
+ \class(0,2)
+ \structline(0,1,-1)
+ \structline(0,3,-1)
+}
+\begin{sseqdata}[ name = structline example,
+ classes = { circle, fill },
+ Adams grading, no axes,
+ yscale = 1.28 ]
+\class(1,1) \class(1,2)
+\class(2,3) \class(2,3) \class(2,5)
+\tower[classes = blue](0,0)
+\tower[struct lines = dashed,orange](1,0)
+\tower[struct lines = red](2,0)
+\d2(1,1,2)
+\end{sseqdata}
+\printpage[ name = structline example, page = 2 ] \quad
+\printpage[ name = structline example, page = 3 ]
+\end{codeexample}
+\end{command}
+
+\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}
+
+\begin{command}{\circleclasses\ooptions\pars{\sourcecoord}\pars{\targetcoord}}
+This command is a lot like |\structline| except that it puts a circle around the classes instead of connecting them with a line. It might take a certain amount of fiddling with options to get |\circleclasses| to produce good results. There is no |\circleclassesoptions| command because it doesn't seem necessary and (more importantly) I didn't feel like making one. Maybe someday I'll put one in.
+\end{command}
+
+\begin{commandlist}{\draw,\path,\node,\clip}
+Any code that would work in a \tikzpictureenv\ 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:
+\codeexample[from file=tikz]
+\end{commandlist}
+
+
+\section{Options for the main commands}
+\subsection{Universal options}
+The following options work with all of the drawing commands in this package, including |\class|, |\d|, and |\structline|, their friends |\replaceclass|, |\classoptions|, |\doptions|, and |\structlines|, as well as with \tikzpkg\ primitives.
+\begin{keylist}{xshift = \meta{integer},yshift = \meta{integer}}
+Shifts by integer values are the only coordinate changes that are allowed to be applied to |\class|, |\d|, |\structline|, their relatives, or to a \scopeenv\ environment that contains any of these commands. These shift commands help with reusing code. For instance:
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ cohomological Serre grading, yscale = 0.45 ]
+\foreach \x in {0,1} \foreach \y in {0,1} {
+ \begin{scope}[ xshift = \x, yshift = \y ]
+ \class(2,0)
+ \class(0,1)
+ \d2(0,1)
+ \end{scope}
+}
+\end{sseqpage}
+\end{codeexample}
+This code segment is very useful so \sseqpages\ has the command |\NewSseqGroup| which to make code like this more convenient. The following code produces the same output as above:
+\begin{codeexample}[code only,width = 6cm]
+\NewSseqGroup\examplegroup {} {
+ \class(2,0)
+ \class(0,1)
+ \d2(0,1)
+}
+\begin{sseqpage}
+\examplegroup(0,0)
+\examplegroup(0,1)
+\examplegroup(1,0)
+\examplegroup(1,1)
+\end{sseqpage}
+\end{codeexample}
+
+
+A word of warning: the behavior of |xshift| in \sseqpages\ 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\ \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 ]
+\class[red](0,0)
+\class[blue](1,0)
+\class[green](2,0)
+\class[cyan](0,1)
+\class[magenta](1,1)
+\class[yellow](2,1)
+\class[blue!50!red](0,2) % a 50-50 blend of blue and red
+\class[green!30!yellow](1,2) % 30% green, 70% yellow
+\class[blue!50!black](2,2)
+\end{sseqpage}
+\end{codeexample}
+\end{manualentry}
+
+\begin{manualentry}{\pgfmanualpdflabel{""quotes}{}|"|\meta{text}|"|\opt{\meta{options}}}
+Specify a label for a class, a differential, or a structure line. This uses the \tikzpkg\ quotes syntax. If the label text includes an equal sign or comma, you need to enclose the entire label in braces, e.g., \codeverb|\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]
+\begin{sseqpage}[ classes = { minimum width = width("a") + 0.5em }, no axes ]
+\class["a"](0,0)
+\class["a", red](1,0)
+\class["a" black, red](2,0)
+\class["b" above](0,1)
+\class["b" { below right, yshift = 0.1cm }](1,1)
+\class["a" { above right = {1em} }](2,1)
+\end{sseqpage}
+\end{codeexample}
+You can adjust the default behavior of class labels using the |labels| style option or its relatives |class labels|, |inner class labels| or |outer class labels|.
+Note that it is also possible to give a label to a |\node| this way, although the behavior is slightly different. In particular, the label defaults to the |above| position instead of going in the |\node| text by default. Also, this won't respect the various label style options like |labels|, etc.
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ no axes ]
+\class(0,0)
+\class(2,0)
+\node[circle, fill, "a"] at (1,0) {};
+\end{sseqpage}
+\end{codeexample}
+
+\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)
+\class(0,2)
+\structline["a"' blue](0,0)(0,1)
+\class(1,0)
+\class(1,1)
+\structline["b"](1,0)(1,1)
+\d[ "\cdot 2" { pos = 0.7, yshift = -5pt } ] 2 (1,0)
+\end{sseqpage}
+\end{codeexample}
+You can use the style options |labels|, |edge labels|, |differential labels|, and |struct line labels| to adjust the styling of edge labels. For instance, if you would prefer for the labels to default to the left hand side of the edge rather than the right hand side, you could say |edge labels = {auto = left}|.
+You can also use quotes to label edges drawn with \tikzpkg\ primitives:
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ yscale = 0.58, no axes ]
+\class(0,0)
+\class(1,1)
+\draw (1,0) to["hi"'{ pos = 0.7, yshift = -0.5em }] (0,1);
+\end{sseqpage}
+\end{codeexample}
+
+\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} {
+ \class(\x,\y)
+}
+\structline["a" red](0,0)(0,1)
+\structline["a'"'blue,"b"{yshift = 1em}](1,0)(1,1)
+\structline["c" description](2,0)(2,1)
+\end{sseqpage}
+\end{codeexample}
+\end{key}
+\end{manualentry}
+
+
+
+\subsection{Options for \sectionstring\class}\pgfmanualpdflabel{class options}{}
+Because the main job of the |\class| command is to print a \tikzpkg\ |\node| on the appropriate pages of the spectral sequence, most options that would work for a \tikzpkg\ node also work for the commands |\class|, |\replaceclass|, and |\classoptions|. Here are a few that you might care about:
+\begin{manualentry}{A \tikzpkg\ shape}
+If you give the name of a \tikzpkg\ shape, the class node will be of that shape. The standard \tikzpkg\ shapes are |circle| and |rectangle|. \sseqpages\ defines two new shapes:
+\begin{key}{circlen = \meta{n}}
+This draws $n$ concentric circles. It's intended for indicating a $\mathbb{Z}/p^n$ summand. For large values of $n$ the result isn't all that appealing.
+\begin{codeexample}[]
+\begin{sseqpage}[ no axes ]
+\class[circlen = 2](0,0)
+\class[circlen = 2,fill](1,0)
+\class[circlen = 3](0,1)
+\class[circlen = 4](1,1)
+\end{sseqpage}
+\end{codeexample}
+\end{key}
+
+\begin{keylist}{newellipse,ellipse ratio = \meta{ratio}}
+This shape is used for |\circleclasses|. It's a variant on the |ellipse| shape that gives more control over the ellipse's aspect ratio.
+\end{keylist}
+
+There are many more \tikzpkg\ shapes in the shapes library, which you can load using the command |\usetikzlibrary{shapes}|. The following are some examples:
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ no axes, classes = { inner sep = 0.4em },
+ class placement transform = { scale = 1.8 },
+ yscale = 1.63 ]
+\class(0,0)
+\class[isosceles triangle](2,0)
+\class[rectangle](1,0)
+\class[diamond](0,1)
+\class[semicircle](1,1)
+\class[regular polygon, regular polygon sides = 5](2,2)
+\class[regular polygon, regular polygon sides = 6](2,2)
+\class[regular polygon, regular polygon sides = 7](2,2)
+\class[regular polygon, regular polygon sides = 8](2,2)
+\end{sseqpage}
+\end{codeexample}
+See the \href{\pgfmanualurl#section.49}{\tikzpkg\ manual} for more information.
+\end{manualentry}
+
+\begin{keylist}{minimum width = \meta{dimension}, minimum height = \meta{dimension}, minimum size = \meta{dimension}, inner sep = \meta{dimension}, outer sep = \meta{dimension}}
+These options control the size of a node. This is typically useful to make the size of nodes consistent independent of the size of their label text. For instance:
+\begin{codeexample}[width = 5cm]
+\begin{sseqdata}[ name = minimum width example, no axes, yscale = 0.8 ]
+\class["ab"](0,0)
+\class["a"](0,1)
+\class(0,2)
+\end{sseqdata}
+\printpage[ name = minimum width example ]
+\printpage[ name = minimum width example,
+ change classes = { blue, minimum width = width("ab") + 0.5em } ]
+\end{codeexample}
+\end{keylist}
+
+\begin{key}{class:name = \meta{node name}}
+The |\class| command makes a \tikzpkg\ node on appropriate pages. You can refer to this node using \tikzpkg\ commands by using its coordinates. Using the |class:name| option, you can give the node a name, which you can use to refer to the class. Using names creates more readable code. The |show name| option can be used to display the names of classes. You can modify the names of classes systematically using the options |class name prefix|, |class name postfix|, and |class name handler|.
+
+Named classes are immune to coordinate transformations. For example, in the following code, |xshift| does not apply to the nodes specified by |(id)| and |(eta)| but does apply to the coordinate specified by |(1,1)|:
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[classes = { show name=above }]
+\class[class:name = 1](0,0)
+\class[class:name = \eta](1,1)
+\class(2,1)
+\structline[xshift = 1] (1) (\eta)
+\structline[xshift = 1,blue] (1) (1,1)
+\end{sseqpage}
+\end{codeexample}
+\end{key}
+
+\begin{key}{show name = \meta{label options}}
+\declareasstyle{show name}
+This option is like saying |"class name"\marg{label options}| if the class has a name, and does nothing if the class has no name. If the class has multiple names, only the most recent is used. This is particularly useful with class styles, . For instance, by saying |this page classes = { show name = above }| you can display names of all of the sources and targets of differentials on each page.
+\begin{codeexample}[width=7cm]
+\begin{sseqdata}[
+ name = show name example,
+ this page classes = { show name = { above right, pin } }
+]
+\class[ name = a ](0,2)
+\class[ name = b ](0,3)
+\class[ name = x ](1,0)
+\d2(x)(a)
+\replacesource[name=2x]
+\d3(x)(b)
+\end{sseqdata}
+
+\printpage[ name = show name example, page = 2]
+
+\printpage[ name = show name example, page = 3]
+\end{codeexample}
+\end{key}
+
+\begin{key}{tag = \meta{tag}}
+This key adds a tag to the current class. Tags are used for identifying which of multiple classes in the same position you are referring to. They are useful when you have groups of related classes and want a family of differentials connecting them. For instance:
+\begin{codeexample}[width = 8cm]
+\DeclareSseqGroup\tower {} {
+ \class(0,0)
+ \foreach \i in {1,...,11} {
+ \class(0,\i)
+ \structline(0,\i-1,-1)(0,\i,-1)
+ }
+}
+\NewSseqGroup\hvee {} {
+ \tower(0,0)
+ \foreach \i in {1,...,11} {
+ \class(\i,\i)
+ \structline(\i-1,\i-1,-1)(\i,\i,-1)
+ }
+}
+\begin{sseqpage}[ degree = {-1}{1}, yscale = 1.1,
+ x range = {0}{5}, y range = {0}{5} ]
+\tower(3,0)
+\hvee[ tag = id ](0,0)
+\hvee[ tag = h21 ](4,2)
+\foreach \n in {0,...,5} {
+ \d2(4+\n,2+\n,h21,id)
+}
+\end{sseqpage}
+\end{codeexample}
+We want each differential to go from the |h21| vee to the |id| vee, independent of which classes are in the same position of the two vees. The easy way to accomplish this is by giving tags to each of the two vees.
+\end{key}
+
+\begin{key}{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:
+\codeexample[from file=insert]
+\end{key}
+
+\begin{key}{offset = \{\pars{\meta{x offset},\meta{y offset}}\}}
+By default, a class uses the offset specified by |class pattern|. Occasionally this is undesirable. In this case, you can specify the offset for a particular class by hand. For example if the sum of two classes is hit by a differential, it looks better for the class replacing them to be centered:
+\begin{codeexample}[width = 9cm]
+\begin{sseqdata}[ name = offset example,
+ xscale = 0.7,
+ Adams grading,
+ class placement transform = {scale = 1.8} ]
+\class(0,1)
+\class(0,2)\class(0,2)
+\draw(0,1)--(0,2);
+\class(1,0)
+\d2(1,0,,1)
+\replacetarget
+\d2(1,0,,2)
+\end{sseqdata}
+\printpage[name = offset example, page=2]
+\printpage[name = offset example, page=3]
+\begin{sseqpage}[name = offset example, page=3]
+\classoptions[offset = {(0,0)}](0,2)
+\end{sseqpage}
+\end{codeexample}
+\end{key}
+
+\begin{key}{tooltip = \meta{text}}
+This key generates a ``tooltip'' over the given class. That is, if you hover your mouse over it, a little window will popup with the tooltip text. This is particularly useful to give the coordinates or names of classes in large 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. The |pdfcomment| package generates two extra auxiliary files, so it is not included by default. In order to use the |tooltip| option, you have to use the |tooltips| package option (e.g., load \sseqpages\ with |\usepackage[tooltips]{spectralsequences}|). This cannot handle math, but it will print math expressions into \TeX\ input form. Not all pdf viewers will display the tooltip correctly. If this concerns you, the command |\sseqtooltip| is used to produce the tooltip, and you can redefine it as any other command that takes |\sseqtooltip|\marg{text}\marg{tooltip text} and produces a tooltip. For instance, on \href{https://tex.stackexchange.com/a/164186/23866}{this stack exchange post}, there is code that supposedly produces tooltips that work with Evince. I have not tested whether it works by itself or whether it works with my package, but you could. You could potentially figure out how to get math to work in tooltips too -- if you find a satisfactory method, please let me know.
+
+Anyways, here's an example:
+\begin{codeexample}[]
+\begin{sseqpage}[classes = {tooltip = {(\xcoord,\ycoord)}}]
+\class(0,0)
+\class(0,1)
+\class(1,0)
+\class(1,1)
+\end{sseqpage}
+\end{codeexample}
+
+There's another example at the beginning of the section on the \hyperref[sec:class stack]{class stack}.
+\end{key}
+
+\begin{keylist}{class:page = \meta{page}\opt{-{}-\meta{page max}},generation = \meta{generation}\opt{-{}-\meta{generation max}}}
+\def\classpagehandler#1#2{\textcolor{keycolor}{\noligs{#2}}}
+\declarecustomhandler{class:page}{\classpagehandler}
+These options only work in |\classoptions|. The |page| option gives a range of pages for which the options apply to. If only one page is specified, it is the minimum page and the option applies to all larger pages.
+\begin{codeexample}[width = 6cm]
+\begin{sseqdata}[ name = page_example, no axes,
+ title = \page, title style = {yshift = -0.5cm} ]
+\class(0,0)
+\classoptions[class:page = 2 -- 3, fill, blue](0,0)
+\end{sseqdata}
+
+\printpage[ name = page_example, page = 1 ] \qquad
+\printpage[ name = page_example, page = 2 ] \qquad
+\printpage[ name = page_example, page = 4 ]
+\end{codeexample}
+A ``generation'' of a class is the interval from one call of |\class| or |\replaceclass| to the page on which it next supports or is hit by a differential.
+By default the |\classoptions| command adds options only to the most recent generation of the class in a \sseqdataenv\ 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.
+\codeexample[from file=class-page2a]
+\codeexample[from file=class-page2b]
+\end{keylist}
+
+\begin{commandlist}{\xcoord,\ycoord}
+These commands represent the $\mathtt{x}$ and $\mathtt{y}$ coordinate of the current class when used in class options. The only use I have for them is in the |tooltip| option, but maybe there is some other purpose for them.
+\end{commandlist}
+
+
+\subsection{Options for \sectionstring\d\ and \sectionstring\structline}
+Because the main job of the |\d| and |\structline| commands is to print an edge on the appropriate pages of the spectral sequence, most \tikzpkg\ options that you could apply to a \tikzpkg\ ``to'' operator (as in |\draw (x1,y1) to (x2,y2);|) can be applied to both |\d| and |\structline|. Some such options are as follows:
+
+\begin{keylist}{source anchor = \meta{anchor}, target anchor = \meta{anchor}}
+Because you can't use the normal \tikzpkg\ mechanism for specifying the source and target anchors, \sseqpages\ has these two keys for |\d| and |\structline|:
+\begin{codeexample}[width = 4cm]
+\begin{sseqpage}[ no axes, yscale = 1.24 ]
+\foreach \x in {0,1} \foreach \y in {0,1} {
+ \class(\x,\y)
+}
+\structline(0,0)(0,1)
+\structline[ source anchor = north west, target anchor = -30 ](1,0)(1,1)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+
+
+\begin{keylist}{shorten > = \meta{distance}, shorten < = \meta{distance}}
+These behave exactly like the corresponding options from \tikzpkg\ , 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\ manual} for a complete explanation of the dash pattern related options. Some examples:
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ no axes, yscale = 1.6 ]
+\foreach \x in {0,1,2} \foreach \y in {0,1} {
+ \class(\x,\y)
+}
+\structline[densely dotted](0,0)(0,1)
+\structline[dashed, red, "a"](1,0)(1,1)
+\structline[dash dot, red, "a" black](2,0)(2,1)
+\end{sseqpage}
+\end{codeexample}
+%
+\end{manualentry}
+
+\begin{keylist}{bend left = \meta{angle}, bend right = \meta{angle}, *in = \meta{anchor}, *out = \meta{anchor}}
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[no axes,yscale = 1.6]
+\foreach \x in {0,1,2} \foreach \y in {0,1} {
+ \class(\x,\y)
+}
+\structline[bend left = 20](0,0)(0,1)
+\structline[bend right = 20](1,0)(1,1)
+\structline[in = 20, out = north](2,0)(2,1)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+
+%\begin{key}{invisible}
+%This key is only for |\d|. It prevents a differential from being drawn at all. The typical reason you might want this is so that you can draw your own differential using \tikzpkg\ 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 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,
+ title = \page, yscale = 0.53 ]
+\class(0,2)
+\class(0,4)
+\class(1,0)
+\class(1,1)
+\d2(1,0)(0,2) \replacesource
+\d3(1,1)(0,4) \replacesource
+\structline(1,0)(1,1)
+\end{sseqdata}
+\printpage[name = structpage example,page = 3]
+\qquad
+\printpage[name = structpage example,page = 4]
+\end{codeexample}
+
+By specifying a page number, you can adjust which page the |\structline| starts on:
+
+\begin{codeexample}[]
+\begin{sseqdata}[ name = structpage example2, title = \page, yscale = 0.5 ]
+\class(0,2)
+\class(0,4)
+\class(1,0)
+\class(1,1)
+\d2(1,0)(0,2) \replacesource
+\d3(1,1)(0,4) \replacesource
+\structline[structline:page = 2](1,0)(1,1)
+\end{sseqdata}
+\printpage[ name = structpage example2, page = 1 ]
+\qquad
+\printpage[ name = structpage example2, page = 2 ]
+\qquad
+\printpage[ name = structpage example2, page = 3 ]
+\qquad
+\printpage[ name = structpage example2, page = 4 ]
+\end{codeexample}
+
+Similarly, for |\structlineoptions| you can specify a minimum page on which to apply the options, or a range of pages.
+\end{key}
+
+\subsection{Options for \sectionstring\circleclass}
+\begin{key}{fit = \meta{coordinates or nodes}}
+The |\circleclasses| command uses the \href{\pgfmanualurl#section.52}{\tikzpkg\ fitting library}. Sometimes it's desirable to make the resulting node fit extra things, for example a label. It doesn't necessarily end up looking great though.
+\begin{codeexample}[]
+\begin{sseqpage}[ Adams grading, axes gap = 0.7cm ]
+\class(0,2)
+\class(1,0)
+% Fit in the label x and also a symmetric invisible label to maintain symmetry
+\d["x"{name = x}, "x"'{name = x', opacity = 0}]2(1,0)
+\circleclasses[fit = (x)(x'), rounded rectangle](1,0)(0,2)
+\end{sseqpage}
+\end{codeexample}
+\end{key}
+
+\begin{key}{rounded rectangle}
+You can put a shape as an option and it will change the shape of the node drawn by |\circleclasses|. Any shape will do, but I think that an |ellipse| or |rounded rectangle| are the only particularly appealing options.
+\end{key}
+
+\begin{key}{ellipse ratio = \meta{ratio} (initially 1.2)}
+By default, the shape drawn by |\circleclasses| is a ``newelipse'' which is a custom defined shape that respects the option |elipse ratio| which roughly controls how long and skinny versus short and fat the ellipse is. If you find that the ellipse is too long, try a larger value of this option, and conversely if it's too fat try a smaller value. If no value is satisfactory, try out the |rounded rectangle| shape. (This is stolen from the following stack exchange answer: \url{https://tex.stackexchange.com/a/24621}.)
+\end{key}
+
+\begin{keylist}{cc:class style,cc:permanent cycle style,cc:transient cycle style,cc:this page class style,cc:differential style,cc:struct line style}
+See the \pgfmanualpdfref{class style}{corresponding entry} in the \tikzpkg\ 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 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\ primitives}
+\begin{key}{background}
+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\ background paths are printed.
+
+\item The clipping is inserted (unless the |no clip| key is used).
+
+\item All foreground elements (classes, differentials, structure lines, and normal \tikzpkg\ paths) are printed.
+\end{itemize}
+
+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)
+\class(1,1)
+\begin{scope}[background]
+\draw(0.1,0.1)--(1.1,1.1);
+\end{scope}
+\node[background] at (0.5,-1) {not clipped};
+\node at (0.5,-0.4) {clipped};
+\end{sseqpage}
+\end{codeexample}
+Here is an example where \tikzpkg\ labels with the |background| key are used to add labels and a grid. Note that this styling is easier to make using the |title|, |x label|, |y label|, and |grid| options.
+\begin{codeexample}[]
+\begin{sseqdata}[ name = tikz background example, cohomological Serre grading, classes = fill ]
+\begin{scope}[background]
+\node at (\xmax/2,\ymax+1.2) {\textup{Page \page}};
+\node at (\xmax/2,-1.7) {H^*(B)};
+\node[rotate = 90] at (-1.5,\ymax/2) {H^*(F)};
+\draw[step = 1cm, gray, very thin] (\xmin-0.5,\ymin-0.5) grid (\xmax+0.4,\ymax+0.5);
+\end{scope}
+\class(0,0)
+\class(3,0)
+\class(0,2)
+\class(3,2)
+\d3(0,2)
+\end{sseqdata}
+\printpage[name = tikz background example, page = 2]
+\printpage[name = tikz background example, page = 3]
+\end{codeexample}
+
+For this particular use case, it's 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)$ } ]
+\class(0,0)
+\class(3,0)
+\class(0,2)
+\class(3,2)
+\d3(0,2)
+\end{sseqdata}
+\printpage[name = tikz background example2, page = 2]
+\printpage[name = tikz background example2, page = 3]
+\end{codeexample}
+
+But if you need more flexible labeling, you'll likely want to use tikz primitives with |background|. See \example{KF3} for an instance where this key is useful.
+
+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}}
+\declarecustomhandler{page constraint}{\codehandler}
+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{,}\oarg{index}}}}}|\]
+will print the \tikzpkg\ primitive only on pages where the specified class is alive. Saying
+\[|page constraint = {\isalive(\meta{coordinate 1})|\,\cdots\,|(\meta{coordinate n})}|\]
+is equivalent to
+\[|page constraint = {\isalive\pararg{coordinate 1} &&|\,\cdots\,|&& \isalive\pararg{coordinate n}}|\]
+Writing
+\[\codeverb|\draw[page constraint = {\isalive(1,0)(2,2)}](1,0)|\texttt{-{}-}|(2,2);|\]
+is the same as |\structline(1,0)(2,2)|, except that you can't later use |\structlineoptions| on it (and it won't have the |struct lines| style applied).
+\end{commandlist}
+\end{keylist}
+
+\begin{keylist}{class style,permanent cycle style,transient cycle style,this page class style,differential style,struct line style}
+These classes apply the styling of the corresponding element to your \tikzpkg\ commands.
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ differentials = blue, yscale = 0.65, no axes ]
+\class(0,2)
+\class(1,0)
+% This will be styled as if it were a differential
+\draw[differential style] (1,0) -- (0,2);
+\end{sseqpage}
+\end{codeexample}
+See |\getdtarget| for a more natural example.
+\end{keylist}
+
+
+
+\section{Miscellaneous Commands}
+\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.
+
+You can also use |\sseqset| to create styles to be used in spectral sequences.
+\begin{keylist}{
+ .global sseq style = \meta{keys},
+ .global sseq append style = \meta{keys},
+ .sseq style = \meta{keys},
+ .sseq append style = \meta{keys}
+}
+These handlers create reusable styles to be used in spectral sequences. If this style is a set of global options, then use the |.global sseq style| handler, whereas if it is supposed to be applied to individual features (classes, differentials, structure lines, circle classes, and tikz primitives) then use the |.sseq style| handler.
+\begin{codeexample}[width=6cm]
+\sseqset{
+ mysseq/.global sseq style = {
+ Adams grading, title = Page \page,
+ x range = {0}{4}, y range = {0}{2},
+ xscale = 0.5, yscale = 1.35
+ },
+ htwostruct/.sseq style = { gray, thin }
+}
+\begin{sseqpage}[ mysseq ]
+\class(0,0) \class(0,1) \class(0,2) \class(0,3)
+\class(3,1) \class(3,2) \class(3,3)
+\structline(0,0)(0,1) \structline(0,1)(0,2)
+\structline(0,2)(0,3)
+\structline(3,1)(3,2) \structline(3,2)(3,3)
+\structline[htwostruct](0,0)(3,1)
+\structline[htwostruct](0,1)(3,2)
+\structline[htwostruct](0,2)(3,3)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+\end{command}
+
+\begin{command}{\SseqErrorToWarning\meta{error-name}}
+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{environment}{{quiet}}
+This environment quiets error messages that occur inside of it. \sseqpages\ is pretty good at error recovery, and so most of commands will fail gracefully and do nothing if their preconditions aren't met. If there are any parsing errors in the body of the |{quiet}| environment, prepare to see low level internal error messages. You might also run into bugs in \sseqpages\ -- the error recovery code hasn't been that carefully tested. If you do get low level error messages, remember to comment out the |{quiet}| environment before trying to debug.
+
+This is particularly useful for code reuse commands. Sometimes there is a source of long differentials that only applies to classes that haven't already supported shorter differentials. Sometimes there should be a structure line if a certain class exists, but it might not exist. In these cases, the |{quiet}| environment will help you out. See also |\DrawIfValidDifferential|, which is a variant of |\d| that behaves as if it were inside a |{quiet}| environment.
+\end{environment}
+
+\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}{
+ \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)
+\d3
+\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}}
+% TODO: Explain the difference between NewSseqCommand and DeclareSseqCommand!
+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() }
+ { \#1 = \textcolor{purple}{\{#1\}};
+ \#2 = \textcolor{purple}{\{#2\}} }
+\hbox{\demo[key = value](x,y)}
+\bigskip
+\hbox{\demo(1,2,3)}
+\end{codeexample}
+% TODO: explain what u does better
+If you want to separate out the coordinates into different arguments, you can use |O{}u(u,u)|. The argument type |u| stands for ``until'' and scans up until the next instance of the given character. So in this case, |#1| is of argument type |O| which is an option list, |#2| corresponds to the |u(| which is a throw-away argument, then |#3| corresponds to |u,| and contains the $\mathtt{x}$ coordinate, and |#4| corresponds to |u)| and contains the $\mathtt{y}$ coordinate. Note however that this will not match balanced parenthetical expressions.
+\begin{codeexample}[width = 6.5cm,vbox]
+\DeclareDocumentCommand\demo{ O{} u( u, u)}
+ { \#1 = \textcolor{purple}{\{#1\}};
+ \#3 = \textcolor{purple}{\{#3\}};
+ \#4 = \textcolor{purple}{\{#4\}} }
+\hbox{\demo[hi](x,y)}
+\bigskip
+\hbox{\demo(1,2)}
+\bigskip
+\hbox{\demo((1+1)*2,2)}
+\bigskip
+\hbox{\demo(1,(1+1)*2)} % uh-oh -- *2) is left off!
+\end{codeexample}
+You can specify an optional argument delimited by parentheses using |d()|. Use the commands |\IfNoValueTF|, |\IfNoValueT|, and |\IfNoValueF| to test whether the user provided a value.
+\begin{codeexample}[width = 6.5cm,vbox]
+\DeclareDocumentCommand\demo{ O{} d() } {
+ \#1 = \textcolor{purple}{\{#1\}};
+ \#2 = \textcolor{purple}{
+ \{\IfNoValueTF{#2}{no value}{#2}\} }
+}
+\hbox{\demo[hi](x,y)}
+\bigskip
+\hbox{\demo[options]}
+\bigskip
+\hbox{\demo(1,2)}
+\bigskip
+\hbox{\demo}
+\end{codeexample}
+An example where this is actually useful:
+\begin{codeexample}[width = 6.5cm]
+\DeclareSseqCommand\etaclass{ O{} d() }{
+ \IfNoValueF{#2}{ \pushstack(#2) }
+ \class[#1] (\lastx+1, \lasty+1)
+ \structline
+}
+\begin{sseqpage}[ classes = fill, yscale = 0.55 ]
+\class(0,0)
+\class(0,1)
+\etaclass\etaclass
+\etaclass[blue](0,0)\etaclass
+\end{sseqpage}
+\end{codeexample}
+
+
+%The |\d| command has argument specification |O{} U( r()|. The argument type |U| is special to \sseqpages, and is a variant of until that reinserts the delimiting token. This allows the |(| token to also delimit the beginning of the |r()| argument. Note that the argument type |U| is specially added by \sseqpages\ and might be removed in the future if the \LaTeX3 team yells at me or something.
+% \ExplSyntaxOn
+% \cs_set_eq:NN \__xparse_add_type_U:w \sseq__xparse_add_type_U:w
+% \cs_set_eq:NN \__xparse_normalize_type_U:w \sseq__xparse_normalize_type_U:w
+% \sseq@install@xparse@Uarggrabber
+% \ExplSyntaxOff
+%\begin{codeexample}[width = 7cm,vbox]
+%\DeclareDocumentCommand {\demo} { O{} U( r() }
+% { \#1 = \textcolor{purple}{\{#1\}};
+% \#2 = \textcolor{purple}{\{#2\}};
+% \#3 = \textcolor{purple}{\{#3\}} }
+%\hbox{\demo[opts]page(x,y)}
+%\bigskip
+%\hbox{\demo5(x,y)}
+%\end{codeexample}
+
+The |\structline| and |\changeclasses| commands have argument specification |O{}r()r()|.
+\begin{codeexample}[width = 7cm,vbox]
+\DeclareDocumentCommand\demo{ O{} r() r() }
+ { \#1 = \textcolor{purple}{\{#1\}};
+ \#2 = \textcolor{purple}{\{#2\}};
+ \#3 = \textcolor{purple}{\{#3\}} }
+\hbox{\demo[hi](x,y)(x',y')}
+\bigskip
+\hbox{\demo(x,y,2)(x',y',-1)}
+\end{codeexample}
+\end{commandlist}
+
+\begin{commandlist}{\NewSseqGroup\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)
+ \foreach \n in {1,...,#1} {
+ \class(0,\n)
+ \structline(0,\n-1)(0,\n)
+ }
+}
+\begin{sseqpage}
+\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}{\SseqCopyPage\cmdarg{command}\marg{spectral sequence name}\marg{page}}
+This defines \cmdarg{command} to print all of the classes and structlines on page |\meta{page}| of the spectral sequence named |\meta{spectral sequence name}|, throwing out differentials and tikz primitives. The resulting command has syntax as if you had used |\DeclareSseqGroup| with no extra arguments -- that is, it takes an optional options list, which are passed to a scope, and an optional coordinate pair.
+\end{command}
+
+\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.
+
+\codeexample[vbox, from file=imJ]
+\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{commandlist}{
+ \SseqIfEmptyTF\marg{expression}\marg{true code}\marg{false code},
+ \SseqIfEmptyT\marg{expression}\marg{true code},
+ \SseqIfEmptyF\marg{expression}\marg{false code}
+}
+This tests if an expression is the empty expression. This is mainly useful for giving systematic labels to things.
+\end{commandlist}
+
+\begin{commandlist}{
+ \IfExistsTF\marg{page}\pararg{coordinate}\marg{true code}\marg{false code},
+ \IfExistsT\marg{page}\pararg{coordinate}\marg{true code},
+ \IfExistsF\marg{page}\pararg{coordinate}\marg{false code}
+}
+Test whether a class of the given description exists. The description can be any valid coordinate, including a named coordinate. If the coordinate is not valid, this will return false.
+\end{commandlist}
+
+\begin{commandlist}{
+ \IfAliveTF\marg{page}\pararg{coordinate}\marg{true code}\marg{false code},
+ \IfAliveT\marg{page}\pararg{coordinate}\marg{true code},
+ \IfAliveF\marg{page}\pararg{coordinate}\marg{false code}
+}
+Test whether a class is alive on the given page. If the class doesn't exist, this will return false.
+\end{commandlist}
+
+\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 a class is in bounds or out of bounds. If no such class exists, returns false.
+\end{commandlist}
+
+\begin{commandlist}{
+ \IfValidDifferentialTF\meta{page}\pararg{coordinate}\opt{\pararg{target coordinate}}\marg{true code}\marg{false code},
+ \IfValidDifferentialT\meta{page}\pararg{coordinate}\opt{\pararg{target coordinate}}\marg{true code},
+ \IfValidDifferentialF\meta{page}\pararg{coordinate}\opt{\pararg{target coordinate}}\marg{false code},
+ \DrawIfValidDifferentialTF\ooptions\meta{page}\pararg{coordinate}\opt{\pararg{target coordinate}}\marg{true code}\marg{false code},
+ \DrawIfValidDifferentialT\ooptions\meta{page}\pararg{coordinate}\opt{\pararg{target coordinate}}\marg{true code},
+ \DrawIfValidDifferentialF\ooptions\meta{page}\pararg{coordinate}\opt{\pararg{target coordinate}}\marg{false code},
+ \DrawIfValidDifferential\ooptions\meta{page}\pararg{coordinate}\opt{\pararg{target coordinate}}\marg{false code}
+}
+Test whether a differential is valid. There are many possible reasons for a differential to not be valid -- the source or target class could not exist, the target could not be in the correct grading, etc. If any error would be generated if you supplied the same arguments to |\d|, this tests false. Otherwise, this tests true. The command |\DrawIfValidDifferental| draws the differential if it is valid, whereas |\DrawIfValidDifferentalT| draws the differential and executes the true code if it is valid,
+|\DrawIfValidDifferentalF| draws the differential or executes false code if it isn't valid, etc.
+\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. The variables are sorted by first occurrence, use |\SseqNormalizeMonomialSetVariables| to set a different sort order. It outputs its result into |\result|. This command is specifically meant to be used as a value for |class label handler| or |class name handler|. See the example in the documentation for |class label handler| for a realistic example. The exponents must be integers or else it will misbehave.
+\begin{codeexample}[]
+\SseqNormalizeMonomial{x^0y^0} $\result$, \quad
+\SseqNormalizeMonomial{x^3yx^{-1}z^0} $\result$, \quad
+\SseqNormalizeMonomial{1x_2^2x^2_2} $\result$
+\end{codeexample}
+\end{command}
+
+\begin{command}{\SseqNormalizeMonomialSetVariables}
+This command takes an undelimited list sets up |\SseqNormalizeMonomial| to sort the variables in the input in the specified order. This is useful for consistency, and particularly important for when you use it to name classes. For example:
+\begin{codeexample}[]
+% We always want a first, then b, then x_1, then x_2, then x_3
+\SseqNormalizeMonomialSetVariables{abx_1x_2x_3}
+\SseqNormalizeMonomial{ba} $\result$, \quad
+\SseqNormalizeMonomial{bx_1} $\result$, \quad
+\SseqNormalizeMonomial{abx_2x_3x_1} $\result$
+\end{codeexample}
+\SseqNormalizeMonomialSetVariables{}
+\end{command}
+
+
+\begin{command}{\SseqAHSSNameHandler}
+This command expects an argument of the form |\meta{monomial}[\meta{integer expression}]| and defines |\result| to be |m[n]| where |m| is the result of applying |\SseqNormalizeMonomial| to the monomial, and |n| is the result of evaluation the integer expression plus any |yshift| that is present. This is intended for use with in drawing Atiyah Hirzebruch spectral sequences. See |class name handler| for an example of the calculation of $KO^*\mathbb{R}P^8$.
+\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, name path = circ,
+ #1, page = #2--#2 ]
+ (target1)(target2) % Circle the classes, use differential style
+%
+ % 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
+ \path[name path = lin] (source) -- (midpt);% save path from start to midpoint
+%
+ % draw line in "differential style" from start to intersection point of circ and lin
+ \draw[ cc:differential style, #1, page constraint= { \page == #2 },
+ name intersections = { of = circ and lin } ]
+ (source) -- (intersection-1);
+}
+\begin{sseqdata}[ name = cathex, Adams grading, differentials = { blue } ]
+\class(0,2)\class(0,2)
+\class(1,0)\class(1,0)
+\twods2(1,0,-1,1){2}
+\end{sseqdata}
+\printpage[ name = cathex, page = 1 ]
+\qquad
+\printpage[ name = cathex, page = 2 ]
+\qquad
+\printpage[ name = cathex, page = 3 ]
+\end{codeexample}
+\end{command}
+
+\begin{command}{\nameclass\marg{name}\pararg{coordinate}}
+The |\nameclass| command gives a name to a class. It's similar to saying |\doptions[name = |\meta{name}|]|, but faster. It's also similar to saying |\pushstack|\pararg{coordinate}. Giving temporary names to coordinates that you are going to use repeatedly makes the code easier to read and is faster (though this only matters in very large charts). See |\getdtarget| for an example.
+\end{command}
+
+\begin{command}{\tagclass\marg{tag}\pararg{coordinate}}
+The |\tagclass| command gives a tag to a class. It's similar to saying |\doptions[tag = |\meta{name}|]|, but faster. See \example{tmfmayss} for a use case for this.
+\end{command}
+
+\begin{command}{\gettag\cmdarg{macro}\pararg{coordinate}}
+The |\gettag| command finds the most recent tag applied to the coordinate and stores it into |\cmdarg{macro}|. This is useful for connecting groups of nodes. For example, consider the following code, inspired by \example{tmfmayss}.
+\begin{codeexample}[width=6cm]
+\DeclareSseqCommand \tower { O{} } {
+ \begin{scope}[#1]
+ \foreach\i in {1,...,7}{
+ \class(\lastx,\lasty+1)
+ \structline
+ }
+ \end{scope}
+ \restorestack
+}
+\DeclareSseqCommand \htwotower { O{} d() } {
+ \IfNoValueF{#2}{
+ \pushstack(#2)
+ }
+ \begin{scope}[#1]
+ \gettag\thetag(\lastclass)
+ \class(\lastx+3,\lasty+1)
+ \structline[gray]
+ \savestack
+ \foreach\i in {1,...,7}{
+ \class(\lastx,\lasty+1)
+ \structline
+ \structline[gray](\lastx-3,\lasty-1,\thetag)
+ }
+ \restorestack
+ \end{scope}
+}
+\begin{sseqpage}[ y range = {0}{6}, x tick step = 3,
+ xscale=0.6, yscale=1.3 ]
+\class(0,2) \class(0,3) \class(3,2)
+\class[tag = h_0^i](0,0)
+\tower[tag = h_0^i]
+\class(0,2) \class(0,1)
+
+\htwotower[tag = h_2 h_0^i](0,0)
+\htwotower[tag = h_2 h_0^i]
+\end{sseqpage}
+\end{codeexample}
+\end{command}
+
+
+\subsection{The class stack}
+\label{sec:class stack}
+The class stack is a linked list of the classes in the order that they are produced that \sseqpages\ maintains. I've only recently implemented this feature, so it is more liable to change in the future than other things. Whenever you use the |\class| function, the class you added is pushed onto the stack. Here's an example that demonstrates basic usage:
+
+
+The following commands are used to access the stack:
+
+\begin{commandlist}{\lastx\opt{\meta{n}},\lasty\opt{\meta{n}},\lastclass\opt{\meta{n}}}
+The commands |\lastx| and |\lasty| evaluate to the |x| and |y| position, respectively, of the $n$th class on the stack. If $n = 0$ you can leave it off.
+The command |\lastclass| evaluates to the coordinate of the 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}
+
+
+\begin{command}{\pushstack\pararg{coordinate}}
+This adds a class to the top of the stack. The coordinate is specified using the same syntax as a coordinate for |\structline| or |\replaceclass|.
+\end{command}
+
+\begin{commandlist}{\savestack,\restorestack}
+This saves and reverts the stack. Saves nest. Most frequently, you will want to use these at the start and end of a command.
+\end{commandlist}
+
+
+\section{Styles}
+The \sseqpages\ 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 = style example ]
+\class(0,0)\class(1,1)
+\end{sseqdata}
+\begin{sseqpage}[ name = style example,
+ classes = { fill, blue },
+ title = change new classes ]
+\class(0,1)\class(1,0)
+\end{sseqpage}
+\quad
+\begin{sseqpage}[ name = style example,
+ change classes = { fill, blue },
+ title = change old classes ]
+\class(0,1)\class(1,0)
+\end{sseqpage}
+\end{codeexample}
+
+You can modify these styles outside of a spectral sequence or inside it using |\sseqset|, you can modify them as options to the \sseqdataenv\ 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]
+\begin{sseqpage}[ classes = { blue, fill },
+ title style = { align = center, text width = 2.4cm },
+ title = { everything is orange } ]
+\begin{scope}[orange]
+\class(0,0) \class(0,1)
+\structline(0,0)(0,1)
+\end{scope}
+\end{sseqpage}
+
+\begin{sseqpage}[ classes = { blue, fill },
+ title style = { align = center, text width = 2.4cm },
+ title = { only structure line is orange } ]
+\begin{scope}[ sseq = orange ]
+\class(0,0) \class(0,1)
+\structline(0,0)(0,1)
+\end{scope}
+\end{sseqpage}
+\end{codeexample}
+
+
+Throughout, ``class'' and ``cycle'' are synonyms.
+\begin{stylekeylist}{sseqs, change sseqs,sseq,change sseq}
+This passes options to all features in all future spectral sequences in the current scope. Note that for many global options you can set a default directly by saying |\sseqset{key = \marg{value}}| and this is in some cases preferable.
+
+\begin{codeexample}[width = 7cm]
+% Applies to both of the following sseqs:
+\sseqset{ sseqs = { blue, scale = 0.5 } }
+\begin{sseqpage}
+\foreach \x in {0,1}
+\foreach \y in {0,1,2} {
+ \class(\x,\y)
+}
+\end{sseqpage}
+\begin{sseqpage}[ Adams grading, classes = fill ]
+\foreach \x in {0,1,2}
+\foreach \y in {0,1,2} {
+ \class(\x,\y)
+}
+\d2(1,0)
+\d2(2,0)
+\end{sseqpage}
+\end{codeexample}
+\end{stylekeylist}
+
+\begin{stylekeylist}{classes, cycles,change classes,change cycles}
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ classes = { blue, fill, minimum width = 0.5em },
+ scale = 0.5, x tick step = 2, y tick step = 2 ]
+\class(0,0)
+\class(2,2)
+\end{sseqpage}
+\end{codeexample}
+\end{stylekeylist}
+
+
+\begin{stylekeylist}{permanent classes, permanent cycles, change permanent classes, change permanent cycles}
+These options change the appearance of all permanent cycles (e.g., those classes which never support or are hit by a differential). For instance, we can circle the permanent cycles automatically. In the following example, note that because |permanent cycles| is more specific than |classes|, the |permanent cycles = {draw}| command takes precedence over the |classes = {draw = none}| command and the permanent cycle nodes are drawn.
+\begin{codeexample}[width = 6.5cm]
+\begin{sseqpage}[ cohomological Serre grading,
+ classes = { draw = none },
+ permanent cycles = {draw} ]
+\foreach \x in {0,2} \foreach \y in {0,1} {
+ \class["\mathbb{Z}"](\x,\y)
+}
+\d2(0,1)
+\end{sseqpage}
+\end{codeexample}
+\end{stylekeylist}
+
+\begin{stylekeylist}{transient classes, transient cycles,change transient classes,change transient cycles}
+These options change the appearance of all transient cycles (e.g., those classes which eventually support or are hit by a differential). Again, this takes precedence over the |classes| option.
+\begin{codeexample}[width = 6.5cm]
+\begin{sseqpage}[ cohomological Serre grading,
+ classes = { draw = none },
+ transient cycles = red ]
+\foreach \x in {0,2} \foreach \y in {0,1} {
+ \class["\mathbb{Z}"](\x,\y)
+}
+\d2(0,1)
+\end{sseqpage}
+\end{codeexample}
+\end{stylekeylist}
+
+\begin{stylekeylist}{this page classes, this page cycles, change this page classes,change this page cycles}
+These options change the appearance of all cycles which support or are hit by a differential on this page. Any class that is hit on the current page is also a transient cycle, and so |this page classes| takes precedence over |transient cycles|.
+\begin{codeexample}[width = 6cm]
+\begin{sseqdata}[ name = this page cycles example, Adams grading,
+ transient cycles = { red, fill }, this page cycles = { blue } ]
+\class(0,0)
+\class(0,2) \class(1,0)
+\class(1,3) \class(2,0)
+\d2(1,0) \d3(2,0)
+\end{sseqdata}
+\printpage[ name = this page cycles example, page = 2 ] \qquad
+\printpage[ name = this page cycles example, page = 3 ]
+\end{codeexample}
+\end{stylekeylist}
+
+\begin{stylekeylist}{edges,differentials,struct lines, change edges, change differentials, change struct lines}
+The |edges| key applies to both differentials and structure lines. The |differentials| and |struct lines| keys both take precedence over |edges|.
+\end{stylekeylist}
+
+\begin{stylekeylist}{this page struct lines, change this page struct lines}
+This style applies to structure lines whose source or target is hit on the current page. It takes precedence over |struct lines|.
+\end{stylekeylist}
+
+\begin{stylekeylist}{tikz primitives,change tikz primitives}
+Applies to all \tikzpkg\ primitives.
+\end{stylekeylist}
+
+
+\begin{stylekeylist}{labels,change labels}
+This style applies to labels on classes, differentials, and structure lines. All the more specific label styles take precedence over it.
+\end{stylekeylist}
+
+\begin{stylekeylist}{class labels,inner class labels,outer class labels,
+ change class labels,change inner class labels,change outer class labels}
+Inner class labels specifically applies to class labels that are inside the node, outer class labels specifically applies to ones outside it:
+\begin{codeexample}[]
+\begin{sseqpage}[ no axes, classes = { inner sep = 1pt },
+ label distance = 2pt,
+ outer class labels = { red },
+ inner class labels = { blue } ]
+\class["a", "b" above](0,0)
+\class["a", "c" right](1,0)
+\end{sseqpage}
+\end{codeexample}
+\end{stylekeylist}
+
+\begin{stylekeylist}{edge labels,differential labels,struct line labels,
+ change edge labels,change differential labels,change struct line labels}
+
+\end{stylekeylist}
+
+
+\subsection{Style-like options}
+The options are not styles, but can be modified in the same set of places (namely, anywhere):
+
+\begin{keylist}{label distance = \meta{dimension}}
+This sets the default distance from a class to an outer label. There are also variants like |above label distance| corresponding to |above|, |below|, |left|, |right|, |above left|, |above right|, |below left|, and |below right|.
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ label distance = 0.3em,
+ right label distance = 0em,
+ no axes, yscale = 1.25 ]
+\class["a" above](0,0)
+\class["b" above right](0,1)
+\class["c" right](1,0)
+\class["c" {right = 1em}](1,1)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+
+\begin{keylist}{run off = \meta{start tip}--\meta{end tip},
+ run off struct lines = \meta{start tip}--\meta{end tip} (initially {...--...}),
+ run off differentials = \meta{start tip}--\meta{end tip} (initially {...--...})}
+Change the default behavior of run off edges for either all edges, just 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.
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ x range = {0}{2}, y range = {0}{2},
+ draw orphan edges, run off = >-stealth ]
+\class(0,0)
+\class(3,0) \class(0,3)
+\structline(0,0)(3,0)
+\structline[red](0,0)(0,3)
+\structline[blue](3,0)(0,3)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+
+\begin{key}{class label handler = \meta{function}}
+\declarecustomhandler{class label handler}{\codehandler}
+The value of |class label handler| is a function that is applied to all labels before displaying them. It should put its output into |\result|.
+This is intended to help with code reusability. Because these handlers may crash or have annoying side-effects on some input, you may want to toggle the value of this command on and off. To turn this off for the rest of the current spectral sequence you can say |\sseqset{class label handler = {}}|. You can also use the |class label handler| key in a \scopeenv.
+
+The main function \sseqpages\ provides for use here is |\SseqNormalizeMonomial{#1}|. This makes it convenient to translate expressions with polynomial labels. You can write your own handlers if your \TeX\ programming skills are sufficient. Let me know if there are any other functions that you want here, and if you implement them yourself, please send me your implementation.
+Here is an example of a function that evaluates an arithmetic expression:
+\begin{codeexample}[width=6cm]
+\begin{sseqpage}[
+ class label handler = { \SseqParseInt\result{#1} }
+]
+\class["1+1"](0,0)
+\class["1+2*(1+3*(4-1))"](1,1)
+\end{sseqpage}
+\end{codeexample}
+Here's an example using |\SseqNormalizeMonomial|:
+\begin{codeexample}[width = 6cm]
+\NewSseqGroup \test {m} {
+ \class["1#1"](0,0)
+ \class["\alpha#1"](0,1)
+ \class["y#1"](1,0)
+ \class["\alpha y#1"](1,1)
+}
+\begin{sseqpage}[
+ class label handler = { \SseqNormalizeMonomial{#1} },
+ classes = { draw = none }, class labels = { font = \small } ]
+\test{}
+\test[red](2,0){y^2}
+\test[orange](2,2){\alpha^2y^2}
+\test[blue](0,2){\alpha^2}
+\end{sseqpage}
+\end{codeexample}
+
+Here is another example which demonstrates a useful idiom for drawing Serre spectral sequences. For a more complete example, see \example{KF3n}. Note the use of braces in |{Sq^1\iota_2}|. Without braces, |\SseqNormalizeMonomial| will simplify |Sq^1xSq^2x| into $S^2q^3x^2$, which is obviously undesirable, so the correct way to input this is |{Sq^1x}{Sq^2x}|. Unfortunately, |\foreach| strips a pair of braces from its arguments, so you need to put two pairs of braces.
+%\pgfmanualpdflabel{normalizemonomialex-labels}
+\begin{codeexample}[width=8cm]
+\begin{sseqpage}[
+ xscale = 1.4,
+ classes = { draw = none },
+ class label handler = {\SseqNormalizeMonomial{#1}} ]
+
+\foreach \x/\xlabel in
+ { 0/1, 2/\iota_2, 3/{{Sq^1\iota_2}}, 4/\iota_2^2 }
+\foreach \y/\ylabel in
+ { 0/1, 1/\alpha, 2/x, 3/\alpha x, 4/x^2 }
+{
+ \class["\ylabel\xlabel"] (\x,\y)
+}
+\end{sseqpage}
+\end{codeexample}
+\end{key}
+
+
+\begin{key}{class name handler = \meta{function}}
+\declarecustomhandler{class name handler}{\codehandler}
+The value of |class name handler| is a function that is applied to all names before using them. It should put its output into |\result|.
+The main functions intended for use here are |\SseqAHSSNameHandler| and |\SseqNormalizeMonomial|, though you can make your own. This is applied both when you name the class, as in \codeverb|\class[name=a](\meta{coordinate})| and when you refer to a class by name, as in |\structline(a)(b)|. One advantage if you are using |\SseqNormalizeMonomial| is that you can ensure that |xy| and |yx| refer to the same class:
+\begin{codeexample}[]
+\SseqNormalizeMonomialSetVariables{xy}
+\begin{sseqpage}[ class name handler = \SseqNormalizeMonomial,
+ classes = {show name = {right,pin}} ]
+\class[name = xy](0,0)
+\class[name = yxy](0,1)
+\class(1,0)
+\structline(yx)(yyx)
+\end{sseqpage}
+\end{codeexample}
+The next page is an example drawing the Atiyah Hirzebruch spectral sequence computing $KO^*\mathbb{R}P^{8}$.
+% Have to load from file so that \afterpage doesn't cause trouble with verbatim reading.
+\afterpage{%
+ An AHSS using \scantokens{|class name handler = \SseqAHSSNameHandler|:}
+ \par
+ \codeexample[from file=KORP8,vbox]
+ \newpage
+}
+\end{key}
+
+\begin{keylist}{class name prefix = \meta{prefix}, class name postfix = \meta{postfix}}
+These keys add respectively a prefix or a postfix to all names of all classes in the scope. This is applied both when you name the class, as in \codeverb|\class[name=a](\meta{coordinate})| and when you refer to a class by name, as in |\structline(a)(b)|.
+The prefix and postfix are added to the command before the |class name handler| is applied, so if you say |name=\meta{the name}| then the name actually given to the class is the value of |\result| after saying |\classnamehander{\meta{name prefix}\meta{the name}\meta{name postfix}}|
+\end{keylist}
+
+\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\ 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}\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\ 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]
+% equivalent to degree = {#1}{1-#1}:
+\begin{sseqpage}[ cohomological Serre grading ]
+\class(0,1)
+\class(2,0)
+\d2(0,1)
+\end{sseqpage}
+\end{codeexample}
+\begin{codeexample}[width = 6cm]
+% equivalent to degree = {-#1}{#1-1}:
+\begin{sseqpage}[ homological Serre grading ]
+\class(0,1)
+\class(2,0)
+\d2(2,0)
+\end{sseqpage}
+\end{codeexample}
+\begin{codeexample}[width = 6cm]
+% equivalent to degree = {-1}{#1}:
+\begin{sseqpage}[ Adams grading ]
+\class(0,2)
+\class(1,0)
+\d2(1,0)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+
+\begin{keylist}{strict degree, lax degree}
+If the degree is strict, then \LaTeX will throw an error if you try to specify a differential that doesn't have the proper grading. The degree is strict by default.
+\begin{codeexample}[code only]
+\begin{sseqdata}[ name = laxdegree, Adams grading ]
+\class(0,2)
+\class(1,0)
+\d3(1,0)(0,2) % Error: differential does not respect grading.
+ % Target should be in position (0,3) but instead it is (0,2)...
+\end{sseqdata}
+\end{codeexample}
+
+\begin{codeexample}[]
+\begin{sseqdata}[ name = laxdegree, Adams grading, lax degree, yscale = 0.6 ]
+\class(0,2)
+\class(1,0)
+\d3(1,0)(0,2) % No error because degree checking is off
+\end{sseqdata}
+\printpage[ name = laxdegree, page = 3 ]
+\end{codeexample}
+\end{keylist}
+
+\begin{key}{update existing}
+This key is only for the \sseqdataenv\ 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\ 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)
+\class(1,0)
+\end{sseqdata}
+
+\begin{sseqpage}[ name = keep changes example, sseq = orange ]
+\class(0,2)
+\class(1,2)
+\classoptions[orange](1,0)
+\d2(1,0)
+\end{sseqpage} \qquad
+
+\printpage[ name = keep changes example, page = 2 ] \qquad
+
+\begin{sseqpage}[ name = keep changes example, sseq = blue, keep changes ]
+\class(0,3)
+\class(1,3)
+\classoptions[blue](1,0)
+\d3(1,0)
+\end{sseqpage} \qquad
+
+\printpage[ name = keep changes example, page = 3 ]
+\end{codeexample}
+Note that the orange classes and differential do not persist because the |keep changes| option is not set in the first \sseqpageenv\ 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}.
+\end{keylist}
+
+\begin{keylist}{no struct lines,draw struct lines}
+The option |no struct lines| suppresses all of the structure lines on the current page, whereas the option |draw struct lines| causes the page appropriate structure lines to be drawn.
+\end{keylist}
+
+\begin{keylist}{no orphan edges,draw orphan edges}
+An edge is an ``orphan'' if both its source and target lie off the page. By default these are drawn, but with the option |no orphan edges| they are not. If the option |no orphan edges| has been set, |draw orphan edges| undoes it.
+\begin{codeexample}[width = 9cm]
+\begin{sseqdata}[
+ name = orphan edges example,
+ cohomological Serre grading,
+ x range = {0}{2}, y range = {0}{2} ]
+\class(0,3) \class(3,1)
+\d3(0,3)
+\class(2,1) \class(4,0)
+\d2(2,1)
+\end{sseqdata}
+\printpage[ name = orphan edges example ]
+\quad
+\printpage[ name = orphan edges example,
+ no orphan edges ]
+\end{codeexample}
+\end{keylist}
+
+
+\begin{key}{class pattern = \meta{class pattern name} (initially standard)}
+This key specifies the arrangement of multiple classes at the same coordinate. The default value is |standard|.
+\begin{codeexample}[width = 5cm]
+\begin{sseqdata}[ name = class pattern example, no axes, ymirror ]
+\class(0,0)
+\class(1,0) \class(1,0)
+\class(0,1) \class(0,1) \class(0,1)
+\class(1,1) \class(1,1) \class(1,1) \class(1,1)
+\class(0,2) \class(0,2) \class(0,2) \class(0,2) \class(0,2)
+\class(1,2) \class(1,2) \class(1,2) \class(1,2) \class(1,2) \class(1,2)
+\end{sseqdata}
+
+\printpage[ name = class pattern example, class pattern = standard ]
+\printpage[ name = class pattern example, change classes = blue,
+ class pattern = linear, class placement transform = { rotate = 45 } ]
+\end{codeexample}
+
+You can add new class patterns using |\sseqnewclasspattern|:
+\begin{command}{\sseqnewclasspattern\marg{class pattern name}\marg{offsets}}
+Creates a new class pattern. For example, the |linear| class pattern is created using the command:
+\begin{codeexample}[code only]
+\sseqnewclasspattern{linear}{
+ (0,0);
+ (-0.13,0)(0.13,0);
+ (-0.2,0)(0,0)(0.2,0);
+ (-0.3,0)(-0.1,0)(0.1,0)(0.3,0);
+ (-0.4,0)(-0.2,0)(0,0)(0.2,0)(0.4,0);
+ (-0.5,0)(-0.3,0)(-0.1,0)(0.1,0)(0.3,0)(0.5,0);
+}
+\end{codeexample}
+For instance the third row indicates that if there are three classes at the position |(x,y)| they should be printed at |(x-0.2,y)|, |(x,y)|, and |(x+0.2,y)|. You can give as many rows as you like; \sseqpages\ will throw an error if there are more classes in any position than the maximum number that your class pattern can handle -- for instance, the |linear| class pattern can handle up to six classes based on this definition.
+\end{command}
+\end{key}
+
+
+\begin{keylist}{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\ 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 = 1.5 },
+ class pattern = linear,
+ classes = { draw = none },
+ xscale = 2, x axis extend end = 0.7cm ]
+\class["\mathbb{Z}"](0,0)
+\class["\mathbb{Z}/2"](1,1)
+\class["\mathbb{Z}/3"](1,1)
+\end{sseqpage}
+\end{codeexample}
+\begin{codeexample}[width = 5cm]
+\begin{sseqpage}[ class placement transform = { rotate = 40 },
+ cohomological Serre grading, scale = 0.65,
+ classes = fill, differentials = blue ]
+\class(0,0)
+\class(0,2)\class(0,2)
+\class[red](3,0)\class[green](3,0)\class[blue](3,0)
+
+\d3(0,2,1,2)
+\d3(0,2,-1,-1)
+\draw[->,red](3,0,1)--(0,0);
+\end{sseqpage}
+\end{codeexample}
+With multiple large class labels, the best option is to arrange the classes vertically:
+\begin{codeexample}[width = 5.5cm]
+\begin{sseqpage}[ classes = {draw = none }, xscale = 2, yscale=1.55,
+ class pattern = linear,
+ class placement transform = { scale = 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)
+\class["P^1\iota_3"](7,0)
+
+\class["\iota_2\iota_3\beta\iota_3"](7,2)
+\class["\iota_2P^1\iota_3"](7,2)
+
+\class["(\beta\iota_3)^2"](8,0)
+\class["P^1\beta\iota_3"](8,0)
+\class["\beta P^1\iota_3"](8,0)
+
+\class["\iota_2(\beta\iota_3)^2"](8,2)
+\class["\iota_2P^1\beta\iota_3"](8,2)
+\class["\iota_2\beta P^1\iota_3"](8,2)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+
+\begin{key}{math nodes = \meta{boolean} (default true)(initially true)}
+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 \sseqpages\ chart:
+\begin{keylist}{scale = \meta{factor},xscale = \meta{factor}, yscale = \meta{factor}, xmirror, ymirror}
+Scale the chart by \meta{factor}. Under normal circumstances, you can tell \tikzpkg\ to mirror a chart by saying, for instance, |xscale = -1|, but \sseqpages\ needs to be aware that the chart has been mirrored in order to draw the axes correctly. Thus, if you want to mirror a spectral sequence, use the |xmirror| and |ymirror| options as appropriate.
+\end{keylist}
+
+\begin{key}{rotate = \meta{angle}}
+It probably won't look great if you pick an angle that isn't a multiple of 90 degrees.
+\end{key}
+
+\subsection{Plot options and axes style}
+\begin{keylist}{x range = \marg{x min}\marg{x max},y range = \marg{y min}\marg{y max}}
+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{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)
+\class(3,0)
+\class(2,1)\class(2,1)
+\class(1,2)\class(1,2)\class(1,2)
+\class(0,3)
+\class(3,3)
+\end{sseqdata}
+\hbox{
+\printpage[ name = grid example, grid = chess, title=chess ]
+\qquad
+\printpage[ name = grid example, grid = crossword, title=crossword ]
+}
+\vskip20pt
+\hbox{
+\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 type by defining the command |\sseq@grid@yourgridname| to draw a grid.
+
+It is a known problem that acrobat reader displays grids very dark and thick. This is caused by the enhance thin lines ``feature'' of Acrobat reader. You can turn it off globally by going into the acrobat reader preferences window and unchecking the ``Enhance thin lines'' checkbox in the ``Rendering'' section. Unfortunately, there is no way to instruct Acrobat Reader to not apply this feature to a particular document. This has apparently been annoying graphic designers for over a decade.
+
+The grid color option changes the color of the grid; the default value is |gray|.
+The grid step keys change the grid step.
+\end{keylist}
+
+\begin{keylist}{title = \meta{text}, title style = \meta{keys}, x label = \meta{text}, y label = \meta{text},x label style = \meta{keys}, y label style = \meta{keys}, label style = \meta{keys}}
+\declareasstyle{title style}
+\declareasstyle{x label style}
+\declareasstyle{y label style}
+\declareasstyle{label style}
+This make chart labels.
+\begin{codeexample}[width = 6cm]
+\begin{sseqpage}[ title = { An example }, yscale = 0.5,
+ x label = { x axis label },
+ y label = { y axis label },
+ label style = { blue, font = \small },
+ x label style = { yshift = 5pt },
+ ]
+\class(0,0)
+\class(2,2)
+\end{sseqpage}
+\end{codeexample}
+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 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\ 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 ]
+ \node at (0,\ymin - 1) {0};
+ % \vphantom is fragile so we have to throw in an extra \protect
+ \node at (1,\ymin - 1) {\protect\vphantom{2}n};
+\foreach \n in {2,..., \xmax}{
+ \node at (\n,\ymin - 1) {\n n};
+}
+\end{scope}
+\class(0,0)
+\class(3,2)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+
+
+\begin{keylist}{x tick step = \meta{positive integer} (initially 1),y tick step = \meta{positive integer} (initially 1),tick step = \meta{positive integer} (initially 1)}
+Sets the interval between labels.
+\end{keylist}
+
+\begin{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]
+\begin{sseqpage}[ tick style = { blue, font = \tiny } ]
+\class(0,0) \class(2,1)
+\end{sseqpage}
+\end{codeexample}
+\end{stylekeylist}
+
+\begin{keylist}{x tick handler = \meta{function} (initially \#1), y tick handler = \meta{function} (initially \#1), tick handler = \meta{function} (initially \#1)}
+\declarecustomhandler{x tick handler}{\codehandler}
+\declarecustomhandler{y tick handler}{\codehandler}
+\declarecustomhandler{tick handler}{\codehandler}
+The value for |x tick handler| should be a function that takes in the current $\mathtt{x}$ value and outputs the appropriate tick. Correspondingly with |y tick handler|. The |tick handler| key sets both.
+\begin{codeexample}[width = 7cm]
+\begin{sseqpage}[ x range = {0}{4}, yscale = 1.78,
+ x tick handler = {
+ \ifnum#1 = 0\relax
+ 0
+ \else
+ \ifnum#1 = 1\relax
+ % \vphantom is fragile so we \protect it
+ \protect\vphantom{2}n
+ \else
+ #1n
+ \fi
+ \fi
+ }
+]
+\class(0,0)
+\class(4,2)
+\end{sseqpage}
+\end{codeexample}
+\end{keylist}
+
+\subsection{Layout}
+\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
+\begin{keylist}{x axis origin = \meta{x value} (initially 0), y axis origin = \meta{y value} (initially 0)}
+If you use |axes type = 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 extend start = \meta{dimension} (initially 0.5cm), y axis extend start = \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.1cm),
+ top clip padding = \meta{dimension} (initially 0.1cm), bottom clip padding = \meta{dimension} (initially 0.1cm)%
+}
+\end{keylist}
+
+\afterpage{
+\begin{center}
+\input spectralsequencesmanual-layoutcharts
+\end{center}
+}
+
+
+\parskip=10pt
+\begin{key}{custom clip = \meta{clip path}}
+Give a custom clipping. The clipping specified must be in the form of a valid \tikzpkg\ 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 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 chart is sideways) use this key.
+\end{key}
+\end{document}
diff --git a/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanualpreamble.tex b/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanualpreamble.tex
new file mode 100644
index 0000000000..b9e76710c8
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/spectralsequencesmanualpreamble.tex
@@ -0,0 +1,546 @@
+%%
+%% Package: spectralsequences v1.2.2 2017-09-16 2017-09-16
+%% Author: Hood Chatham
+%% Email: hood@mit.edu
+%% Date: 2019-02-18
+%% License: Latex Project Public License
+%%
+%% File: spectralsequencesmanualpreamble.tex
+%%
+%% Manual preamble
+%%
+
+% TODO: someday I should comment this -- it's a bit of a mess
+
+\documentclass{ltxdoc}
+\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry}
+\usepackage[tooltips]{spectralsequences}
+\usetikzlibrary{shapes.geometric}
+\usepackage{amssymb}
+\usepackage{afterpage}
+\usepackage[notmath]{sansmathfonts}
+\usepackage{verbatim}
+\usepackage{needspace}
+\usepackage[documentation]{tcolorbox}
+\usepackage[T1]{fontenc}
+\usepackage{hyperref}
+
+\hypersetup{%
+ colorlinks=true,
+ linkcolor=blue,
+ filecolor=blue,
+ urlcolor=thered,
+ citecolor=blue,
+ pdfborder=0 0 0,
+}
+\usepackage{hyperxmp}
+\makeatletter
+\def\displaycommand#1{\displaycommand@#1\@nil}
+\def\displaycommand@#1#2\@nil{\texttt{\string#1}#2}
+
+% From Christian Feuersänger https://tex.stackexchange.com/a/73103
+\makeatletter % !!!!
+\input{pgfmanual.code} % This must be exectuted when catcode of @ is letter
+\makeatother % !!!!
+
+\usepackage{calc} %
+\include{pgfmanual-en-macros} % This must be executed when catcode of @ is other
+
+\makeatletter
+
+\parskip=10pt
+\parindent=0pt
+\MakeShortVerb{\|}
+
+\def\sectionstring{\textbackslash\@xp\@gobble\string}
+
+\def\@gobbletocln#1:{}
+\def\eatclnifpresent#1{%
+ \eatclnifpresent@#1:\nil
+}
+\def\eatclnifpresent@#1:#2\nil{%
+ \ifx$#2$%
+ #1%
+ \else
+ \removecln#2\nil
+ \fi
+}
+\def\removecln#1:\nil{#1}
+
+\def\removenil#1\nil{#1}
+
+\def\pgfmanual@pretty@singlequote{'}
+
+
+
+\def\pulloffstartspaces{\@xp\pulloffstartspaces@\thekey\@nil}
+\def\pulloffstartspaces@#1{%
+ \def\test{#1}%
+ \ifx\test\pgfmanual@pretty@activespace
+ \@xp\def\@xp\leadingtoks\@xp{\leadingtoks\pgfmanual@pretty@space}%
+ \@xp\pulloffstartspaces@
+ \else
+ \ifx#1\@nil
+ \def\thekey{}%
+ \else
+ \@xp\@xp\@xp\pulloffstartspaces@@\@xp\@xp\@xp#1%
+ \fi
+ \fi
+}
+\def\pulloffstartspaces@@#1\@nil{\def\thekey{#1}}
+
+\def\pulloffstartbrace{\@xp\pullofflbrace\thekey\nil\@nil}
+\def\pullofflbrace#1#2\@nil{%
+ \ifx\test\pgfmanual@pretty@lbrace
+ \@xp\def\@xp\leadingtoks\@xp{\leadingtoks\pgfmanual@pretty@lbrace}%
+ \@xp\def\@xp\thekey\@xp{\removenil#2}%
+ \else
+ \@xp\def\@xp\thekey\@xp{\removenil#1#2}%
+ \fi
+}
+
+
+\def\pulloffsinglequote{\@xp\pulloffsinglequote@\thekey\nil\@nil}
+\def\pulloffsinglequote@#1#2\@nil{%
+ \def\test{#1}%
+ \ifx\test\pgfmanual@pretty@singlequote
+ \@xp\def\@xp\leadingtoks\@xp{\leadingtoks\pgfmanual@pretty@singlequote}%
+ \@xp\def\@xp\thekey\@xp{\removenil#2}%
+ \else
+ \def\possiblesinglequote{}%
+ \@xp\def\@xp\thekey\@xp{\removenil#1#2}%
+ \fi
+}
+
+
+
+
+% deletes everything except trailing spaces. For making link underline not include trailing spaces (have to reinsert spaces)
+\def\onlytrailingspaces#1{%
+ \pgfkeys@spdef\temp{#1}%
+ \@xp\def\@xp\temp\@xp##\@xp1\temp{}%
+ \temp#1%
+}
+
+% remove trailing spaces, for making link underline not include trailing spaces
+\def\removetrailingspaces{\@xp\removetrailingspaces@\@xp{\thekey}}
+\def\removetrailingspaces@#1{%
+ \removetrailingspace{#1}%
+ \ifx\possibletrailingspace\empty\else
+ \edef\trailingtoks{\unexpanded\@xp{\possibletrailingspace}\unexpanded\@xp{\trailingtoks}}%
+ \@xp\removetrailingspaces@\@xp{\thekey}%
+ \fi
+}
+
+\bgroup
+\catcode`\Q=3\lccode`\)=`\}\lccode`\~=`\ \lowercase{
+ \gdef\removetrailingspace#1{\removetrailingspace@#1QQ~Q}
+ \gdef\removetrailingspace@#1~Q{\removetrailingspace@@#1}
+ \gdef\removetrailingspace@@#1Q#2Q{\def\thekey{#1}\def\possibletrailingspace{#2}}
+
+ % Remove trailing brace -- so close brace can be colored / styled differently
+ \gdef\removetrailingbrace{\@xp\removetrailingbrace@\thekey QQ)Q}
+ \gdef\removetrailingbrace@#1)Q{\removetrailingbrace@@#1}
+ \gdef\removetrailingbrace@@#1Q#2Q{\def\thekey{#1}\edef\trailingtoks{\unexpanded{#2}\unexpanded\@xp{\trailingtoks}}}
+}
+
+\catcode`\^^M=\active
+ % remove trailing new line -- so we can properly test whether the last nonwhitespace character is a brace
+ \gdef\removetrailingnewline{\@xp\removetrailingnewline@\thekey \nil\nil^^M\nil}%
+ \gdef\removetrailingnewline@#1^^M\nil{\removetrailingnewline@@#1}%
+ \gdef\removetrailingnewline@@#1\nil#2\nil{\def\thekey{#1}\edef\trailingtoks{\unexpanded{#2}\unexpanded\@xp{\trailingtoks}}}%
+\egroup
+
+
+
+% Redefine decompose not to do all that fancy crap -- just print as is. Maybe we should get rid of surrounding spaces here and where we do the ref?
+\def\decompose#1/\nil{%
+ \index{#1@\protect\texttt{#1} key}%
+ \index{\mypath#1@\protect\texttt{#1}}%
+ \pgfmanualpdflabel{#1}{}%
+}
+\let\olddeclare\declare
+\ExplSyntaxOn
+% Get rid of colon so that we can have context based linking -- "page" links to global page, "class:page" prints page and links to the page key in the class section, etc.
+\def\declare#1{%
+ \exp_args:Nf\olddeclare{%
+ \eatclnifpresent{#1}%
+ }%
+}
+\ExplSyntaxOff
+
+%\patchcmd\pgfmanualpdfref{#2}{#2} % If I want it to behave differently for things that aren't links
+\patchcmd\pgfmanualpdfref{\expandafter\pgfmanualpdfref@\expandafter{\pgfmanualpdflabel@@}{#2}} % Fix it so that being a link doesn't change the color
+ {\colorlet{temp}{.}\expandafter\pgfmanualpdfref@\expandafter{\pgfmanualpdflabel@@}{\textcolor{temp}{#2}}}{}{}%
+
+\newenvironment{manualentry}[1]{%
+ \begin{pgfmanualentry}%
+ \pgfmanualentryheadline{#1}%
+ \pgfmanualbody
+}{%
+ \end{pgfmanualentry}%
+}
+
+
+
+\def\removespace#1\space\nil{#1}
+\newenvironment{stylekeylist}[2][]{%
+ \begin{pgfmanualentry}
+ \def\extrakeytext{}%
+ \foreach \xx in {#2} {%
+ \expandafter\extractkey\xx\space= \marg{keys}\@nil%
+ \declareasstyle{\@xp\removespace\mykey\nil}% tells latex not to italicize body
+ % The link created in \extractkey is named "key name " with a space at the end.
+ % So it won't work. We need to make our own link without the space in it.
+ \sseq@eval{\@nx\pgfmanualpdflabel{\@xp\removespace\mykey\nil}{}}%
+ }%
+ \pgfmanualbody
+}{%
+ \end{pgfmanualentry}
+}%
+
+% Custom handler for value of key -- instead of italicizing, do what?
+\def\ifcustomhandler#1{%
+ \@xp\pgfkeys@spdef\@xp\test\@xp{#1}%
+ \expandafter\ifx\csname\test @ custom handler\endcsname\relax\@xp\@secondoftwo\else\@xp\@firstoftwo\fi
+}
+\def\customhandler#1{%
+ \@xp\pgfkeys@spdef\@xp\test\@xp{#1}%
+ \csname\test @ custom handler\endcsname{#1}%
+}
+
+\def\declarecustomhandler#1#2{%
+ \immediate\write\@auxout{\@nx\expandafter\gdef\@nx\csname#1@ custom handler\endcsname{\@nx#2}}%
+ \@xp\gdef\csname#1@ custom handler\endcsname{#2}%
+}
+
+\def\declareasstyle#1{\declarecustomhandler{#1}\stylehandler}
+\def\stylehandler#1#2{%
+ \bgroup
+ \let\pgfmanualwordstartup\relax
+ \def\thekey{#2}%
+ \let\leadingtoks\empty
+ \pulloffstartspaces\pulloffstartbrace
+ \textcolor{keycolor}{\leadingtoks}%
+ \@xp\pgfmanualprettyprintpgfkeys\@xp{\thekey}%
+ \egroup
+}
+\def\codehandler#1#2{%
+ \bgroup
+ \def\thekey{#2}%
+ \let\leadingtoks\empty
+ \let\trailingtoks\empty
+ \pulloffstartspaces\pulloffstartbrace
+ \removetrailingspaces\removetrailingnewline
+ \removetrailingspaces\removetrailingbrace
+ \textcolor{keycolor}{\leadingtoks}%
+ \@xp\pgfmanualprettyprintcode\@xp{\thekey}%
+ \textcolor{keycolor}{\trailingtoks}%
+ \egroup
+}
+
+\declarecustomhandler{font}{\codehandler}
+\declarecustomhandler{page constraint}{\codehandler}
+\declarecustomhandler{page constraint}{\codehandler}
+
+
+\let\pgfmanualpdflabel@opt@old\pgfmanualpdflabel@opt
+\def\pgfmanualpdflabel@opt[#1]#2#3{%
+ \pgfkeys@spdef\temp{#2}%
+ \sseq@eval{\unexpanded{\pgfmanualpdflabel@opt@old[#1]}\unexpanded\@xp{\@xp{\temp}{#3}}}%
+}
+
+\patchcmd\extractkey{\hfill(\extrakeytext no value)}{}{}{\error}
+\patchcmd\extractkey{\def\mykey}{\gdef\mykey}{}{\error}
+\patchcmd\extractkeyequal{\hfill(\extrakeytext no default)}{}{}{\error}
+\patchcmd\extractkeyequal{\def\mykey}{\gdef\mykey}{}{\error}
+\patchcmd\extractinitial{no default, }{}{}{\error}
+\patchcmd\extractinitial{\def\mykey}{\gdef\mykey}{}{\error}
+\patchcmd\extractdefault{\def\mykey}{\gdef\mykey}{}{\error}
+\patchcmd\extractdefault{#2}{{\hskip2pt}#2}{}{\error}
+\patchcmd\extractequalinitial{\def\mykey}{\gdef\mykey}{}{\error}
+\let\extractkey@\extractkey
+\apptocmd\extractkey@{\egroup}{}{\error}
+\def\extractkey{\bgroup\@ifnextchar*{\def\decompose####1\nil{}\relax\extractkey@\@gobble}{\extractkey@}}
+
+\def\pgfmanual@pretty@quote{"}
+\let\pgfmanual@pretty@pgfkeys@loop@\pgfmanual@pretty@pgfkeys@loop
+\def\pgfmanual@pretty@pgfkeys@loop#1{%
+ \def\pgfmanual@loc@TMPa{#1}%
+ \def\pgfmanual@pretty@pgfkeys@loop@NEXT{\pgfmanual@pretty@pgfkeys@loop@{#1}}%
+ \ifx\pgfmanual@loc@TMPa\pgfmanual@pretty@quote%
+ \let\pgfmanual@pretty@pgfkeys@loop@NEXT\pgfmanual@pretty@collectquote
+ \fi
+ \pgfmanual@pretty@pgfkeys@loop@NEXT
+}
+\def\pgfmanual@pretty@collectquote{%
+ \let\pgfmanualprettyprinterhandlecollectedargs=\pgfmanual@pretty@collectargs@finish@collectquote
+ \let\pgfmanualprettyprinterhandlecollectedargsVtwo\pgfmanualprettyprinterhandlecollectedargsVtwo@default
+ \pgfmanualprettyprintercollectupto"%
+ {\pgfmanual@pretty@collectquote@b}%
+}
+\def\pgfmanual@pretty@collectquote@b{%
+ \let\pgfmanualprettyprinterhandlecollectedargs=\pgfmanual@pretty@collectargs@finish@collectquote@b
+ \pgfmanualprettyprintercollectupto,{%
+ \@xp\afterpgfmanual@pretty@collectquote\temp
+ }%
+}
+
+\def\afterpgfmanual@pretty@collectquotenocomma,{\pgfmanual@pretty@pgfkeys@loop}
+\def\afterpgfmanual@pretty@collectquote{\pgfmanual@pretty@pgfkeys@loop}
+\def\pgfmanual@pretty@collectargs@finish@collectquote#1{\textcolor{keycolor}{\pgfmanualpdfref{""quotes}{"#1"}}}
+\def\pgfmanual@pretty@collectargs@finish@collectquote@b#1{%
+ \def\thekey{#1}%
+ \edef\temp{\ifpgfmanualprettyprinterfoundterminator,\fi}%
+ \pgfkeys{/codeexample/prettyprint/key name/.code={\textcolor{keycolor}{##1}}}%
+ \def\leadingtoks{}\def\trailingtoks{}%
+ \pulloffstartspaces\pulloffsinglequote\pulloffstartspaces\pulloffstartbrace
+ \removetrailingspaces\removetrailingbrace
+ \textcolor{keycolor}{{}\leadingtoks}% {} here to prevent \textcolor from eating initial space
+ \@xp\pgfmanual@pretty@pgfkeys@loop\thekey\pgfmanual@EOI
+ \textcolor{keycolor}{{}\trailingtoks}%
+}
+
+% Don't allow braces in key names
+\patchcmd\pgfmanual@pretty@pgfkeys@collectkey{%
+ \def\pgfmanual@pretty@pgfkeys@collectkey@next{%
+ \pgfmanualprettyprintercollectargcount{1}{\pgfmanual@pretty@pgfkeys@collectkey}%
+ #1%
+ }%
+}{%
+ \expandafter\pgfmanual@pretty@pgfkeys@processkey\expandafter{\the\toks0 }%
+ #1%
+ \def\pgfmanual@pretty@pgfkeys@collectkey@next{\pgfmanual@pretty@pgfkeys@loop}%
+}{}{\error}
+
+% Redefine point collection to correctly balance the parens
+% Has unfortunate side effect that it now throws an error if parens don't balance.
+\let\pgfmanual@pretty@collectpoint@old\pgfmanual@pretty@collectpoint
+%\def\pgfmanual@pretty@collectpoint{\pgfmanual@pretty@collectpoint@(} %)
+%\DeclareDocumentCommand\pgfmanual@pretty@collectpoint@{r()}{%
+% \pgfmanualprettyprinterfoundterminatortrue
+% \pgfmanual@pretty@collectargs@finish@collectpoint{#1}%
+% \afterpgfmanual@pretty@collectpoint
+%}
+
+
+
+\pgfqkeys{/codeexample/prettyprint}{
+ cs arguments/meta/.initial=1, % Make \meta work correctly in codeexample
+ cs/meta/.code={\textcolor{black}{\meta{\@gobble#1}}},
+%
+ cs arguments/opt/.initial=1,
+ cs/opt/.code={\opt{\@gobble#1}},
+ %
+ cs arguments/oarg/.initial=1,
+ cs/oarg/.code={\oarg{\@gobble#1}},
+%
+ cs arguments/marg/.initial=1,
+ cs/marg/.code={\marg{\@gobble#1}},
+ cs arguments/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}}},
+ cs arguments/pararg/.initial=1,
+ cs/pararg/.code={\pararg{\@gobble#1}},
+ cs arguments/parargtwo/.initial=2,
+ cs/parargtwo/.code 2 args={\parargtwo{\@gobble#1}{\@gobble#2}},
+%
+ cs arguments/cscolor/.initial=1,
+ cs/cscolor/.code={\textcolor{cscolor}{\@gobble#1}},
+ cs arguments/pointcolor/.initial=1,
+ cs/pointcolor/.code={\textcolor{pointcolor}{\@gobble#1}},
+ %point/.code={\def\temp{#1}\show\temp},
+%
+ cs arguments/sseqset/.initial=1,
+ cs/sseqset/.code 2 args={\textcolor{cscolor}{\string\sseqset}\{\pgfmanualprettyprintpgfkeys{#2}\}},
+%
+ cs arguments/DeclareDocumentCommand/.initial=2,
+ cs/DeclareDocumentCommand/.code={\handlexparsestylecmd#1},
+ cs arguments/NewSseqCommand/.initial=2,
+ cs/NewSseqCommand/.code={\handlexparsestylecmd#1},
+%
+ /pdflinks/internal link prefix=pgf,
+ key value with style detection/.code 2 args={\pgfkeysalso{/codeexample/prettyprint/key value display only={#2}}}, % get rid of bothersome special style handling
+ % handle spaces and colons
+ key name/.code={%
+ \pgfkeys@spdef\temp{#1}%
+ \let\pgfmanual@pretty@pgfkeys@collectkey@keyname\temp
+ \textcolor{keycolor}{%
+ \pgfmanualpdfref{\temp}{%
+ \noligs{\@xp\eatclnifpresent\@xp{\temp}}%
+ }%
+ }%
+ \onlytrailingspaces{#1}%
+ },
+ key value display only/.code={%
+ \sseq@eval{\@nx\pgfutil@in@{/.style}{\pgfmanual@pretty@pgfkeys@collectkey@keyname}}%
+ \ifpgfutil@in@\else
+ \sseq@eval{\@nx\pgfutil@in@{/.sseq style}{\pgfmanual@pretty@pgfkeys@collectkey@keyname}}%
+ \fi
+ \ifpgfutil@in@
+ \def\thekey{#1}%
+ \def\trailingtoks{}%
+ \removetrailingspaces\removetrailingbrace
+ \@xp\stylehandler\@xp{\@xp}\@xp{\thekey}%
+ \textcolor{keycolor}{%
+ \trailingtoks
+ }%
+ \else
+ \ifcustomhandler{\pgfmanual@pretty@pgfkeys@collectkey@keyname}{%
+ \def\thekey{#1}%
+ \def\trailingtoks{}%
+ \removetrailingspaces\removetrailingbrace
+ \@xp\customhandler\@xp{\@xp\pgfmanual@pretty@pgfkeys@collectkey@keyname\@xp}\@xp{\thekey}%
+ \textcolor{keycolor}{%
+ \trailingtoks
+ }%
+ }{%
+ \textcolor{keycolor}{{\itshape{\let\pgfmanualwordstartup\relax\pgfmanualprettyprintpgfkeys{#1}}}}%
+ }%
+ \fi
+ },
+ point/.code={%\pgfutil@in@){#1}\ifpgfutil@in@\def\temp{#1}\prettyprintprocesspoint{#1}\else \textcolor{pointcolor}{\noligs{#1}}\fi
+ \textcolor{pointcolor}{\noligs{#1}}},
+ %/cs/.code={\pgfmanualpdfref{#1}{\textcolor{blue}{#1}}},
+% /cs with args/.code 2 args={\pgfmanualpdfref{#1}{\textcolor{blue}{#1}}\{\pgfmanualprettyprintcode{#2}\pgfmanualclosebrace},
+ %/colored
+}
+
+\def\handlexparsestylecmd#1#2#3{\pgfkeysvalueof{/codeexample/prettyprint/cs/.@cmd}#1\pgfeov\textcolor{cscolor}{#2}\typesetargspec{#3}}
+\def\typesetargspec#1{\{\textcolor{purple}{#1}\}}
+
+\let\oldtextcolor\textcolor
+\def\textcolorpoint#1{\oldtextcolor{pointcolor}}
+
+
+% Normally the verbatim processes stuff using
+\let\pgfmanual@verb@collect@code\pgfmanual@verb@collect
+\patchcmd\pgfmanual@verb@collect@code{\pgfmanualprettyprintpgfkeys}{\pgfmanualprettyprintcode}{}{\error}
+\let\pgfmanual@verb@code\pgfmanual@verb
+\patchcmd\pgfmanual@verb@code{\begingroup}{\begingroup\let\pgfmanual@verb@collect\pgfmanual@verb@collect@code}{}{\error}
+\def\codeverb|{\pgfmanual@verb@code}
+
+% balance the braces
+\NewDocumentCommand\prettyprintprocesspoint { m } {%
+ \textcolor{pointcolor}{%
+ \bgroup
+ \let\pgfmanual@pretty@collectpoint\pgfmanual@pretty@collectpoint@old
+ \let\textcolor\textcolorpoint
+ \noligs{(\pgfmanualprettyprintcode{#1})}%
+ \egroup
+ }%
+}
+%\pgfqkeys{/codeexample}{every codeexample/.style={width=6cm}}
+
+% This macro in pgfmanual-en-macros.tex seems not to work because the call to \openin is wrong...
+\def\do@codeexamplefromfile{%
+ \immediate\openin\examplesource examples/spectralsequencesmanual-\codeexamplesource.tex\relax % I only changed this line
+ \def\examplelines{}%
+ \readexamplelines
+ \closein\examplesource
+ \expandafter\endofcodeexample\expandafter{\examplelines}%
+}
+
+% For some reason it's started duplicating the last line of the file,
+% so I added an illogical extra \ifeof and that seems to fix the problem.
+\def\readexamplelines{
+ \ifeof\examplesource%
+ \else
+ \immediate\read\examplesource to \exampleline
+ \ifeof\examplesource\else %% Added
+ \edef\examplelines{\unexpanded\@xp{\examplelines}\unexpanded\@xp{\exampleline}}%
+ \fi %% Added
+ \expandafter\readexamplelines%
+ \fi
+}
+
+
+\pgfqkeys{/sseqpages}{
+ class/class:name/.forward to=/sseqpages/class/name,
+ class/class:page/.forward to=/sseqpages/class/page,
+ struct line/structline:page/.forward to=/sseqpages/struct line/page,
+ fit/cc:differential style/.forward to=/sseqpages/fit/differential style,
+ tikz primitives/cc:differential style/.forward to=/sseqpages/tikz primitives/differential style
+}
+
+
+
+\hypersetup{
+ pdftitle={The Spectral Sequences 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}}
+\def\targetcoord{\meta{target coordinate}}
+\def\sourcen{\meta{source n}}
+\def\targetn{\meta{target n}}
+\def\sourcename{\meta{source name}}
+
+\def\today{\the\year/\the\month/\the\day}
+\def\pgfmanualurl{http://math.mit.edu/~hood/pgfmanual_v3.0.1a.pdf}
+\def\xparseurl{http://mirror.ctan.org/macros/latex2e/contrib/l3packages/xparse.pdf}
+\def\colormanualurl{http://mirror.ctan.org/macros/latex/required/graphics/color.pdf}
+
+\def\pkg#1{\textsf{\textmd{#1}}}
+\def\sseqpages{\textsc{\pkg{spectralsequences}}}
+\let\spectralsequences\sseqpages
+\def\sseqpkg{\pkg{sseq}}
+\let\tikzpkg\tikzname
+\def\pgfpkg{\pkg{\textmd{PGF}}}
+\def\tikzcdpkg{\pkg{tikzcd}}
+\def\pgfplotspkg{\textsc{\pkg{pgfplots}}}
+\def\xparsepkg{\pkg{xparse}}
+\def\colorpkg{\pkg{color}}
+\def\texlive{\TeX\ Live}
+\def\miktex{MiK\TeX}
+\def\pdflatex{\textsc{PDF}\LaTeX}
+\def\lualatex{Lua\LaTeX}
+\let\pdfLaTeX\pdflatex
+\let\LuaLaTeX\lualatex
+
+
+\def\env#1{\texttt{\{#1\}}}
+\def\sseqpageenv{\pgfmanualpdfref{sseqpage}{\env{sseqpage}}}
+\def\sseqdataenv{\pgfmanualpdfref{sseqdata}{\env{sseqdata}}}
+\def\tikzpictureenv{\env{tikzpicture}}
+\def\scopeenv{\env{scope}}
+\def\tikzcdenv{\env{tikzcd}}
+\def\eTeX{\leavevmode\hbox{$\varepsilon$}-\TeX}
+
+
+\def\example#1{\path{example_#1.tex}}
+
+
+% xparse modifications:
+\ExplSyntaxOn
+\cs_set_eq:NN \__xparse_grab_U:w \sseq__xparse_grab_U:w
+\cs_set_eq:NN \__xparse_add_type_U:w \sseq__xparse_add_type_U:w
+\ExplSyntaxOff
+
+\def\@maketitle{%
+ \null\vskip 2em
+ \begin{center}\let\footnote\thanks\sffamily
+ {\huge \@title\par}\vskip 1.5em
+ {\large \parbox{.33\textwidth}{\centering\@author}%
+ \parbox{.33\textwidth}{\centering\@date}}%
+ \vskip2.5em\rule{\textwidth}{.4pt}%
+ \end{center}\par\vskip1.5em}
+\def\abstractname{}
+\def\mailtoHC{\href % some PDF viewers don't like spaces:
+ {mailto:<hood@mit.edu>\%20Hood\%20Chatham?subject=[spectralsequences\%20package]}
+ {\texttt{hood@mit.edu}}} \ No newline at end of file
diff --git a/graphics/pgf/contrib/spectralsequences/manual/sseqmanualtest.tex b/graphics/pgf/contrib/spectralsequences/manual/sseqmanualtest.tex
new file mode 100755
index 0000000000..e69de29bb2
--- /dev/null
+++ b/graphics/pgf/contrib/spectralsequences/manual/sseqmanualtest.tex