diff options
author | Karl Berry <karl@freefriends.org> | 2017-08-03 21:07:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-08-03 21:07:30 +0000 |
commit | ff587f620cc7c6d0068c33b27a8e554bce2b08fe (patch) | |
tree | 0857cebe6e2e1325bb94305516fbf9b6e27326c0 /Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex | |
parent | 29d69088963132c0a036286f984331c74ac99f1a (diff) |
spectralsequences (3aug17)
git-svn-id: svn://tug.org/texlive/trunk@44942 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex | 617 |
1 files changed, 495 insertions, 122 deletions
diff --git a/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex b/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex index edc87c5d2b0..b7dea7f4149 100644 --- a/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex +++ b/Master/texmf-dist/tex/latex/spectralsequences/sseqmain.code.tex @@ -1,8 +1,8 @@ %% -%% Package: spectralsequences.sty version 1.0 +%% Package: spectralsequences v1.1.0 %% Author: Hood Chatham %% Email: hood@mit.edu -%% Date: 2017-06-18 +%% Date: 2017-08-02 %% License: Latex Project Public License %% %% File: sseqmain.code.tex @@ -16,14 +16,21 @@ %%% Environment definitions %%% %%%%%%% +\def\sseq@usesavedpaths{% + \sseq@savedpaths + \sseq@clearchangestyles + \sseq@tempsavedpaths + \gdef\sseq@tempsavedpaths{}% +} \sseq@addtostorelist\sseq@savedbackgroundpaths{} \sseq@addtostorelist\sseq@restorestyles{} -\def\sseqdata{\@ifnextchar[{\sseqdata@}{\sseqdata@[]}}%} - \def\sseq@page{\protect\sseq@thepage} + +\def\sseqdata{\@ifnextchar[{\sseqdata@}{\sseqdata@[]}}%} + \def\sseqdata@[#1]{% \edef\sseq@restorefont{\font@name} \selectfont\nullfont % Avoid space hazards! @@ -91,14 +98,18 @@ } \sseq@savedpaths@xadd{\sseq@stylelist} \sseq@savedpaths@add{\begingroup} % prevent some of the two-pass user macros horrors + \let\sseq@error@setup\sseq@error@setup@withinfo } % Just store all the settings \def\endsseqdata{ + \let\sseq@error@setup\sseq@error@setup@noinfo + \sseq@checkend{sseqdata} \sseq@savedpaths@add{\endgroup} % prevent some of the two-pass user macros horrors \xdef\sseq@restorestyles{\sseq@stylelist} \sseq@storecmds \ignorespacesafterend + \sseq@breakpoint } \def\sseqpage{\@ifnextchar[{\sseqpage@}{\sseqpage@[]}} %] @@ -118,11 +129,9 @@ \sseq@ispageenvtrue \def\sseq@sseqsetdirectory{/sseqpages} % - \let\sseq@xminmax\sseq@xminmax@active - \let\sseq@yminmax\sseq@yminmax@active - \ifsseq@mathnodes - \let\sseq@maybemathswitch=$\@gobble$ - \fi +% \ifsseq@mathnodes +% \let\sseq@maybemathswitch=$\@gobble$ +% \fi % % Copy commands into user namespace \sseq@installmacros @@ -176,28 +185,88 @@ \@xp\@nx\csname pgfk@/sseqpages/global/{\sseq@currentoptionpath} options/.@cmd\endcsname } \fi +% + \ifsseq@specifiedxrange + \let\sseq@xminmax\@gobbletwo + \else + \let\sseq@xminmax\sseq@xminmax@active + \fi + \ifsseq@specifiedyrange + \let\sseq@yminmax\@gobbletwo + \else + \let\sseq@yminmax\sseq@yminmax@active + \fi +% \sseq@savedpaths@xadd{\sseq@stylelist} \sseq@savedpaths@add{\begingroup} % prevent some of the two-pass user macros horrors \ifx\sseq@targetx\pgfutil@empty\else \sseq@hasdegreetrue \fi + \let\sseq@error@setup\sseq@error@setup@withinfo } % Here we do all of the work to actually print the page \def\endsseqpage{ + \let\sseq@error@setup\sseq@error@setup@noinfo + \sseq@checkend{sseqpage} \sseq@savedpaths@add{\endgroup} % prevent some of the two-pass user macros horrors +% + \sseq@xscalecm=\sseq@xscale cm + \sseq@yscalecm=\sseq@yscale cm +% +% check that range is okay +% \ifx\sseq@xmin\sseq@infinity\sseq@error{no-range}\def\sseq@xmin{0}\def\sseq@xmax{0}\@xp\sseq@break\fi % could be warning \ifx\sseq@ymin\sseq@infinity\sseq@error{no-range}\def\sseq@ymin{0}\def\sseq@ymax{0}\@xp\sseq@break\fi % + \ifnum\numexpr\sseq@xmax-\sseq@xmin\relax>\numexpr\maxdimen/\dimexpr1pt\relax-1\relax + \sseq@error@xx{range-super-overflow}{x} + {from \sseq@xmin\space to \sseq@xmax\space (xmax - xmin = \the\numexpr\sseq@xmax-\sseq@xmin)} + \@xp\sseq@break + \fi + \ifnum\numexpr\sseq@ymax-\sseq@ymin\relax>\numexpr\maxdimen/\dimexpr1pt\relax-1\relax + \sseq@error@xx{range-super-overflow}{y} + {from \sseq@ymin\space to \sseq@ymax\space (ymax - ymin = \the\numexpr\sseq@ymax-\sseq@ymin)} + \@xp\sseq@break + \fi +% + \sseq@tempdimen = \dimexpr \textwidth -\sseq@clip@padding@right - \sseq@xaxis@end@extend - \sseq@xaxis@start@extend - \sseq@yaxisgap \relax + \sseq@tempcount = \numexpr \sseq@tempdimen /\sseq@xscalecm \relax + \ifnum \numexpr\sseq@xmax-\sseq@xmin + 1 > \sseq@tempcount + \pgfmathparse{\sseq@tempdimen/1cm/(\sseq@xmax-\sseq@xmin+1)} + \sseq@error@xxxx{range-overflow}{x} + {from \sseq@xmin\space to \sseq@xmax\space (xmax - xmin = \the\numexpr\sseq@xmax-\sseq@xmin)} + {\the\sseq@tempcount}% max x range + {\pgfmathresult}% max xscale + \@xp\sseq@break + \fi +% + \sseq@tempdimen = \dimexpr \textheight - \sseq@clip@padding@top - \sseq@yaxis@end@extend - \sseq@yaxis@start@extend - \sseq@xaxisgap \relax + \sseq@tempcount = \numexpr \sseq@tempdimen /\sseq@yscalecm \relax + \ifnum \numexpr\sseq@ymax-\sseq@ymin +1 > \sseq@tempcount + \pgfmathparse{\sseq@tempdimen/1cm/(\sseq@ymax-\sseq@ymin+1)} + \sseq@error@xxxx{range-overflow}{y} + {from \sseq@ymin\space to \sseq@ymax\space (ymax - ymin = \the\numexpr\sseq@ymax-\sseq@ymin)} + {\the\sseq@tempcount}% max x range + {\pgfmathresult}% max xscale + \@xp\sseq@break + \fi +% + % Really this could be anything between -\sseq@xmin and -\sseq@xmax and it wouldn't matter. We'll split the difference. + \sseq@xoffset=\numexpr\sseq@intdivceiling{\numexpr-\sseq@xmin-\sseq@xmax\relax}{\numexpr4*\sseq@xgridstep\relax}*(2*\sseq@xgridstep)\relax + \sseq@yoffset=\numexpr\sseq@intdivceiling{\numexpr-\sseq@ymin-\sseq@ymax\relax}{\numexpr4*\sseq@ygridstep\relax}*(2*\sseq@ygridstep)\relax +% +% \tikzset{ z=0pt, every path/.style={}, every node/.style={} } \let\errmessage\sseq@errmessage@std + \sseq@setlayoutparameters \begin{tikzpicture}[/sseqpages/global/{default} options,\ifsseq@hasname/sseqpages/global/{\sseq@thename} options\fi,/sseqpages/global/{this page} options]% \sseq@sseqstyle@globalpart - \pgftransformreset + %\pgftransformreset \sseq@globaldetonetransform \sseq@globalscaletransform % @@ -205,32 +274,49 @@ \let\sseq@shifttransform\sseq@checkshifttransform % Allow shifts as long as they are by integers and have no units. % \sseq@setupclip +% + \sseq@patchtikzcoords +% \pgfonlayer{background}% % Axes labels only occur once per page, so the cost of typesetting them with tikz doesn't matter ... THANK GOD \ifx\sseq@title\pgfutil@empty\else \ifsseq@drawtitle - \sseq@eval{\unexpanded{\path (0.5*\xmin+0.5*\xmax,\ymax) node[ + \sseq@eval{\@nx\path (0,-\sseq@yoffset) node[ /sseqpages/global/every title, - above=\sseq@clip@padding@top+\sseq@yaxis@end@extend+10pt - ]} {\unexpanded\expandafter{\sseq@title}};} + above=\sseq@topclippadding+5pt + ] {\unexpanded\expandafter{\sseq@title}}; + } \fi \fi % Don't touch the shifts -- they are very persnickety. \ifx\sseq@xaxislabel\pgfutil@empty\else\ifsseq@drawxaxislabel - \sseq@eval{\noexpand\node[/sseqpages/global/every x axis label, yshift=-\sseq@xaxisgap-\sseq@yaxis@start@extend-10pt] {\unexpanded\expandafter{\sseq@xaxislabel}};} + \sseq@eval{\noexpand\node[ + align=center, + /sseqpages/global/every x axis label, + below, + shift={\sseq@xlabelposition}, + ] {\unexpanded\expandafter{\sseq@xaxislabel}};} \fi\fi \ifx\sseq@yaxislabel\pgfutil@empty\else\ifsseq@drawyaxislabel - \sseq@eval{\noexpand\node[/sseqpages/global/every y axis label,rotate=90,yshift=\sseq@yaxisgap+\sseq@xaxis@start@extend+10pt] {\unexpanded\expandafter{\sseq@yaxislabel}};} + \sseq@eval{\noexpand\node[ + align=center, + /sseqpages/global/every y axis label, + above, + rotate=90, + shift={\sseq@ylabelposition}, + ] {\unexpanded\expandafter{\sseq@yaxislabel}};} \fi\fi +% + \sseq@grid \sseq@handlexaxis % Draw the axis with pgf primitives. These are defined in sseqdrawing.code.tex \sseq@handleyaxis - \sseq@grid \endpgfonlayer % \ifsseq@mathnodes \tikzset{execute at begin node=$,execute at end node=$}% \fi %\let\sseq@error@setup\sseq@error@setup@withinfo +% \begingroup \sseq@savedbackgroundpaths \endgroup @@ -267,11 +353,18 @@ %%% Scope \newcount\sseq@scope@savestackid +\def\sseq@scope@secondpasstoks{} \def\sseq@scope{\@ifnextchar[{\sseq@scope@}{\sseq@scope@[]}}%] \def\sseq@scope@[#1]{% \sseq@scope@savedpaths@add{\begin{scope}}% + % This is a funky hack to fix a problem with shifts. On tmfass, if we don't handle shifts specially, we actually put so much stuff into + % this \sseq@scope@secondpasstoks macro that we exceed TeX's upper bound for the maximum total macro memory. Or something like that -- I don't understand the error, + % but it definitely only depends on how much stuff there is overall and on there being lots of scopes, not on any particular part of the diagram. + % Anyways, to avoid this excessive storage demand, we don't put the shifts into the scope toks and apply them tons of times, we just do them once. + \let\sseq@options@scopeshiftsecondpass\sseq@scope@savedpaths@add \sseq@processoptions{scope}{#1}% outputs into \sseq@savedoptioncode - \sseq@eval{\@nx\sseq@scope@savedpaths@add{\sseq@scope@toks{\unexpanded\@xp{\sseq@savedoptioncode\tikz@options}}}}% + \edef\sseq@scope@secondpasstoks{\unexpanded\@xp{\sseq@scope@secondpasstoks}\unexpanded\@xp{\sseq@savedoptioncode}} + \sseq@eval{\@nx\sseq@scope@savedpaths@add{\sseq@scope@toks{\unexpanded\@xp{\sseq@scope@secondpasstoks}}}}% %\advance\sseq@scope@savestackid\@ne %\sseq@savestack@name{scope@save\the\sseq@scope@savestackid} } @@ -284,25 +377,13 @@ \ifsseq@draftmode % Okay, have to dummy out all the main commands. - \sseq@setsavedpaths{ignore} % Don't add stuff to paths - \let\sseq@setsavedpaths\@gobble % and dummy out the normal mechanism that would change this - - % We don't really want to add anything to the saved paths, but the whole tikz parser is already loaded in parsers and we want to dummy a bit of it out. - % It's good to have the parser itself though, because it is responsible for sanity checking the structure of the input. Just get rid of the hard tasks - % the parser does once it's parsed the stuff. - \def\sseq@defer@tikzcommand@option[#1]{% - \sseq@g@addto@macro\sseq@whattheusersaid{[#1]}% - \sseq@defer@tikzcommand@ - } % These are the two expensive handlers, redefine them to do nothing. - \def\sseq@defer@tikzcommand@coord(#1){% - \sseq@g@addto@macro\sseq@whattheusersaid{(#1)}% - \sseq@defer@tikzcommand@ - } - - + % Only add tikz background paths to the savedpaths. We need to draw background paths because they might change the bounding box! + \sseq@setsavedpaths@draftmode +% % All we want to do here is record the range. Have to process options in order to figure out where it is. \sseq@DeclareDocumentCommand\class{or()}{% \begingroup + \sseq@loadinputline \IfNoValueT{#2}{\sseq@break}% \sseq@xsetthiscall{\string\class\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}% \sseq@options@firstpassmode @@ -317,13 +398,10 @@ \sseq@yminmax{\xcoord}{\ycoord}% \sseq@pushstack@\coord % also need the class stack to calculate other \class commands. \sseq@cleanup@obj{partcoord.(\partialcoord).numnodes}% - \sseq@cleanup@obj{partcoord.(\partialcoord).numnodespp}% \ifnum\nodenum=\@ne \sseq@obj@gdef{partcoord.(\partialcoord).numnodes}{0}% - \sseq@obj@gdef{partcoord.(\partialcoord).numnodespp}{1}% \fi \sseq@obj@xdef{partcoord.(\partialcoord).numnodes}{\nodenum}% - \sseq@obj@xdef{partcoord.(\partialcoord).numnodespp}{\the\numexpr\nodenum+1}% \edef\classname{class.\coord[0]}% \ifx\sseq@class@tag\pgfutil@empty\else \sseq@obj@ifdef{partcoord.(\partialcoord).tag.\sseq@class@tagprefix\sseq@class@tag}{% @@ -344,12 +422,11 @@ } % Now the rest of these can be no-ops - \sseq@DeclareDocumentCommand\classoptions{or()}{} - \sseq@DeclareDocumentCommand\replaceclass{or()}{} - \sseq@DeclareDocumentCommand\d{oU(r()d()}{} - \sseq@DeclareDocumentCommand\doptions{oU(r()d()}{} - \sseq@DeclareDocumentCommand\structline{or()r()}{} - \sseq@DeclareDocumentCommand\structlineoptions{or()r()}{} + \sseq@DeclareDocumentCommand\classoptions{od()}{} + \sseq@DeclareDocumentCommand\replaceclass{od()}{} + \def\sseq@d@main#1#2#3#4#5{} % makes both \d and \doptions do nothing + \sseq@DeclareDocumentCommand\structline{od()d()}{} + \sseq@DeclareDocumentCommand\structlineoptions{od()d()}{} \sseq@DeclareDocumentCommand\circleclasses{or()r()}{} \endinput \fi @@ -365,6 +442,7 @@ %%% \class, \classoptions, \replaceclass \sseq@DeclareDocumentCommand\class{or()}{% \begingroup + \sseq@loadinputline \IfNoValueT{#2}{\sseq@break} \sseq@xsetthiscall{\string\class\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}% \sseq@options@firstpassmode @@ -384,18 +462,33 @@ \sseq@error@xxxx{classpattern-too-many-classes}{(\partialcoord)}{\nodenum}{\sseq@classpattern}{\@xp\the\csname sseq@\sseq@classpattern @maxclasses\endcsname} \sseq@breakfi \fi - \sseq@processlabels +%%%% No more breaks after this point +% + \ifx\sseq@classinsert\empty + % by default, just insert to the right of previous classes + \edef\sseq@classinsert{\nodenum} + \else + \ifnum\sseq@classinsert<\z@ + % negative 1 is where we would normally insert things + \edef\sseq@classinsert{\the\numexpr\nodenum+\sseq@classinsert+1} + \fi + \ifnum\sseq@classinsert<\@ne + \def\sseq@classinsert{1} + \fi + \ifnum\sseq@classinsert>\nodenum\relax + \edef\sseq@classinsert{\nodenum} + \fi + \ifnum\nodenum>\@ne + \@xp\sseq@class@adjustclasses\@xp{\partialcoord} % Adjust all of the indices of the classes to the right of the one we're inserting + \fi + \fi +% + \sseq@processlabels % This sets up the label nodes, now that we know the position of the class (I think that's what we needed?) % \sseq@xminmax{\xcoord}{\ycoord}% \sseq@yminmax{\xcoord}{\ycoord}% \sseq@cleanup@obj{partcoord.(\partialcoord).numnodes}% - \sseq@cleanup@obj{partcoord.(\partialcoord).numnodespp}% - \ifnum\nodenum=\@ne - \sseq@obj@gdef{partcoord.(\partialcoord).numnodes}{0}% - \sseq@obj@gdef{partcoord.(\partialcoord).numnodespp}{1}% - \fi \sseq@obj@xdef{partcoord.(\partialcoord).numnodes}{\nodenum}% - \sseq@obj@xdef{partcoord.(\partialcoord).numnodespp}{\the\numexpr\nodenum+1}% \edef\classname{class.\coord[0]}% \ifx\sseq@class@tag\pgfutil@empty\else \sseq@obj@ifdef{partcoord.(\partialcoord).tag.\sseq@class@tagprefix\sseq@class@tag}{ @@ -421,14 +514,25 @@ % \sseq@obj@gdef{class.\coord.num}{0}% For \replaceclass \sseq@obj@xdef{\classname.page}{\sseq@infinity}% - \sseq@obj@xodef{\classname.options}{\sseq@savedoptioncode}% - \sseq@obj@xodef{\classname.nodetext}{\sseq@classnodetext}% - \sseq@obj@xodef{\classname.nodetext.options}{\sseq@classnodetextoptions}% - \sseq@obj@xodef{\classname.labelnodes}{\sseq@classlabelnodes}% - \sseq@obj@xdef{class.\coord.x}{\xcoord}% - \sseq@obj@xdef{class.\coord.y}{\ycoord}% - \sseq@obj@gdef{\classname.dependencies}{}% - \sseq@obj@xdef{\classname.needstikz}{\ifsseq@needstikz\@nx\sseq@needstikztrue\fi}% + \sseq@obj@xdef{class.\coord.n}{\sseq@classinsert} + \ifx\sseq@familylist\pgfutil@empty\else + \sseq@obj@xodef{\classname.familylist}{\sseq@familylist} + \fi + \ifx\sseq@savedoptioncode\pgfutil@empty\else + \sseq@obj@xodef{\classname.options}{\sseq@savedoptioncode}% + \fi + \ifx\sseq@classnodetext\pgfutil@empty\else + \sseq@obj@xodef{\classname.nodetext}{\sseq@classnodetext} + \fi + \ifx\sseq@classnodetextoptions\pgfutil@empty\else + \sseq@obj@xodef{\classname.nodetext.options}{\sseq@classnodetextoptions} + \fi + \ifx\sseq@classlabelnodes\pgfutil@empty\else + \sseq@obj@xodef{\classname.labelnodes}{\sseq@classlabelnodes}% + \fi + \ifsseq@needstikz + \sseq@obj@xdef{\classname.needstikz}{\sseq@needstikztrue}% + \fi \@ifundefined{sseq@tempoffset}{}{% \tikz@scan@one@point\sseq@setoffset\sseq@tempoffset }% @@ -437,17 +541,31 @@ \fi % \sseq@savedpaths@addclass{class.\coord}% - \sseq@obj@gdef{class.\coord.style}{}% \sseq@breakpoint \endgroup } \def\sseq@setoffset#1{\sseq@obj@gdef{\classname.offset}{\pgftransformshift{#1}}} -\sseq@DeclareDocumentCommand\classoptions{or()}{% +% This is for use with "insert" key. Add one to offset index of each class later than the one currently being inserted +% Takes the partial coordinate "x,y" in #1, and the position that the new class is being inserted into in \sseq@classinsert. +\def\sseq@class@adjustclasses#1{ + \sseq@tempcount=\z@ + \sseq@tempcountb=\sseq@obj{partcoord.(#1).numnodes} + \loop + \advance\sseq@tempcount\@ne + \ifnum\sseq@obj{class.(#1,\the\sseq@tempcount).n}<\sseq@classinsert\relax\else + \sseq@cleanup@obj{class.(#1,\the\sseq@tempcount).n} + \sseq@eval{\@nx\sseq@obj@inc{class.(#1,\the\sseq@tempcount).n}} % unfortunately, \sseq@obj@inc uses \sseq@tempcount so we need this eval + \fi + \ifnum\sseq@tempcount<\sseq@tempcountb\repeat + +} + +\sseq@DeclareDocumentCommand\classoptions{od()}{% \begingroup - \sseq@xsetthiscall{\classoptions\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}% + \sseq@loadinputline + \sseq@xsetthiscall{\string\classoptions\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}}% \IfNoValueT{#1}{\sseq@error@x{cmdoptions-without-options}{\string\classoptions}\sseq@break}% could be warning - \IfNoValueT{#2}{\sseq@break}% \sseq@options@firstpassmode \the\sseq@sseqstyle \the\sseq@classstyle @@ -456,25 +574,31 @@ \let\sseq@processlabels\sseq@processlabels@default % Don't double dip on labels from the scope or classstyle \sseq@processoptions{class}{#1}% Outputs result into \sseq@savedoptioncode % - \sseq@parsecoord\coord{#2}{\string\classoptions}% + \IfNoValueTF{#2}{ + \def\sseq@coord{\lastclass0} + }{ + \def\sseq@coord{#2} + } + \sseq@parsecoord\coord{\sseq@coord}{\string\classoptions}% % \sseq@processlabels % \let\partialcoord\coord@partial + \edef\sseq@classnum{\sseq@obj@ifdef{class.\coord.num}{\sseq@obj{class.\coord.num}}{0}} \@ifundefined{sseq@class@page}{% \@ifundefined{sseq@gen}{ \@ifundefined{sseq@thepage}{ - \edef\sseq@gen{\sseq@obj{class.\coord.num}} + \let\sseq@gen\sseq@classnum }{ \sseq@obj@pagetogen{class.\coord}{\sseq@thepage} % stores in \sseq@gen } \let\sseq@genmax\sseq@gen }{ \ifnum\sseq@gen<\z@ - \edef\sseq@gen{\the\numexpr\sseq@obj{class.\coord.num}+\sseq@gen+1} + \edef\sseq@gen{\the\numexpr\sseq@classnum+\sseq@gen+1} \fi \@ifundefined{sseq@genmax}{\let\sseq@genmax\sseq@gen}{ - \edef\sseq@genmax{\the\numexpr\sseq@obj{class.\coord.num}+\sseq@genmax+1} + \edef\sseq@genmax{\the\numexpr\sseq@classnum+\sseq@genmax+1} } } }{ @@ -482,7 +606,7 @@ \sseq@class@getgen{\sseq@class@page} \@ifundefined{sseq@class@pagemax}{ % If no max is present, apply options to all pages starting at specified minimum - \edef\sseq@genmax{\sseq@obj{class.\coord.num}}% + \let\sseq@genmax\sseq@classnum% \let\sseq@class@pagemax\sseq@infinity % ensure if "page" is defined, "pagemax" is defined too }{ \let\sseq@genmin\sseq@gen @@ -494,7 +618,7 @@ \edef\sseq@class@pagemax{\the\numexpr\sseq@class@pagemax+\@ne} } \ifnum\sseq@gen=\m@ne - \edef\sseq@gen{\sseq@obj{class.\coord.num}} + \let\sseq@gen\sseq@classnum \fi \edef\classname{class.\coord[\sseq@gen]} \ifsseq@keepchanges\else @@ -552,6 +676,10 @@ \sseq@cleanup@obj{\classname.labelnodes} \sseq@classoptions@obj@addto@withpagerange{\classname.labelnodes}{\sseq@classlabelnodes} \fi + \ifx\sseq@familylist\pgfutil@empty\else + \sseq@cleanup@obj{\classname.familylist} + \sseq@classoptions@obj@addto@withpagerange{\classname.familylist}{\sseq@familylist} + \fi \@ifundefined{sseq@tempoffset}{}{ \sseq@cleanup@obj{\classname.offset} \tikz@scan@one@point\sseq@setoffset\sseq@tempoffset @@ -586,7 +714,7 @@ } \def\sseq@class@getgen#1{ \bgroup - \ifnum\sseq@obj{class.\coord.num}>\z@ + \ifnum\sseq@classnum>\z@ \sseq@eval{\unexpanded{\sseq@obj@pagetogen{class.\coord}}{#1}} % stores in \sseq@gen \else \def\sseq@gen{0} @@ -594,8 +722,9 @@ \sseq@smuggle@macro\sseq@gen \egroup } -\sseq@DeclareDocumentCommand\replaceclass{or()}{% +\sseq@DeclareDocumentCommand\replaceclass{od()}{% \begingroup + \sseq@loadinputline \sseq@xsetthiscall{\string\replaceclass\IfNoValueF{#1}{[\unexpanded{#1}]}\unexpanded{(#2)}} \sseq@options@firstpassmode \the\sseq@sseqstyle @@ -606,10 +735,15 @@ \sseq@processoptions{class}{#1}% Outputs result into \sseq@savedoptioncode }% % - \sseq@parsecoord\coord{#2}{\string\replaceclass} + \IfNoValueTF{#2}{ + \def\sseq@coord{\lastclass0} + }{ + \def\sseq@coord{#2} + } + \sseq@parsecoord\coord{\sseq@coord}{\string\classoptions}% \sseq@processlabels % - \sseq@ifundefcoord\coord{\sseq@error@x{replaceclass-no-class}{\coordname}\sseq@break}{} + \sseq@obj@ifundef{class.\coord.num}{\sseq@error@x{replaceclass-no-class}{\coordname}\sseq@break}{} \sseq@ifdead\coord{}{\sseq@error@x{replaceclass-not-dead-yet}{\coordname}\sseq@break} \ifsseq@keepchanges\else \ifnum\the\numexpr\sseq@obj{class.\coord[\sseq@obj{class.\coord.num}].page}<\sseq@thepagecount\else @@ -647,13 +781,20 @@ \fi \edef\classname{class.\coord[\sseq@obj{class.\coord.num}]} % + \sseq@obj@xodef{\classname.familylist}{\sseq@familylist} \sseq@obj@xdef{\classname.page}{\sseq@infinity} \sseq@obj@xodef{\classname.options}{\sseq@savedoptioncode} - \sseq@obj@xodef{\classname.nodetext}{\sseq@classnodetext} - \sseq@obj@xodef{\classname.nodetext.options}{\sseq@classnodetextoptions} + \ifx\sseq@classnodetext\pgfutil@empty\else + \sseq@obj@xodef{\classname.nodetext}{\sseq@classnodetext} + \fi + \ifx\sseq@classnodetextoptions\pgfutil@empty\else + \sseq@obj@xodef{\classname.nodetext.options}{\sseq@classnodetextoptions} + \fi \sseq@obj@xodef{\classname.labelnodes}{\sseq@classlabelnodes} \sseq@obj@gdef{\classname.dependencies}{} - \sseq@obj@xdef{\classname.needstikz}{\ifsseq@needstikz\@nx\sseq@needstikztrue\fi} + \ifsseq@needstikz + \sseq@obj@xdef{\classname.needstikz}{\sseq@needstikztrue} + \fi \@ifundefined{sseq@tempoffset}{}{\tikz@scan@one@point\sseq@setoffset\sseq@tempoffset} % \sseq@breakpoint @@ -666,8 +807,12 @@ \ifnum\sseq@obj{#1[\sseq@gen].page}=\sseq@thepagecount \sseq@thispagetrue \fi - \sseq@gsetthiscall{class #1} - \sseq@class@drawnode{#1[\sseq@gen]} + \sseq@drawtrue + \sseq@obj{#1[\sseq@gen].familylist} + \ifsseq@draw + \sseq@gsetthiscall{class #1} + \sseq@class@drawnode{#1[\sseq@gen]} + \fi \fi \egroup } @@ -690,25 +835,76 @@ \egroup } %%% -%%% \d and \doptions +%%% \kill, \d and \doptions %%% -\sseq@DeclareDocumentCommand\d{oU(r()d()}{% - \sseq@d@{d}{#1}{#2}{#3}{#4}% -} -\sseq@DeclareDocumentCommand\doptions{oU(r()d()}{% +% Because \kill doesn't take options, there's no need to use \sseq@DeclareDocumentCommand for the outer command. +% Rather than use \sseq@DeclareDocumentCommand with no arguments, we just do the normal stuff that \sseq@DeclareDocumentCommand would do, +% Then call \sseq@d@grabpage, the command that is responsible for handling the strange syntax of the page argument for \d. +\protected\def\sseq@kill{% \begingroup - \IfNoValueT{#1}{ - \sseq@xsetthiscall{\@xp\string\csname#1\endcsname\unexpanded{#2(#3)}\IfNoValueF{#4}{\unexpanded{(#4)}}}% - \sseq@error@x{cmdoptions-without-options}{\string\doptions}\sseq@break % could be warning - } - \sseq@d@{doptions}{#1}{#2}{#3}{#4}% + \sseq@setinputline % These two lines normally would happen inside of \sseq@DeclareDocumentCommand. + \sseq@loadinputline + \sseq@d@grabpage\sseq@kill@ +} + +% Now we need to parse a potential coordinate. +\sseq@DeclareDocumentCommandAs\sseq@kill@\kill {d()} { + \sseq@xsetthiscall{\string\kill\unexpanded\@xp{\sseq@dpage}\IfNoValueF{#1}{(#1)}}% + \sseq@parsecoord\coordinate{\IfNoValueTF{#1}{\lastclass}{#1}}{}% + \sseq@ifintexpr{\sseq@dpage}{% + \sseq@tempcount=\numexpr\sseq@dpage\relax % this is a convenient way to get rid of spaces because #3 has to be a number + }{% + \sseq@error@x{d-invalid-page}{\unexpanded\@xp{\sseq@dpage}}\sseq@break% + }% + \sseq@d@setpageminrec{class.\coordinate}{\the\sseq@tempcount}{coordinate}% automatically handles \sseq@cleanup@obj \sseq@breakpoint \endgroup } -\def\sseq@d@#1#2#3#4#5{% + +% \sseq@d@grabpage is defined in sseqparsers. +\sseq@DeclareDocumentCommand\d{o}{% + \begingroup + \sseq@loadinputline + \def\sseq@dtype{d} + \def\sseq@d@theoptions{#1} + \sseq@d@grabpage\sseq@d@ +} + +\sseq@DeclareDocumentCommand\doptions{o}{% \begingroup + \sseq@loadinputline + \def\sseq@dtype{doptions} + \def\sseq@d@theoptions{#1} + \sseq@d@grabpage\sseq@d@ +} + +\def\sseq@d@{ + \ifsseq@tempif + \csname sseq@\sseq@dtype @grabcoord\@xp\endcsname + \else + \sseq@eval{\@nx\sseq@d@main{\sseq@dtype}{\unexpanded\@xp{\sseq@d@theoptions}}{\sseq@dpage}{\sseq@NoValue}{\sseq@NoValue}} + \sseq@breakpoint + \endgroup + \fi +} + +\sseq@DeclareDocumentCommandAs\sseq@d@grabcoord\d{d()d()}{ + \sseq@eval{\@nx\sseq@d@main{\sseq@dtype}{\unexpanded\@xp{\sseq@d@theoptions}}{\sseq@dpage}}{#1}{#2} + \sseq@breakpoint + \endgroup +} + +\sseq@DeclareDocumentCommandAs\sseq@doptions@grabcoord\doptions{d()d()}{ + \sseq@eval{\@nx\sseq@d@main{\sseq@dtype}{\unexpanded\@xp{\sseq@d@theoptions}}{\sseq@dpage}}{#1}{#2} + \sseq@breakpoint + \endgroup +} + + +\def\sseq@d@main#1#2#3#4#5{% \sseq@options@firstpassmode + \def\sseq@edgetype{differential} \the\sseq@sseqstyle \the\sseq@edgestyle \the\sseq@differentialstyle @@ -717,16 +913,15 @@ \IfNoValueF{#2}{ \sseq@processoptions{differential}{#2}% Outputs result into \sseq@savedoptioncode } - \sseq@xsetthiscall{\@xp\string\csname#1\endcsname\IfNoValueF{#2}{\unexpanded{[#2]}}\unexpanded{#3(#4)}\IfNoValueF{#5}{\unexpanded{(#5)}}}% + \sseq@xsetthiscall{\@xp\string\csname#1\endcsname\IfNoValueF{#2}{\unexpanded{[#2]}}\unexpanded{#3}\IfNoValueF{#4}{\unexpanded{(#4)}}\IfNoValueF{#5}{\unexpanded{(#5)}}}% \sseq@ifintexpr{#3}{% \sseq@tempcount=\numexpr#3\relax % this is a convenient way to get rid of spaces because #3 has to be a number }{% \sseq@error@n{d-invalid-page}{#3}\sseq@break% }% - \@xp\sseq@dparsecoord\@xp{\the\sseq@tempcount}{#4}{#5}% + \sseq@eval{\@nx\sseq@dparsecoord{\the\sseq@tempcount}{\IfNoValueTF{#4}{\lastclass0}{\unexpanded{#4}}}{\unexpanded{#5}}} \sseq@eval{\unexpanded{\csname sseq@d@#1\endcsname{#2}}{\the\sseq@tempcount}}% \sseq@breakpoint - \endgroup } % #1 -- options @@ -736,9 +931,9 @@ \sseq@d@setpageminrec{class.\source}{#2}{source}% automatically handles \sseq@cleanup@obj \sseq@d@setpageminrec{class.\target}{#2}{target} % - \ifsseq@drawdifferential + \ifsseq@drawdifferential % TODO: probably should get rid of invisible now that we have \kill... + \sseq@obj@xodef{d.#2\source\target.familylist}{\sseq@familylist} \sseq@obj@gdef{d.#2\source\target.page}{#2} - \sseq@obj@gdef{d.#2\source\target.style}{}% \sseq@obj@xdef{d.#2\source\target.source}{\source} \sseq@obj@xdef{d.#2\source\target.target}{\target} \sseq@obj@xdef{d.#2\source\target.options}{\ifsseq@needstikz\@nx\sseq@needstikztrue\fi\unexpanded\@xp{\sseq@savedoptioncode}} @@ -759,6 +954,8 @@ }% \fi % + \sseq@cleanup@obj{d.#2\source\target.familylist} + \sseq@obj@xoaddto{d.#2\source\target.familylist}{\sseq@familylist} \sseq@cleanup@obj{d.#2\source\target.options} \sseq@obj@xoaddto{d.#2\source\target.options}{\sseq@savedoptioncode} } @@ -823,9 +1020,9 @@ \let\sseq@possibleperiod\empty \let\sseq@possibleperiodb\empty \sseq@obj@xdef{\sseq@classgenname.deathlocation}{% - on input line \the\inputlineno\sseq@error@inforeachloop + on input line \sseq@inputline\sseq@error@inforeachloop } - \sseq@obj@xdef{\sseq@classgenname.deathline}{\the\inputlineno} + \sseq@obj@xdef{\sseq@classgenname.deathline}{\sseq@inputline} \sseq@tempiffalse \edef\sseq@temp{\the\sseq@foreachcall} \ifx\sseq@temp\pgfutil@empty\else\sseq@tempiftrue\fi @@ -843,7 +1040,7 @@ \def\sseq@preparestacktrace{ \def\foreach{\@nx\foreach} \edef\sseq@temp@i{\unexpanded\@xpthree{\sseq@obj{\sseq@deadclass@genname.deathline}}} - \edef\sseq@temp@ii{\the\inputlineno} + \edef\sseq@temp@ii{\sseq@inputline} \ifx\sseq@temp@i\sseq@temp@ii \sseq@temptoks\@xpthree{\sseq@obj{\sseq@deadclass@genname.deathinfo} (in the same \foreach loop)} \else @@ -860,11 +1057,17 @@ \fi } \def\sseq@differential@draw@ifpage#1{ - \ifnum\sseq@thepagecount=\z@ - \sseq@drawdifferential{#1} - \else - \ifnum\sseq@obj{#1.page}=\sseq@thepagecount\relax + \sseq@drawtrue + \sseq@obj{#1.familylist} + \ifsseq@draw + \ifnum\sseq@thepagecount=\z@ \sseq@drawdifferential{#1} + \else + \ifnum\sseq@obj{#1.page}>\sseq@thepagemm\relax + \ifnum\sseq@obj{#1.page}<\sseq@thepagemaxpp\relax + \sseq@drawdifferential{#1} + \fi + \fi \fi \fi } @@ -880,19 +1083,39 @@ %%% %%% \structline and \structlineoptions %%% -\sseq@DeclareDocumentCommand\structline{or()r()}{% + +\sseq@DeclareDocumentCommand\structline{od()}{% \begingroup - \sseq@xsetthiscall{\string\structline\IfNoValueF{#1}{\unexpanded{[#1]}}\unexpanded{(#2)(#3)}}% - \sseq@structline@main{structline}{#1}{#2}{#3}% + \sseq@loadinputline + \IfNoValueTF{#2}{ + \sseq@structline@main{structline}{#1}{#2}{#2} + }{ + \def\next{\sseq@structline@@{structline}{#1}{#2}}% + \@xptwo\next\sseq@trimleadingspaces + } } -\sseq@DeclareDocumentCommand\structlineoptions{or()r()}{% +\sseq@DeclareDocumentCommand\structlineoptions{od()}{% \begingroup - \sseq@xsetthiscall{\string\structlineoptions\IfNoValueF{#1}{\unexpanded{[#1]}}\unexpanded{(#2)(#3)}}% - \IfNoValueT{#1}{\sseq@error@x{cmdoptions-without-options}{\string\structlineoptions}\sseq@break@withcleanup} - \sseq@structline@main{structlineoptions}{#1}{#2}{#3}% - \sseq@breakpoint\@gobble\endgroup + \sseq@loadinputline + \IfNoValueTF{#2}{ + \sseq@structline@main{structlineoptions}{#1}{#2}{#2} + }{ + \def\next{\sseq@structlineoptions@@{structlineoptions}{#1}{#2}}% + \@xptwo\next\sseq@trimleadingspaces + } +} + +\sseq@DeclareDocumentCommandAs\sseq@structline@@\structline{mmmd()}{% + \sseq@structline@main{#1}{#2}{#3}{#4} } -\def\sseq@structline@main#1#2#3#4{% + +\sseq@DeclareDocumentCommandAs\sseq@structlineoptions@@\structlineoptions{mmmd()}{% + \sseq@structline@main{#1}{#2}{#3}{#4} +} + +\def\sseq@structline@main#1#2#3#4{ + \sseq@xsetthiscall{\string\structline\IfNoValueF{#2}{\unexpanded{[#2]}}\IfNoValueF{#3}{\unexpanded{(#3)}\IfNoValueF{#4}{\unexpanded{(#4)}}}}% + \def\sseq@edgetype{structline} \sseq@options@firstpassmode \the\sseq@sseqstyle \the\sseq@edgestyle @@ -902,8 +1125,38 @@ \IfNoValueF{#2}{% \sseq@processoptions{struct line}{#2}% Outputs result into \sseq@savedoptioncode }% - \sseq@parsecoord\source{#3}{source of structure line}% - \sseq@parsecoord\target{#4}{target of structure line}% + \def\sourcename{#3}% + \def\targetname{#4}% + \IfNoValueTF{#3}{% + \def\sourcename{\lastclass1}% + \def\targetname{\lastclass}% + }{% + \IfNoValueT{#4}{% + \def\targetname{\lastclass}% + }% + }% + \sseq@parsecoord\source{\sourcename}{source of structure line}% + \sseq@parsecoord\target{\targetname}{target of structure line}% + \ifnum\xsource>\xtarget\relax + \sseq@parsedcoords@swap\source\target + \else + \ifnum\xsource=\xtarget\relax + \ifnum\ysource>\ytarget\relax + \sseq@parsedcoords@swap\source\target + \else + \ifnum\ysource=\ytarget\relax + \ifnum\nsource>\ntarget\relax + \sseq@parsedcoords@swap\source\target + \else + \ifnum\nsource=\ntarget\relax + \sseq@error{structline-source-target-equal}% + \@xp\sseq@break\romannumeral-`0 + \fi + \fi + \fi + \fi + \fi + \fi \@ifundefined{sseq@structline@page}{%this is repeated in circleclasses \def\sseq@pagemin{0} \ifnum\sseq@obj{class.\source.num}>\z@ @@ -938,17 +1191,22 @@ \sseq@cleanup@obj{structline.\source\target.num} \sseq@obj@inc{structline.\source\target.num} }{ + \sseq@cleanup@obj{structline.\source\target.num} \sseq@obj@gdef{structline.\source\target.num}{0} \sseq@savedpaths@addstructline{structline.\source\target} } \edef\sseq@structlinename{structline.\source\target[\sseq@obj{structline.\source\target.num}]} + % The following cleanup call is needed to prevent a glitch where if a \structline is made inside of a temporary sseqpage environment, then later attempts + % to put a structline throw a "structline already exists" error + \sseq@cleanup@obj{\sseq@structlinename.page} \sseq@obj@xdef{\sseq@structlinename.page}{\sseq@infinity} \sseq@obj@xdef{\sseq@structlinename.pagemin}{\sseq@pagemin} \sseq@obj@xdef{\sseq@structlinename.source}{\source} \sseq@obj@xdef{\sseq@structlinename.target}{\target} - \sseq@cleanup@obj{structline.\source\target.num} \sseq@class@adddependence{class.\source}{\sseq@structlinename}% If the source or target is already dead, this will set structlinename.page \sseq@class@adddependence{class.\target}{\sseq@structlinename} + \sseq@obj@xodef{\sseq@structlinename.familylist}{\sseq@familylist} + \sseq@cleanup@obj{\sseq@structlinename.options} \sseq@obj@xdef{\sseq@structlinename.options}{\ifsseq@needstikz\@nx\sseq@needstikztrue\fi\unexpanded\@xp{\sseq@savedoptioncode}} } \def\sseq@structline@structlineoptions{ @@ -980,20 +1238,24 @@ \advance\sseq@tempcount\@ne \edef\sseq@structlinename{structline.\source\target[\the\sseq@tempcount]} \sseq@cleanup@obj{\sseq@structlinename.options} + \sseq@cleanup@obj{\sseq@structlinename.familylist} \ifsseq@needstikz \sseq@obj@gaddto{\sseq@structlinename.options}{\sseq@needstikztrue} \fi \ifnum\sseq@tempcount=\sseq@gen\relax \@ifundefined{sseq@structline@page}{}{ \edef\sseq@savedoptioncode{\@nx\ifnum\sseq@thepagecount>\sseq@structline@page\relax\unexpanded\@xp{\sseq@savedoptioncode}\@nx\fi} + \edef\sseq@familylist{\@nx\ifnum\sseq@thepagecount>\sseq@structline@page\relax\unexpanded\@xp{\sseq@familylist}\@nx\fi} } \fi \ifnum\sseq@tempcount=\sseq@genmax\relax \@ifundefined{sseq@structline@pagemax}{}{ \edef\sseq@savedoptioncode{\@nx\ifnum\sseq@thepagecount<\sseq@structline@pagemax\relax\unexpanded\@xp{\sseq@savedoptioncode}\@nx\fi} + \edef\sseq@familylist{\@nx\ifnum\sseq@thepagecount<\sseq@structline@pagemax\relax\unexpanded\@xp{\sseq@familylist}\@nx\fi} } \fi \sseq@obj@xoaddto{\sseq@structlinename.options}{\sseq@savedoptioncode} + \sseq@obj@xoaddto{\sseq@structlinename.familylist}{\sseq@familylist} \ifnum\sseq@tempcount<\sseq@genmax\repeat } \def\sseq@structline@getgen#1{ @@ -1032,7 +1294,11 @@ \bgroup \ifnum\sseq@thepagecount=\z@ \ifnum\sseq@obj{#1[0].pagemin}=\z@ - \sseq@structline@draw{#1[0]} + \sseq@drawtrue + \sseq@obj{#1[0].familylist} + \ifsseq@draw + \sseq@structline@draw{#1[0]} + \fi \fi \else \sseq@obj@pagetogen{#1}{\sseq@thepage} % sets \sseq@gen @@ -1041,7 +1307,11 @@ \sseq@thispagetrue \fi \ifnum\sseq@obj{#1[\sseq@gen].pagemin}<\sseq@thepagecount - \sseq@structline@draw{#1[\sseq@gen]} + \sseq@drawtrue + \sseq@obj{#1[\sseq@gen].familylist} + \ifsseq@draw + \sseq@structline@draw{#1[\sseq@gen]} + \fi \fi \fi \fi @@ -1052,11 +1322,10 @@ - - \newcount\sseq@circleclassuid \sseq@DeclareDocumentCommand\circleclasses{or()r()}{ \begingroup + \sseq@loadinputline \def\sseq@keysfortikzprim{} \IfNoValueF{#1}{ \sseq@processoptions{fit}{#1} @@ -1089,6 +1358,7 @@ % % \sseq@obj@xodef{\circleclassobjname.options}{\sseq@savedoptioncode} + \sseq@obj@xodef{\circleclassobjname.familylist}{\sseq@familylist} \sseq@obj@xodef{\circleclassobjname.tikzprimoptions}{\sseq@keysfortikzprim} \sseq@obj@xdef{\circleclassobjname.fitnodes}{\@nx\tikz@lib@fit{(sseq{\coordanopar})(sseq{\coordbnopar})\sseq@fitalso}} %\edef\temp{\@nx\sseq@circleclass@draw{\coorda@internalname}{\coordb@internalname}{\unexpanded\@xp{\sseq@savedoptioncode}}} @@ -1112,12 +1382,115 @@ \fi \def\sseq@circleclass@draw@ifpage#1#2#3{ - \ifnum\sseq@thepagecount<\numexpr\sseq@obj{#1.page}+\@ne - \ifnum\sseq@obj{#1.page}=\sseq@thepagecount - \sseq@thispagetrue - \fi - \ifnum\sseq@obj{#1.pagemin}<\sseq@thepagecount - \sseq@circleclass@draw{#1}{#2}{#3} + \sseq@drawtrue + \sseq@obj{#1.familylist} + \ifsseq@draw + \ifnum\sseq@thepagecount<\numexpr\sseq@obj{#1.page}+\@ne + \ifnum\sseq@obj{#1.page}=\sseq@thepagecount + \sseq@thispagetrue + \fi + \ifnum\sseq@obj{#1.pagemin}<\sseq@thepagecount + \sseq@circleclass@draw{#1}{#2}{#3} + \fi \fi \fi -}
\ No newline at end of file +} + +%% +%% Labels +%% +%% This code is called from the key value handler, but it has more to do with the code in this file so I am putting it here. Search in sseqkeys.code.tex for "Labels" +%% + +\def\sseq@processlabels@default{% + \global\let\sseq@classnodetext\pgfutil@empty + \global\let\sseq@classnodetextoptions\pgfutil@empty + \global\let\sseq@classlabelnodes\pgfutil@empty +} +\let\sseq@processlabels\sseq@processlabels@default + +% I can't remember why we need to defer this. If at some point I figure this out, I should explain why here and in the definition of \class... +\def\sseq@handleclassquotes@inner#1#2{% + \begingroup\pgfscope + \def\sseq@classquotes@smugglehook{} + \def\sseq@classquotes@smugglehook@inner{} + \sseq@options@firstpassmode + \sseq@thesseqstyle + \sseq@thelabelstyle + \sseq@theclasslabelstyle + \the\sseq@scope@toks + \sseq@options@normalmode + \sseq@processoptions{class/label}{#2}% + \sseq@classlabeltextfn{#1}% labeltextfn is a private handler, classlabeltextfn is exposed via "class label handler" + \ifsseq@classlabel + \sseq@options@firstpassmode + \the\sseq@outerclasslabelstyle + \sseq@x@addto@macro\sseq@classlabelnodes{% + \@nx\sseq@drawlabel{% + \sseq@maybemathswitch\unexpanded\@xp{\processedlabel}\sseq@maybemathswitch}% + {% This is setup to prevent a bug where \classoptions and class label style don't work correctly together + \the\sseq@sseqstyle\@nx\the\sseq@sseqstyle@page + \the\sseq@labelstyle\@nx\the\sseq@labelstyle@page + \the\sseq@classlabelstyle\@nx\the\sseq@classlabelstyle@page + \sseq@theouterclasslabelstyle + \@nx\sseq@collections@labels@hook + \@nx\sseq@collections@classlabels@hook + \@nx\sseq@collections@outerclasslabels@hook + \unexpanded\@xp{\sseq@savedoptioncode}% + }% + }% + \else + \let\sseq@classquotes@smugglehook\sseq@classquotes@smugglehook@inner + \sseq@options@firstpassmode + \the\sseq@innerclasslabelstyle + \sseq@options@normalmode + \sseq@protectedeval{\@nx\pgfqkeys{/sseqpages/class/label}{#2}}% + \sseq@protected@xdef\sseq@classnodetext{\sseq@maybemathswitch\processedlabel\sseq@maybemathswitch}% + \xdef\sseq@classnodetextoptions{% + %\unexpanded{\def\pgfkeysdefaultpath{/sseqpages/class/node texts/}}% + \sseq@thelabelstyle\sseq@theclasslabelstyle\sseq@theinnerclasslabelstyle + \@nx\sseq@collections@labels@hook + \@nx\sseq@collections@classlabels@hook + \@nx\sseq@collections@innerclasslabels@hook + \unexpanded\@xp{\sseq@savedoptioncode}% + }% + \fi + \@xp\endpgfscope\@xp\endgroup + \sseq@classquotes@smugglehook +} + +\def\sseq@handleedgequotes#1#2{% We use this via \let\tikz@quotes@as\sseq@handleedgequotes + /utils/exec={% so it's called inside \pgfkeysalso{stuff}. Need to surround with /utils/exec={} to get out. + \let\sseq@savedoptioncode@save\sseq@savedoptioncode + \sseq@processoptions{label}{#2} + \sseq@needstikztrue + \let\sseq@temp\sseq@savedoptioncode + \let\sseq@savedoptioncode\sseq@savedoptioncode@save + \sseq@e@addto@options{ + \@nx\tikzset{ + every to/.append style={ + edge node={ + node [/sseqpages/label, + /utils/exec={ + \let\@nx\sseq@tikz@transform@save\@nx\tikz@transform + \let\@nx\tikz@transform\relax + \@nx\sseq@thelabelstyle + \@nx\sseq@collections@labels@hook + \@nx\sseq@theedgelabelstyle + \@nx\sseq@collections@edgelabels@hook + \@xp\@nx\csname sseq@the\sseq@edgetype labelstyle\endcsname + \@xp\@nx\csname sseq@collections@\sseq@edgetype labels@hook\endcsname + \unexpanded\@xp{\sseq@temp} + \ifsseq@rotatelabels\iftikz@fullytransformed\else\@nx\tikz@fullytransformedtrue\@nx\tikz@addtransform{\@nx\pgftransformresetnontranslations\@nx\sseq@globalrotatetransform}\fi\fi + \unexpanded\@xp{\sseq@edgeoptionhook} % this is just to make description work + \let\@nx\tikz@transform\@nx\sseq@tikz@transform@save + } + ]{\sseq@labeltextfn{#1}} + } + } + } + } + } +} + + |