From d1d6136c3b0e4b416d32f744f3bc762bd1ebe303 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 11 Jan 2006 23:57:57 +0000
Subject: trunk/Master/texmf-dist/source/latex/sseq

git-svn-id: svn://tug.org/texlive/trunk@524 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/source/latex/sseq/sseq.dtx | 1420 ++++++++++++++++++++++++++
 1 file changed, 1420 insertions(+)
 create mode 100644 Master/texmf-dist/source/latex/sseq/sseq.dtx

(limited to 'Master/texmf-dist/source/latex/sseq/sseq.dtx')

diff --git a/Master/texmf-dist/source/latex/sseq/sseq.dtx b/Master/texmf-dist/source/latex/sseq/sseq.dtx
new file mode 100644
index 00000000000..dbc22b65f95
--- /dev/null
+++ b/Master/texmf-dist/source/latex/sseq/sseq.dtx
@@ -0,0 +1,1420 @@
+%
+% ^^A This is file sseq.dtx. First LaTeX the accompanying file sseq.ins
+% ^^A to produce the package file sseq.sty.
+% ^^A Then LaTeX this file to produce the documentation of the sseq package.
+% ^^A
+% ^^A (c) 2003 Tilman Bauer. Freely distributable under the LaTeX Project Public License (LPPL)
+% ^^A
+% \iffalse
+%<*never>
+\documentclass{ltxdoc}
+\usepackage[dvips]{sseq}
+\begin{document}
+\DocInput{sseq.dtx}
+\end{document}
+%</never>
+% \fi
+
+% 
+% \changes{v1.0}{November 12, 2003}{First release of code and documentation}
+% \changes{v1.01}{November 15, 2003}{Bug fix with clipping after a ssgoto}
+% \changes{v1.02}{November 18, 2003}{Bug fix that would mess up page numbering in some cases}
+% \changes{v1.03}{December 11, 2003}{Added examples to documentation, bug fix in grid drawing}
+%
+% \iffalse
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+
+\ProvidesPackage{sseq}
+
+\RequirePackage{ifthen,calc,pifont}
+
+\newboolean{usesps}
+\setboolean{usesps}{true}
+\newboolean{usescolor}
+\setboolean{usescolor}{true}
+\newboolean{debug}
+\setboolean{debug}{false}
+
+\DeclareOption{ps}{\setboolean{usesps}{true}}
+\DeclareOption{nops}{\setboolean{usesps}{false}}
+\DeclareOption{color}{\setboolean{usescolor}{true}}
+\DeclareOption{nocolor}{\setboolean{usescolor}{false}}
+\DeclareOption{debug}{\setboolean{debug}{true}}
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{xy}}
+
+\ProcessOptions
+
+\ifx\xyloaded\undefined \RequirePackage[curve,frame]{xy} \fi
+
+\ifthenelse{\boolean{usesps}}{\xyrequire{ps}}{}
+\ifthenelse{\boolean{usescolor}}{\xyrequire{color}}{}
+
+
+%</package>
+% \fi
+%
+% \title{Typesetting spectral sequences in \LaTeX\ with sseq.sty}
+% \author{Tilman Bauer\footnote{tbauer@math.uni-muenster.de}}
+% \date{November 12, 2003}
+%
+% \MakeShortVerb{\|}
+% \maketitle
+%
+% \section{Introduction}
+%
+% The present package, \texttt{sseq}, facilitates the typesetting of mathematical objects called \emph{spectral sequence charts} (henceforth simply called ``chart''). From a typographical point of view, a chart is a two-dimensional grid with integer coordinates; at every position (x,y), there may be any number of symbols (usually dots, little circles or boxes, digits etc.), possibly decorated with labels, and between any two such symbols may or may not be a connection---e.~g., a line, an arrow, or some curved line.
+%
+% The \texttt{sseq} package is built on top of the \Xy-pic package by K.~H.~Rose and R.~Moore. It shares the disadvantage of using up lots of \TeX's memory; therefore, if your system provides a \texttt{biglatex} or \texttt{hugelatex} command, it is wise to use it when using \texttt{sseq}. Still, problems may arise with very large charts (i.e., more than $100\times100$).
+%
+% This package automates the following functions and thereby offers an improvement over pure \Xy-pic graphics:
+%
+% \begin{itemize}
+% \item Automatic drawing of the grid and the axis labels;
+% \item Clipping. Anything outside the displayed portion of the chart is clipped away. This has the advantage that a large chart, which does not fit on a page, can be cut into smaller pieces which contain exactly the same \texttt{sseq} code, but different clipping regions.
+% \item Arranging. Multiple symbols dropped at the same integer coordinates will be automatically arranged so that they usually do not overlap. The algorithm for doing this is rather primitive, but still powerful enough for most applications
+% \item Simplified ``turtle graphics'' syntax. Every primitive element of a chart is typeset with a macro defined by \texttt{sseq}; no cryptic command lines like in \Xy-pic.
+% \item More flexibility. Control structures (loops, if/then, etc.) are allowed inside the \texttt{sseq} environment.
+% \end{itemize}
+%
+%
+% \section{Global options}
+%
+% The |sseq| package is loaded with
+%
+% |\usepackage[|\emph{options...}|]{sseq}|.
+%
+% The following options are defined:
+%
+% \begin{itemize}
+% \item |nops| will tell \Xy-pic not to generate PostScript code but to use special \TeX fonts to typeset the diagrams. This is preferable if you do not have a PostScript printer; however, the overhead in memory and time usage is so enormous that this should only serve as a last resort against incompatibilities
+% \item |nocolor| will tell |sseq| not to generate any color information. This includes gray shades. Many |dvi| drivers do not support color, but most of them tolerate (i.e. ignore) the color directives.
+% \item |debug| will typeout the \Xy-pic code generated by every |sseq| environment and wait for the user to confirm.
+% \item any other options are fed into \Xy-pic. Thus, for example, the option |dvips| will tell \Xy-pic to generate code for the |dvips| driver.
+% \end{itemize}
+%
+%
+% \section{Basic usage}
+%
+% A spectral sequence is typeset by the code
+%
+% |\begin{sseq}{x}{y}|
+%
+% \emph{(sseq commands...)}
+%
+% |\end{sseq}|
+%
+% Here |x| and |y| are nonnegative integers specifying the size of the grid. By default, the bottom left corner of the chart will have coordinates $(0,0)$; however, this can be changed by issung
+%
+% |\sseqxstart=|\emph{(starting x position)}
+%
+% |\sseqystart=|\emph{(starting y position)}
+%
+% By default, the size of one coordinate square is .4cm; this can be changed by
+%
+% |\sseqentrysize=|\emph{(new length)}
+%
+% Normally, all even labels are printed (for space reasons); this can be changed by
+%
+% |\sseqxstep=|\emph{(x-axis label step)}
+%
+% |\sseqystep=|\emph{(y-axis label step)}
+%
+% Setting these to $1$ will typeset every label; setting it to $n$ will typeset every $n$th label.
+%
+% All of the above have to be issued \textbf{before} the |\begin{sseq}| command. They remain valid for subsequent charts until changed again.
+%
+%
+% \section{sseq commands}
+%
+% Inside an |sseq| environment there is defined a virtual cursor, which starts out at position $(0,0)$ (even if that position is not within the clipping region!). All drawing commands are relative to the current cursor position; this facilitates reusage of |sseq| code when a certain pattern has to be repeated, as is often the case in mathematical spectral sequences.
+%
+%
+% ^^A Produce save boxes for the circled digits
+% \ifthenelse{0=1}{
+\newsavebox{\sseqcircledone}
+\newsavebox{\sseqcircledtwo}
+\newsavebox{\sseqcircledthree}
+\newsavebox{\sseqcircledfour}
+\newsavebox{\sseqcircledfive}
+\newsavebox{\sseqcircledsix}
+\newsavebox{\sseqcircledseven}
+\newsavebox{\sseqcircledeight}
+\newsavebox{\sseqcirclednine}
+\sbox{\sseqcircledone}{\ding{192}}
+\sbox{\sseqcircledtwo}{\ding{193}}
+\sbox{\sseqcircledthree}{\ding{194}}
+\sbox{\sseqcircledfour}{\ding{195}}
+\sbox{\sseqcircledfive}{\ding{196}}
+\sbox{\sseqcircledsix}{\ding{197}}
+\sbox{\sseqcircledseven}{\ding{198}}
+\sbox{\sseqcircledeight}{\ding{199}}
+\sbox{\sseqcirclednine}{\ding{200}}
+%
+% 
+\newboolean{sseqhasfinishedpos}
+\setboolean{sseqhasfinishedpos}{true}
+\newboolean{sseqhasopenconn}
+\setboolean{sseqhasopenconn}{false}
+\newboolean{sseqclip}
+\setboolean{sseqclip}{true}
+\newboolean{sseqprevclip}\setboolean{sseqprevclip}{false}
+\newboolean{sseqcurrclip}\setboolean{sseqcurrclip}{false}
+
+\def\sseqconncommand{}
+
+\ifthenelse{\boolean{usescolor}}
+{
+ \newxyColor{sseqgr}{0.65}{gray}{}
+ \newxycolor{ssred}{Red}
+ \newxycolor{ssblack}{Black}
+}{}
+\newcommand{\ssconncolor}{ssblack}
+\newcommand{\sslabelcolor}{ssblack}
+\newcommand{\ssplacecolor}{ssblack}
+\def\ssoldconncolor{ssblack}
+
+
+%% ^^A Initialization
+\newcount\sseqxstart \sseqxstart=0
+\newcount\sseqystart \sseqystart=0
+\newcount\sseqxstep \sseqxstep=2
+\newcount\sseqystep \sseqystep=2
+\newdimen\sseqentrysize \sseqentrysize=0.4cm
+\newif\ifssclipped 
+
+\newtoks\sseqcmdlist
+\sseqcmdlist={}
+
+\def\currprefix{}
+
+\def\sseqcurrentname{}
+
+\long\def\ntimes#1#2{
+\ifnum#1>0
+ #2
+ \count0=#1
+ \advance\count0 by -1
+ \edef\tmpcnt{\the\count0}
+ \ntimes{\tmpcnt}{#2}
+\fi
+}
+
+\newif\ifforcondition
+
+\long\def\for#1=#2\to#3\do#4\od{
+#1=#2
+\loop
+\ifnum#1>#3\forconditionfalse\else\forconditiontrue\fi
+\ifforcondition
+ #4
+ \advance #1 by 1
+ \repeat
+}
+
+%
+% ^^A \putxy will put a list of commands into the execution queue
+%
+\def\putxyq#1{\toks0={#1}%
+ \edef\act{\noexpand\sseqcmdlist={\the\sseqcmdlist \the\toks0}}
+ \act
+}
+\def\putxy#1{%
+ \edef\act{\noexpand\sseqcmdlist={\the\sseqcmdlist #1}}
+ \act
+}
+
+%
+%
+%
+\def\sseqwritecolor#1{
+\ifthenelse{\boolean{usescolor}}{
+  \putxy {[#1]}
+}{}
+}
+%
+%
+%
+
+\def\sseqconcludeconnection{
+\sseqconncommand
+\setboolean{sseqhasopenconn}{false}
+}
+
+\def\dropvarname#1#2{\csname sseqdrop#1,#2\endcsname}
+
+\def\ifuniquedrop#1#2{
+\edef\tmpval{\dropvarname{#1}{#2}}
+\expandafter\ifx\tmpval1
+}
+
+\def\ifnodrop#1#2{
+\edef\tmpval{\dropvarname{#1}{#2}}
+\expandafter\ifx\tmpval\relax
+}
+
+\def\ssdroperrormsg#1#2{
+ \ifnodrop{#1}{#2}
+  \PackageError{sseq}{cannot open position (#1,#2): nothing dropped yet}{You cannot draw any connection until you have drawn the source.}
+ \else
+  \PackageError{sseq}{cannot open position (#1,#2): multiple drops}{You cannot specify this position by coordinates. Instead, name it.}
+ \fi
+}
+
+\def\ssopenposition#1#2{
+\ifuniquedrop{#1}{#2}
+ \def\sseqcurrentname{ss(#1,#2)1}
+ \putxy{"\sseqcurrentname"}
+\else \ssdroperrormsg{#1}{#2}
+\fi
+\setboolean{sseqhasfinishedpos}{false}
+}
+
+\newcommand{\ssassertsource}{
+\ifthenelse{\boolean{sseqhasfinishedpos}}{
+\ssopenposition{\the\sseqposx}{\the\sseqposy}
+}
+{}
+}
+
+\newcommand{\ssputsemicolon}{
+\putxy{;}
+\ifthenelse{\boolean{sseqcurrclip}}{
+ \setboolean{sseqprevclip}{true}}{
+ \setboolean{sseqprevclip}{false}}
+}
+
+\newcommand{\ssfinishpos}{
+\ifthenelse{\boolean{sseqhasfinishedpos}}{}{
+\setboolean{sseqhasfinishedpos}{true}
+\ssputsemicolon
+}
+\ifthenelse{\boolean{sseqhasopenconn}}
+{
+  \ssopenposition{\the\sseqposx}{\the\sseqposy}
+  \sseqconcludeconnection
+  \ifthenelse{\boolean{sseqhasfinishedpos}}{}{
+  \setboolean{sseqhasfinishedpos}{true}
+  \ssputsemicolon}
+}{}
+}
+
+\newcommand{\ssnewpos}{
+\ssfinishpos
+\setboolean{sseqhasfinishedpos}{false}
+}
+
+\def\ssifposinclippingregion#1#2{
+  \ssclippedtrue
+  \ifthenelse{\boolean{sseqclip}}{
+   \ifnum#1<\sseqxstart \ssclippedfalse \fi
+   \ifnum#1<\sseqxend \else \ssclippedfalse \fi
+   \ifnum#2<\sseqystart \ssclippedfalse \fi
+   \ifnum#2<\sseqyend \else \ssclippedfalse \fi
+  }{}
+  \ifssclipped
+}
+
+\def\sseqrearrange#1#2#3#4#5{
+\dimen0 = \csname sseqcoordx<#1,#2>#3\endcsname
+\dimen1 = \csname sseqcoordy<#1,#2>#3\endcsname
+\advance\dimen0 by #4
+\advance\dimen1 by #5
+\expandafter\edef\csname sseqcoordx<#1,#2>#3\endcsname{\the\dimen0}
+\expandafter\edef\csname sseqcoordy<#1,#2>#3\endcsname{\the\dimen1}
+}
+
+\def\sseqstacking#1#2#3{ % ^^A (xpos, ypos, number of previous drops)
+ \dimen5=\sseqentrysize
+ \divide\dimen5 by 4
+ \dimen6=\dimen5
+ \multiply\dimen6 by -1
+%
+ \count11=0
+ \for\count10=1 \to #3 \do
+  \if1\csname sseqwillmove<#1,#2>\the\count10 \endcsname
+   \advance\count11 by 1
+   \expandafter\count\the\count11=\count10
+  \fi
+ \od
+ % ^^A Now count11 contains the number of previously dropped objects that have to be rearranged.
+ \ifcase\count11
+  % ^^A 0
+  \PackageError{sseq}{This can't happen!}{Internal error. Contact the author.}
+ \or % ^^A 1
+  \sseqrearrange{#1}{#2}{\the\count1}{\the\dimen6}{\the\dimen5}
+  \advance\sseqx by \dimen5
+  \advance\sseqy by \dimen6
+ \or % ^^A 2
+  \sseqrearrange{#1}{#2}{\the\count2}{0pt}{\the\dimen5}
+  \sseqrearrange{#1}{#2}{\the\count2}{0pt}{\the\dimen5}
+  \advance\sseqy by \dimen6
+ \or % ^^A 3
+  \sseqrearrange{#1}{#2}{\the\count3}{\the\dimen6}{0pt}
+  \advance\sseqx by \dimen5
+ \else
+  \PackageError{sseq}{Too many drops at (#1,#2)}{The sseq.sty algorithm can only place up to four independent drops in one position.}
+ \fi
+}
+
+\newcommand{\ssplacespecial}[4]{
+\ifthenelse{\boolean{sseqhasfinishedpos}}{}{
+ \ssputsemicolon
+}
+\setboolean{sseqhasfinishedpos}{false}
+%
+%
+\sseqx=\sseqentrysize
+\multiply\sseqx \sseqxdir
+\multiply\sseqx by #1
+\advance\sseqx by \sseqhalfentry
+\advance\sseqx by \sseqoffsetx
+\advance\sseqx by \sseqoffx
+%
+\sseqy=\sseqentrysize
+\multiply\sseqy \sseqydir
+\multiply\sseqy by #2
+\advance\sseqy by \sseqhalfentry
+\advance\sseqy by \sseqoffsety
+\advance\sseqy by \sseqoffy
+%
+\expandafter\def\expandafter\tmpname\expandafter{\csname sseqdrop#1,#2\endcsname}
+%
+\ifnodrop{#1}{#2}
+\expandafter\def\tmpname{1}
+\else
+ \edef\setcnt{\noexpand\count0=\tmpname}
+ \setcnt
+ \sseqstacking{#1}{#2}{\tmpname}
+ \advance\count0 by 1
+ \expandafter\edef\tmpname{\the\count0}
+\fi
+\putxy{<\csname sseqcoordx<#1,#2>\tmpname\endcsname,\csname sseqcoordy<#1,#2>\tmpname \endcsname>}
+\expandafter\edef\csname sseqcoordx<#1,#2>\tmpname\endcsname{\the\sseqx}
+\expandafter\edef\csname sseqcoordy<#1,#2>\tmpname\endcsname{\the\sseqy}
+\expandafter\def\csname sseqwillmove<#1,#2>\tmpname\endcsname{1}
+%^^A \putxy{<\the\sseqx,\the\sseqy>}
+\setboolean{sseqcurrclip}{true}
+\ssifposinclippingregion{#1}{#2}
+ \setboolean{sseqcurrclip}{false}
+ \putxy{*#3}
+ \sseqwritecolor{\ssplacecolor}
+ \putxy{#4}
+\fi
+%
+% ^^A now give it a unique name
+%
+\edef\sseqcurrentname{ss(#1,#2)\tmpname}
+\putxy{="\sseqcurrentname"}
+\ifthenelse{\boolean{sseqhasopenconn}}{\sseqconcludeconnection}{}
+}
+
+\newcommand{\ssplace}[3]{
+\ssplacespecial{#1}{#2}{}{{#3}}
+}
+
+\newcommand{\ssplaceboxed}[3]{
+ \ifthenelse{\boolean{usescolor}}{
+   \ssplacespecial{#1}{#2}{+<2pt>[F:\ssplacecolor]}{{#3}}
+ }{
+   \ssplacespecial{#1}{#2}{+<2pt>}{{#3}}
+ }
+}
+
+\newcommand{\ssplacecircled}[3]{
+\ifthenelse{\equal{#3}{1}}{
+ \ssplacespecial{#1}{#2}{}{[o]{\copy\sseqcircledone}}}{
+ \ifthenelse{\equal{#3}{2}}{
+  \ssplacespecial{#1}{#2}{}{[o]{\copy\sseqcircledtwo}}}{
+  \ifthenelse{\equal{#3}{3}}{
+   \ssplacespecial{#1}{#2}{}{[o]{\copy\sseqcircledthree}}}{
+   \ifthenelse{\equal{#3}{4}}{
+    \ssplacespecial{#1}{#2}{}{[o]{\copy\sseqcircledfour}}}{
+    \ifthenelse{\equal{#3}{5}}{
+     \ssplacespecial{#1}{#2}{}{[o]{\copy\sseqcircledfive}}}{
+     \ifthenelse{\equal{#3}{6}}{
+      \ssplacespecial{#1}{#2}{}{[o]{\copy\sseqcircledsix}}}{
+      \ifthenelse{\equal{#3}{7}}{
+       \ssplacespecial{#1}{#2}{}{[o]{\copy\sseqcircledseven}}}{
+       \ifthenelse{\equal{#3}{8}}{
+        \ssplacespecial{#1}{#2}{}{[o]{\copy\sseqcircledeight}}}{
+        \ifthenelse{\equal{#3}{9}}{
+         \ssplacespecial{#1}{#2}{}{[o]{\copy\sseqcirclednine}}}{
+         \ifthenelse{\boolean{usescolor}}{
+          \ssplacespecial{#1}{#2}{+<3pt>}{[o][F:\ssplacecolor]{#3}}
+         }{
+          \ssplacespecial{#1}{#2}{+<3pt>}{[o]{#3}}
+         }
+        }
+       }
+      }
+     }
+    }
+   }
+  }
+ }
+}
+}
+
+\newcommand{\ssbull}[2]{
+\ifthenelse{\boolean{usescolor}}{
+ \ssplacespecial{#1}{#2}{+<1.1mm>[o][F:\ssplacecolor]}{{}*[\ssplacecolor]\noexpand\frm{*}}
+ }{
+ \ssplacespecial{#1}{#2}{+<1.1mm>[o]}{{}*\noexpand\frm{*}}
+ }
+}
+
+\newcommand{\sscirc}[2]{
+\ssplacespecial{#1}{#2}{}{[o]-={\circ}}
+}
+
+\newcommand{\ssglobalname}[1]{\currprefix#1}
+
+
+\def\sssetglobalname#1{
+ \ssassertsource
+ \expandafter\edef\csname sseqpos<#1>\endcsname{\sseqcurrentname}
+ \expandafter\edef\csname sseqx<#1>\endcsname{\the\sseqposx}
+ \expandafter\edef\csname sseqy<#1>\endcsname{\the\sseqposy}
+}
+% }{}
+%
+% \DescribeMacro{\ssmoveto} 
+% To move the cursor to position (x,y), use |\ssmoveto{x}{y}|.
+%
+% \ifthenelse{0=1}{
+\newcommand{\ssmoveto}[2]{
+\ssfinishpos
+\sseqposx=#1
+\sseqposy=#2
+\ssifposinclippingregion{#1}{#2}
+ \setboolean{sseqcurrclip}{false}
+\fi
+}
+% }{}
+% \DescribeMacro{\ssmove}
+% To move the cursor relative to the current position by (x,y), use |\ssmove{x}{y}|.
+%
+% \iffalse
+\newcommand{\ssmove}[2]{
+\count0=\sseqposx
+\advance\count0 by #1
+\count1=\sseqposy
+\advance\count1 by #2
+\ssmoveto{\count0}{\count1}
+}
+% \fi
+%
+% \DescribeMacro{\ssdrop}
+% The command |\ssdrop{|\emph{mathcode}|}| will display \emph{mathcode} at the current cursor position. The argument is always interpreted in math mode.
+%
+% \iffalse
+\newcommand{\ssdrop}[1]{
+\ssplace {\the\sseqposx} {\the\sseqposy} {#1}
+}
+% \fi
+%
+% \DescribeMacro{\ssdropbull}
+% This command is a shorthand for and improvement over |\ssdrop{\bullet}|, i.e. it will typeset a thick black dot at the current cursor position. It is better than the longer version because the bounding circle of a |\bullet| is not accurate in most fonts. However, some |dvi| drivers do not support this and typeset a square instead of a bullet. If that is the case, either use a different driver (like |dvips|), or use |\ssdrop{\bullet}| instead at the cost of a slightly poorer display.
+%
+% \iffalse
+\newcommand{\ssdropbull}{\ssbull {\the\sseqposx} {\the\sseqposy}}
+% \fi
+%
+% \DescribeMacro{\ssdropboxed}
+% This command is the same as |\ssdrop|, except that it will also draw a box around its argument.
+%
+% \iffalse
+\newcommand{\ssdropboxed}[1]{
+\ssplaceboxed {\the\sseqposx} {\the\sseqposy} {#1}
+}
+% \fi
+%
+% \DescribeMacro{\ssdropcircled}
+% This command is the same as |\ssdrop|, except that it will also draw a circle around its argument. If the argument is a single digit, the symbol dropped will be prettified by replacing it with a character from the |dingbats| font.
+%
+% \iffalse
+\newcommand{\ssdropcircled}[1]{
+\ssplacecircled {\the\sseqposx} {\the\sseqposy} {#1}
+}
+% \fi
+%
+% \DescribeMacro{\ssname}
+% |\ssname{|\emph{name}|}| gives the object most recently dropped the name \emph{name}. If the previous command is one of the drop commands, then it refers to that object; if it is not, then if there is one and only one object at the current cursor position, it refers to that object; if that is also not the case, an error message is generated.
+%
+% \iffalse
+\def\ssname#1{
+ \sssetglobalname{\ssglobalname{#1}}
+}
+% \fi
+%
+% \DescribeMacro{\ssgoto}
+% After an object has been given a \emph{name} with |\ssname|, the cursor can be moved back to that object at any time by issuing |\ssgoto{|\emph{name}|}|. This becomes necessary when there is more than one object in one position.
+%
+% \iffalse
+\newcommand{\ssgoto}[1]{
+\ssabsgoto{\ssglobalname{#1}}
+}
+% \fi
+%
+% \DescribeMacro{\ssprefix}
+% Often the mechanism provided by |\ssname|/|\ssgoto| is not flexible enough to deal with repeated code. In that case, |\ssprefix{|\emph{prefix}|}| defines a prefix for all names that follow; i.e. a |\ssname{|\emph{name}|}| after such a command will really define a name \emph{prefixname}. However, since |\ssgoto| also observes the prefix, |\ssgoto{|\emph{name}|}| will still work. |\ssprefix| commands can be iterated; the prefices are then concatenated (most recent right).
+%
+% \iffalse
+\newcommand{\ssprefix}[1]{
+  \edef\currprefix{\currprefix#1}
+}
+% \fi
+%
+% \DescribeMacro{\ssresetprefix}
+% This command resets the prefix defined by (a sequence of) |\ssprefix| to the empty prefix.
+%
+% \iffalse
+\newcommand{\ssresetprefix}{\def\currprefix{}}
+% \fi
+%
+% \DescribeMacro{\ssabsgoto}
+% This is a version of |\ssgoto| that ignores the current prefix.
+%
+% \ifthenelse{0=1}{
+\newcommand{\ssabsgoto}[1]{
+\ssnewpos
+\edef\ssoldconncolor{\ssconncolor}
+\putxy{"\csname sseqpos<#1>\endcsname"}
+\sseqposx=\csname sseqx<#1>\endcsname
+\sseqposy=\csname sseqy<#1>\endcsname
+\ssifposinclippingregion{\the\sseqposx}{\the\sseqposy}
+ \setboolean{sseqcurrclip}{false}
+\fi
+}
+% }{}
+%
+% \DescribeMacro{\ssdroplabel}
+% This command decorates the previously typeset object with a label. It can be used either in the form
+%
+% |\ssdroplabel{|\emph{label}|}|
+%
+% or in the form
+%
+% |\ssdroplabel[|\emph{pos}|]{|\emph{label}|}|.
+%
+% The \emph{label} will then be typeset next to the most recently dropped object (for a definition for what that is, exactly, consult the description of |\ssname|). The optional argument \emph{pos}, which defaults to |U|, can be one of |U|,|LU|,|RU|,|L|,|R|,|LD|,|RD|,|D|, and denotes one of eight directions in which the label is positioned relative to the object it labels.
+%
+% \ifthenelse{0=1}{
+\newcommand{\ssdroplabel}[2][U]{
+\ssassertsource
+\ssifposinclippingregion{\the\sseqposx}{\the\sseqposy}
+ \putxy{="prev"}
+ \ifthenelse{\boolean{usescolor}}{
+  \ifthenelse{\equal{#1}{U}}{
+   \putxy{+U*[\sslabelcolor]!D{#2}}}{}
+  \ifthenelse{\equal{#1}{LU}}{
+  \putxy{+LU*[\sslabelcolor]!RD{#2}}}{}
+  \ifthenelse{\equal{#1}{RU}}{
+  \putxy{+RU*[\sslabelcolor]!LD{#2}}}{}
+  \ifthenelse{\equal{#1}{R}}{
+  \putxy{+R*[\sslabelcolor]!L{#2}}}{}
+  \ifthenelse{\equal{#1}{L}}{
+  \putxy{+L*[\sslabelcolor]!R{#2}}}{}
+  \ifthenelse{\equal{#1}{D}}{
+  \putxy{+D*[\sslabelcolor]!U{#2}}}{}
+  \ifthenelse{\equal{#1}{LD}}{
+  \putxy{+LD*[\sslabelcolor]!RU{#2}}}{}
+  \ifthenelse{\equal{#1}{RD}}{
+  \putxy{+RD*[\sslabelcolor]!LU{#2}}}{}
+ }{
+  \ifthenelse{\equal{#1}{U}}{
+   \putxy{+U*!D{#2}}}{}
+  \ifthenelse{\equal{#1}{LU}}{
+  \putxy{+LU*!RD{#2}}}{}
+  \ifthenelse{\equal{#1}{RU}}{
+  \putxy{+RU*!LD{#2}}}{}
+  \ifthenelse{\equal{#1}{R}}{
+  \putxy{+R*!L{#2}}}{}
+  \ifthenelse{\equal{#1}{L}}{
+  \putxy{+L*!R{#2}}}{}
+  \ifthenelse{\equal{#1}{D}}{
+  \putxy{+D*!U{#2}}}{}
+  \ifthenelse{\equal{#1}{LD}}{
+  \putxy{+LD*!RU{#2}}}{}
+  \ifthenelse{\equal{#1}{RD}}{
+  \putxy{+RD*!LU{#2}}}{}
+ }
+ \putxy{;"prev"}
+\fi
+}
+% }{}
+%
+% \DescribeMacro{\ssdropextension}
+% This command has no arguments and is rather specialized. It refers to a previously dropped object (see |\ssname|), draws a circle around it, and considers that circle a new object. Thus it produces a new circle object that is attached to the original object, and not subject to the algorithm that tries to make objects non-overlapping
+%
+% \ifthenelse{0=1}{
+\newcommand{\ssdropextension}{
+\ssassertsource
+\expandafter\def\expandafter\tmpname\expandafter{\csname sseqdrop\the\sseqposx,\the\sseqposy\endcsname}
+\edef\setcnt{\noexpand\count0=\tmpname}
+\setcnt
+\advance\count0 by 1
+\expandafter\edef\tmpname{\the\count0}
+\setboolean{sseqcurrclip}{true}
+\ssifposinclippingregion{\the\sseqposx}{\the\sseqposy}
+ \setboolean{sseqcurrclip}{false}
+ \putxy{*+<1mm,1mm>\noexpand\frm{}*}
+ \sseqwritecolor{\ssplacecolor}
+ \putxyq{\cir{}}
+\fi
+%
+% ^^A now give it a unique name
+%
+\edef\sseqcurrentname{ss(\the\sseqposx,\the\sseqposy)\tmpname}
+\putxy{="\sseqcurrentname"}
+\ifthenelse{\boolean{sseqhasopenconn}}{\sseqconcludeconnection}{}
+}
+
+\newcommand{\ssprepareline}[2]{
+\ifthenelse{\boolean{sseqhasfinishedpos}}{
+ \ssopenposition{\the\sseqposx}{\the\sseqposy}
+}{}
+\advance\sseqposx by #1
+\advance\sseqposy by #2
+\setboolean{sseqhasopenconn}{true}
+\edef\ssoldconncolor{\ssconncolor}
+}
+
+\newcommand{\sspreparevoidline}[2]{
+\ifthenelse{\boolean{sseqhasfinishedpos}}{
+ \ssopenposition{\the\sseqposx}{\the\sseqposy}
+}{}
+\ifthenelse{\boolean{sseqhasfinishedpos}}{}{
+ \ssputsemicolon
+}
+\setboolean{sseqhasfinishedpos}{false}
+%
+%
+%
+\sseqx=\sseqentrysize
+\multiply\sseqx \sseqxdir
+\multiply\sseqx by #1
+%
+\sseqy=\sseqentrysize
+\multiply\sseqy \sseqydir
+\multiply\sseqy by #2
+%
+\putxy{p+<\the\sseqx,\the\sseqy>}
+\edef\ssoldconncolor{\ssconncolor}
+}
+
+\def\sseqifconninclippingregion{%
+\ifthenelse{\boolean{sseqcurrclip}\and\boolean{sseqprevclip}}{
+  \ssclippedfalse}{
+  \ssclippedtrue
+ }
+ \ifssclipped
+}
+% }{}
+%
+% \DescribeMacro{\ssstroke}
+% There are two ways of typesetting connections between objects. One of them is the suit of commands |\ssstroke|, |\sscurve|, |\ssdashedstroke|, |\ssdashedcurve|, |\ssarrowhead|, which all behave similarly. |\ssstroke| requires that the cursor recently moved from one object to another. It takes no arguments and typesets a straight line between the two objects. Example: Suppose there are two objects, which have been given the names |a| and |b| by |\ssname|. Drawing a line between them is achieved by the command |\ssgoto{a} \ssgoto{b} \ssstroke|.
+%
+% \ifthenelse{0=1}{
+\newcommand{\ssstroke}{
+\ssassertsource
+% ^^A only do it if not both source and target are outside the clipping region
+\sseqifconninclippingregion
+ \putxy{**} \sseqwritecolor{\ssoldconncolor}
+ \putxyq{\dir{-}}
+\fi
+}
+% }{}
+%
+% \DescribeMacro{\sscurve}
+% This command behaves like |\ssstroke|, except that it takes an additional real number argument which denotes a curving factor for the line. $0$ means straight.
+%
+% \ifthenelse{0=1}{
+\newcommand{\sscurve}[1]{
+\ssassertsource
+\sseqifconninclippingregion
+ \putxy{**} \sseqwritecolor{\ssoldconncolor}
+ \putxyq{\crv{:(.5,#1)}}
+\fi
+}
+% }{}
+%
+% \DescribeMacro{\ssdashedstroke}
+% Like |\ssstroke|, but typesets a dashed line.
+%
+% \ifthenelse{0=1}{
+\newcommand{\ssdashedstroke}{
+\ssassertsource
+\sseqifconninclippingregion
+ \putxy{**} \sseqwritecolor{\ssoldconncolor}
+ \putxyq{\dir{--}}
+\fi
+}
+% }{}
+%
+% \DescribeMacro{\ssdashedcurve}
+% Like |\sscurve|, but typesets a dashed curve.
+%
+% \ifthenelse{0=1}{
+\newcommand{\ssdashedcurve}[1]{
+\ssassertsource
+\sseqifconninclippingregion
+ \putxy{**} \sseqwritecolor{\ssoldconncolor}
+ \putxyq{\crv{~**\dir{--}:(.5,#1)}}
+\fi
+}
+% }{}
+%
+% \DescribeMacro{\ssarrowhead}
+% Typesets an arrow head onto the connection most recently typeset.
+%
+% \ifthenelse{0=1}{
+\newcommand{\ssarrowhead}{
+\sseqifconninclippingregion
+ \putxy {?>*} \sseqwritecolor{\ssoldconncolor}
+ \putxyq{\dir{>}}
+\fi
+}
+% }{}
+%
+% \DescribeMacro{\ssline}
+% The second way of producing connections is the suit of commands that follow, starting with |\ssline| \emph{x y}. This command draws a straight line from the most recent object (cf. |\ssname|) to an object at relative position $(x,y)$, and it moves that cursor to that new position. If |\ssline| is followed by a drop command, then the line is attached to this newly dropped object (note the slightly out-of-order execution!), no matter how many other objects there are at the target position. However, if it is not followed by a drop command, then there has to be one and only one object at the target position, otherwise an error message is generated.
+%
+% \iffalse
+\newcommand{\ssline}[2]{
+\ssprepareline{#1}{#2}
+\def\sseqconncommand{\ssstroke}
+}
+% \fi
+%
+% \DescribeMacro{\sscurvedline}
+% Like |\ssline|; the third argument is a real number denoting a curvature factor.
+%
+% \iffalse
+\newcommand{\sscurvedline}[3]{
+\ssprepareline{#1}{#2} \def\sseqconncommand{\sscurve{#3}}
+}
+% \fi
+%
+% \DescribeMacro{\ssdashedline}
+% Like |\ssline|; typesets a curved line
+% 
+% \iffalse
+\newcommand{\ssdashedline}[2]{
+\ssprepareline{#1}{#2} \def\sseqconncommand{\ssdashedstroke}
+}
+% \fi
+%
+% \DescribeMacro{\sscurveddashedline}
+% Like |\sscurvedline|; typesets a dashed curve
+%
+% \iffalse
+\newcommand{\sscurveddashedline}[3]{
+\ssprepareline{#1}{#2} \def\sseqconncommand{\ssdashedcurve{#3}}
+}
+% \fi
+%
+% \DescribeMacro{\ssarrow}
+% Like |\ssline|; but adds an arrowhead at the end
+%
+% \iffalse
+\newcommand{\ssarrow}[2]{
+\ssprepareline{#1}{#2}
+\def\sseqconncommand{\ssstroke\ssarrowhead}
+}
+% \fi
+%
+% \DescribeMacro{\sscurvedarrow}
+% Like |\sscurve|; but adds an arrowhead at the end
+%
+% \iffalse
+\newcommand{\sscurvedarrow}[3]{
+\ssprepareline{#1}{#2} \def\sseqconncommand{\sscurve{#3}\ssarrowhead}
+}
+% \fi
+%
+% \DescribeMacro{\ssdashedarrow}
+% Like |\ssdashedline|; but adds an arrowhead at the end
+%
+% \iffalse
+\newcommand{\ssdashedarrow}[2]{
+\ssprepareline{#1}{#2} \def\sseqconncommand{\ssdashedstroke\ssarrowhead}
+}
+% \fi
+%
+% \DescribeMacro{\sscurveddashedarrow}
+% Like |\sscurveddashedline|; but adds an arrowhead at the end
+%
+% \iffalse
+\newcommand{\sscurveddashedarrow}[3]{
+\ssprepareline{#1}{#2} \def\sseqconncommand{\ssdashedcurve{#3}\ssarrowhead}
+}
+% \fi
+%
+% \DescribeMacro{\ssvoidline}
+% This command behaves like |\ssline| except it disregards the target and just typesets a line to the given position. This is useful if the line is not supposed to have an object as its target. Unlike |\ssline| and its companions, it does \textbf{not} move the cursor.
+
+%
+% \iffalse
+\newcommand{\ssvoidline}[2]{
+\sspreparevoidline{#1}{#2}
+\ssstroke
+\putxy{,p}
+}
+% \fi
+%
+% \DescribeMacro{\ssvoidarrow}
+% Same as |\ssvoidline|, but typesets an arrow.
+%
+% \iffalse
+\newcommand{\ssvoidarrow}[2]{
+\sspreparevoidline{#1}{#2}
+\ssstroke\ssarrowhead
+\putxy{,p}
+}
+% \fi
+%
+% \DescribeMacro{\ssbullstring}
+% |\ssbullstring{x}{y}{n}| is a shortcut for |\ssdropbull| followed by $n$ copies of |\ssline{x}{y} \ssdropbull|.
+% \iffalse
+\newcommand{\ssbullstring}[3]{
+\ifnum#3>0
+ \ifnum#3=1
+  \ssdropbull
+ \else
+  \ssdropbull
+  \ssline{#1}{#2}
+  \count0=#3
+  \advance\count0 by -1
+  \edef\sseqbullcnt{\the\count0}
+  \ssbullstring{#1}{#2}{\sseqbullcnt}
+\fi\fi
+}
+% \fi
+%
+% \DescribeMacro{\ssinfbullstring}
+% |\ssinfbullstring{x}{y}{n}| is a shortcut for |\ssdropbull| followed by $n$ copies of |\ssline{x}{y} \ssdropbull|, followed by |\ssvoidarrow{x}{y}|.
+%
+% \iffalse
+\newcommand{\ssinfbullstring}[3]{
+\ssbullstring{#1}{#2}{#3}
+\ssvoidarrow{#1}{#2}
+}
+% \fi
+%
+% \section{Additional parameters}
+%
+% For typesetting dropped objects, |sseq| uses the color |\ssplacecolor|, for connections, |\ssconncolor|, and for labels, |\sslabelcolor|. These all default to black, but can be |\def|'d at any point to any valid \Xy-pic color. There are pre-defined colors |ssblack|, |sseqgr|, and |ssred|, denoting black, light gray, and red.
+%
+% At any point, clipping can be switched on or off by setting
+%
+% |\setboolean{sseqclip}{true}| or |\setboolean{sseqclip}{false}|
+%
+%
+% \section{Examples}
+%
+% \newtheorem{ex}{Example}
+%
+%\begin{ex}
+%The following code generates a $5 \times 5$ grid with labels between $-2$ and $2$. The size of every square is $(.8cm)^2$, and labels are written on every square. A bullet is drawn at coordinate (0,0).
+%
+%\noindent
+%\begin{minipage}{\textwidth/2}
+%\begin{verbatim}
+%\sseqxstart=-2
+%\sseqystart=-2
+%\sseqentrysize=.8cm
+%\sseqxstep=1
+%\sseqystep=1
+%\begin{sseq}{5}{5}
+%\ssdropbull
+%\end{sseq}
+%\end{verbatim}
+%\end{minipage}
+%\begin{minipage}{\textwidth/2}
+%\sseqxstart=-2
+%\sseqystart=-2
+%\sseqentrysize=.8cm
+%\sseqxstep=1
+%\sseqystep=1
+%\begin{sseq}{5}{5}
+%\ssdropbull
+%\end{sseq}
+%\end{minipage}
+%\end{ex}
+%
+%\sseqxstart=0
+%\sseqystart=0
+%\sseqentrysize=.6cm
+%\sseqxstep=2
+%\sseqystep=2
+%
+%\begin{ex}
+%This example demonstrates how to move the cursor and drop objects and labels. Note how the last bullet, which is dropped at position (8,4), is outside the grid and thus clipped.
+%
+%\noindent
+%\begin{minipage}{\textwidth/2}
+%\begin{verbatim}
+%\begin{sseq}{7}{7}
+%\ssdropbull
+%\ssdroplabel{(0,0)}
+%\ssmove 2 1
+%\ssdrop{\clubsuit}
+%\ssdropextension
+%\ssdropextension
+%\ssdropextension
+%\ssdroplabel[RU]{(2,1)}
+%\ssmove 0 4
+%\ssdropcircled{8}
+%\ssmoveto 5 4
+%\ssdropboxed{\spadesuit}
+%\ssdroplabel[R]{(5,4)}
+%\ssmove 3 0
+%\ssdropbull
+%\end{sseq}
+%\end{verbatim}
+%\end{minipage}
+%\begin{minipage}{\textwidth/2}
+%\begin{sseq}{7}{7}
+%\ssdropbull
+%\ssdroplabel{(0,0)}
+%\ssmove 2 1
+%\ssdrop{\clubsuit}
+%\ssdropextension
+%\ssdropextension
+%\ssdropextension
+%\ssdroplabel[RU]{(2,1)}
+%\ssmove 0 4
+%\ssdropcircled{8}
+%\ssmoveto 5 4
+%\ssdropboxed{\spadesuit}
+%\ssdroplabel[R]{(5,4)}
+%\ssmove 3 0
+%\ssdropbull
+%\end{sseq}
+%\end{minipage}
+%\end{ex}
+% 
+%\sseqentrysize=.4cm
+%\begin{ex}
+%This example illustrates the different ways of drawing connections. Note how the size of the axis labels is adjusted to the grid size.
+%
+%\noindent
+%\begin{minipage}{\textwidth/2}
+%\begin{verbatim}
+%\sseqentrysize=.4cm
+%\begin{sseq}{10}{7}
+%\ssdropbull
+%\ssmove 4 4
+%\ssdropbull \ssstroke
+%\sscurve{-.5}
+%\ssdashedcurve{.1} \ssarrowhead
+%\ssmove 4 0 \ssdropcircled{T}
+%\ssstroke
+%\ssmoveto 0 6
+%\ssdropbull 
+%\ssline {1} {-1}
+%\sscurvedline 7 {-1} {.2}
+%\ssdropbull 
+%\end{sseq}
+%\end{verbatim}
+%\end{minipage}
+%\begin{minipage}{\textwidth/2}
+%\begin{sseq}{10}{7}
+%\ssdropbull
+%\ssmove 4 4
+%\ssdropbull \ssstroke
+%\sscurve{-.5}
+%\ssdashedcurve{.1} \ssarrowhead
+%\ssmove 4 0 \ssdropcircled{T}\ssstroke
+%\ssmoveto 0 6
+%\ssdropbull 
+%\ssline {1} {-1}
+%\ssdropbull
+%\sscurvedline 7 {-1} {.2}
+%\end{sseq}
+%\end{minipage}
+%\end{ex}
+%
+%\begin{ex}
+%This sample code shows how to use names for objects dropped in spectral sequence; this is particularly useful when more than one item is dropped at one position. It also demonstrates void arrows, which do not need a target.
+%
+%\noindent
+%\begin{minipage}{\textwidth*2/3}
+%\begin{verbatim}
+%\begin{sseq}{5}{5}
+%\ssdropbull \ssname{a} \ssvoidarrow 0 1
+%\ssdropbull \ssname{b} \ssvoidarrow 0 1
+%\ssdropbull \ssname{c} \ssvoidarrow 0 1
+%\ssdropextension \ssname{d}
+%\ssmove 4 4
+%\ssdropbull \ssname{e}
+%\ssdropbull \ssname{f}
+%\ssgoto a \ssgoto f \ssstroke
+%\ssgoto e \ssstroke
+%\ssgoto d \sscurve{.2}
+%\ssline 4 0 \ssdropbull
+%\end{sseq}
+%\end{verbatim}
+%\end{minipage}
+%\begin{minipage}{\textwidth/3}
+%\begin{sseq}{5}{5}
+%\ssdropbull \ssname{a}\ssvoidarrow 0 1
+%\ssdropbull \ssname{b}\ssvoidarrow 0 1
+%\ssdropbull \ssname{c}\ssvoidarrow 0 1
+%\ssdropextension \ssname{d}
+%\ssmove 4 4
+%\ssdropbull \ssname{e}
+%\ssdropbull \ssname{f}
+%\ssgoto a \ssgoto f \ssstroke
+%\ssgoto e \ssstroke
+%\ssgoto d \sscurve{.2}
+%\ssline 4 0 \ssdropbull
+%\end{sseq}
+%\end{minipage}
+%\end{ex}
+%
+%\begin{ex}
+% This final example shows how to take advantage of loops and prefices.
+%
+%\noindent
+%\begin{minipage}[t]{\textwidth*1/3}
+%\begin{verbatim}
+%\newcount\cnti
+%\def\drawstring#1#2{
+% \ifnum#2=1
+%  \ssdropbull \ssname{#1}
+% \else
+%  \ssdropbull \ssname{#1}
+%  \ssline 1 0
+%  \ssprefix{i}
+%  \cnti=#2
+%  \advance \cnti by -1
+%  \drawstring{#1}
+%   {\the\cnti}
+% \fi
+%}
+%\end{verbatim}
+%\end{minipage}
+%\begin{minipage}[t]{\textwidth*1/3}
+%\begin{verbatim}
+%\def\drawlines#1#2#3{
+% \ifnum#3>0
+%  \cnti=#3
+%  \ssgoto{#1} \ssgoto{#2}
+%  \ssstroke \ssarrowhead
+%  \ssprefix{i}
+%  \advance \cnti by -1
+%  \drawlines{#1}{#2}
+%   {\the\cnti}
+% \fi
+%}
+%\end{verbatim}
+%\end{minipage}
+%\begin{minipage}[t]{\textwidth*1/3}
+%\begin{verbatim}
+%\begin{sseq}{9}{4}
+%\ssmoveto 0 3
+%\drawstring{a}{8}
+%\ssmoveto 0 3
+%\ssresetprefix
+%\drawstring{b}{8}
+%\ssmoveto 0 0
+%\ssresetprefix
+%\drawstring{c}{8}
+%\ssresetprefix
+%\drawlines{c}{a}{8}
+%\ssresetprefix
+%\drawlines{b}{iic}{6}
+%\end{sseq}
+%\end{verbatim}
+%\end{minipage}
+%
+% The result is shown in the following chart:
+%\newcount\cnti
+%\def\drawstring#1#2{
+% \ifnum#2=1
+%  \ssdropbull \ssname{#1}
+% \else
+%  \ssdropbull \ssname{#1}
+%  \ssline 1 0
+%  \ssprefix{i}
+%  \cnti=#2
+%  \advance \cnti by -1
+%  \drawstring{#1}
+%   {\the\cnti}
+% \fi
+%}
+%\def\drawlines#1#2#3{
+% \ifnum#3>0
+%  \cnti=#3
+%  \ssgoto{#1} \ssgoto{#2}
+%  \ssstroke \ssarrowhead
+%  \ssprefix{i}
+%  \advance \cnti by -1
+%  \drawlines{#1}{#2}
+%   {\the\cnti}
+% \fi
+%}
+%\begin{sseq}{9}{4}
+%\ssmoveto 0 3
+%\drawstring{a}{8}
+%\ssmoveto 0 3
+%\ssresetprefix
+%\drawstring{b}{8}
+%\ssmoveto 0 0
+%\ssresetprefix
+%\drawstring{c}{8}
+%\ssresetprefix
+%\drawlines{c}{a}{8}
+%\ssresetprefix
+%\drawlines{b}{iic}{6}
+%\end{sseq}
+%\end{ex}
+%
+%\section{Final remarks}
+%
+% This package has been extremely helpful for my own mathematical work, and it most likely carries the characteristics of a tool initially developed for my own purposes only. Before this published version, there was an earlier version of |sseq| which was much less powerful; and what is worse, this version is not fully upward compatible with the previous one. (Every object that was dropped was forgotten right afterwards; thus connections could not properly connect objects but were always drawn from the center of the box corresponding to a coordinate to the center of the box corresponding to the target coordinate, resulting in fairly ugly pictures.)
+%
+% Many things remain to be desired:
+%
+% \begin{itemize}
+% \item |sseq| seems to be too voracious in memory
+% \item While object are placed next to each other, no attempt is made not to make connections overlap
+% \item Other things ought to be customizable: The grid style, the axis labels, etc.
+% \item A ``grayout'' option that automatically turns the source and target of any arrow into a different color would be highly useful for spectral sequence charts
+% \end{itemize}
+%
+% Given time and leisure, I might or might not implement one or more of these improvements and make them available; of course, I would be even more happy if somebody else did it. (Needless to say, I would request that I be informed of and sent the enhancements.) I do guarantee that all further versions of |sseq| that might or might not be written by me will be compatible with the documented code written for this version.
+%
+% \endinput
+% ^^A\sseqdrawgrid
+%
+\def\sseqdrawgrid#1#2{
+\sseqi=0
+\sseqj=0
+\loop
+ \sseqy=\sseqentrysize
+ \multiply \sseqy by \sseqj
+ \advance \sseqy by \sseqlabelbarwidth
+ %
+ \putxy{<\the\sseqlabelbarwidth,\the\sseqy>;<\the\sseqx,\the\sseqy>**}
+ \sseqwritecolor{sseqgr}
+ \putxyq{\dir {.},}
+ \advance\sseqj 1
+\ifnum\sseqj>#2 \else \repeat
+%
+\sseqy = \sseqentrysize
+\multiply \sseqy by #2
+\advance \sseqy by \sseqlabelbarwidth
+\loop
+ \sseqx=\sseqentrysize
+ \multiply \sseqx by \sseqi
+ \advance \sseqx by \sseqlabelbarwidth
+ %
+ \putxy{<\the\sseqx,\the\sseqlabelbarwidth>;<\the\sseqx,\the\sseqy>**}
+ \sseqwritecolor{sseqgr}
+ \putxyq{\dir {.},}
+ \advance \sseqi 1
+\ifnum\sseqi>#1 \else \repeat
+}
+%
+% ^^A\sseqdrawlabels
+%
+\def\sseqdrawlabels#1#2{
+\sseqi=\sseqxstart
+\sseqposx=\sseqxstart
+\multiply \sseqposx by -1
+\advance \sseqposx \sseqi
+\count0=\sseqxdir
+\multiply\count0 by \sseqxdir
+\multiply\count0 by \sseqxstep
+\count1=\sseqydir
+\multiply\count1 by \sseqydir
+\multiply\count1 by \sseqystep
+\loop
+ \sseqxx=\sseqentrysize
+ \multiply\sseqxx by \sseqposx
+ \advance\sseqxx by \sseqhalfentry
+ \advance\sseqxx by \sseqlabelbarwidth
+ \putxy { <\the\sseqxx,0pt>*}
+ \putxyq{\txt\sseqlabelfont}
+ \putxy {{\the\sseqi},}
+ \advance\sseqi by \sseqxstep
+ \advance\sseqposx by \count0
+\ifnum\sseqposx<#1 \repeat
+%
+\sseqj=\sseqystart
+\sseqposy=\sseqj
+\multiply\sseqposy by -1
+\advance\sseqposy by \sseqj
+\loop
+ \sseqyy=\sseqentrysize
+ \multiply\sseqyy by \sseqposy
+ \advance\sseqyy by \sseqhalfentry
+ \advance\sseqyy by \sseqlabelbarwidth
+ \putxy { <0pt,\the\sseqyy>*}
+ \putxyq {\txt\sseqlabelfont}
+ \putxy{{\the\sseqj},}
+ \advance\sseqj by \sseqystep
+ \advance\sseqposy by \count1
+\ifnum\sseqposy<#2\repeat
+}
+
+
+%
+%
+\newenvironment{sseq}[2]{
+\begingroup
+%
+% ^^A Initialize some local counters and dimensions
+%
+\countdef\sseqxend=150 \sseqxend=\sseqxstart \advance\sseqxend by #1
+\countdef\sseqyend=151 \sseqyend=\sseqystart \advance\sseqyend by #2
+\dimendef\sseqoffx=200 \sseqoffx=0pt
+\dimendef\sseqoffy=201 \sseqoffy=0pt
+\dimendef\sseqoffsetx=202
+\dimendef\sseqoffsety=203
+\countdef\sseqi=152 \sseqi=0
+\countdef\sseqj=153 \sseqj=0
+\countdef\sseqxdir=154
+\countdef\sseqposx=155
+\countdef\sseqposy=156
+\countdef\sseqydir=157
+\dimendef\sseqlabelbarwidth=204
+\dimendef\sseqhalfentry=205
+\dimendef\sseqx=206
+\dimendef\sseqy=207
+\dimendef\sseqxx=208
+\dimendef\sseqyy=209
+\dimendef\sseqlabelwidth=210 
+\dimendef\sseqrightlabelwidth=211 
+\dimendef\sseqlabelsize=212 
+
+\ifnum\sseqxstep<0 \sseqxdir=-1 \else \sseqxdir=1 \fi
+\ifnum\sseqystep<0 \sseqydir=-1 \else \sseqydir=1 \fi
+\def\sseqlabelfontsize{12}
+%
+% Backup count0 - count9 (these are page numbers!)
+%
+\edef\sseqsavecnto{\the\count0}
+\edef\sseqsavecnti{\the\count1}
+\edef\sseqsavecntii{\the\count2}
+\edef\sseqsavecntiii{\the\count3}
+\edef\sseqsavecntiv{\the\count4}
+\edef\sseqsavecntv{\the\count5}
+\edef\sseqsavecntvi{\the\count6}
+\edef\sseqsavecntvii{\the\count7}
+\edef\sseqsavecntviii{\the\count8}
+\edef\sseqsavecntix{\the\count9}
+%
+% ^^A Compute the maximal axis label width
+%
+\sseqlabelwidth=14pt
+\sseqrightlabelwidth=10pt
+\ifnum\sseqxstart<0
+ \advance\sseqlabelwidth by 8pt
+ \ifnum\sseqxstart<-9
+  \advance\sseqlabelwidth by 6pt
+  \ifnum\sseqxstart<-99
+   \advance\sseqlabelwidth by 6pt
+  \fi
+ \fi
+\fi
+\ifnum\sseqxend>10
+ \advance\sseqrightlabelwidth by 6pt
+ \ifnum\sseqxend>100
+  \advance\sseqrightlabelwidth by 6pt
+ \fi
+\fi
+\ifnum\sseqrightlabelwidth>\sseqlabelwidth
+ \sseqlabelwidth=\sseqrightlabelwidth
+\fi
+\sseqlabelsize=10pt
+\count0=\sseqentrysize
+\multiply \count0 by 160
+\divide \count0 by \sseqlabelwidth
+\multiply \sseqlabelsize by \count0
+\divide \sseqlabelsize by 100
+\ifdim\sseqlabelsize<11pt
+ \def\sseqlabelfontsize{10}
+ \ifdim\sseqlabelsize<9.5pt
+  \def\sseqlabelfontsize{9}
+  \ifdim\sseqlabelsize<8.5pt
+   \def\sseqlabelfontsize{8}
+  \fi
+ \fi
+\fi
+\edef\sz{\the\sseqlabelsize}
+\putxyq {\font \sseqlabelfont = cmtt}
+\putxy{\sseqlabelfontsize\space at \the\sseqlabelsize\space}
+\sseqlabelbarwidth=\sseqlabelsize
+\divide\sseqlabelbarwidth by 2
+\dimen0=\sseqentrysize
+\multiply\dimen0 by -1
+\multiply\dimen0 by \sseqxdir
+\multiply\dimen0 by \sseqxstart
+\sseqoffsetx=\sseqlabelbarwidth
+\advance\sseqoffsetx by \dimen0
+\dimen0=\sseqentrysize
+\multiply\dimen0 by -1
+\multiply\dimen0 by \sseqydir
+\multiply\dimen0 by \sseqystart
+\sseqoffsety=\sseqlabelbarwidth
+\advance\sseqoffsety by \dimen0
+\sseqhalfentry=\sseqentrysize
+\divide\sseqhalfentry by 2
+\sseqx=\sseqentrysize
+\multiply \sseqx by #1
+\advance \sseqx by \sseqlabelbarwidth
+\sseqy=\sseqentrysize
+\multiply \sseqy by \sseqj
+\advance \sseqy by \sseqlabelbarwidth
+\sseqxx=\sseqx
+\sseqyy=\sseqy
+\advance\sseqxx by \sseqhalfentry
+\advance\sseqyy by \sseqhalfentry
+%
+%
+% ^^A start the xy environment
+\putxyq {\xy}
+%
+%
+\sseqdrawgrid{#1}{#2}
+\sseqdrawlabels{#1}{#2}
+%
+%
+\sseqposx=0
+\sseqposy=0
+}
+%
+%
+% ^^A PART FOR \end{sseq}
+%
+{
+\relax
+\ssfinishpos
+\putxyq{\endxy}
+\bigskip
+\edef\lst{\the\sseqcmdlist}
+\ifthenelse{\boolean{debug}}{\show\lst}{}
+%
+% ^^A Restore count0-count9 in case we're in the middle of a page break.
+%
+\count0=\sseqsavecnto
+\count1=\sseqsavecnti
+\count2=\sseqsavecntii
+\count3=\sseqsavecntiii
+\count4=\sseqsavecntiv
+\count5=\sseqsavecntv
+\count6=\sseqsavecntvi
+\count7=\sseqsavecntvii
+\count8=\sseqsavecntviii
+\count9=\sseqsavecntix
+\the\sseqcmdlist
+\endgroup
+\bigskip
+}
+%
+% \Finale
-- 
cgit v1.2.3

