summaryrefslogtreecommitdiff
path: root/tex/context/base/core-sec.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/core-sec.tex')
-rw-r--r--tex/context/base/core-sec.tex871
1 files changed, 537 insertions, 334 deletions
diff --git a/tex/context/base/core-sec.tex b/tex/context/base/core-sec.tex
index c2c43d8d6..d12c2ab02 100644
--- a/tex/context/base/core-sec.tex
+++ b/tex/context/base/core-sec.tex
@@ -11,6 +11,9 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+% this module needs a clean up, currently some manipulations
+% take place multiple times
+
\writestatus{loading}{Context Core Macros / Sectioning}
\startmessages dutch library: structures
@@ -57,54 +60,93 @@
\unprotect
-\def\dodochecknummer#1#2#3%
+% from now on, internaly numbers are separated by a period
+% and postprocessed on demand
+
+\def\numberseparator{.} % reasonable default
+
+\def\gobbleuntilrelax#1\relax{}
+
+\def\separatednumber #1{\doseparatednumber #1.\empty\relax}
+\def\removefirstprefix#1{\doremovefirstprefix#1.\empty\relax}
+\def\removeallprefixes#1{\doremoveallprefixes#1.\empty\relax}
+
+\def\doseparatednumber#1.#2%
+ {#1%
+ \ifx#2\empty
+ \@EA\gobbleuntilrelax
+ \else \numberseparator
+ \@EA\doseparatednumber
+ \fi#2}
+
+\def\doremoveallprefixes#1.#2%
+ {\ifx#2\empty
+ #1\@EA\gobbleuntilrelax
+ \else
+ \@EA\doremoveallprefixes
+ \fi#2}
+
+\def\doremovefirstprefix#1.#2%
+ {\ifx#2\empty
+ #1\@EA\gobbleuntilrelax
+ \else
+ \@EA\noremovefirstprefix
+ \fi#2}
+
+\def\noremovefirstprefix#1.\empty\relax
+ {#1}
+
+% we need to expand in order to get something separatable
+
+\def\dohandleheadnumber#1%
+ {\expanded{\separatednumber{#1}}}
+
+\def\dodochecknummer#1#2#3% will become ugly after speed up
{\bgroup
- \doifinstringelse{.0}{.#2} % waarom \instring en \@koscheider
- {\doifnot{#3}{\v!per}
+ \doifinstringelse{.0}{.#2}
+ {\doifnot{#3}\v!per
{%\debuggerinfo{\m!systems}{number #1 #3 becomes \getnumbervariable{#1\c!wijze}}%
- \setevalue{\s!number#1\c!wijze}{#3}% geen \xdef, gaat mis met \subpage
+ \setevalue{\@@thenumber{#1}\c!wijze}{#3}% geen \xdef, gaat mis met \subpage
\dochecknummer{#1}}} % tricky and ugly
- {\doifnotvalue{\s!number#1\s!check}{#2}
- {\setcounter{\s!number#1}{0\getvalue{\s!number#1\c!start}}%
- \setxvalue{\s!number#1\c!wijze\c!lokaal}%
- {\getvalue{\s!number#1\c!wijze}}%
- \setxvalue{\s!number#1\s!check}%
+ {\doifnotvalue{\@@thenumber{#1}\s!check}{#2}
+ {\setcounter{\@@thenumber{#1}}{0\getvalue{\@@thenumber{#1}\c!start}}%
+ \setxvalue{\@@thenumber{#1}\c!wijze\c!lokaal}%
+ {\getvalue{\@@thenumber{#1}\c!wijze}}%
+ \setxvalue{\@@thenumber{#1}\s!check}%
{#2}}}%
\egroup}
\def\dochecknummer#1%
- {\edef\currentsection{\getvalue{\??by\getvalue{\s!number#1\c!wijze}}}%
- \doifsomething{\currentsection}
- {\dodochecknummer
- {#1}
- {\getvalue{\currentsection\c!nummer}}
- {\v!per\previoussection{\currentsection}}}}
+ {\edef\currentsection{\csname\??by\csname\@@thenumber{#1}\c!wijze\endcsname\endcsname}%
+ \ifx\currentsection\empty\else
+ \dodochecknummer
+ {#1}%
+ {\csname\currentsection\c!nummer\endcsname}%
+ {\v!per\previoussection\currentsection}%
+ \fi}
\def\checknummer#1%
{\bgroup
- \ifnum\blocklevel>0
- \doifelsevalue{\s!number#1\c!blokwijze}{\v!nee}
- {\dochecknummer{#1}}
- {\setblockcounters % dit kan sneller omdat de waarden
- \dochecknummer{#1}}% % en het type bekend zijn
- \else
- \dochecknummer{#1}%
+ %\ifcase\blocklevel\else
+ \ifdoingblocks
+ \doifnotvalue{\@@thenumber{#1}\c!blokwijze}\v!nee\setblockcounters
\fi
+ \dochecknummer{#1}%
\egroup}
-\def\domaakvoorafgaandenummer[#1]%
+\def\domaakvoorafgaandenummer[#1]% will become ugly after speed up
{\bgroup % added
\global\let\voorafgaandenummer\empty
\ifsectienummer
- \doifvalue{\??sb\@@sectieblok\c!nummer}{\v!ja} % added
- {\doifelsevalue{\s!number#1\c!sectienummer}{\v!ja}
- {\donetrue}{\donefalse}%
- \doifvalue{\s!number#1\c!sectienummer}{\v!nummer}
+ \doifvalue{\??sb\@@sectieblok\c!nummer}\v!ja % added
+ {\doifelsevalue{\@@thenumber{#1}\c!sectienummer}\v!ja
+ \donetrue\donefalse
+ \doifvalue{\@@thenumber{#1}\c!sectienummer}\v!nummer
{\donetrue\let\@@sectionconversion\gobbleoneargument}%
\ifdone
\edef\currentsection%
- {\getvalue{\??by\getvalue{\s!number#1\c!wijze\c!lokaal}}}%
- \doifnot{\currentsection}{\zerosection}
+ {\getvalue{\??by\getvalue{\@@thenumber{#1}\c!wijze\c!lokaal}}}%
+ \doifnot{\currentsection}\zerosection
{\doifnot{\@@sectionvalue{\currentsection}}{0}
{\xdef\voorafgaandenummer%
{\getvalue{\currentsection\c!nummer}.}}}%
@@ -114,22 +156,20 @@
\def\maakvoorafgaandenummer[#1]%
{\bgroup
- \ifnum\blocklevel>0
- \doifelsevalue{\s!number#1\c!blokwijze}{\v!nee}
- {\domaakvoorafgaandenummer[#1]}%
- {\setblockcounters % dit kan sneller omdat de waarden
- \domaakvoorafgaandenummer[#1]}% % en het type bekend zijn
- \else
- \domaakvoorafgaandenummer[#1]%
+ %\ifnum\blocklevel>0
+ %\ifcase\blocklevel\else
+ \ifdoingblocks
+ \doifnotvalue{\@@thenumber{#1}\c!blokwijze}\v!nee\setblockcounters
\fi
+ \domaakvoorafgaandenummer[#1]%
\egroup}
% \def\maakhetnummer[#1]%
% {\maakvoorafgaandenummer[#1]%
% \xdef\hetnummer%
% {\voorafgaandenummer\nummer[#1]}}%
-%
-% hack needed for chinese and oldstyle in normal tex, will change
+%
+% hack needed for chinese and oldstyle in normal tex, will change
\def\maakhetnummer[#1]%
{\bgroup
@@ -139,14 +179,21 @@
{\voorafgaandenummer\nummer[#1]}%
\egroup}
+\def\preparethenumber#1#2#3% {\??id#1} \number \result
+ {\doifelsevaluenothing{#1\c!scheider}
+ {\let\numberseparator\empty
+ \let#3#2}
+ {\unexpanded\def\numberseparator{\getvalue{#1\c!scheider}}%
+ \edef#3{\@EA\separatednumber\@EA{#2}}}}
+
\def\lossenummer[#1]%
{\maakhetnummer[#1]%
\hetnummer}
\def\huidigenummer[#1]%
- {%\getvalue{\getvalue{\s!number#1\c!zetwijze}}%
- \getvalue{\getvalue{\s!number#1\c!plaats}}%
- {\dotextprefix{\getvalue{\s!number#1\c!tekst}}\lossenummer[#1]}}
+ {%\getvalue{\getvalue{\@@thenumber{#1}\c!zetwijze}}%
+ \getvalue{\getvalue{\@@thenumber{#1}\c!plaats}}%
+ {\dotextprefix{\getvalue{\@@thenumber{#1}\c!tekst}}\lossenummer[#1]}}
\def\volgendenummer[#1][#2][#3]%
{\verhoognummer[#1]%
@@ -157,30 +204,30 @@
\newcount\nofsections
-\def\zerosection{\v!tekst}
-\def\firstsection{}
-\def\lastsection{}
-\let\@@sectie\empty
-\let\@@koppeling\empty
+\let\zerosection \v!tekst
+\let\firstsection\empty
+\let\lastsection \empty
+\let\@@sectie \empty
+\let\@@koppeling \empty
\makecounter{\??se\v!tekst}
-\setevalue{\??se\v!tekst\c!voor}{}
-\setevalue{\??se\v!tekst\c!na }{}
+\letvalue{\??se\v!tekst\c!voor}\empty
+\letvalue{\??se\v!tekst\c!na }\empty
-\setevalue{\v!tekst\c!nummer}{0}
-\setevalue{\v!tekst\s!format}{}
+\setvalue{\v!tekst\c!nummer}{0}
+\letvalue{\v!tekst\s!format}\empty
-\setevalue{\??sk\v!tekst}{}
-\setevalue{\??sk }{}
+\letvalue{\??sk\v!tekst}\empty
+\letvalue{\??sk }\empty
-\setvalue{\??by }{\v!tekst}
-\setvalue{\??by\v!tekst }{\v!tekst}
-\setvalue{\??by\v!alles }{\v!tekst}
-\setvalue{\??by\v!per }{\v!tekst}
-\setvalue{\??by\v!per\v!tekst }{\v!tekst}
-\setvalue{\??by\v!per\v!alles }{\v!tekst}
-\setvalue{\??by\v!per\v!pagina}{\v!tekst} % see footnotes
+\letvalue{\??by }\v!tekst
+\letvalue{\??by\v!tekst }\v!tekst
+\letvalue{\??by\v!alles }\v!tekst
+\letvalue{\??by\v!per }\v!tekst
+\letvalue{\??by\v!per\v!tekst }\v!tekst
+\letvalue{\??by\v!per\v!alles }\v!tekst
+\letvalue{\??by\v!per\v!pagina}\v!tekst % see footnotes
%%%%%%%%% old
@@ -202,7 +249,7 @@
\getparameters[\??se#1][#2]%
\fi
\doifelsevalue{\??se#1\c!vorigenummer}{\v!ja}
- {\setvalue{#1\c!nummer}{\@@longsectionnumber{#1}}}
+ {\setvalue{#1\c!nummer}{\@@longsectionnumber {#1}}}
{\setvalue{#1\c!nummer}{\@@shortsectionnumber{#1}}}}
\def\stelsectiein%
@@ -251,7 +298,7 @@
\setevalue{\??by#1}{#1}%
\setevalue{\??by\v!per#1}{#1}%
\makecounter{\??se#1}%
- \def\lastsection{#1}%
+ \edef\lastsection{#1}%
\setvalue{\??sk#1}%
{#1}%
\setvalue{\??se#1\c!markering}%
@@ -259,22 +306,19 @@
\stelsectiein[#1]
[\c!vorigenummer=\v!ja]}}%
-\def\previoussection#1%
- {\getvalue{\??se#1\c!voor}}
-
-\def\nextsection#1%
- {\getvalue{\??se#1\c!na}}
+\def\previoussection#1{\csname\??se#1\c!voor\endcsname}
+\def\nextsection #1{\csname\??se#1\c!na \endcsname}
\def\@@setsectionnumber#1#2%
{\setgvalue{\??se#1\s!start}{}% % signal i.p.v. boolean
\setcounter{\??se#1}{#2}%
- \resetsectioncounters[#1]%
+ \resetsectioncounters{#1}%
\checkpagecounter}
\def\@@nextsectionnumber#1%
{\setgvalue{\??se#1\s!start}{}% % signal i.p.v. boolean
\pluscounter{\??se#1}%
- \resetsectioncounters[#1]%
+ \resetsectioncounters{#1}%
\checkpagecounter}
\def\@@sectionvalue#1% % nog niet overal doorgevoerd
@@ -304,25 +348,49 @@
% Omdat een markering kan worden herdefinieerd moeten we
% eerst testen of er wel een keten||afhankelijkheid is.
-% we het huidge (eigen) nummer kunnen ophalen
+% \def\doresetsectionmarks#1%
+% {\doifdefined{\??se#1\c!markering} % skip zero level
+% {\fastresetmarkerlist[\getvalue{\??se#1\c!markering}]}%
+% \donexttracklevel{#1}}
+%
+% \def\resetsectionmarks#1%
+% {\doifdefinedelse{\??se#1}
+% {\let\donexttrackcommando\doresetsectionmarks
+% \donexttracklevel{#1}}%
+% {\fastresetmarker[\hoofdmarkering{#1}]}} % redundant \hoofdmarkering
+
+\def\doresetsectionmarks#1%
+ {\ifundefined{\??se#1\c!markering}\else % skip zero level
+ \fastresetmarkerlist[\csname\??se#1\c!markering\endcsname]%
+ \fi
+ \donexttracklevel{#1}}
+
+\def\resetsectionmarks#1%
+ {\ifundefined{\??se#1}%
+ \fastresetmarker[\hoofdmarkering{#1}]% % redundant \hoofdmarkering
+ \else
+ \let\donexttrackcommando\doresetsectionmarks
+ \donexttracklevel{#1}%
+ \fi}
-\def\resetsectionmarks[#1]%
- {\doifdefinedelse{\??se#1}
- {\def\donexttrackcommando##1%
- {\doifdefined{\??se##1\c!markering} % skip zero level
- {\def\docommando####1%
- {\ExpandFirstAfter\resetmarkering[####1]}%
- \processcommacommand[\getvalue{\??se##1\c!markering}]\docommando}%
- \donexttracklevel{##1}}%
- \donexttracklevel{#1}}%
- {\ExpandFirstAfter\resetmarkering[\hoofdmarkering{#1}]}}
+% packaged:
+%
+% \def\resetsectioncounters#1%
+% {\def\donexttrackcommando##1%
+% {\resetcounter{\??se##1}%
+% \donexttracklevel{##1}}%
+% \donexttracklevel{#1}}
+%
+% nicer
-\def\resetsectioncounters[#1]%
- {\def\donexttrackcommando##1%
- {\resetcounter{\??se##1}%
- \donexttracklevel{##1}}%
+\def\doresetsectioncounters#1%
+ {\resetcounter{\??se#1}%
\donexttracklevel{#1}}
+\def\resetsectioncounters % #1
+ {\let\donexttrackcommando\doresetsectioncounters
+ \donexttracklevel} % #1
+
% bij checken kan geen prefix worden bekeken, anders vallen
% er titels buiten de inhoudsopgave
@@ -333,7 +401,7 @@
{\@@sectiontype:\getvalue{\lastsection\s!format}}}
\def\dobacktracklevel#1%
- {\doifnot{\previoussection{#1}}{\zerosection}
+ {\doifnot{\previoussection{#1}}\zerosection
{\dobacktrackcommando{\previoussection{#1}}}}
\def\donexttracklevel#1%
@@ -385,63 +453,139 @@
\def\dontsetlevel#1%
{\let\currentlevel\somesavedlevel
\alllevelsfalse}
-
-\def\dosetlevel#1% opvoeren met \ifcsname
- {\let\dosetlevel\dontsetlevel % local lists will be real local
- \bgroup
- \doifelse{#1}{\v!vorige}
+
+% \def\dosetlevel#1% opvoeren met \ifcsname
+% {\let\dosetlevel\dontsetlevel % local lists will be real local
+% \bgroup
+% \doifelse{#1}{\v!vorige}
+% {\global\alllevelstrue
+% \global\let\currentlevel\empty
+% \def\dobacktrackcommando##1%
+% {\ifnum\countervalue{\??se##1}>0
+% \global\alllevelsfalse
+% \xdef\currentlevel{\getvalue{\previoussection{##1}\s!format}}%
+% \else
+% \dobacktracklevel{##1}%
+% \fi}%
+% \dobacktrackcommando\lastsection}
+% {\doifelse{\getvalue{\??by#1}}{\v!tekst}
+% {\global\alllevelstrue
+% \global\let\currentlevel\empty}
+% {\doifdefinedelse{\??ko#1\c!sectie} % beter alteratief: ook
+% {\edef\@@sectie{\getvalue{\??ko#1\c!sectie}}} % hoofdstuk\c!format
+% {\edef\@@sectie{#1}}%
+% \doifdefinedelse{\??se\@@sectie}
+% {\global\alllevelsfalse
+% \xdef\currentlevel{\getvalue{\@@sectie\s!format}}}
+% {\global\alllevelstrue
+% \global\let\currentlevel\empty
+% \def\dobacktrackcommando##1%
+% {\@EA\ifx\csname\??se##1\c!start\endcsname\relax
+% \dobacktracklevel{##1}%
+% \else
+% \ifnum\countervalue{\??se##1}>0
+% \global\alllevelsfalse
+% \xdef\currentlevel{\getvalue{##1\s!format}}%
+% \else
+% \dobacktracklevel{##1}%
+% \fi
+% \fi}%
+% \dobacktrackcommando\lastsection}}}%
+% \egroup}
+
+\def\dosetcurrentlevel#1%
+ {\global\alllevelsfalse
+ \xdef\currentlevel{\getvalue{\lastsection\s!format}}}
+
+\def\dosetpreviouslevel#1%
+ {\global\alllevelstrue
+ \global\let\currentlevel\empty
+ \def\dobacktrackcommando##1%
+ {\ifnum\countervalue{\??se##1}>0
+ \global\alllevelsfalse
+ \xdef\currentlevel{\getvalue{\previoussection{##1}\s!format}}%
+ \else
+ \dobacktracklevel{##1}%
+ \fi}%
+ \dobacktrackcommando\lastsection}
+
+\def\dosettextlevel#1%
+ {\global\alllevelstrue
+ \global\let\currentlevel\empty}
+
+\def\dosetotherlevel#1%
+ {\doifdefinedelse{\??ko#1\c!sectie} % beter alteratief: ook
+ {\edef\@@sectie{\getvalue{\??ko#1\c!sectie}}} % hoofdstuk\c!format
+ {\edef\@@sectie{#1}}%
+ \doifdefinedelse{\??se\@@sectie}
+ {\global\alllevelsfalse
+ \xdef\currentlevel{\getvalue{\@@sectie\s!format}}}
{\global\alllevelstrue
\global\let\currentlevel\empty
\def\dobacktrackcommando##1%
- {\ifnum\countervalue{\??se##1}>0
- \global\alllevelsfalse
- \xdef\currentlevel{\getvalue{\previoussection{##1}\s!format}}%
- \else
+ {\@EA\ifx\csname\??se##1\c!start\endcsname\relax
\dobacktracklevel{##1}%
+ \else
+ \ifnum\countervalue{\??se##1}>0
+ \global\alllevelsfalse
+ \xdef\currentlevel{\getvalue{##1\s!format}}%
+ \else
+ \dobacktracklevel{##1}%
+ \fi
\fi}%
- \dobacktrackcommando\lastsection}
- {\doifelse{\getvalue{\??by#1}}{\v!tekst}
- {\global\alllevelstrue
- \global\let\currentlevel\empty}
- {\doifdefinedelse{\??ko#1\c!sectie} % beter alteratief: ook
- {\edef\@@sectie{\getvalue{\??ko#1\c!sectie}}} % hoofdstuk\c!format
- {\edef\@@sectie{#1}}%
- \doifdefinedelse{\??se\@@sectie}
- {\global\alllevelsfalse
- \xdef\currentlevel{\getvalue{\@@sectie\s!format}}}
- {\global\alllevelstrue
- \global\let\currentlevel\empty
- \def\dobacktrackcommando##1%
- {\@EA\ifx\csname\??se##1\c!start\endcsname\relax
- \dobacktracklevel{##1}%
- \else
- \ifnum\countervalue{\??se##1}>0
- \global\alllevelsfalse
- \xdef\currentlevel{\getvalue{##1\s!format}}%
- \else
- \dobacktracklevel{##1}%
- \fi
- \fi}%
- \dobacktrackcommando\lastsection}}}%
+ \dobacktrackcommando\lastsection}}
+
+% \def\dosetlevel#1% opvoeren met \ifcsname
+% {\let\dosetlevel\dontsetlevel % local lists will be real local
+% \bgroup
+% \doifelse{#1}{\v!huidige}
+% {\dosetcurrentlevel{#1}}
+% {\doifelse{#1}{\v!vorige}
+% {\dosetpreviouslevel{#1}}
+% {\doifelsevalue{\??by#1}{\v!tekst}
+% {\dosettextlevel{#1}}
+% {\dosetotherlevel{#1}}}}%
+% \egroup}
+
+\def\dosetlevel#1% beware: this one is \let
+ {\let\dosetlevel\dontsetlevel % local lists will be real local
+ \bgroup
+ \edef\askedlevel{#1}%
+ \ifx\askedlevel\v!huidige
+ \dosetcurrentlevel\askedlevel
+ \else\ifx\askedlevel\v!vorige
+ \dosetpreviouslevel\askedlevel
+ \else
+ \edef\byaskedlevel{\csname\??by\askedlevel\endcsname}%
+ \ifx\byaskedlevel\v!tekst
+ \dosettextlevel\askedlevel
+ \else
+ \dosetotherlevel\askedlevel
+ \fi
+ \fi\fi
\egroup}
-\def\dosettoclevel{\dosetlevel}
-\def\dosetreglevel{\dosetlevel}
-\def\dosetblklevel{\dosetlevel}
+% \def\dosettoclevel{\dosetlevel}
+% \def\dosetreglevel{\dosetlevel}
+% \def\dosetblklevel{\dosetlevel}
-% cleaner
+\let\dosettoclevel\dosetlevel
+\let\dosetreglevel\dosetlevel
+\let\dosetblklevel\dosetlevel
+
+% cleaner
%
% \def\doifnextlevelelse[#1::#2]#3#4%
% {\ifalllevels
% #3%
% \else
-% \doifelse{\@@sectiontype}{#1}
+% \doifelse{\@@sectiontype}{#1}
% {\doifinstringelse{=\currentlevel:}{=:#2:}
% {\doifinstringelse{=\currentlevel:0}{=:#2:}{#4}{#3}}
% {#4}}
% {#4}%
% \fi}
-%
+%
% \def\doifprevlevelelse[#1::#2]#3#4%
% {\ifalllevels
% #3%
@@ -451,13 +595,13 @@
% {#4}%
% \fi}
%
-% faster
-%
+% faster
+%
% \def\doifnextlevelelse[#1::#2]%
-% {\ifalllevels
-% \donetrue
+% {\ifalllevels
+% \donetrue
% \else
-% \doifelse{\@@sectiontype}{#1}
+% \doifelse{\@@sectiontype}{#1}
% {\doifinstringelse{=\currentlevel:}{=:#2:}
% {\doifinstringelse{=\currentlevel:0}{=:#2:}\donefalse\donetrue}
% \donefalse}
@@ -468,7 +612,7 @@
% \else
% \expandafter\secondoftwoarguments
% \fi}
-%
+%
% \def\doifprevlevelelse[#1::#2]%
% {\ifalllevels
% \donetrue
@@ -482,7 +626,7 @@
% \else
% \expandafter\secondoftwoarguments
% \fi}
-%
+%
% meaner
%
% \stellijstin
@@ -494,48 +638,91 @@
\def\dosavesomelevel[#1:0:0:0:#2]%
{\def\somesavedlevel{:#1}}
-\def\doifnextlevelelse[#1::#2]%
+% \def\doifnextlevelelse[#1::#2]%
+% {\dosavesomelevel[#2:0:0:0:0]%
+% \ifalllevels
+% \donetrue
+% \else
+% \doifelse{\@@sectiontype}{#1}
+% {\doifinstringelse{=\currentlevel:}{=:#2:}
+% {\doifinstringelse{=\currentlevel:0}{=:#2:}\donefalse\donetrue}
+% \donefalse}
+% \donefalse
+% \fi
+% \ifdone
+% \expandafter\firstoftwoarguments
+% \else
+% \expandafter\secondoftwoarguments
+% \fi}
+%
+% \def\doifprevlevelelse[#1::#2]%
+% {\dosavesomelevel[#2:0:0:0:0]%
+% \ifalllevels
+% \donetrue
+% \else
+% \doifelse{\@@sectiontype}{#1}
+% {\doifinstringelse{=\currentlevel:}{=:#2:}\donetrue\donefalse}
+% \donefalse
+% \fi
+% \ifdone
+% \expandafter\firstoftwoarguments
+% \else
+% \expandafter\secondoftwoarguments
+% \fi}
+%
+% again faster:
+
+\def\doifnextlevelelse[#1::#2]% beware: this one is \let
{\dosavesomelevel[#2:0:0:0:0]%
- \ifalllevels
- \donetrue
- \else
- \doifelse{\@@sectiontype}{#1}
- {\doifinstringelse{=\currentlevel:}{=:#2:}
- {\doifinstringelse{=\currentlevel:0}{=:#2:}\donefalse\donetrue}
- \donefalse}
+ \ifalllevels
+ \donetrue
+ \else\ifnum\@@sectiontype=#1
+% \doifinstringelse{=\currentlevel:}{=:#2:}
+% {\doifinstringelse{=\currentlevel:0}{=:#2:}\donefalse\donetrue}
+% \donefalse
+ \def\levelstring{=:#2:}%
+ \doifincsnameelse{=\currentlevel:}\levelstring
+ {\doifincsnameelse{=\currentlevel:0}\levelstring\donefalse\donetrue}
\donefalse
- \fi
+ \else
+ \donefalse
+ \fi\fi
\ifdone
\expandafter\firstoftwoarguments
\else
\expandafter\secondoftwoarguments
\fi}
-\def\doifprevlevelelse[#1::#2]%
+\def\doifprevlevelelse[#1::#2]% beware: this one is \let
{\dosavesomelevel[#2:0:0:0:0]%
\ifalllevels
\donetrue
+ \else\ifnum\@@sectiontype=#1
+ \doifinstringelse{=\currentlevel:}{=:#2:}\donetrue\donefalse
\else
- \doifelse{\@@sectiontype}{#1}
- {\doifinstringelse{=\currentlevel:}{=:#2:}\donetrue\donefalse}
- \donefalse
- \fi
+ \donefalse
+ \fi\fi
\ifdone
\expandafter\firstoftwoarguments
\else
\expandafter\secondoftwoarguments
\fi}
-\def\doiftoclevelelse{\doifnextlevelelse}
-\def\doifreglevelelse{\doifprevlevelelse}
-\def\doifblklevelelse{\doifprevlevelelse}
+% \def\doiftoclevelelse{\doifnextlevelelse}
+% \def\doifreglevelelse{\doifprevlevelelse}
+% \def\doifblklevelelse{\doifprevlevelelse}
+
+\let\doiftoclevelelse\doifnextlevelelse
+\let\doifreglevelelse\doifprevlevelelse
+\let\doifblklevelelse\doifprevlevelelse
\def\@@longformatnumber#1%
{\getvalue{\previoussection{#1}\s!format}:\@@shortsectionnumber{#1}}
\def\@@longsectionnumber#1%
{\ifnum\countervalue{\??se\previoussection{#1}}>0
- \getvalue{\previoussection{#1}\c!nummer}\@@koscheider
+ %\getvalue{\previoussection{#1}\c!nummer}\@@koscheider
+ \getvalue{\previoussection{#1}\c!nummer}.%
\fi
\@@shortsectionnumber{#1}}
@@ -567,8 +754,8 @@
\def\doaroundsectieblok#1%
{\doifvaluesomething{\??sb#1\c!pagina}
{\ExpandFirstAfter\pagina[\getvalue{\??sb#1\c!pagina}]}%
- \resetsectioncounters[\zerosection]% was firstsection
- \resetsectionmarks[\zerosection]}
+ \resetsectioncounters\zerosection % was firstsection
+ \resetsectionmarks\zerosection}
\def\dostartsectieblok#1#2%
{\begingroup
@@ -576,20 +763,20 @@
\getvalue{\??sb#1}% % set name of section block
\getsectieblokomgeving{#1}% % special settings, grouped
%\expandafter\csname#2true\endcsname % obsolete
- \enablemode[\systemmodeprefix#1]% % can be used in conditionals
+ \setsystemmode{#1}% % can be used in conditionals
\getvalue{\??sb\@@sectieblok\c!voor}% this one is not to be moved!
- \showmessage{\m!structures}{1}{\@@sectieblokken}}
+ \showmessage\m!structures1\@@sectieblokken}
-\def\dostopsectieblok%
- {\showmessage{\m!structures}{2}{\@@sectieblokken}%
+\def\dostopsectieblok
+ {\showmessage\m!structures2\@@sectieblokken
\getvalue{\??sb\@@sectieblok\c!na}% don't move
- \doaroundsectieblok{\@@sectieblok}%
+ \doaroundsectieblok\@@sectieblok
\endgroup}
-\def\dostelsectieblokin[#1][#2]%
- {\getparameters[\??sb#1][#2]}
+\def\dostelsectieblokin[#1]% [#2]
+ {\getparameters[\??sb#1]}
-\def\stelsectieblokin%
+\def\stelsectieblokin
{\dodoubleargument\dostelsectieblokin}
\long\def\setsectieblokomgeving#1#2%
@@ -706,7 +893,7 @@
\def\dohandelpaginaafB#1%
{\doifinset{\getvalue{\??ko#1\c!pagina}}{\v!ja,\v!rechts,\v!links}
{\def\resetcurrentsectionmarks% toegevoegd, zie \pagina
- {\resetsectionmarks[\previoussection{\@@sectie}]}%
+ {\resetsectionmarks{\previoussection\@@sectie}}%
\pagina[\getvalue{\??ko#1\c!pagina}]%
\dohandelpaginaafBB{#1}\v!hoofd\c!hoofd
\dohandelpaginaafBB{#1}\v!tekst\c!tekst
@@ -724,7 +911,7 @@
\def\handelpaginaaf#1%
{\dohandelpaginaafAA{#1}%
- \ifnum\countervalue{\??se\previoussection{\@@sectie}}>0
+ \ifnum\countervalue{\??se\previoussection\@@sectie}>0
\ifnum\countervalue{\??se\@@sectie}>0
\dohandelpaginaafB{#1}%
\else
@@ -749,10 +936,10 @@
% \def\\{\crlf\strut\ignorespaces}}
\def\dolocalkopsetup#1% koppeling met standaard kopcommando / engels
- {\forgetall
- \doifvaluesomething{\??ko#1\c!uitlijnen}
+ {\forgetall % traag dus ...
+ \doifvaluesomething{\??ko#1\c!uitlijnen} % wordt al expanded in spa
{\expanded{\steluitlijnenin[\getvalue{\??ko#1\c!uitlijnen}]}}%
- \doifvaluesomething{\??ko#1\c!tolerantie}
+ \doifvaluesomething{\??ko#1\c!tolerantie} % wordt al expanded in spa
{\expanded{\steltolerantiein[\getvalue{\??ko#1\c!tolerantie}]}}%
\def\\{\crlf\strut\ignorespaces}}
@@ -780,12 +967,6 @@
% \hoofdstuk tekst
% \hoofdstuk <niets>
-\def\dodosomekop#1[#2]#3%
- {\doifelsevalue{\??ko#1\c!eigennummer}{\v!ja}
- {\def\next{\doquadruplegroupempty\dododosomekop{#1}{#2}{#3}}}
- {\def\next{\fourthargumentfalse \dododosomekop{#1}{#2}{#3}{}}}%
- \next}
-
\def\finalsectionnumber%
{\ifundefined{\@@sectie\c!nummer}\else
\ifsomeheadconversion
@@ -795,16 +976,6 @@
\fi
\fi}
-\def\dododosomekop#1#2#3#4%
- {\iffourthargument
- \def\next%
- {\dodododosomekop{#1}[#2]{#1}{#3}{#4}}%
- \else
- \def\next%
- {\dodododosomekop{#1}[#2]{#1}{\finalsectionnumber}{#3}}%
- \fi
- \next}
-
\def\findsectionnumber#1#2#3% class file title
{\begingroup
\setsectieenkoppeling{#1}%
@@ -861,11 +1032,16 @@
\fi
\fi}}
- \def\writtenfullsectionnumber {\string\fullsectionnumber}
- \def\ignoredfullsectionnumber#1#2#3{#3}
- \let \storedfullsectionnumber \relax
-\unexpanded\def\naturalfullsectionnumber#1#2#3{\sectiebloklabel{#1}{\getvalue{\??cv#2}{#3}}}
-\unexpanded\def\limitedfullsectionnumber#1#2#3{\getvalue{\??cv#2}{#3}}
+ \def \writtenfullsectionnumber {\string\fullsectionnumber}
+ \def \ignoredfullsectionnumber#1#2#3{#3}
+ \let \storedfullsectionnumber \relax
+\unexpanded\def \naturalfullsectionnumber#1#2#3{\sectiebloklabel{#1}{\getvalue{\??cv#2}{#3}}}
+ \def\expandablefullsectionnumber#1#2#3{#3}
+\unexpanded\def \limitedfullsectionnumber#1#2#3{\getvalue{\??cv#2}{#3}}
+
+% under test:
+%
+% \def\expandablefullsectionnumber#1#2#3{\getvalue{\??cv#2}{#3}}
\def\setfullsectionnumber#1%
{\doifelsevalue{#1\c!kopconversie}{\v!ja}
@@ -874,18 +1050,59 @@
{\let\fullsectionnumber\limitedfullsectionnumber}}
{\let\fullsectionnumber\ignoredfullsectionnumber}}
-%\let\fullsectionnumber\naturalfullsectionnumber
\let\fullsectionnumber\limitedfullsectionnumber
% \dodododosomekop IS NON GROUPED, SO WE NEED TO RESTORE !!!!
%
% dit kan dus beter \everyaroundhead zijn
-\def\dodododosomekop#1[#2]#3#4#5% % pas met \ExpandFirstAfter op bij twee||taligheid
- {\flushingcolumnfloatsfalse % #3=#1=redundant
+\let\currentheadnumber\empty
+\let\currentheadtext \empty
+
+\def\dodosomekop#1[#2]#3% [ref] {title}
+ {\doifelsevalue{\??ko#1\c!eigennummer}{\v!ja}
+ {\doquadruplegroupempty\dododosomekop{#1}{#2}{#3}}
+ {\fourthargumentfalse \dododosomekop{#1}{#2}{#3}{}}}
+
+\def\dododosomekop#1#2#3#4% [ref] {own} {title}
+ {\iffourthargument
+ \def\next{\dodododosomekop{#1}[#2]{#3}{#4}}%
+ \else
+ \def\next{\dodododosomekop{#1}[#2]{\finalsectionnumber}{#3}}%
+ \fi
+ \next}
+
+% clearer
+
+\def\dodosomekop#1[#2]#3% [ref] {title}
+ {\doifelsevalue{\??ko#1\c!eigennummer}{\v!ja}
+ {\doquadruplegroupempty\dododosomekop{#1}[#2]{#3}}
+ %{\fourthargumentfalse \dododosomekop{#1}[#2]{#3}{}}}
+ {\dodododosomekop{#1}[#2]{\finalsectionnumber}{#3}}}
+
+\def\dododosomekop#1[#2]#3#4% [ref] {own} {title}
+ {\iffourthargument
+ \def\next{\dodododosomekop{#1}[#2]{#3}{#4}}%
+ \else % normal head or no own number given
+ \def\next{\dodododosomekop{#1}[#2]{\finalsectionnumber}{#3}}%
+ \fi
+ \next}
+
+% pas met \ExpandFirstAfter op bij twee||taligheid
+
+\ifx\dohandleheadnumber\undefined
+ \let\dohandleheadnumber\firstofoneargument
+\fi
+
+\unexpanded\def\\{\space}
+
+\def\dodododosomekop#1[#2]#3#4% [ref] {number} {title}
+ {\def\currenthead{#1}%
+ \unexpanded\def\\{\space}%
+ \def\numberseparator{\getvalue{\??ko\currenthead\c!scheider}}%
+ \flushingcolumnfloatsfalse % {number} can be \finalsectionnumber
\someheadconversionfalse
-% \let\fullsectionnumber\naturalfullsectionnumber
-\let\fullsectionnumber\limitedfullsectionnumber
+ \let\fullsectionnumber\limitedfullsectionnumber
\setsectieenkoppeling{#1}%
\doifelsevalue{\??ko#1\c!prefix}{}
{\kopprefixfalse}
@@ -905,7 +1122,7 @@
[ \v!ja=>\verhoognummertrue,
\v!nee=>\verhoognummerfalse,
\s!unknown=>{\ifx\currentproduct\empty
- \findsectionnumber{#1}\commalistelement{#5}%
+ \findsectionnumber{#1}\commalistelement{#4}%
\fi
\verhoognummertrue}]%
\edef\numberheaddistance {\getvalue{\??ko#1\c!afstand}}%
@@ -919,75 +1136,82 @@
\else
\kopnummerfalse
\fi
- \convertexpanded{\??ko#1}{#5}\asciititle
+ \convertexpanded{\??ko#1}{#4}\asciititle
+ %
+ \gdef\currentheadtext{#4}% scheelt args
+ \global\let\currentheadnumber\empty
+ %
\ifverhoognummer
\ifplaatskop
\checknexthead\handelpaginaaf{#1}%
\setsectieenkoppeling{#1}% can be changed when [voor=\somehead{..}...]
\ifkopprefix
- \setupreferencing[\c!prefix=-]%
+ %\setupreferencing[\c!prefix=-]%
+ \setupreferenceprefix[-]%
\fi
\getvalue{\e!volgende\@@sectie}%
- \getvalue{\??ko#1\c!tussen}%
\ifkopnummer
-\setsomeheadconversion{#1}{#4}%
-\ifsomeheadconversion
- \let\fullsectionnumber\naturalfullsectionnumber
- \doplaatskopnummertekst
- {#1}
- {\setsectionlistreference{\@@sectie}{#1}%
- \ExpandFirstAfter\soortpagina[\@@koppeling]%
-% \let\fullsectionnumber\storedfullsectionnumber
- \let\fullsectionnumber\writtenfullsectionnumber
- \rawreference{\s!sec}{#2}{{\someheadconversion}{\asciititle}}%
- \resetsectionmarks[\@@sectie]%
- \stellijstin[\@@koppeling][\c!expansie=\getvalue{\??ko#1\c!expansie}]%
- \let\fullsectionnumber\writtenfullsectionnumber
- \doschrijfnaarlijst{\@@koppeling}{\someheadconversion}{#5}{\v!kop}}%
- {\someheadconversion}
- {#5}
- {\marking[#1]{#5}%
- \let\fullsectionnumber\storedfullsectionnumber
- \expanded{\marking[#1\v!nummer]{\someheadconversion}}}%
- \let\fullsectionnumber\ignoredfullsectionnumber
- \writesection{#1}{\someheadconversion}{#5}%
-\else
- \doplaatskopnummertekst
- {#1}
- {\setsectionlistreference{\@@sectie}{#1}%
- \ExpandFirstAfter\soortpagina[\@@koppeling]%
- \rawreference{\s!sec}{#2}{{#4}{\asciititle}}%
- \resetsectionmarks[\@@sectie]%
- \stellijstin[\@@koppeling][\c!expansie=\getvalue{\??ko#1\c!expansie}]%
- \doschrijfnaarlijst{\@@koppeling}{#4}{#5}{\v!kop}}
- {\sectiebloklabel{#3}{#4}}
- {#5}
- {\marking[#1]{#5}%
- \doifelsevalue{\??ko#1\c!eigennummer}{\v!ja} % rommelig omdat
- {\edef\finalsectionnumber{#4}} % #4 al is toegekend
- {\bepaalkopnummer[#1]}% migreert naar 3e argument
- \expanded{\marking[#1\v!nummer]{\finalsectionnumber}}}%
- \writesection{#1}{#4}{#5}%
- \fi
+ \setsomeheadconversion{#1}{#3}%
+ \let\fullsectionnumber\expandablefullsectionnumber
+ \xdef\currentheadnumber{\someheadconversion}%
+ \getvalue{\??ko#1\c!tussen}%
+ \ifsomeheadconversion
+ \let\fullsectionnumber\naturalfullsectionnumber
+ \doplaatskopnummertekst
+ {#1}
+ {\setsectionlistreference{\@@sectie}{#1}%
+ \soortpagina[\@@koppeling]%
+ \let\fullsectionnumber\writtenfullsectionnumber
+ \rawreference{\s!sec}{#2}{{\someheadconversion}{\asciititle}}%
+ \resetsectionmarks\@@sectie
+ \setlistparameter\@@koppeling\c!expansie{\getvalue{\??ko#1\c!expansie}}%
+ \let\fullsectionnumber\writtenfullsectionnumber
+ \doschrijfnaarlijst{\@@koppeling}{\someheadconversion}{#4}{\v!kop}}%
+ {\dohandleheadnumber\someheadconversion}% handle is new
+ {#4}
+ {\marking[#1]{#4}%
+ \let\fullsectionnumber\storedfullsectionnumber
+ \expanded{\marking[#1\v!nummer]{\someheadconversion}}}%
+ \let\fullsectionnumber\ignoredfullsectionnumber
+ \writesection{#1}{\someheadconversion}{#4}%
+ \else
+ \doplaatskopnummertekst
+ {#1}
+ {\setsectionlistreference{\@@sectie}{#1}%
+ \soortpagina[\@@koppeling]%
+ \rawreference{\s!sec}{#2}{{#3}{\asciititle}}%
+ \resetsectionmarks\@@sectie
+ \setlistparameter\@@koppeling\c!expansie{\getvalue{\??ko#1\c!expansie}}%
+ \doschrijfnaarlijst{\@@koppeling}{#3}{#4}{\v!kop}}
+ {\sectiebloklabel{#1}{\dohandleheadnumber{#3}}}% handle is new
+ {#4}
+ {\marking[#1]{#4}%
+ \doifelsevalue{\??ko#1\c!eigennummer}{\v!ja} % rommelig omdat
+ {\edef\finalsectionnumber{#3}} % #3 al is toegekend
+ {\bepaalkopnummer[#1]}% migreert naar 3e argument
+ \expanded{\marking[#1\v!nummer]{\finalsectionnumber}}}%
+ \writesection{#1}{#3}{#4}%
+ \fi
\else
+ \getvalue{\??ko#1\c!tussen}%
\doplaatskoptekst
{#1}
{\setsectionlistreference{\@@sectie}{#1}%
- \ExpandFirstAfter\soortpagina[\@@koppeling]%
- \rawreference{\s!sec}{#2}{{#4}{\asciititle}}%
- \resetsectionmarks[\@@sectie]%
- \stellijstin[\@@koppeling][\c!expansie=\getvalue{\??ko#1\c!expansie}]%
- \doschrijfnaarlijst{\@@koppeling}{}{#5}{\v!kop}}
- {#5}
- {\marking[#1]{#5}%
- \doifelsevalue{\??ko#1\c!eigennummer}{\v!ja}
- {\edef\finalsectionnumber{#4}}
+ \soortpagina[\@@koppeling]%
+ \rawreference{\s!sec}{#2}{{#3}{\asciititle}}%
+ \resetsectionmarks\@@sectie
+ \setlistparameter\@@koppeling\c!expansie{\getvalue{\??ko#1\c!expansie}}%
+ \doschrijfnaarlijst{\@@koppeling}{}{#4}{\v!kop}}
+ {#4}
+ {\marking[#1]{#4}%
+ \doifelsevalue{\??ko#1\c!eigennummer}{\v!ja} % brrr
+ {\edef\finalsectionnumber{#3}}
{\bepaalkopnummer[#1]}%
\expanded{\marking[#1\v!nummer]{\finalsectionnumber}}}%
- \writesection{#1}{-}{#5}%
+ \writesection{#1}{-}{#4}%
\fi
\ifkopprefix
- \ExpandFirstAfter\setupreferencing[\c!prefix=\localkopprefix]%
+ \setupreferenceprefix[\localkopprefix]%
\fi
\dosomebreak\nobreak
\ifdisplaysectionhead\getvalue{\??ko#1\c!na}\fi
@@ -995,32 +1219,37 @@
\checknexthead\dohandelpaginaafB{#1}% toegevoegd ivm subpaginanr / tug sheets
\setsectieenkoppeling{#1}% can be changed when [voor=\somehead{..}...]
\ifkopprefix
- \setupreferencing[\c!prefix=-]%
+ \setupreferenceprefix[-]%
\fi
\getvalue{\e!volgende\@@sectie}%
+ \ifkopnummer
+ \setsomeheadconversion{#1}{#3}%
+ \let\fullsectionnumber\expandablefullsectionnumber
+ \xdef\currentheadnumber{\someheadconversion}%
+ \fi
\getvalue{\??ko#1\c!tussen}%
\setsectionlistreference{\@@sectie}{#1}%
- \resetsectionmarks[\@@sectie]%
- \marking[#1]{#5}%
+ \resetsectionmarks\@@sectie
+ \marking[#1]{#4}%
\doifelsevalue{\??ko#1\c!eigennummer}{\v!ja}
- {\edef\finalsectionnumber{#4}}
+ {\edef\finalsectionnumber{#3}}
{\bepaalkopnummer[#1]}%
\expanded{\marking[#1\v!nummer]{\finalsectionnumber}}%
- \ExpandFirstAfter\soortpagina[\@@koppeling]%
+ \soortpagina[\@@koppeling]%
\bgroup
- \stellijstin[\@@koppeling][\c!expansie=\getvalue{\??ko#1\c!expansie}]%
+ \setlistparameter\@@koppeling\c!expansie{\getvalue{\??ko#1\c!expansie}}%
\ifkopnummer
- \rawreference{\s!sec}{#2}{{#4}{\asciititle}}%
- \doschrijfnaarlijst{\@@koppeling}{#4}{#5}{\v!kop}%
- \writesection{#1}{#4}{#5}%
+ \rawreference{\s!sec}{#2}{{#3}{\asciititle}}%
+ \doschrijfnaarlijst{\@@koppeling}{#3}{#4}{\v!kop}%
+ \writesection{#1}{#3}{#4}%
\else
- \rawreference{\s!sec}{#2}{{#4}{\asciititle}}%
- \doschrijfnaarlijst{\@@koppeling}{}{#5}{\v!kop}%
- \writesection{#1}{-}{#5}%
+ \rawreference{\s!sec}{#2}{{#3}{\asciititle}}%
+ \doschrijfnaarlijst{\@@koppeling}{}{#4}{\v!kop}%
+ \writesection{#1}{-}{#4}%
\fi
\egroup
\ifkopprefix
- \ExpandFirstAfter\setupreferencing[\c!prefix=\localkopprefix]%
+ \setupreferenceprefix[\localkopprefix]%
\fi
\fi
\else
@@ -1030,10 +1259,10 @@
\getvalue{\??ko#1\c!tussen}%
\doplaatskoptekst
{#1}
- {\rawreference{\s!sec}{#2}{{#4}{\asciititle}}}
- {#5}
+ {\rawreference{\s!sec}{#2}{{#3}{\asciititle}}}
+ {#4}
{}%
- \writesection{#1}{-}{#5}%
+ \writesection{#1}{-}{#4}%
\dosomebreak\nobreak
\ifdisplaysectionhead\getvalue{\??ko#1\c!na}\fi
\else
@@ -1042,21 +1271,20 @@
\fi
\flushingcolumnfloatstrue
\someheadconversionfalse
-% \let\fullsectionnumber\naturalfullsectionnumber
-\let\fullsectionnumber\limitedfullsectionnumber
+ \let\fullsectionnumber\limitedfullsectionnumber
\ifdisplaysectionhead\else\expandafter\GotoPar\fi}
-\def\previoussectionformat{}
-\def\currentsectionformat{}
+\let\previoussectionformat\empty
+\let\currentsectionformat \empty
-\let\updatelistreferences=\relax
-\def\updatedlistreferences{}
+\let\updatelistreferences \relax
+\let\updatedlistreferences\empty
\def\setsectionlistreference#1#2%
{\ifnum\countervalue{\??se\previoussection{#1}}>0\relax
\xdef\previoussectionformat{\@@longformatnumber{\previoussection{#1}}}%
\else
- \xdef\previoussectionformat{}%
+ \global\let\previoussectionformat\empty
\fi
\xdef\currentsectionformat{\@@longformatnumber{#1}}}
@@ -1079,8 +1307,8 @@
\def\dostoplistreferences#1%
{\iflijstgeplaatst
- \addtocommalist{#1}\updatedlistreferences % nog global (\doglobal)
- \global\let\updatedlistreferences=\updatedlistreferences % een noodverbandje
+ \addtocommalist{#1}\updatedlistreferences % nog global (\doglobal)
+ \global\let\updatedlistreferences\updatedlistreferences % een noodverbandje
\gdef\updatelistreferences%
{\def\docommando####1%
%
@@ -1090,8 +1318,8 @@
% {\definereference[\e!vorige####1][\getvalue{\e!huidigelokale####1}]%
%
\processcommacommand[\updatedlistreferences]\docommando
- \global\let\updatelistreferences=\relax
- \global\let\updatedlistreferences=\empty}%
+ \global\let\updatelistreferences\relax
+ \global\let\updatedlistreferences\empty}%
\fi}
\def\stoplistreferences%
@@ -1103,12 +1331,13 @@
% \onderwerp{test} \strut \input tufte
% \onderwerp{test} \plaatslijst[...]
-\newif\ifheadnumbercontent
+\newif\ifheadnumbercontent % niet meer wijzigen / wordt mode
\def\doplaatskoptekst#1#2#3#4%
{\beginheadplacement{#1}%
\setbox0=\ifvertical\vbox\else\hbox\fi % \vhbox
{\headnumbercontentfalse
+ \resetsystemmode\v!sectienummer
\getvalue{\??ko#1\c!commando}
{} % no number
{\doattributes
@@ -1125,7 +1354,7 @@
\getvalue{\??ko#1\c!voorcommando}%
\ifdisplaysectionhead
\getvalue{\??ko#1\c!tekstcommando}%
- {\setstrut\begstrut#3\endstrut}
+ {\setstrut\begstrut#3\endstrut}%
\xdef\localheaddepth{\the\dp\strutbox}%
\else
\getvalue{\??ko#1\c!tekstcommando}{#3}%
@@ -1138,7 +1367,8 @@
{\beginheadplacement{#1}%
\setbox0=\ifvertical\vbox\else\hbox\fi % \vhbox
{\doiftextelse{#3}
- {\headnumbercontenttrue}{\headnumbercontentfalse}%
+ {\setsystemmode \v!sectienummer\headnumbercontenttrue }
+ {\resetsystemmode\v!sectienummer\headnumbercontentfalse}%
\getvalue{\??ko#1\c!commando}%
{\doattributes{\??ko#1}\c!letter\c!kleur
{\doattributes{\??ko#1}\c!nummerletter\c!nummerkleur
@@ -1184,10 +1414,13 @@
\mindermeldingen
\postponefootnotes
\iflocation\ifdisplaysectionhead\else\noninterferingmarks\fi\fi
- \setupinteraction
- [\c!letter=,
- \c!kleur=,
- \c!contrastkleur=]%
+ %\setupinteraction
+ % [\c!letter=,
+ % \c!kleur=,
+ % \c!contrastkleur=]%
+ \resetinteractionparameter\c!letter
+ \resetinteractionparameter\c!kleur
+ \resetinteractionparameter\c!contrastkleur
\strictouterreferencestrue % tzt instelling
\def\localkopsetup%
{\dolocalkopsetup{#1}}%
@@ -1198,8 +1431,7 @@
{\doifvaluenothing{\??ko#1\c!file}{\autocrossdocumentfalse}}
{\autocrossdocumentfalse}%
% no message needed here, should be a proper switch
- \let\unknownreference\relax
- %
+ % \let\unknownreference\gobbleoneargument
\ifdisplaysectionhead
\let\headlastlinewidth\!!zeropoint
\snaptogrid\hbox
@@ -1225,7 +1457,7 @@
\doflushfootnotes % new, here since we're in par mode
\iflocation
\ifautocrossdocument
- \hhboxindent=\ifcontinuoushead\headlastlinewidth\else\!!zeropoint\fi
+ \hhboxindent=\ifcontinuoushead\headlastlinewidth\else\zeropoint\fi
\unhhbox0\with{\naarbox{\box\hhbox}[\getvalue{\??ko#1\c!file}::#1]}%
\advance\lasthhboxwidth by \numberheaddistance
\xdef\headlastlinewidth{\the\lasthhboxwidth}%
@@ -1289,15 +1521,6 @@
\def\stelkopnummerin%
{\dodoubleargument\dostelkopnummerin}
-% \def\dokopnummer[#1]%
-% {\bgroup
-% \setsectieenkoppeling{#1}%
-% \doifnot{\finalsectionnumber}{0} % kan effienter
-% {\finalsectionnumber}%
-% \egroup}
-%
-% beter :
-
\def\huidigekopnummer{0}
\def\bepaalkopnummer[#1]%
@@ -1306,19 +1529,11 @@
\xdef\huidigekopnummer{\@@sectionvalue{\@@sectie}}%
\egroup}
-%\def\complexkopnummer[#1]%
-% {\bgroup
-% \setsectieenkoppeling{#1}%
-% \xdef\huidigekopnummer{\@@sectionvalue{\@@sectie}}%
-% \doifnot{\huidigekopnummer}{0}
-% {\finalsectionnumber}%
-% \egroup}
-
\def\complexkopnummer[#1]%
{\bgroup
\edef\huidigekopnummer{#1}%
- \doifinsetelse{-}{#1}
- {\removefromcommalist{-}\huidigekopnummer
+ \doifinsetelse{-}{#1} % br undocumented
+ {\removefromcommalist{-}\huidigekopnummer % br
\setsectieenkoppeling\huidigekopnummer
\stelsectiein[\@@sectie][\c!vorigenummer=\v!nee]}%
{\setsectieenkoppeling\huidigekopnummer}%
@@ -1358,7 +1573,7 @@
{\vbox
{\localkopsetup
\begstrut % but use one \strut here!
- \ifheadnumbercontent
+ \ifheadnumbercontent
\llap{\hbox to 5em{\hfill{#1}\hskip\linkermargeafstand}}%
\fi
{#2}}}
@@ -1391,7 +1606,8 @@
\c!tekstletter=\getvalue{\??ko#1\c!letter},
\c!nummerkleur=\getvalue{\??ko#1\c!kleur},
\c!tekstkleur=\getvalue{\??ko#1\c!kleur}]%
- \ConvertToConstant\doifinstringelse{=}{#2}
+% \ConvertToConstant\doifinstringelse{=}{#2}
+ \doifassignmentelse{#2}
{\getparameters
[\??ko#1]
[\c!sectie=\getvalue{\??ko\getvalue{\??ko#1\c!koppeling}\c!sectie},
@@ -1400,7 +1616,7 @@
\c!prefix=,
\c!voor=,
\c!na=,
- \c!afstand=,
+ \c!afstand=\!!zeropoint,
\c!pagina=,
\c!hoofd=,
\c!tekst=,
@@ -1417,6 +1633,7 @@
\c!verhoognummer=\v!ja,
\c!variant=\@@kovariant,
\c!commando=\@@plaatskop,
+ \c!scheider=\@@koscheider,
\c!uitlijnen=,
\c!tolerantie=,
\c!file=,
@@ -1431,7 +1648,7 @@
\c!nummer,\c!eigennummer,\c!plaatskop,\c!verhoognummer,
\c!letter,\c!kleur,\c!afstand,\c!variant,\c!springvolgendein,
%\c!nummerletter,\c!tekstletter,
- %\c!expansie, % njet
+ %\c!expansie, % why njet ?
\c!uitlijnen,\c!tolerantie,\c!nummercommando,\c!tekstcommando]}}%
\getparameters[\??ko#1][#2]%
\doifsomething{\getvalue{\??ko#1\c!sectie}}
@@ -1452,8 +1669,9 @@
\c!nummer,\c!eigennummer,\c!plaatskop,\c!verhoognummer,
\c!letter,\c!kleur,\c!afstand,\c!variant,\c!springvolgendein,
%\c!nummerletter,\c!tekstletter,
- %\c!expansie, % njet
+ %\c!expansie, % why njet ?
\c!uitlijnen,\c!tolerantie,\c!nummercommando,\c!tekstcommando]%
+\getparameters[\??ko#1][\c!expansie=]% iig een value, rather fuzzy
\definieermarkering[#1][#2]%
\definieermarkering[#1\v!nummer][#2\v!nummer]%
\doifundefined{\??li#1}{\definieerlijst[#1][#2]}}}%
@@ -1490,7 +1708,7 @@
\def\@@plaatskop{\plaatskopnormaal}
-\def\dostelkopvariantin[#1]%
+\def\dostelkopvariantin[#1]% will be installable ! ! ! ! ! !
{\displaysectionheadtrue
\processaction
[#1]
@@ -1504,12 +1722,10 @@
\def\dostelkoppenin[#1]%
{\getparameters[\??ko][#1]%
- \doifelse{\@@kosectienummer}{\v!ja}
- {\sectienummertrue}
- {\sectienummerfalse}%
- \dostelkopvariantin[\@@kovariant]}
+ \doifelse{\@@kosectienummer}\v!ja\sectienummertrue\sectienummerfalse
+ \dostelkopvariantin[\@@kovariant]} % not really needed here
-\def\stelkoppenin%
+\def\stelkoppenin
{\dosingleargument\dostelkoppenin}
\def\systemsuppliedchapter {\getvalue{\v!hoofdstuk}}
@@ -1688,8 +1904,7 @@
\stellijstin
[\v!deel]
- [\c!breedte=0em,
- \c!voor={\blanko\pagina[\v!voorkeur]},
+ [\c!voor={\blanko\pagina[\v!voorkeur]},
\c!na=\blanko,
\c!label=\v!ja,
\c!scheider=:,
@@ -1697,29 +1912,16 @@
\stellijstin
[\v!hoofdstuk]
- [\c!breedte=2em,
- \c!voor={\blanko\pagina[\v!voorkeur]},
+ [\c!voor={\blanko\pagina[\v!voorkeur]},
\c!na=]
-\stellijstin
- [\v!paragraaf]
- [\c!breedte=3em]
-
-\stellijstin
- [\v!sub\v!paragraaf]
- [\c!breedte=4em]
-
-\stellijstin
- [\v!sub\v!sub\v!paragraaf]
- [\c!breedte=5em]
-
-\stellijstin
- [\v!sub\v!sub\v!sub\v!paragraaf]
- [\c!breedte=6em]
-
-\stellijstin
- [\v!sub\v!sub\v!sub\v!sub\v!paragraaf]
- [\c!breedte=7em]
+\stellijstin [\v!deel] [\c!breedte=0em]
+\stellijstin [\v!hoofdstuk] [\c!breedte=2em]
+\stellijstin [\v!paragraaf] [\c!breedte=3em]
+\stellijstin [\v!sub\v!paragraaf] [\c!breedte=4em]
+\stellijstin [\v!sub\v!sub\v!paragraaf] [\c!breedte=5em]
+\stellijstin [\v!sub\v!sub\v!sub\v!paragraaf] [\c!breedte=6em]
+\stellijstin [\v!sub\v!sub\v!sub\v!sub\v!paragraaf] [\c!breedte=7em]
% hm
@@ -1737,7 +1939,8 @@
\c!tekstscheider=\tfskip,
\c!status=\v!start,
\c!commando=,
- \c!letter=, % \v!normaal, % empty, otherwise conflict
+ \c!strut=\v!ja, % nieuw
+ \c!letter=, % \v!normaal, % empty, otherwise conflict
\c!kleur=]
\protect \endinput