summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-07-04 23:48:00 +0200
committerHans Hagen <pragma@wxs.nl>2012-07-04 23:48:00 +0200
commit083ba74a2e7a28ca940b62d37e9e976d26c824d3 (patch)
tree378aabeae69895bcade62599d37918a43e5c0af2 /tex
parentdf66a97a985e53b13a9b37963d8086384ca6ba04 (diff)
downloadcontext-083ba74a2e7a28ca940b62d37e9e976d26c824d3.tar.gz
beta 2012.07.04 23:48
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/cont-new.mkii2
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4145 -> 4142 bytes
-rw-r--r--tex/context/base/context-version.pngbin105624 -> 105888 bytes
-rw-r--r--tex/context/base/context.mkii2
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/math-ali.mkiv10
-rw-r--r--tex/context/base/mult-aux.mkiv78
-rw-r--r--tex/context/base/mult-sys.mkiv431
-rw-r--r--tex/context/base/pack-rul.mkiv4
-rw-r--r--tex/context/base/page-mul.mkiv3
-rw-r--r--tex/context/base/page-set.mkiv3
-rw-r--r--tex/context/base/spac-par.mkiv7
-rw-r--r--tex/context/base/status-files.pdfbin24469 -> 24502 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin182719 -> 182717 bytes
-rw-r--r--tex/context/base/status-mkiv.lua7
-rw-r--r--tex/context/base/strc-con.mkvi161
-rw-r--r--tex/context/base/strc-des.mkii2
-rw-r--r--tex/context/base/strc-des.mkvi20
-rw-r--r--tex/context/base/strc-enu.mkvi25
-rw-r--r--tex/context/base/strc-lab.mkiv239
-rw-r--r--tex/context/base/strc-not.mkvi43
-rw-r--r--tex/context/base/strc-reg.mkiv444
-rw-r--r--tex/context/base/supp-mat.mkiv46
-rw-r--r--tex/context/base/syst-aux.mkiv49
-rw-r--r--tex/context/base/tabl-ltb.mkiv2
-rw-r--r--tex/context/base/type-ini.mkvi2
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
28 files changed, 858 insertions, 728 deletions
diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii
index 95d396b14..1f6c6d8a3 100644
--- a/tex/context/base/cont-new.mkii
+++ b/tex/context/base/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2012.07.04 14:44}
+\newcontextversion{2012.07.04 23:48}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 7ba8675f5..d262e6821 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2012.07.04 14:44}
+\newcontextversion{2012.07.04 23:48}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index 508d9771d..7a28f0951 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png
index 088c7307e..962970781 100644
--- a/tex/context/base/context-version.png
+++ b/tex/context/base/context-version.png
Binary files differ
diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii
index ec464bdf8..af378d0ba 100644
--- a/tex/context/base/context.mkii
+++ b/tex/context/base/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2012.07.04 14:44}
+\edef\contextversion{2012.07.04 23:48}
%D For those who want to use this:
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index c0fc2ede4..29a2432db 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -25,7 +25,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2012.07.04 14:44}
+\edef\contextversion{2012.07.04 23:48}
%D For those who want to use this:
diff --git a/tex/context/base/math-ali.mkiv b/tex/context/base/math-ali.mkiv
index 57727b03a..ef82e9adb 100644
--- a/tex/context/base/math-ali.mkiv
+++ b/tex/context/base/math-ali.mkiv
@@ -33,7 +33,7 @@
\def\math_build_eqalign
{\scratchtoks\emptytoks
- \dorecurse{\mathalignmentparameter\c!m}\def\math_build_eqalign
+ \dorecurse{\mathalignmentparameter\c!m}\math_build_eqalign_step
\normalexpanded{\scratchtoks{\the\scratchtoks\the\c_math_align_c}}}
\def\math_build_eqalign_step
@@ -153,7 +153,7 @@
\newtoks \everymathalignment
\def\math_alignment_NR_indeed[#1][#2]%
- {\donestedformulanumber{#1}{#2}% to be tagged (better an attribute)
+ {\strc_formulas_place_number_nested{#1}{#2}% to be tagged (better an attribute)
\crcr
\dostoptagged % finish row
\noalign{\glet\math_alignment_NC\math_alignment_NC_first}} % noalign used for change state, conditional does not work here
@@ -260,7 +260,7 @@
\letvalue{\??mathalignmentvariant\v!middle}\plusthree
\def\math_align_NR_generic[#1][#2]%
- {\donestedformulanumber{#1}{#2}\crcr}
+ {\strc_formulas_place_number_nested{#1}{#2}\crcr}
%D \starttyping
%D \placeformula[eqn0]\startformula \startalign[n=1] a\NR \stopalign \stopformula See \in[eqn0]
@@ -882,10 +882,10 @@
\expandafter\mathbin
\else\ifdim\wd\scratchbox>\zeropoint
\endgroup
- \expandafter\expandafter\expandafter\mathrel
+ \doubleexpandafter\mathrel
\else
\endgroup
- \expandafter\expandafter\expandafter\firstofoneargument
+ \doubleexpandafter\firstofoneargument
\fi\fi}
\unexpanded\def\overset#1#2%
diff --git a/tex/context/base/mult-aux.mkiv b/tex/context/base/mult-aux.mkiv
index ec773f994..81b9b84c8 100644
--- a/tex/context/base/mult-aux.mkiv
+++ b/tex/context/base/mult-aux.mkiv
@@ -130,7 +130,7 @@
% End of experimental code.
\unexpanded\def\mult_interfaces_install_parameter_handler#1#2#3#4#5#6#7#8#9% inlining \csname*\endcsname is more efficient (#3 and #6 only)
- {\ifx#2\relax\let#2\empty\fi % it is hardly faster but produces less expansion tracing
+ {\ifx#2\relax\let#2\empty\fi % it is hardly faster but produces less expansion tracing
%\def#3##1{\csname#4{#1#2}{##1}\endcsname}%
\def#3##1{\csname\ifcsname#1#2:##1\endcsname#1#2:##1\else\expandafter#5\csname#1#2:\s!parent\endcsname{##1}\fi\endcsname}%
\def#4##1##2{\ifcsname##1:##2\endcsname##1:##2\else\expandafter#5\csname##1:\s!parent\endcsname{##2}\fi}%
@@ -248,65 +248,34 @@
\let\definehandlerparent\empty
-% \unexpanded\def\mult_interfaces_install_define_handler#1#2#3#4#5#6#7#8#9%
-% {\ifx#4\relax\let#4\empty\fi
-% \unexpanded\def#2{\dotripleempty#5}%
-% \newtoks#6%
-% \newtoks#7%
-% \def#5[##1][##2][##3]% [child][parent][settings] | [child][settings] | [child][parent] | [child]
-% {\let#9#4%
-% \edef#4{##1}%
-% \ifthirdargument
-% \the#6% predefine
-% \edef#8{##2}%
-% \mult_interfaces_get_parameters{#1#4:}[\s!parent=#1##2,##3]%
-% \else\ifsecondargument
-% \the#6% predefine
-% % \mult_check_for_assignment{##2}%
-% \expandafter\mult_check_for_assignment_indeed\detokenize{##2}=@@\_end_
-% \ifassignment
-% \let#8\empty
-% \mult_interfaces_get_parameters{#1#4:}[\s!parent=#3,##2]%
-% \else
-% \edef#8{##2}%
-% \mult_interfaces_get_parameters{#1#4:}[\s!parent=#1##2]%
-% \fi
-% \else
-% \the#6% predefine
-% \let#8\empty
-% \mult_interfaces_get_parameters{#1#4:}[\s!parent=#3]%
-% \fi\fi
-% \the#7%
-% \let#4#9}}
-
\unexpanded\def\mult_interfaces_install_define_handler#1#2#3#4#5#6#7#8#9%
{\ifx#4\relax\let#4\empty\fi
\unexpanded\def#2{\dotripleempty#5}%
\newtoks#6%
\newtoks#7%
- \def#5[##1][##2][##3]% [child][parent][settings] | [child][settings] | [child][parent] | [child]
+ \unexpanded\def#5[##1][##2][##3]% [child][parent][settings] | [child][settings] | [child][parent] | [child]
{\let#9#4%
\edef#4{##1}%
\ifthirdargument
\the#6% predefine
\edef#8{##2}%
- \expandafter\edef\csname#1#4:\s!parent\endcsname{#1##2}% was \def
+ \expandafter\edef\csname#1#4:\s!parent\endcsname{#1##2}%
\mult_interfaces_get_parameters{#1#4:}[##3]%
\else\ifsecondargument
\the#6% predefine
\expandafter\mult_check_for_assignment_indeed\detokenize{##2}=@@\_end_
\ifassignment
\let#8\empty
- \expandafter\def\csname#1#4:\s!parent\endcsname{#3}% maybe \edef is more efficient
+ \expandafter\edef\csname#1#4:\s!parent\endcsname{#3}%
\mult_interfaces_get_parameters{#1#4:}[##2]%
\else
\edef#8{##2}%
- \expandafter\edef\csname#1#4:\s!parent\endcsname{#1##2}% was \def
+ \expandafter\edef\csname#1#4:\s!parent\endcsname{#1##2}%
\fi
\else
\the#6% predefine
\let#8\empty
- \expandafter\def\csname#1#4:\s!parent\endcsname{#3}% maybe \edef is more efficient
+ \expandafter\edef\csname#1#4:\s!parent\endcsname{#3}%
\fi\fi
\the#7%
\let#4#9}}
@@ -330,7 +299,7 @@
\unexpanded\def#6{\mult_interfaces_get_parameters{#1#3:}}% no every ! don't change it
\newtoks#5%
\newtoks#8%
- \def#4[##1][##2]% maybe helper
+ \unexpanded\def#4[##1][##2]% maybe helper
{\let#7#3%
\ifsecondargument
\def\mult_interfaces_with_comma_list_element####1% we will have a simple one as well
@@ -374,7 +343,7 @@
\newtoks#8%
\newtoks#9%
\ifx#6\relax\let#6\empty\fi
- \def#4[##1][##2]% maybe helper
+ \unexpanded\def#4[##1][##2]% maybe helper
{\ifsecondargument % no commalist here
% \setuplayout[whatever][key=value]
\let#7#3%
@@ -386,8 +355,8 @@
\ifx#3#6\the#8\fi % only switchsetups if previous == current
\let#3#7%
\else\iffirstargument
-% \mult_check_for_assignment{##1}%
-\expandafter\mult_check_for_assignment_indeed\detokenize{##1}=@@\_end_
+ % \mult_check_for_assignment{##1}%
+ \expandafter\mult_check_for_assignment_indeed\detokenize{##1}=@@\_end_
\ifassignment
% \setuplayout[key=value]
\let#7#3%
@@ -436,33 +405,6 @@
\expandafter\noexpand\csname everyswitch#2\endcsname
\expandafter\noexpand\csname everysetup#2root\endcsname}}
-% \unexpanded\def\mult_interfaces_install_auto_setup_handler#1#2#3#4#5#6#7#8%
-% {\ifx#3\relax\let#3\empty\fi
-% \unexpanded\def#2{\dotripleempty#4}%
-% \unexpanded\def#6{\mult_interfaces_get_parameters{#1#3:}}%
-% \newtoks#5%
-% \def#4[##1][##2][##3]%
-% {\let#8#3%
-% \ifthirdargument
-% \def\mult_interfaces_with_comma_list_element####1%
-% {\edef#3{####1}%
-% \mult_interfaces_get_parameters{#1#3:}[\s!parent=#1##2,##3]% always sets parent
-% \the#5}%
-% \processcommalist[##1]\mult_interfaces_with_comma_list_element
-% \else\ifsecondargument
-% \def\mult_interfaces_with_comma_list_element####1%
-% {\edef#3{####1}%
-% #7% checks parent and sets if needed
-% \mult_interfaces_get_parameters{#1#3:}[##2]%
-% \the#5}%
-% \processcommalist[##1]\mult_interfaces_with_comma_list_element
-% \else
-% \let#3\empty
-% \mult_interfaces_get_parameters{#1:}[##1]%
-% \the#5%
-% \fi\fi
-% \let#3#8}}
-
\unexpanded\def\mult_interfaces_install_auto_setup_handler#1#2#3#4#5#6#7#8%
{\ifx#3\relax\let#3\empty\fi
\unexpanded\def#2{\dotripleempty#4}%
diff --git a/tex/context/base/mult-sys.mkiv b/tex/context/base/mult-sys.mkiv
index 46d321632..fdeff699d 100644
--- a/tex/context/base/mult-sys.mkiv
+++ b/tex/context/base/mult-sys.mkiv
@@ -11,20 +11,19 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D In boring module we define a lot of obscure but useful
-%D system constants. By doing so we save lots of memory while
-%D at the same time we prevent ourself from typing errors.
+%D In boring module we define a lot of obscure but useful system constants.
+%D By doing so we save lots of memory while at the same time we prevent
+%D ourself making typing errors.
\writestatus{loading}{ConTeXt Multilingual Macros / System}
\unprotect
-%D This file is mostly the same as the \MKII\ variant but we
-%D keep extending \MKIV, so it was bout time to have a dedicated
-%D variant.
+%D This file is mostly the same as the \MKII\ variant but we keep extending
+%D \MKIV, so it was bout time to have a dedicated variant.
%D
-%D The constants are grouped in such a way that there is a
-%D minimal change of conflicts.
+%D The constants are grouped in such a way that there is a minimal change of
+%D conflicts.
%D
%D \starttyping
%D \definesystemconstants {word}
@@ -36,8 +35,8 @@
\definesystemconstant {hans}
\definesystemconstant {taco}
-%D First we define some system constants used for both the
-%D multi||lingual interface and multi||linguag typesetting.
+%D First we define some system constants used for both the multi||lingual
+%D interface and multi||linguag typesetting.
\definesystemconstant {afrikaans} \definesystemconstant {af}
\definesystemconstant {arabic} \definesystemconstant {ar}
@@ -83,8 +82,7 @@
\definesystemconstant {japanese} \definesystemconstant {ja}
\definesystemconstant {korean} \definesystemconstant {kr}
-%D For proper \UNICODE\ support we need a few font related
-%D constants.
+%D For proper \UNICODE\ support we need a few font related constants.
\definesystemconstant {BoldItalic}
\definesystemconstant {BoldSlanted}
@@ -115,7 +113,7 @@
\definesystemconstant {SerifSlanted}
\definesystemconstant {SerifBoldSlanted}
\definesystemconstant {SerifCaps}
-% \definesystemconstant {SerifCapsSlanted}
+%definesystemconstant {SerifCapsSlanted}
\definesystemconstant {Sans}
\definesystemconstant {SansBold}
@@ -220,174 +218,173 @@
\definesystemconstant {second}
\definesystemconstant {third}
-%D Net come some \CONTEXT\ constants, used in the definition
-%D of private commands:
-
-\definesystemconstant {tex}
-\definesystemconstant {xml}
-\definesystemconstant {lua}
-
-\definesystemconstant {next}
-\definesystemconstant {pickup}
-\definesystemconstant {ascii}
-\definesystemconstant {default}
-\definesystemconstant {unknown}
-\definesystemconstant {action}
-\definesystemconstant {compare}
-\definesystemconstant {do}
-\definesystemconstant {dodo}
-\definesystemconstant {complex}
-\definesystemconstant {simple}
-\definesystemconstant {start}
-\definesystemconstant {stop}
-\definesystemconstant {dummy}
-\definesystemconstant {local}
-\definesystemconstant {global}
-\definesystemconstant {done}
-\definesystemconstant {font}
-\definesystemconstant {link}
-\definesystemconstant {parent}
-\definesystemconstant {child}
-\definesystemconstant {clone}
-\definesystemconstant {section}
-\definesystemconstant {handler}
-\definesystemconstant {counter}
-\definesystemconstant {single}
-\definesystemconstant {multi}
-\definesystemconstant {indeed}
-
-\definesystemconstant {hasnumber}
-\definesystemconstant {hastitle}
-\definesystemconstant {hascaption}
-\definesystemconstant {haslevel}
-
-\definesystemconstant {mkiv}
-\definesystemconstant {mkii}
-
-\definesystemconstant {normal}
-\definesystemconstant {bold}
-\definesystemconstant {italic}
-\definesystemconstant {slanted}
-
-\definesystemconstant {default}
-\definesystemconstant {smallcaps}
-
-\definesystemconstant {run}
-
-\definesystemconstant {mode}
-\definesystemconstant {setup}
-\definesystemconstant {environment}
-\definesystemconstant {document}
-
-%definesystemconstant {fam}
-\definesystemconstant {text}
-\definesystemconstant {script}
-\definesystemconstant {scriptscript}
-
-\definesystemconstant {lefthyphenmin}
-\definesystemconstant {righthyphenmin}
-\definesystemconstant {lefthyphenchar}
-\definesystemconstant {righthyphenchar}
-
-%definesystemconstant {skewchar}
-%definesystemconstant {hyphenchar}
-\definesystemconstant {catcodes}
-%definesystemconstant {encoding}
-%definesystemconstant {entities}
-%definesystemconstant {resource}
-%definesystemconstant {mapping}
-\definesystemconstant {language}
-\definesystemconstant {patterns}
-\definesystemconstant {rname}
-\definesystemconstant {rscale}
-%definesystemconstant {handling}
-\definesystemconstant {features}
-\definesystemconstant {direction}
-\definesystemconstant {fallbacks}
-\definesystemconstant {goodies}
-\definesystemconstant {designsize}
-%definesystemconstant {background}
-%definesystemconstant {ucmap}
-
-%definesystemconstant {property}
-%definesystemconstant {overprint}
-%definesystemconstant {layer}
-\definesystemconstant {effect} % todo s
-%definesystemconstant {negative}
-%definesystemconstant {color}
-%definesystemconstant {transparency}
-
-\definesystemconstant {black}
-\definesystemconstant {white}
-
-\definesystemconstant {system} % not yet interfaces messages
-\definesystemconstant {user}
-\definesystemconstant {check}
-\definesystemconstant {reset}
-\definesystemconstant {set}
-\definesystemconstant {empty}
-
-\definesystemconstant {realpage}
-\definesystemconstant {userpage}
-\definesystemconstant {subpage}
-
-\definesystemconstant {page}
-\definesystemconstant {subpage}
-\definesystemconstant {leftpage}
-\definesystemconstant {rightpage}
-\definesystemconstant {somewhere}
-
-\definesystemconstant {userdata}
-\definesystemconstant {command}
-\definesystemconstant {simple}
-
-\definesystemconstant {full}
-\definesystemconstant {text}
-\definesystemconstant {paragraph}
-\definesystemconstant {margintext}
-\definesystemconstant {line}
-
-\definesystemconstant {number}
-\definesystemconstant {symbol}
-\definesystemconstant {format}
-\definesystemconstant {data}
-\definesystemconstant {float}
-\definesystemconstant {extensions}
-\definesystemconstant {initializations}
-
-\definesystemconstant {rgb}
-\definesystemconstant {cmyk}
-\definesystemconstant {gray}
-\definesystemconstant {spot}
-\definesystemconstant {all}
-\definesystemconstant {dtp}
-\definesystemconstant {none}
-
-\definesystemconstant {map}
-\definesystemconstant {special}
-\definesystemconstant {size}
-
-\definesystemconstant {depth}
-\definesystemconstant {nodepth}
+%D Next come some \CONTEXT\ constants, used in the definition of private commands:
+
+\definesystemconstant {tex}
+\definesystemconstant {xml}
+\definesystemconstant {lua}
+
+\definesystemconstant {next}
+\definesystemconstant {pickup}
+\definesystemconstant {ascii}
+\definesystemconstant {default}
+\definesystemconstant {unknown}
+\definesystemconstant {action}
+\definesystemconstant {compare}
+\definesystemconstant {do}
+\definesystemconstant {dodo}
+\definesystemconstant {complex}
+\definesystemconstant {simple}
+\definesystemconstant {start}
+\definesystemconstant {stop}
+\definesystemconstant {dummy}
+\definesystemconstant {local}
+\definesystemconstant {global}
+\definesystemconstant {done}
+\definesystemconstant {font}
+\definesystemconstant {link}
+\definesystemconstant {parent}
+\definesystemconstant {child}
+\definesystemconstant {clone}
+\definesystemconstant {section}
+\definesystemconstant {handler}
+\definesystemconstant {counter}
+\definesystemconstant {single}
+\definesystemconstant {multi}
+\definesystemconstant {indeed}
+
+\definesystemconstant {hasnumber}
+\definesystemconstant {hastitle}
+\definesystemconstant {hascaption}
+\definesystemconstant {haslevel}
+
+\definesystemconstant {mkiv}
+\definesystemconstant {mkii}
+
+\definesystemconstant {normal}
+\definesystemconstant {bold}
+\definesystemconstant {italic}
+\definesystemconstant {slanted}
+
+\definesystemconstant {default}
+\definesystemconstant {smallcaps}
+
+\definesystemconstant {run}
+
+\definesystemconstant {mode}
+\definesystemconstant {setup}
+\definesystemconstant {environment}
+\definesystemconstant {document}
+
+%definesystemconstant {fam}
+\definesystemconstant {text}
+\definesystemconstant {script}
+\definesystemconstant {scriptscript}
+
+\definesystemconstant {lefthyphenmin}
+\definesystemconstant {righthyphenmin}
+\definesystemconstant {lefthyphenchar}
+\definesystemconstant {righthyphenchar}
+
+%definesystemconstant {skewchar}
+%definesystemconstant {hyphenchar}
+\definesystemconstant {catcodes}
+%definesystemconstant {encoding}
+%definesystemconstant {entities}
+%definesystemconstant {resource}
+%definesystemconstant {mapping}
+\definesystemconstant {language}
+\definesystemconstant {patterns}
+\definesystemconstant {rname}
+\definesystemconstant {rscale}
+%definesystemconstant {handling}
+\definesystemconstant {features}
+\definesystemconstant {direction}
+\definesystemconstant {fallbacks}
+\definesystemconstant {goodies}
+\definesystemconstant {designsize}
+%definesystemconstant {background}
+%definesystemconstant {ucmap}
+
+%definesystemconstant {property}
+%definesystemconstant {overprint}
+%definesystemconstant {layer}
+\definesystemconstant {effect} % todo s
+%definesystemconstant {negative}
+%definesystemconstant {color}
+%definesystemconstant {transparency}
+
+\definesystemconstant {black}
+\definesystemconstant {white}
+
+\definesystemconstant {system} % not yet interfaces messages
+\definesystemconstant {user}
+\definesystemconstant {check}
+\definesystemconstant {reset}
+\definesystemconstant {set}
+\definesystemconstant {empty}
+
+\definesystemconstant {realpage}
+\definesystemconstant {userpage}
+\definesystemconstant {subpage}
+
+\definesystemconstant {page}
+\definesystemconstant {subpage}
+\definesystemconstant {leftpage}
+\definesystemconstant {rightpage}
+\definesystemconstant {somewhere}
+
+\definesystemconstant {userdata}
+\definesystemconstant {command}
+\definesystemconstant {simple}
+
+\definesystemconstant {full}
+\definesystemconstant {text}
+\definesystemconstant {paragraph}
+\definesystemconstant {margintext}
+\definesystemconstant {line}
+
+\definesystemconstant {number}
+\definesystemconstant {symbol}
+\definesystemconstant {format}
+\definesystemconstant {data}
+\definesystemconstant {float}
+\definesystemconstant {extensions}
+\definesystemconstant {initializations}
+
+\definesystemconstant {rgb}
+\definesystemconstant {cmyk}
+\definesystemconstant {gray}
+\definesystemconstant {spot}
+\definesystemconstant {all}
+\definesystemconstant {dtp}
+\definesystemconstant {none}
+
+\definesystemconstant {map}
+\definesystemconstant {special}
+\definesystemconstant {size}
+
+\definesystemconstant {depth}
+\definesystemconstant {nodepth}
%D Just to be complete we define the standard \TEX\ units.
-\definesystemconstant {cm}
-\definesystemconstant {em}
-\definesystemconstant {ex}
-\definesystemconstant {mm}
-\definesystemconstant {pt}
-\definesystemconstant {sp}
-\definesystemconstant {bp}
-\definesystemconstant {in}
-\definesystemconstant {pc}
-\definesystemconstant {dd}
-\definesystemconstant {cc}
-\definesystemconstant {nd}
-\definesystemconstant {nc}
-
-%D As the name of their define command states, the next set of
-%D constants is used in the message macro's.
+\definesystemconstant {cm}
+\definesystemconstant {em}
+\definesystemconstant {ex}
+\definesystemconstant {mm}
+\definesystemconstant {pt}
+\definesystemconstant {sp}
+\definesystemconstant {bp}
+\definesystemconstant {in}
+\definesystemconstant {pc}
+\definesystemconstant {dd}
+\definesystemconstant {cc}
+\definesystemconstant {nd}
+\definesystemconstant {nc}
+
+%D As the name of their define command states, the next set of constants is used in
+%D the message macro's.
\definemessageconstant {check}
\definemessageconstant {colors}
@@ -415,9 +412,8 @@
\definemessageconstant {chemicals}
\definemessageconstant {publications}
-%D When we use numbers and dimensions the same applies as
-%D with the keywords like \type{width} and \type{plus}
-%D mentioned earlier.
+%D When we use numbers and dimensions the same applies as with the keywords like
+%D \type {width} and \type {plus} mentioned earlier.
\def\!!ten {10}
\def\!!twelve {12}
@@ -447,31 +443,12 @@
\def\__unknown__ {\string\\//} % unlikely value
-%D Variables are composed of a command specific tag and a user
-%D supplied variable (system constant). The first tag \type{ag}
-%D for instance is available as \type{\??ag} and expands to
-%D \type{@@ag} in composed variables.
+%D Variables are composed of a command specific tag and a user supplied variable
+%D (system constant). The tag \type {du} for instance is available as \type {\??du}
+%D and expands to \type {@@du} in composed variables.
\definesystemvariable {du} % dummy, will stay
-% these will be replaced by namespaces / commandhandlers
-
-\definesystemvariable {db} % Labels
-\definesystemvariable {dd} % DoorDefinieren
-\definesystemvariable {id} % Index
-
-\definesystemvariable {kl} % KoLommen
-\definesystemvariable {ks} % KolomSpan
-\definesystemvariable {mc} % MultiColumn
-\definesystemvariable {mt} % MulTicolumn
-
-\definesystemvariable {fc} % FramedContent
-\definesystemvariable {od} % Omlijnd Defaults (simple)
-\definesystemvariable {oi} % OmlijndInstellingen
-\definesystemvariable {ol} % OmLijnd
-
-\definesystemvariable {le} % LinetablE
-
% bibl:
\definesystemvariable {pv} % PublicationVariable
@@ -495,17 +472,8 @@
\definesystemvariable {fo} % xml FO (xtag)
\definesystemvariable {fx} % FoXet
-% still used but defined locally
-
-\definesystemvariable {ts} % TypeScript
-
-% obsolete but kept for a while (core-obs)
-
-\definesystemvariable {fr} % Division
-
-%D Next we define some language independant one letter
-%D variables and keywords. We can actually make these
-%D system variables.
+%D Next we define some language independant one letter variables and keywords. We can
+%D actually make these system variables.
\defineinterfaceconstant {x} {x}
\defineinterfaceconstant {y} {y}
@@ -555,10 +523,9 @@
\def\v!oddeven#1{\ifodd#1\v!odd\else\v!even\fi}
-%D The names of files and their extensions are fixed.
-%D \CONTEXT\ uses as less files as possible. Utility files can
-%D be recognized by the first two characters of the extension:
-%D \type{tu}.
+%D The names of files and their extensions are fixed. \CONTEXT\ uses as less
+%D files as possible. Utility files can be recognized by the first two
+%D characters of the extension: \type {tu}.
%definefileconstant {utilityfilename} {texutil}
%definefileconstant {blockextension} {tub}
@@ -572,10 +539,9 @@
%definefileconstant {fontmapextension} {map}
\definefileconstant {bibextension} {bbl}
-%D These files are loaded at start||up. They may contain system
-%D specific setups (or calls to other files), old macro's, to
-%D garantee compatibility and new macro's noy yet present in
-%D the format.
+%D These files are loaded at start||up. They may contain system specific setups (or
+%D calls to other files), old macro's, to garantee compatibility and new macro's noy
+%D yet present in the format.
\definefileconstant {errfilename} {cont-err}
\definefileconstant {sysfilename} {cont-sys}
@@ -583,9 +549,8 @@
\definefileconstant {locfilename} {cont-loc}
\definefileconstant {expfilename} {cont-exp}
-%D The setup files for the language, font, color and special
-%D subsystems have a common prefix. This means that we have at
-%D most three characters for unique filenames.
+%D The setup files for the language, font, color and special subsystems have a common
+%D prefix. This means that we have at most three characters for unique filenames.
\definefileconstant {colorprefix} {colo-}
%definefileconstant {encodingprefix} {enco-}
@@ -644,20 +609,16 @@
%defineinterfaceconstant {tmp} {tmp}
%defineinterfaceconstant {cld} {cld}
-%D A careful reader will have noticed that in the module
-%D \type{mult-ini} we defined \type{\selectinterface}. We were
-%D not yet able to actually select an interface, because we
-%D still had to define the constants and variables. Now we've
-%D done so, selection is permitted.
+%D A careful reader will have noticed that in the module \type {mult-ini} we defined
+%D \type {\selectinterface}. We were not yet able to actually select an interface,
+%D because we still had to define the constants and variables. Now we've done so,
+%D selection is permitted.
\selectinterface
-%D Ok, here are some more, because we've got ouselves some
-%D extensions to \CONTEXT.
+%D Ok, here are some more, because we've got ouselves some extensions to \CONTEXT.
\definemessageconstant {addresses}
\definemessageconstant {documents}
-\protect
-
-\endinput
+\protect \endinput
diff --git a/tex/context/base/pack-rul.mkiv b/tex/context/base/pack-rul.mkiv
index e0be2db13..2803cd518 100644
--- a/tex/context/base/pack-rul.mkiv
+++ b/tex/context/base/pack-rul.mkiv
@@ -26,6 +26,10 @@
\unprotect
+\definesystemvariable {fc} % FramedContent
+\definesystemvariable {od} % Omlijnd Defaults (simple) -> check page-bck too
+\definesystemvariable {ol} % OmLijnd -> check scrn-fld too
+
%D \macros
%D {linewidth, setuplinewidth}
%D
diff --git a/tex/context/base/page-mul.mkiv b/tex/context/base/page-mul.mkiv
index e22ecd0a3..2d0593884 100644
--- a/tex/context/base/page-mul.mkiv
+++ b/tex/context/base/page-mul.mkiv
@@ -25,6 +25,9 @@
\unprotect
+\definesystemvariable {kl} % KoLommen
+\definesystemvariable {ks} % KolomSpan
+
\unexpanded\def\page_mul_command_side_float_output
{\page_otr_construct_and_shipout\unvbox\normalpagebox}
diff --git a/tex/context/base/page-set.mkiv b/tex/context/base/page-set.mkiv
index 79a2fb211..c74c397e8 100644
--- a/tex/context/base/page-set.mkiv
+++ b/tex/context/base/page-set.mkiv
@@ -29,6 +29,9 @@
\unprotect
+\definesystemvariable {mc} % MultiColumn
+\definesystemvariable {mt} % MulTicolumn
+
\newcount\tofcolumns % total
\newcount\lofcolumns % left
\newcount\rofcolumns % right
diff --git a/tex/context/base/spac-par.mkiv b/tex/context/base/spac-par.mkiv
index af032a145..6b7ed4f7d 100644
--- a/tex/context/base/spac-par.mkiv
+++ b/tex/context/base/spac-par.mkiv
@@ -203,4 +203,11 @@
\fi
\glet\flushpostponednodedata\relax}
+\unexpanded\def\doflushatpar
+ {\ifvmode
+ \expandafter\flushatnextpar
+ \else
+ \expandafter\firstofoneargument
+ \fi}
+
\protect \endinput
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index ccdffb40f..9108cfcaf 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index 4c6aa1ef2..f2ba08cc9 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/status-mkiv.lua b/tex/context/base/status-mkiv.lua
index d5c2f72eb..9f50a7745 100644
--- a/tex/context/base/status-mkiv.lua
+++ b/tex/context/base/status-mkiv.lua
@@ -463,8 +463,8 @@ return {
{
filename = "pack-rul",
marktype = "mkiv",
- status = "okay",
- comment = "namespace to be done",
+ status = "todo",
+ comment = "only namespace to be done",
},
{
filename = "pack-mrl",
@@ -673,7 +673,8 @@ return {
{
filename = "strc-lab",
marktype = "mkiv",
- status = "todo",
+ status = "okay",
+ comment = "needs to be adapted when strc-con/des/enu changes",
},
{
filename = "core-sys",
diff --git a/tex/context/base/strc-con.mkvi b/tex/context/base/strc-con.mkvi
index a795b429c..16cc16bbb 100644
--- a/tex/context/base/strc-con.mkvi
+++ b/tex/context/base/strc-con.mkvi
@@ -68,9 +68,9 @@
%
\c!alternative=\v!left,
\c!display=\v!yes,
- \c!width=7em,
- \c!distance=1em,
- \c!titledistance=0.5em,
+ \c!width=7\emwidth,
+ \c!distance=\emwidth,
+ \c!titledistance=.5\emwidth,
%c!hang=,
%c!sample=,
\c!margin=\v!no,
@@ -152,7 +152,7 @@
\unexpanded\def\strc_constructions_initialize#1% class instance
{\edef\currentconstruction{#1}%
-\let\currentconstructionlistentry\!!zerocount
+ \let\currentconstructionlistentry\!!zerocount
\expandafter\let\expandafter\currentconstructionmain \csname\??constructionmain \currentconstruction\endcsname
\expandafter\let\expandafter\currentconstructionlevel \csname\??constructionlevel\currentconstruction\endcsname
\expandafter\let\expandafter\currentconstructionhandler\csname\??constructionclass\currentconstruction\endcsname
@@ -165,11 +165,11 @@
\newconditional\c_strc_constructions_number_state
\newconditional\c_strc_constructions_title_state
-\setvalue{\??constructioninitializer\v!construction}%
+\unexpanded\setvalue{\??constructioninitializer\v!construction}%
{\setfalse\c_strc_constructions_number_state
\setfalse\c_strc_constructions_title_state}
-\setvalue{\??constructionfinalizer\v!construction}%
+\unexpanded\setvalue{\??constructionfinalizer\v!construction}%
{}
% We keep the command variant around but rather would move to the
@@ -188,10 +188,10 @@
\unexpanded\def\currentconstructionsample
{\begstrut
\constructionparameter\c!text
- \constructionparameter\c!sample
+ \p_strc_constructions_sample
\endstrut}
-\setvalue{\??constructionmainhandler\v!construction}#1%
+\unexpanded\setvalue{\??constructionmainhandler\v!construction}#1%
{\iftrialtypesetting \else
\begingroup
\currentconstructionsynchronize % reinstated
@@ -200,7 +200,7 @@
\endgroup
\fi#1}
-\setvalue{\??constructiontexthandler\v!construction}%
+\unexpanded\setvalue{\??constructiontexthandler\v!construction}%
{\begingroup
\useconstructionstyleandcolor\c!headstyle\c!headcolor % move to \currentconstructiontext
\the\everyconstruction
@@ -222,36 +222,54 @@
\def\resetconstructions % to be used in e.g. footnotes
{\c_strc_constructions_nested_state\zerocount}
-\setvalue{\??constructioncommandhandler\v!construction}%
+\unexpanded\setvalue{\??constructioncommandhandler\v!construction}%
{\endgroup}
-\setvalue{\??constructionstarthandler\v!construction}% this will be redone (reorganized) .. too much boxing
+\let\p_strc_constructions_sample \empty
+\let\p_strc_constructions_align \empty
+\let\p_strc_constructions_indenting \empty
+\let\p_strc_constructions_width \empty
+\let\p_strc_constructions_aligntitle \empty
+\let\p_strc_constructions_renderingsetup\empty
+\let\p_strc_constructions_headalign \empty
+\let\p_strc_constructions_hang \empty
+\let\p_strc_constructions_inbetween \empty
+\let\p_strc_constructions_closesymbol \empty
+
+\unexpanded\setvalue{\??constructionstarthandler\v!construction}% this will be redone (reorganized) .. too much boxing
{\dostarttagged\t!construction\currentconstruction
\dotagsetconstruction
\constructionparameter\c!before
\begingroup
\edef\currentconstructionalternative{\constructionparameter\c!alternative}%
% \checkconstructionalternativeparent % this catches an unknown alternative
- \doifnotsetups{\constructionalternativeparameter\c!renderingsetup}
+ \edef\p_strc_constructions_renderingsetup{\constructionalternativeparameter\c!renderingsetup}%
+ \doifnotsetups\p_strc_constructions_renderingsetup
{\letconstructionparameter\c!alternative\v!left
\let\currentconstructionalternative\v!left}%
\doadaptleftskip{\constructionparameter\c!margin}%
\setlocalhsize % so we can use \localhsize in width assignments
\constructionsheaddistance\constructionalternativeparameter\c!distance\relax
+ \edef\p_strc_constructions_width{\constructionalternativeparameter\c!width}%
\ifdim\constructionsheaddistance=\zeropoint
- \doif{\constructionalternativeparameter\c!width}\v!broad{\constructionsheaddistance\emwidth}%
+ \ifx\p_strc_constructions_width\v!broad
+ \constructionsheaddistance\emwidth
+ \fi
\fi
% inefficient and not always needed, for instance not with margins so we will make checkers
- % per alternative
+ % per alternative some day (especially in labels this is unwanted overhead)
\setbox\constructionheadbox\hbox
{\forgetall
\dontcomplain
\settrialtypesetting
- \doifelsenothing{\constructionparameter\c!sample}
- {\csname\??constructionmainhandler\currentconstructionhandler\endcsname\currentconstructiontext}%
- {\csname\??constructionmainhandler\currentconstructionhandler\endcsname\currentconstructionsample}}%
+ \edef\p_strc_constructions_sample{\constructionparameter\c!sample}%
+ \ifx\p_strc_constructions_sample\empty
+ \csname\??constructionmainhandler\currentconstructionhandler\endcsname\currentconstructiontext
+ \else
+ \csname\??constructionmainhandler\currentconstructionhandler\endcsname\currentconstructionsample
+ \fi}%
\assignwidth
- {\constructionalternativeparameter\c!width}
+ \p_strc_constructions_width
\constructionsheadwidth
{\unhcopy\constructionheadbox}
\constructionsheaddistance
@@ -264,15 +282,24 @@
\else
\csname\??constructionmainhandler\currentconstructionhandler\endcsname{\boxedconstructionhead\currentconstructiontext}%
\fi}%
- \doifelse{\constructionparameter\c!aligntitle}\v!no
- {\leftconstructionskip \leftskip
- \rightconstructionskip\rightskip}
- {\ifcase\c_strc_constructions_nested_state
- \leftconstructionskip \leftskip
- \rightconstructionskip\rightskip
- \fi}%
- \doifsomething{\constructionparameter\c!align}{\setupalign[\constructionparameter\c!align]}% \use...
- \indenting[\constructionparameter\c!indenting]% \use...
+ \edef\p_strc_constructions_aligntitle{\constructionparameter\c!aligntitle}%
+ \ifx\p_strc_constructions_aligntitle\v!no
+ \leftconstructionskip \leftskip
+ \rightconstructionskip\rightskip
+ \else
+ \ifcase\c_strc_constructions_nested_state
+ \leftconstructionskip \leftskip
+ \rightconstructionskip\rightskip
+ \fi
+ \fi
+ \edef\p_strc_constructions_align{\constructionparameter\c!align}%
+ \ifx\p_strc_constructions_align\empty \else
+ \setupalign[\p_strc_constructions_align]% \use...
+ \fi
+ \edef\p_strc_constructions_indenting{\constructionparameter\c!indenting}%
+ \ifx\p_strc_constructions_indenting\empty \else
+ \indenting[\p_strc_constructions_indenting]% \use...
+ \fi
\ifcase\c_strc_constructions_nested_state
\c_strc_constructions_nested_state\plusone
\or
@@ -280,15 +307,15 @@
\fi
\strc_constructions_close_symbol_reset
%
- % \doifnotsetups {\constructionalternativeparameter\c!renderingsetup}
- % {\let\currentconstructionalternative\v!left}%
- \directsetup{\constructionalternativeparameter\c!renderingsetup}\relax
+ \edef\p_strc_constructions_headalign{\constructionparameter\c!headalign}%
+ %
+ \directsetup\p_strc_constructions_renderingsetup\relax
%
\dostoptagged % tag
\dostarttagged\t!constructioncontent\empty
\ignorespaces} % args not needed
-\setvalue{\??constructionstophandler\v!construction}%
+\unexpanded\setvalue{\??constructionstophandler\v!construction}%
{\strc_constructions_close_symbol_place
\doifnot{\constructionparameter\c!display}\v!no\par
\dostoptagged % content
@@ -300,10 +327,12 @@
% \endgroup
\dorechecknextindentation}
-\def\boxedconstructionhead#1%
+\unexpanded\def\boxedconstructionhead#1%
{\vtop
{\hsize\constructionsheadwidth
- \doifsomething{\constructionparameter\c!headalign}{\setupalign[\constructionparameter\c!headalign]}%
+ \ifx\p_strc_constructions_headalign\empty \else
+ \setupalign[\p_strc_constructions_headalign]% \use...
+ \fi
#1}}
\installcorenamespace{constructionalternative}
@@ -390,15 +419,14 @@
{\forgetall
\dontcomplain
\hsize\constructionsheadwidth
- \edef\p_headalign{\constructionparameter\c!headalign}%
- \ifx\p_headalign\empty
+ \ifx\p_strc_constructions_headalign\empty
\setupalign[#1]% use fast one
\else
- \setupalign[\p_headalign]% use fast one
+ \setupalign[\p_strc_constructions_headalign]% use fast one
\fi
\advance\ifx#1\v!flushleft\rightskip\else\leftskip\fi\constructionsheaddistance % only difference and wrong anyway
\ifhbox\constructionheadbox\unhcopy\else\copy\fi\constructionheadbox}%
-\setbox\constructionheadbox\hbox{\box\constructionheadbox}% needed in case of e.g. a real big head font, see descriptions-006.tex
+ \setbox\constructionheadbox\hbox{\box\constructionheadbox}% needed in case of e.g. a real big head font, see descriptions-006.tex
\ht\constructionheadbox\strutht
\dp\constructionheadbox\strutdp}
@@ -407,11 +435,10 @@
{\forgetall
\dontcomplain
\hsize\constructionsheadwidth
- \edef\p_headalign{\constructionparameter\c!headalign}%
- \ifx\p_headalign\empty
+ \ifx\p_strc_constructions_headalign\empty
\setupalign[#1]% use fast one
\else
- \setupalign[\p_headalign]% use fast one
+ \setupalign[\p_strc_constructions_headalign]% use fast one
\fi
\ifhbox\constructionheadbox\unhcopy\else\copy\fi\constructionheadbox}%
\setbox\constructionheadbox\hbox{\box\constructionheadbox}% needed in case of e.g. a real big head font, see descriptions-006.tex
@@ -419,18 +446,18 @@
\dp\constructionheadbox\strutdp}
\def\strc_constructions_set_hang#1%
- {\edef\p_hang{\constructionparameter\c!hang}%
- \ifx\p_hang\empty
- \else\ifx\p_hang\v!fit
+ {\ifx\p_strc_constructions_hang\empty
+ % nothing
+ \else\ifx\p_strc_constructions_hang\v!fit
\scratchdimen\htdp\constructionheadbox
\getnoflines\scratchdimen
\hangafter-\noflines
- \else\ifx\p_hang\v!broad
+ \else\ifx\p_strc_constructions_hang\v!broad
\scratchdimen\dimexpr\htdp\constructionheadbox+.5\strutht\relax
\getnoflines\scratchdimen
\hangafter-\noflines
\else
- \hangafter-\p_hang
+ \hangafter-\p_strc_constructions_hang
\fi\fi\fi
\relax
\hangindent\ifx#1\v!right-\fi\constructionsheadwidth}
@@ -439,18 +466,18 @@
% environment. The wrapping happens elsewhere.
\startsetups[\??constructionrenderings:\v!left]
- \edef\p_hang{\constructionparameter\c!hang}
- \doifsetupselse{\??constructionrenderings:\v!left:\p_hang} {
- \directsetup{\??constructionrenderings:\v!left:\p_hang}
+ \edef\p_strc_constructions_hang{\constructionparameter\c!hang}%
+ \doifsetupselse{\??constructionrenderings:\v!left:\p_strc_constructions_hang} {
+ \directsetup{\??constructionrenderings:\v!left:\p_strc_constructions_hang}
} {
\directsetup{\??constructionrenderings:\v!left:\v!hanging}
}
\stopsetups
\startsetups[\??constructionrenderings:\v!right]
- \edef\p_hang{\constructionparameter\c!hang}
- \doifsetupselse{\??constructionrenderings:\v!right:\p_hang} {
- \directsetup{\??constructionrenderings:\v!right:\p_hang}
+ \edef\p_strc_constructions_hang{\constructionparameter\c!hang}
+ \doifsetupselse{\??constructionrenderings:\v!right:\p_strc_constructions_hang} {
+ \directsetup{\??constructionrenderings:\v!right:\p_strc_constructions_hang}
} {
\directsetup{\??constructionrenderings:\v!right:\v!hanging}
}
@@ -460,9 +487,8 @@
\let\\=\crlf
\noindent
\strc_constructions_set_pure_box\v!flushleft
- \leftskip\dimexpr\leftconstructionskip+\constructionsheadwidth\relax
- \rightskip\rightconstructionskip
- \advance\leftskip\constructionsheaddistance
+ \leftskip\dimexpr\leftconstructionskip+\constructionsheadwidth+\constructionsheaddistance\relax
+ \rightskip\rightconstructionskip\relax
\llap {
\hbox to \leftskip {
\hskip\leftconstructionskip
@@ -574,10 +600,15 @@
\dohandlepagebreakX\plusone
\let\\=\space
\noindent
- \copy\constructionheadbox\par % copy ?
- \nobreak
- \doifelsenothing{\constructionparameter\c!inbetween}{\blank}{\constructionparameter\c!inbetween}%
+ \copy\constructionheadbox % why copy ?
+ \par
\nobreak
+ \edef\p_strc_constructions_inbetween{\constructionparameter\c!inbetween}%
+ \ifx\p_strc_constructions_inbetween\empty \else
+ \p_strc_constructions_inbetween
+ \par
+ \nobreak
+ \fi
\useconstructionstyleandcolor\c!style\c!color
\ignorespaces
\stopsetups
@@ -637,9 +668,9 @@
\stopsetups
\startsetups[\??constructionrenderings:\v!serried]
- \edef\p_width{\constructionparameter\c!width}% CHECK ! ! ! wrong parameter namespace
- \doifsetupselse{\??constructionrenderings:\v!serried:\p_width} {
- \directsetup{\??constructionrenderings:\v!serried:\p_width}
+ \edef\p_strc_constructions_width{\constructionparameter\c!width}% CHECK ! ! ! wrong parameter namespace
+ \doifsetupselse{\??constructionrenderings:\v!serried:\p_strc_constructions_width} {
+ \directsetup{\??constructionrenderings:\v!serried:\p_strc_constructions_width}
} {
\directsetup{\??constructionrenderings:\v!serried:\v!wide}
}
@@ -685,7 +716,7 @@
\noindent
\advance\leftskip-\leftskipadaption\relax
\ifdim\leftskipadaption=\zeropoint
- \leftskipadaption1.5em\relax % just some default
+ \leftskipadaption1.5\emwidth\relax % just some default
\ifnum\c_strc_constructions_nested_state=\plusone
\ifdim\leftskip>\zeropoint \relax
\leftskipadaption\leftskip
@@ -697,7 +728,7 @@
\fi
\hskip-\leftskipadaption\relax
\ifhbox\constructionheadbox\unhcopy\else\copy\fi\constructionheadbox
- \kern\ifdim\constructionsheaddistance=\zeropoint .75em\else\constructionsheaddistance\fi
+ \kern\ifdim\constructionsheaddistance=\zeropoint .75\emwidth\else\constructionsheaddistance\fi
\useconstructionstyleandcolor\c!style\c!color
\ignorespaces
\stopsetups
@@ -729,9 +760,9 @@
\unexpanded\def\strc_constructions_close_symbol_place
{\ifconditional\csname\??constructionclosesymbol\currentconstruction\endcsname
\global\expandafter\setfalse\csname\??constructionclosesymbol\currentconstruction\endcsname
- \edef\p_closesymbol{\constructionparameter\c!closesymbol}%
- \ifx\p_closesymbol\empty \else
- \constructionparameter\c!closecommand{\p_closesymbol}% hm why {} maybe because box expected
+ \edef\p_strc_constructions_closesymbol{\constructionparameter\c!closesymbol}%
+ \ifx\p_strc_constructions_closesymbol\empty \else
+ \constructionparameter\c!closecommand{\p_strc_constructions_closesymbol}% hm why {} maybe because box expected
\fi
\fi}
diff --git a/tex/context/base/strc-des.mkii b/tex/context/base/strc-des.mkii
index 587ef13e7..e699df9ea 100644
--- a/tex/context/base/strc-des.mkii
+++ b/tex/context/base/strc-des.mkii
@@ -47,7 +47,7 @@
% Op die manier is meer mogelijk en worden \par's geskipt.
%
% De macro \??dd#1\s!do\c!commando levert de koppeling tussen
-% \doornumberen en \doordefinieren. Deze constructie is nodig
+% \doornummeren en \doordefinieren. Deze constructie is nodig
% omdat doornummeren geen argument heeft en omdat subnummers
% niet worden genest binnen het hogere niveau.
%
diff --git a/tex/context/base/strc-des.mkvi b/tex/context/base/strc-des.mkvi
index 129370771..816a89316 100644
--- a/tex/context/base/strc-des.mkvi
+++ b/tex/context/base/strc-des.mkvi
@@ -33,9 +33,9 @@
%\c!color=,
%\c!headcolor=,
%\c!titlecolor=,
- \c!width=7em,
- \c!distance=1em,
- \c!titledistance=0.5em,
+ \c!width=7\emwidth,
+ \c!distance=\emwidth,
+ \c!titledistance=.5\emwidth,
%\c!hang=,
%\c!sample=,
%\c!align=,
@@ -71,15 +71,17 @@
\setuevalue{\e!stop \currentdescription}{\strc_descriptions_stop}%
\to \everydefinedescription
-\setvalue{\??constructioninitializer\v!description}%
+\let\p_strc_constructions_title \empty
+
+\unexpanded\setvalue{\??constructioninitializer\v!description}%
{\let\currentdescription \currentconstruction
\let\constructionparameter \descriptionparameter
\let\detokenizedconstructionparameter\detokenizeddescriptionparameter
\let\letconstructionparameter \letdescriptionparameter
\let\useconstructionstyleandcolor \usedescriptionstyleandcolor
\let\setupcurrentconstruction \setupcurrentdescription
- \edef\p_title{\constructionparameter\c!title}%
- \ifx\p_title\v!yes
+ \edef\p_strc_constructions_title{\constructionparameter\c!title}%
+ \ifx\p_strc_constructions_title\v!yes
\settrue\c_strc_constructions_title_state
\else
\setfalse\c_strc_constructions_title_state
@@ -227,16 +229,16 @@
\expandafter\let\csname\??constructioncommandhandler\v!description\expandafter\endcsname\csname\??constructioncommandhandler\v!construction\endcsname
\expandafter\let\csname\??constructiontexthandler \v!description\expandafter\endcsname\csname\??constructiontexthandler \v!construction\endcsname
-\setvalue{\??constructioncommandhandler\v!description}%
+\unexpanded\setvalue{\??constructioncommandhandler\v!description}%
{\dowithpar
{\csname\??constructionstarthandler\v!construction\endcsname}%
{\csname\??constructionstophandler \v!construction\endcsname\endgroup}}
-\setvalue{\??constructionstarthandler\v!description}%
+\unexpanded\setvalue{\??constructionstarthandler\v!description}%
{\BeforePar{\csname\??constructionstarthandler\v!construction\endcsname}%
\GotoPar}
-\setvalue{\??constructionstophandler\v!description}%
+\unexpanded\setvalue{\??constructionstophandler\v!description}%
{\csname\??constructionstophandler\v!construction\endcsname
\endgroup}
diff --git a/tex/context/base/strc-enu.mkvi b/tex/context/base/strc-enu.mkvi
index e3261fa35..ea5cc0d19 100644
--- a/tex/context/base/strc-enu.mkvi
+++ b/tex/context/base/strc-enu.mkvi
@@ -85,10 +85,10 @@
%\c!color=,
%\c!headcolor=,
%\c!titlecolor=,
- \c!width=8em,
- \c!distance=0pt,
-\c!distance=1em,
- \c!titledistance=0.5em,
+ \c!width=8\emwidth,
+ \c!distance=\zeropoint,
+ \c!distance=\emwidth,
+ \c!titledistance=.5\emwidth,
%\c!hang=,
%\c!sample=,
%\c!align=,
@@ -175,15 +175,18 @@
\strc_enumerations_setup_counter\currentenumeration
\to \everydefineenumeration
-\setvalue{\??constructioninitializer\v!enumeration}%
+\let\p_strc_constructions_title \empty
+\let\p_strc_constructions_number\empty
+
+\unexpanded\setvalue{\??constructioninitializer\v!enumeration}%
{\let\currentenumeration \currentconstruction
\let\constructionparameter \enumerationparameter
\let\detokenizedconstructionparameter\detokenizedenumerationparameter
\let\letconstructionparameter \letenumerationparameter
\let\useconstructionstyleandcolor \useenumerationstyleandcolor
\let\setupcurrentconstruction \setupcurrentenumeration
- \edef\p_number{\constructionparameter\c!number}%
- \ifx\p_number\v!yes
+ \edef\p_strc_constructions_number{\constructionparameter\c!number}%
+ \ifx\p_strc_constructions_number\v!yes
\settrue\c_strc_constructions_number_state
\iftrialtypesetting
\strc_counters_save\currentconstructionnumber
@@ -192,14 +195,14 @@
\else
\setfalse\c_strc_constructions_number_state
\fi
- \edef\p_title{\constructionparameter\c!title}%
- \ifx\p_title\v!yes
+ \edef\p_strc_constructions_title{\constructionparameter\c!title}%
+ \ifx\p_strc_constructions_title\v!yes
\settrue\c_strc_constructions_title_state
\else
\setfalse\c_strc_constructions_title_state
\fi}
-\setvalue{\??constructionfinalizer\v!enumeration}%
+\unexpanded\setvalue{\??constructionfinalizer\v!enumeration}%
{\ifconditional\c_strc_constructions_number_state
\iftrialtypesetting
\strc_counters_restore\currentconstructionnumber
@@ -263,7 +266,7 @@
\expandafter\let\csname\??constructionstarthandler \v!enumeration\expandafter\endcsname\csname\??constructionstarthandler \v!description\endcsname
\expandafter\let\csname\??constructionstophandler \v!enumeration\expandafter\endcsname\csname\??constructionstophandler \v!description\endcsname
-\setvalue{\??constructiontexthandler\v!enumeration}%
+\unexpanded\setvalue{\??constructiontexthandler\v!enumeration}%
{\begingroup
\useconstructionstyleandcolor\c!headstyle\c!headcolor
\strc_enumerations_text
diff --git a/tex/context/base/strc-lab.mkiv b/tex/context/base/strc-lab.mkiv
index 483791462..0bf65608f 100644
--- a/tex/context/base/strc-lab.mkiv
+++ b/tex/context/base/strc-lab.mkiv
@@ -15,82 +15,173 @@
\unprotect
-% labels, we could share with enumerations and forget about the text; anyhow, figure
-% labels etc can use enumerations; we keep labels for compatibility reasons; we need
-% the slightly different namespace; we can still define structure counters directly
-% (multiple levels) and use an enumeration without following text
-
-% unfinished ... no longer okay
-
-\unexpanded\def\setuplabels
- {\getparameters[\??db]}
-
-\unexpanded\def\definelabel
- {\dotripleargumentwithset\dodefinelabel}
-
-\def\dodefinelabel[#1][#2][#3]% #2 or #3 assignment
- {\doenumerationinit{#1}{1}\empty
- \getparameters[\??dd#1][\c!command=,\c!state=\v!start,\c!location=,\c!text=#1]%
- \ifsecondargument\doifassignmentelse{#2}\donetrue\donefalse\else\donetrue\fi
- \ifdone
- % an independent one
- \getparameters[\??dd#1][\s!counter=#1,\s!parent=\??db,#2]%
- \dodefinelabelcommands{#1}{\??db}%
- \dodefineenumerationcounter{#1}%
+%D Labels are implemented somewhat inefficient but have the advantage that they
+%D can be controlled like other constructions. Who knows when that comes in
+%D handy?
+
+\installcorenamespace{labels}
+
+\installcommandhandler \??labels {label} \??labels % plural hash, else clash with label (or rename that one)
+
+\let\setuplabels\setuplabel
+
+\setuplabel
+ [\c!alternative=\v!intext,
+ \c!headstyle=\v!bold,
+ \c!titlestyle=\v!bold,
+ \c!distance=\zeropoint,
+ \c!width=\v!fit,
+ \c!titledistance=.5\emwidth,
+ \c!margin=\v!no,
+ \c!titleleft=(,
+ \c!titleright=),
+ \c!display=\v!no,
+ \c!titlecommand=,
+ \c!expansion=\v!no,
+ \c!way=\v!by\v!text,
+ \c!prefix=\v!no,
+ \c!prefixconnector=.,
+ \c!text=\currentlabel,
+ \c!number=\v!yes, % else description
+ \c!start=0,
+ \c!state=\v!start,
+ \c!levels=3]
+
+\unexpanded\def\strc_define_commands_label#1#2#3% current level parent
+ {\doifelsenothing{#3}
+ {\normalexpanded{\defineconstruction[#1][\s!handler=\v!label,\c!level=#2]}%
+ \setevalue{\??label#1:\s!parent}{\??label}}%
+ {\normalexpanded{\defineconstruction[#1][#3][\s!handler=\v!label,\c!level=#2]}%
+ \setevalue{\??label#1:\s!parent}{\??label#3}}%
+ \setuevalue{\e!next #1}{\strc_labels_next }%
+ \setuevalue{\c!reset#1}{\strc_labels_reset }%
+ %setuevalue{\c!set #1}{\strc_labels_set }%
+ \setuevalue {#1}{\strc_labels_command{#1}}}
+
+\appendtoks
+ \ifx\currentlabelparent\empty
+ % clone => parent | subclone => clone | subsubclone => subclone
+ \let\currentlabelsub\empty
+ \strc_define_commands_label
+ {\currentlabelsub\currentlabel}%
+ \plusone
+ \empty
+ \edef\p_levels{\labelparameter\c!levels}%
+ \dostepwiserecurse\plustwo\p_levels\plusone
+ {\strc_define_commands_label
+ {\v!sub\currentlabelsub\currentlabel}%
+ \recurselevel
+ {\currentlabelsub\currentlabel}%
+ \edef\currentlabelsub{\v!sub\currentlabelsub}}%
\else
- \getparameters[\??dd#1][\s!counter=#1,\s!parent=\??dd#2,#3]%
- \dodefinelabelcommands{#1}{\??dd#2}%
+ % clone => parent | subclone => subparent | subsubclone => subsubparent
+ \let\currentlabelsub\empty
+ \edef\p_levels{\labelparameter\c!levels}%
+ \dorecurse\p_levels
+ {\strc_define_commands_label
+ {\currentlabelsub\currentlabel}%
+ \recurselevel
+ {\currentlabelsub\currentlabelparent}%
+ \edef\currentlabelsub{\v!sub\currentlabelsub}}%
+ \fi
+ \edef\p_counter{\labelparameter\s!counter}% can inherit from parent
+ \ifx\p_counter\empty %
+ \let\p_counter\currentlabel
+ \fi
+ \doifcounterelse\p_counter\donothing{\strc_labels_define_counter\p_counter}%
+ \letlabelparameter\s!counter\p_counter
+ \strc_labels_setup_counter\currentlabel
+\to \everydefinelabel
+
+\let\p_strc_constructions_title \empty
+\let\p_strc_constructions_number\empty
+
+\setvalue{\??constructioninitializer\v!label}%
+ {\let\currentlabel \currentconstruction
+ \let\constructionparameter \labelparameter
+ \let\detokenizedconstructionparameter\detokenizedlabelparameter
+ \let\letconstructionparameter \letlabelparameter
+ \let\useconstructionstyleandcolor \uselabelstyleandcolor
+ \let\setupcurrentconstruction \setupcurrentlabel
+ % shared with enumerations
+ \edef\p_strc_constructions_number{\constructionparameter\c!number}%
+ \ifx\p_strc_constructions_number\v!yes
+ \settrue\c_strc_constructions_number_state
+ \iftrialtypesetting
+ \strc_counters_save\currentconstructionnumber
+ \fi
+ \strc_counters_increment_sub\currentconstructionnumber\currentconstructionlevel
+ \else
+ \setfalse\c_strc_constructions_number_state
+ \fi
+ \edef\p_strc_constructions_title{\constructionparameter\c!title}%
+ \ifx\p_strc_constructions_title\v!yes
+ \settrue\c_strc_constructions_title_state
+ \else
+ \setfalse\c_strc_constructions_title_state
\fi}
-\def\dodefinelabelcommands#1#2%
- {\setuevalue {#1}{\noexpand\dolabelnumbercommand {#1}}%
- \setuevalue{\c!reset #1}{\noexpand\doresetlabelnumber {#1}}%
- %\setuevalue{\c!set #1}{\noexpand\dosetlabelnumber {#1}}% [#2] or {#2} ?
- \setuevalue{\e!next #1}{\noexpand\donextlabelnumber {#1}}%
- \setuevalue{\e!increment#1}{\noexpand\doincrementlabelnumber{#1}}%
- \setuevalue{\c!current #1}{\noexpand\docurrentlabelnumber {#1}}}
-
-% this is just for downward compatibility, we might drop it
-
-\setvalue{\??db:\c!location:\v!inmargin}{\inmargin}
-\setvalue{\??db:\c!location:\v!inleft }{\inleft}
-\setvalue{\??db:\c!location:\v!inright }{\inright}
-\setvalue{\??db:\c!location:\v!margin }{\inmargin}
-
-\def\dolabelinit#1%
- {\def\currentdescriptionmain{#1}%
- \def\currentdescription {#1}%
- \def\currentdescriptionlevel{1}}
-
-\def\docurrentlabelnumber #1{\dolabelinit{#1}\dosingleempty\dodocurrentlabelnumber}
-\def\donextlabelnumber #1{\dolabelinit{#1}\dosingleempty\dodonextlabelnumber}
-\def\dolabelnumbercommand #1{\dolabelinit{#1}\dosingleempty\dodolabelnumbercommand}
-
-\def\doresetlabelnumber #1{\dolabelinit{#1}\strc_counters_reset_sub \currentdescriptionnumber\currentdescriptionlevel}
-\def\dosetlabelnumber #1#2{\dolabelinit{#1}\strc_counters_set_sub \currentdescriptionnumber\currentdescriptionlevel{#2}}
-\def\doincrementlabelnumber #1{\dolabelinit{#1}\strc_counters_increment_sub\currentdescriptionnumber\currentdescriptionlevel}
-
-\def\dodocurrentlabelnumber[#1]%
- {\dontleavehmode
- \writestatus{!!!}{todo: reference of label}%
- \dotextprefix{\descriptionparameter\c!text}%
- \convertedsubcounter[\currentdescriptionnumber][\currentdescriptionlevel]}
-
-\def\dodonextlabelnumber[#1]% todo: ref
- {\strc_counters_increment_sub\currentdescriptionnumber\currentdescriptionlevel
- \dodocurrentlabelnumber[\currentdescriptionnumber]}
-
-\def\dodolabelnumbercommand[#1]% todo: ref
- {\dontleavehmode
- \descriptionparameter\c!before
- \begingroup
- \strc_counters_increment_sub\currentdescriptionnumber\currentdescriptionlevel
- \usedescriptionstyleandcolor\c!headstyle\c!headcolor
- \executeifdefined{\??db:\c!location:\descriptionparameter\c!location}{\descriptionparameter\c!command}{\dodocurrentlabelnumber[#1]}%
- \endgroup
- \descriptionparameter\c!after}
-
-\setuplabels
- [\s!parent=\??dn]
+\setvalue{\??constructionfinalizer\v!label}%
+ {\ifconditional\c_strc_constructions_number_state
+ \iftrialtypesetting
+ \strc_counters_restore\currentconstructionnumber
+ \fi
+ \fi}
+
+%D Interfaces:
+
+\let\strc_labels_command\strc_descriptions_command
+\let\strc_labels_next \strc_enumerations_next
+\let\strc_labels_reset \strc_enumerations_reset
+%let\strc_labels_set \strc_enumerations_set
+
+% similar to enumerations
+
+\newtoks\everysetuplabelcounter
+
+\let\v_strc_labels_counter_name\empty
+
+\def\strc_labels_setup_counter#1%
+ {\edef\v_strc_labels_counter_name{#1}%
+ \the\everysetuplabelcounter}
+
+\def\strc_labels_define_counter#1%
+ {\definecounter[#1]%
+ \strc_labels_setup_counter{#1}}
+
+\appendtoks
+ \strc_counter_setup_using_parameter\v_strc_labels_counter_name\labelparameter
+\to \everysetuplabelcounter
+
+\appendtoks
+ \strc_labels_setup_counter\currentlabel
+\to \everysetuplabel
+
+% no start stop here
+
+\expandafter\let\csname\??constructionmainhandler\v!label\expandafter\endcsname\csname\??constructionmainhandler\v!description\endcsname
+
+\unexpanded\setevalue{\??constructioncommandhandler\v!label}%
+ {\csname\??constructionstarthandler\v!construction\endcsname
+ \csname\??constructionstophandler \v!construction\endcsname
+ \endgroup}
+
+\unexpanded\setvalue{\??constructiontexthandler\v!label}%
+ {\begingroup
+ \useconstructionstyleandcolor\c!headstyle\c!headcolor
+ \strc_labels_text
+ \endgroup}
+
+\let\strc_labels_text\strc_enumerations_text
+
+% inline variant
+
+\defineconstructionalternative
+ [\v!intext]
+ [\c!renderingsetup=\??constructionrenderings:\v!intext]
+
+\startsetups[\??constructionrenderings:\v!intext]
+ \dontleavehmode\box\constructionheadbox
+\stopsetups
\protect \endinput
diff --git a/tex/context/base/strc-not.mkvi b/tex/context/base/strc-not.mkvi
index 5ee432761..b5e81fee1 100644
--- a/tex/context/base/strc-not.mkvi
+++ b/tex/context/base/strc-not.mkvi
@@ -175,23 +175,24 @@
\ifx\p_counter\empty %
\let\p_counter\currentnotation
\fi
-% \doifcounterelse\p_counter\donothing{\strc_enumerations_define_counter\p_counter}%
-% \letnotationparameter\s!counter\p_counter
-% \strc_enumerations_setup_counter\currentnotation
\doifcounterelse\p_counter\donothing{\strc_notes_define_counter\p_counter}%
\letnotationparameter\s!counter\p_counter
\strc_notes_setup_counter\currentnotation
\to \everydefinenotation
-\setvalue{\??constructioninitializer\v!notation}%
+
+\let\p_strc_constructions_title \empty
+\let\p_strc_constructions_number\empty
+
+\unexpanded\setvalue{\??constructioninitializer\v!notation}%
{\let\currentnotation \currentconstruction
\let\constructionparameter \notationparameter
\let\detokenizedconstructionparameter\detokenizednotationparameter
\let\letconstructionparameter \letnotationparameter
\let\useconstructionstyleandcolor \usenotationstyleandcolor
\let\setupcurrentconstruction \setupcurrentnotation
- \edef\p_number{\constructionparameter\c!number}%
- \ifx\p_number\v!yes
+ \edef\p_strc_constructions_number{\constructionparameter\c!number}%
+ \ifx\p_strc_constructions_number\v!yes
\settrue\c_strc_constructions_number_state
\iftrialtypesetting
\strc_counters_save\currentconstructionnumber
@@ -200,14 +201,14 @@
\else
\setfalse\c_strc_constructions_number_state
\fi
- \edef\p_title{\constructionparameter\c!title}%
- \ifx\p_title\v!yes
+ \edef\p_strc_constructions_title{\constructionparameter\c!title}%
+ \ifx\p_strc_constructions_title\v!yes
\settrue\c_strc_constructions_title_state
\else
\setfalse\c_strc_constructions_title_state
\fi}
-\setvalue{\??constructionfinalizer\v!notation}%
+\unexpanded\setvalue{\??constructionfinalizer\v!notation}%
{\ifconditional\c_strc_constructions_number_state
\iftrialtypesetting
\strc_counters_restore\currentconstructionnumber
@@ -292,10 +293,10 @@
%D level of indirectness. This way notations don't bark on undefined
%D macros when used in combination.
-\setvalue{\??constructionnotehandler\v!notation}%
+\unexpanded\setvalue{\??constructionnotehandler\v!notation}%
{\csname\??constructionnotehandler\currentconstructionhandler:\constructionparameter\c!type\endcsname}
-\setvalue{\??constructionnotehandler\v!notation:}% empty case
+\unexpanded\setvalue{\??constructionnotehandler\v!notation:}% empty case
{[\currentconstructionhandler:\currentconstruction]}
%D Here is a simple renderer for notes
@@ -419,7 +420,7 @@
\expandafter\let\csname\??constructioncommandhandler\v!notation\expandafter\endcsname\csname\??constructioncommandhandler\v!enumeration \endcsname
\expandafter\let\csname\??constructiontexthandler \v!notation\expandafter\endcsname\csname\??constructiontexthandler \v!enumeration \endcsname
-\setvalue{\??constructionmainhandler\v!notation}#1%
+\unexpanded\setvalue{\??constructionmainhandler\v!notation}#1%
{\iftrialtypesetting \else
\begingroup
\currentconstructionsynchronize
@@ -428,7 +429,7 @@
\endgroup
\fi#1}
-\setvalue{\??constructionnotehandler\v!notation:\v!note}% in the running text
+\unexpanded\setvalue{\??constructionnotehandler\v!notation:\v!note}% in the running text
{\ifnotesenabled
\let\currentnote\currentconstructionmain % do be done elsewhere
\iftrialtypesetting
@@ -1421,15 +1422,21 @@
{\processcommacommand[\localnoteslist]\strc_notes_local_stop_step
\setfalse\inlocalnotes}
+\let\p_strc_notes_continue\empty
+
\def\strc_notes_local_start_step#1%
- {\doifnot{\noteparameter\c!continue}\v!yes
- {\strc_counters_save{#1}%
- \strc_counters_reset{#1}}%
+ {\p_strc_notes_continue{\noteparameter\c!continue}%
+ \ifx\p_strc_notes_continue\v!yes \else
+ \strc_counters_save{#1}%
+ \strc_counters_reset{#1}%
+ \fi
\ctxlua{structures.notes.save("#1","store")}}
\def\strc_notes_local_stop_step#1%
- {\doifnot{\noteparameter\c!continue}\v!yes
- {\strc_counters_restore{#1}}%
+ {\p_strc_notes_continue{\noteparameter\c!continue}%
+ \ifx\p_strc_notes_continue\v!yes \else
+ \strc_counters_restore{#1}%
+ \fi
\ctxlua{structures.notes.restore("#1")}}
\unexpanded\def\placelocalnotes
diff --git a/tex/context/base/strc-reg.mkiv b/tex/context/base/strc-reg.mkiv
index 7ac21761d..e90de80ec 100644
--- a/tex/context/base/strc-reg.mkiv
+++ b/tex/context/base/strc-reg.mkiv
@@ -19,12 +19,7 @@
% todo: tag:: becomes rendering
% todo: language, character, linked, location
-
-%D Helper:
-
-% \def\doflushatpar{\ifvmode\expandafter\dogotopar\else\expandafter\firstofoneargument\fi}
-
-\def\doflushatpar{\ifvmode\expandafter\flushatnextpar\else\expandafter\firstofoneargument\fi}
+% todo: fonts etc at sublevels (already defined)
% \starttext
% \placeregister[index]
@@ -34,9 +29,6 @@
% test \index{aa} test \setregisterentry[index][label=y] test \page test \page test \page test \finishregisterentry[index][label=y,entries=yy]
% \stoptext
-% In plaats van + kan een & worden gebruikt. Ook kan als
-% eerste karakter worden opgegeven wat de scheider is.
-%
% \index {entry}
% \index[key] {entry}
% \index[pageclass::] {entry}
@@ -46,52 +38,34 @@
% \index[pageclass::] {textclass::entry}
% \index[pageclass::key]{textclass::entry}
-%D Parameters ... we set up levels so we need a slightly different command handler here .. okay, we
-%D can use the childs for that ... but then we need to tweak the name in order to distinguish:
-%D register -> register:1 (i.e. prefix)
-
-\let\currentregister\empty
-
-% \def\registerparameter#1{\csname\??id\currentregister#1\endcsname}
+% tzt variant with n entries, parameters and userdata (altnum)
-\def\detokenizedregisterparameter#1{\detokenize\expandafter\expandafter\expandafter{\csname\??id#1\endcsname}} % always root
+\installcorenamespace{register}
-\def\registerparameter #1{\csname\doregisterparameter{\??id\currentregister}{#1}\endcsname}
-\def\registerparameterhash#1{\doregisterparameterhash {\??id\currentregister}#1}
+\installcommandhandler\??register {register} \??register
-\def\doregisterparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\doregisterparentparameter \csname#1\s!parent\endcsname{#2}\fi}
-\def\doregisterparameterhash#1#2{\ifcsname#1#2\endcsname #1\else\expandafter\doregisterparentparameterhash\csname#1\s!parent\endcsname{#2}\fi}
+\let\strc_registers_setup_saved\setupregister
-\def\doregisterparentparameter #1#2{\ifx#1\relax\s!empty\else\doregisterparameter #1{#2}\fi}
-\def\doregisterparentparameterhash#1#2{\ifx#1\relax \else\doregisterparameterhash#1{#2}\fi}
+\unexpanded\def\setupregister
+ {\dotripleempty\strc_registers_setup}
-\def\useregisterstyleandcolor#1#2% style color
- {\edef\currentstyleparameter{\registerparameter#1}%
- \edef\currentcolorparameter{\registerparameter#2}%
- \ifx\currentstyleparameter\empty\else\dousestyleparameter\currentstyleparameter\fi
- \ifx\currentcolorparameter\empty\else\dousecolorparameter\currentcolorparameter\fi}
-
-%D Setup:
-
-\newtoks\everysetupregister
-
-\unexpanded\def\setupregisters
- {\dotripleempty\dosetupregisters}
-
-\def\dosetupregisters[#1][#2][#3]%
+\def\strc_registers_setup[#1][#2][#3]%
{\ifthirdargument
- \def\dodosetupregister##1{\getparameters[\??id##1#2][#3]}%
- \processcommalist[#1]\dodosetupregister
+ \def\strc_registers_setup_step##1{\strc_registers_setup_saved[#1:##1][#3]}%
+ \processcommalist[#2]\strc_registers_setup_step
\else\ifsecondargument
- \def\dodosetupregister##1{\edef\currentregister{##1}\getparameters[\??id##1][#2]\the\everysetupregister}%
- \processcommalist[#1]\dodosetupregister
+ \strc_registers_setup_saved[#1][#2]%
\else
- \getparameters[\??id][#1]%
+ \strc_registers_setup_saved[#1]%
\fi\fi}
-\let\setupregister\setupregisters
+\unexpanded\def\setupregisters
+ {\dosingleempty\strc_registers_setup_root}
+
+\def\strc_registers_setup_root[#1]%
+ {\strc_registers_setup_saved[#1]\relax}
-\setupregisters
+\setupregister
[\c!n=2,
\c!balance=\v!yes, % \v!no komt niet zo vaak voor
\c!align=\v!flushleft,
@@ -102,7 +76,7 @@
\c!compress=\v!no,
\c!interaction=\v!pagenumber,
\c!alternative=\v!a,
- \c!distance=1em,
+ \c!distance=\emwidth,
\c!style=\v!bold,
\c!pagestyle=\v!slanted,
\c!indicator=\v!yes,
@@ -115,7 +89,7 @@
\c!unknownreference=\v!empty,
\c!prefix=\v!both,
%\c!expansion=,
-%\c!xmlsetup=,
+ %\c!xmlsetup=,
\c!pagenumber=\v!yes,
\c!pageprefixconnector=\endash,
\c!pagesegments=2:2,
@@ -125,48 +99,64 @@
\c!numberorder=\v!numbers, % \v!characters
\s!language=\currentmainlanguage]%
-%D Definition:
+% yes or no shared ?
-\unexpanded\def\defineregister
- {\dodoubleargument\dodefineregister}
+\setupregister
+ [\c!label=,
+ \c!entries=,
+ \c!entries:1=,
+ \c!entries:2=,
+ \c!entries:3=,
+ \c!keys:1=,
+ \c!keys:2=,
+ \c!keys:3=,
+ \c!alternative=]
-\def\dodefineregister[#1][#2]% #2?
- {\setupregister[#1][\s!parent=\??id]%
- \ctxlua{structures.registers.define('#1')}%
- \presetheadtext[#1=\Word{#1}]%
- \setuvalue{#1}{\dodoubleempty\doregister[#1]}%
- \setuvalue{\e!see#1}{\dodoubleempty\doseeregister[#1]}%
-% \setuvalue{\e!coupled#1}{\dolinkedregister{#1}}%
- \setvalue{\e!place#1}{\placeregister[#1]}%
- \setvalue{\e!complete#1}{\completeregister[#1]}%
- \setvalue{\e!setup#1\e!endsetup}[##1]{\getparameters[\??id#1][##1]}}
+%D \starttyping
+%D \setupregister[index][1][textcolor=darkred]
+%D \setupregister[index][2][textcolor=darkgreen,textstyle=bold]
+%D
+%D \placeregister[index][n=1] \blank[3*big]
+%D
+%D test \index{test+one} test \index{test+two} more \index{more}
+%D \stoptyping
-%D Registering:
+\newconditional\c_strc_registers_defining
-\newif\ifwritetoregister \writetoregistertrue
+\ifdefined\Word \else \unexpanded\def\Word#1{#1} \fi
-% tzt variant met n entries, parameters en userdata (altnum)
+\appendtoks
+ \ifconditional\c_strc_registers_defining \else
+ \settrue\c_strc_registers_defining
+ \ctxlua{structures.registers.define('\currentregister')}%
+ \normalexpanded{\presetheadtext[\currentregister=\Word{\currentregister}]}%
+ \setuevalue{\currentregister}{\dodoubleempty\strc_registers_insert_entry[\currentregister]}%
+ \setuevalue{\e!see\currentregister}{\dodoubleempty\strc_registers_insert_see[\currentregister]}%
+ %setuevalue{\e!coupled\currentregister}{\dolinkedregister{\currentregister}}%
+ \setuevalue{\e!place\currentregister}{\placeregister[\currentregister]}% % historic ballast
+ \setuevalue{\e!complete\currentregister}{\completeregister[\currentregister]}% % historic ballast
+ \setuevalue{\e!setup\currentregister\e!endsetup}{\setupregister[\currentregister}% % historic ballast
+ \normalexpanded{\defineregister[\currentregister:1][\currentregister]}% expansion should not be needed
+ \normalexpanded{\defineregister[\currentregister:2][\currentregister]}% expansion should not be needed
+ \normalexpanded{\defineregister[\currentregister:3][\currentregister]}% expansion should not be needed
+ \setfalse\c_strc_registers_defining
+ \fi
+\to \everydefineregister
-\getparameters
- [\??id]
- [\c!label=,
- \c!entries=,
- \c!entries:1=,\c!entries:2=,\c!entries:3=,
- \c!keys:1=,\c!keys:2=,\c!keys:3=,
- \c!alternative=]
+%D Registering:
-\def\doregisterstructurepageregister
+\def\strc_registers_register_page_entry
{\iftrialtypesetting
\expandafter\gobblethreearguments
\else
- \expandafter\dodoregisterstructurepageregister
+ \expandafter\strc_registers_register_page_entry_indeed
\fi}
-\def\dodoregisterstructurepageregister#1#2#3% register data userdata
+\def\strc_registers_register_page_entry_indeed#1#2#3% register data userdata
{\begingroup
\edef\currentregister{#1}%
- %getparameters[\??id][\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]%
- \getparameters[\??id][#2]%
+ %\setupcurrentregister[\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]%
+ \setupcurrentregister[#2]%
\edef\currentregisterlabel {\registerparameter\c!label}%
\edef\currentregisterexpansion{\registerparameter\c!expansion}%
\edef\currentregisterownnumber{\registerparameter\c!ownnumber}%
@@ -245,7 +235,7 @@
section = structures.sections.currentid(), % hm, why then not also lastsection the same way
label = "\currentregisterlabel",
},
-% \ifx\currentregisterentries\empty \else
+ % \ifx\currentregisterentries\empty \else
entries = {
% we need a special one for xml, this is just a single one
\ifx\currentregisterentries\empty
@@ -259,10 +249,10 @@
\!!bs\currentregisterkeys\!!es,
\fi
},
-% \fi
+ % \fi
userdata = structures.helpers.touserdata(\!!bs\detokenize{#3}\!!es)
}
- } }%
+ }}%
\ctxlua{structures.references.setinternalreference(nil,nil,\nextinternalreference)}%
\ifx\currentregisterownnumber\v!yes
\glet\currentregistersynchronize\relax
@@ -275,45 +265,51 @@
\attribute\destinationattribute\lastdestinationattribute \signalcharacter % no \strut as it will be removed during cleanup
\endgroup}
-\def\doregister[#1][#2]%
+\unexpanded\def\strc_registers_insert_entry[#1][#2]%
{\def\currentregister{#1}%
- \doifelse{\registerparameter\c!ownnumber}\v!yes\dodoregister\donoregister{#1}{#2}}
+ \doifelse{\registerparameter\c!ownnumber}\v!yes
+ \strc_registers_insert_entry_yes
+ \strc_registers_insert_entry_nop
+ {#2}}
-\def\donoregister #1#2#3{\doflushatpar{\doregisterstructurepageregister{#1}{\c!keys={#2},\c!entries={#3}}{}}}
-\def\dodoregister#1#2#3#4{\doflushatpar{\doregisterstructurepageregister{#1}{\c!keys={#2},\c!alternative=#3,\c!entries={#4}}{}}}
+\def\strc_registers_insert_entry_nop#1#2%
+ {\doflushatpar{\strc_registers_register_page_entry\currentregister{\c!keys={#1},\c!entries={#2}}{}}}
-\unexpanded\def\startregister{\doquadrupleempty\dostartregister}
-\unexpanded\def\stopregister {\dodoubleargument\dostopregister}
+\def\strc_registers_insert_entry_yes#1#2#3%
+ {\doflushatpar{\strc_registers_register_page_entry\currentregister{\c!keys={#1},\c!alternative=#2,\c!entries={#3}}{}}}
+
+\unexpanded\def\startregister{\doquadrupleempty\strc_registers_start_entry}
+\unexpanded\def\stopregister {\dodoubleargument\strc_registers_stop_entry}
% a synonym, so that we can nest with overlap without syntax check problems
\let\openregisterrange \startregister
\let\closeregisterrange\stopregister
-\def\dostartregister[#1][#2][#3][#4]#5%
+\def\strc_registers_start_entry[#1][#2][#3][#4]#5%
{\iffourthargument
% #1=register #2=tag #3=own #4=sortkey #5=entry
- \doflushatpar{\doregisterstructurepageregister{#1}{\c!label=#2,\c!alternative=#3,\c!keys={#4},\c!entries={#5}}{}}%
+ \doflushatpar{\strc_registers_register_page_entry{#1}{\c!label=#2,\c!alternative=#3,\c!keys={#4},\c!entries={#5}}{}}%
\else
% #1=register #2=tag #3=sortkey #5=entry
- \doflushatpar{\doregisterstructurepageregister{#1}{\c!label=#2,\c!keys={#3},\c!entries={#5}}{}}%
+ \doflushatpar{\strc_registers_register_page_entry{#1}{\c!label=#2,\c!keys={#3},\c!entries={#5}}{}}%
\fi}
-\def\dostopregister[#1][#2]%
+\def\strc_registers_stop_entry[#1][#2]%
{\normalexpanded{\ctxlatelua{structures.registers.extend("#1","#2")}}}
-\def\setregisterentry {\dotripleempty\dosetregisterentry}
-\def\finishregisterentry{\dotripleempty\dofinishregisterentry}
+\def\setregisterentry {\dotripleempty\strc_registers_set_entry}
+\def\finishregisterentry{\dotripleempty\strc_registers_finish_entry}
% not yet document, not sure if this will stay:
-\def\dosetregisterentry [#1][#2][#3]{\doflushatpar{\doregisterstructurepageregister{#1}{#2}{#3}}}
-\def\dofinishregisterentry[#1][#2][#3]{\dofinishregisterstructurepageregister{#1}{#2}{#3}}
+\def\strc_registers_set_entry [#1][#2][#3]{\doflushatpar{\strc_registers_register_page_entry{#1}{#2}{#3}}}
+\def\strc_registers_finish_entry[#1][#2][#3]{\strc_registers_finish_entry_indeed{#1}{#2}{#3}}
-\def\dofinishregisterstructurepageregister#1#2#3% register data userdata
+\def\strc_registers_finish_entry_indeed#1#2#3% register data userdata
{\begingroup
\edef\currentregister{#1}%
- \getparameters[\??id][\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]%
+ \setupcurrentregister[\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]%
\edef\currentregisterlabel {\registerparameter\c!label}%
\edef\currentregisterexpansion{\registerparameter\c!expansion}%
\edef\currentregisterownnumber{\registerparameter\c!ownnumber}%
@@ -377,29 +373,32 @@
% \placeregister[index][n=1]
% \stoptext
-\def\setstructurepageregister{\dotripleempty\dosetstructurepageregister}
+% some overlap wit previous
+
+\unexpanded\def\setstructurepageregister
+ {\dotripleempty\strc_registers_set}
-\def\dosetstructurepageregister[#1][#2][#3]% [register][settings][userdata]
- {\doflushatpar{\doregisterstructurepageregister{#1}{#2}{#3}}}
+\def\strc_registers_set[#1][#2][#3]% [register][settings][userdata]
+ {\doflushatpar{\strc_registers_register_page_entry{#1}{#2}{#3}}}
-\unexpanded\def\startstructurepageregister{\doquadrupleempty\dostartstructurepageregister}
-\unexpanded\def\stopstructurepageregister {\dodoubleargument\dostopstructurepageregister}
+\unexpanded\def\startstructurepageregister{\doquadrupleempty\strc_registers_start}
+\unexpanded\def\stopstructurepageregister {\dodoubleargument\strc_registers_stop}
\let\openstructurepageregisterrange \startstructurepageregister
\let\closestructurepageregisterrange\stopstructurepageregister
-\def\dostartstructurepageregister[#1][#2][#3][#4]% [register][tag][settings][userdata]
- {\doflushatpar{\doregisterstructurepageregister{#1}{\c!label=#2,#3}{#4}}}
+\def\strc_registers_start[#1][#2][#3][#4]% [register][tag][settings][userdata]
+ {\doflushatpar{\strc_registers_register_page_entry{#1}{\c!label=#2,#3}{#4}}}
-\def\dostopstructurepageregister[#1][#2]%
+\def\strc_registers_stop[#1][#2]%
{\normalexpanded{\ctxlatelua{structures.registers.extend("#1","#2")}}}
% So far.
-\def\doseeregister[#1][#2]#3#4%
- {\doflushatpar{\doprocessseeregister{#1}{#2}{#3}{#4}}}
+\unexpanded\def\strc_registers_insert_see[#1][#2]#3#4%
+ {\doflushatpar{\strc_registers_insert_see_indeed{#1}{#2}{#3}{#4}}}
-\def\doprocessseeregister#1#2#3#4% register key entry seeword
+\def\strc_registers_insert_see_indeed#1#2#3#4% register key entry seeword
{\begingroup
\edef\currentregister{#1}%
\edef\currentregisterexpansion{\registerparameter\c!expansion}%
@@ -450,9 +449,9 @@
\let\utilityregisterlength\!!zerocount
\def\determineregistercharacteristics
- {\dodoubleempty\dodetermineregistercharacteristics}
+ {\dodoubleempty\strc_registers_determine_characteristics}
-\def\dodetermineregistercharacteristics[#1][#2]%
+\def\strc_registers_determine_characteristics[#1][#2]%
{\begingroup
\edef\currentregister{#1}%
\setupregister[\currentregister][#2]%
@@ -476,67 +475,85 @@
\to \everyplaceregister
\unexpanded\def\placeregister
- {\dodoubleempty\doplaceregister}
+ {\dodoubleempty\strc_registers_place}
-\def\doplaceregister[#1][#2]%
+\def\strc_registers_place[#1][#2]%
{\iffirstargument
\begingroup
-% \forgetall
+ %\forgetall
\edef\currentregister{#1}%
\setupregister[\currentregister][#2]%
\the\everyplaceregister
- \startcolumns
- [\c!n=\registerparameter\c!n,
- \c!balance=\registerparameter\c!balance,
- \c!align=\registerparameter\c!align,
- \c!tolerance=\registerparameter\c!tolerance]%
- \startpacked[\v!blank]%
- \ctxlua{structures.registers.process('\currentregister',{
- language = "\registerparameter\s!language",
- method = "\registerparameter\c!method",
- numberorder = "\registerparameter\c!numberorder",
- compress = "\registerparameter\c!compress",
- criterium = "\registerparameter\c!criterium",
- },
- {
-% prefix = "\registerparameter\c!pageprefix",
- separatorset = "\registerparameter\c!pageprefixseparatorset",
- conversionset = "\registerparameter\c!pageprefixconversionset",
- starter = \!!bs\registerparameter\c!pageprefixstarter\!!es,
- stopper = \!!bs\registerparameter\c!pageprefixstopper\!!es,
- set = "\registerparameter\c!pageprefixset",
- segments = "\registerparameter\c!pageprefixsegments",
- connector = \!!bs\registerparameter\c!pageprefixconnector\!!es,
- },
- {
- prefix = "\registerparameter\c!pageprefix",
- separatorset = "\registerparameter\c!pageseparatorset",
- conversionset = "\registerparameter\c!pageconversionset",
- starter = \!!bs\registerparameter\c!pagestarter\!!es,
- stopper = \!!bs\registerparameter\c!pagestopper\!!es,
- segments = "\registerparameter\c!pagesegments",
- }
- )}%
- \stoppacked
- \stopcolumns
+ \ifnum\registerparameter\c!n>\plusone
+ \startcolumns
+ [\c!n=\registerparameter\c!n,
+ \c!balance=\registerparameter\c!balance,
+ \c!align=\registerparameter\c!align,
+ \c!tolerance=\registerparameter\c!tolerance]%
+ \strc_registers_place_indeed
+ \stopcolumns
+ \else
+ \strc_registers_place_indeed
+ \fi
\endgroup
\fi}
-\def\dolimitedregisterentry#1{\limitatetext{#1}\currentregistermaxwidth\unknown}%
+\def\strc_registers_place_columns
+ {\startcolumns
+ [\c!n=\registerparameter\c!n,
+ \c!balance=\registerparameter\c!balance,
+ \c!align=\registerparameter\c!align,
+ \c!tolerance=\registerparameter\c!tolerance]%
+ \startpacked[\v!blank]%
+ \strc_registers_place_indeed
+ \stoppacked
+ \stopcolumns}
+
+\def\strc_registers_place_normal
+ {\startpacked[\v!blank]%
+ \strc_registers_place_indeed
+ \stoppacked}
+
+\def\strc_registers_place_indeed
+ {\ctxlua{structures.registers.process('\currentregister',{
+ language = "\registerparameter\s!language",
+ method = "\registerparameter\c!method",
+ numberorder = "\registerparameter\c!numberorder",
+ compress = "\registerparameter\c!compress",
+ criterium = "\registerparameter\c!criterium",
+ },{
+ separatorset = "\registerparameter\c!pageprefixseparatorset",
+ conversionset = "\registerparameter\c!pageprefixconversionset",
+ starter = \!!bs\registerparameter\c!pageprefixstarter\!!es,
+ stopper = \!!bs\registerparameter\c!pageprefixstopper\!!es,
+ set = "\registerparameter\c!pageprefixset",
+ segments = "\registerparameter\c!pageprefixsegments",
+ connector = \!!bs\registerparameter\c!pageprefixconnector\!!es,
+ },{
+ prefix = "\registerparameter\c!pageprefix",
+ separatorset = "\registerparameter\c!pageseparatorset",
+ conversionset = "\registerparameter\c!pageconversionset",
+ starter = \!!bs\registerparameter\c!pagestarter\!!es,
+ stopper = \!!bs\registerparameter\c!pagestopper\!!es,
+ segments = "\registerparameter\c!pagesegments",
+ })}}
+
+\def\strc_registers_limited_entry#1%
+ {\limitatetext{#1}\currentregistermaxwidth\unknown}%
\appendtoks
\edef\currentregistermaxwidth{\registerparameter\c!maxwidth}%
\ifx\currentregistermaxwidth\empty
\let\limitedregisterentry\firstofoneargument
\else
- \let\limitedregisterentry\dolimitedregisterentry
+ \let\limitedregisterentry\strc_registers_limited_entry
\fi
\to \everyplaceregister
-\def\completeregister
- {\dodoubleempty\docompleteregister}
+\unexpanded\def\completeregister
+ {\dodoubleempty\strc_registers_complete}
-\def\docompleteregister[#1][#2]%
+\def\strc_registers_complete[#1][#2]%
{\iffirstargument
\begingroup
\edef\currentregister{#1}%
@@ -546,7 +563,7 @@
\stopnamedsection
\endgroup
\fi}
-
+
% test case for collapsing (experimental, for Steffen Wolfrum)
%
% \starttext
@@ -565,37 +582,36 @@
% xxxx \index{xxxx}
% todo \index{todo}
% \stoptext
-
+
%D Character rendering (sections):
+\installcorenamespace{registerindicator}
+
\def\defaultregistercharacter#1%
- {\doifsomething{#1}
- {\doifnot{#1}\s!unknown
- {\doifelse{\registerparameter\c!indicator}\v!yes
- {\doregistercharacter{#1}}
- {\noregistercharacter{#1}}}}}
-
-% \def\doregistercharacter#1%
-% {\expandcheckedcsname % why no \executeifdefined
-% {\??id:\c!indicator:}%
-% {\registerparameter\c!alternative}%
-% {a}%
-% {#1}}
-
-\def\doregistercharacter#1%
- {\expandcheckedcsname % why no \executeifdefined
- {\??id:\c!indicator:}%
- {\registerparameter\c!alternative}%
- {a}%
- {#1}}
-
-\def\noregistercharacter#1%
+ {\edef\currentregistercharacter{#1}%
+ \ifx\currentregistercharacter\empty
+ % skip
+ \else\ifx\currentregistercharacter\s!unknown
+ % skip
+ \else
+ \edef\p_indicator{\registerparameter\c!indicator}%
+ \ifx\p_indicator\v!yes
+ \strc_registers_place_character_yes
+ \else
+ \strc_registers_place_character_nop
+ \fi
+ \fi\fi}
+
+\def\strc_registers_place_character_yes
+ {\expandcheckedcsname\??registerindicator{\registerparameter\c!alternative}\v!a{\currentregistercharacter}}
+
+\def\strc_registers_place_character_nop
{\registerparameter\c!before
\goodbreak}
% a = <before> <goodbreak> <character> <par> <after> <nobreak>
-\setvalue{\??id:\c!indicator:a}#1%
+\setvalue{\??registerindicator a}#1%
{\registerparameter\c!before
% bugged, why does leftskip gets set: \vskip\lineheight\goodbreak\vskip-\lineheight
\begingroup
@@ -613,7 +629,7 @@
% b = <goodbreak> <before> <character> <after> <nobreak>
-\setvalue{\??id:\c!indicator:b}#1% will be shared with a
+\setvalue{\??registerindicator b}#1% will be shared with a
{\registerparameter\c!before
\begingroup
\useregisterstyleandcolor\c!style\c!color
@@ -627,9 +643,9 @@
\registerparameter\c!after
\nobreak}
-\setvalue{\??id:\c!indicator:A}#1{\getvalue{\??id:\c!indicator:a}{\WORD{#1}}}
-\setvalue{\??id:\c!indicator:B}#1{\getvalue{\??id:\c!indicator:b}{\WORD{#1}}}
-
+\setvalue{\??registerindicator A}#1{\getvalue{\??registerindicator a}{\WORD{#1}}}
+\setvalue{\??registerindicator B}#1{\getvalue{\??registerindicator b}{\WORD{#1}}}
+
%D The following macros are the interface to the rendering. These are
%D generated by \LUA. This might change.
@@ -637,9 +653,13 @@
%D placeindex as then flushing takes place inside the index. Took me hours
%D to notice that.
+\newconditional\c_strc_registers_page_done
+\newdimen \d_strc_registers_distance
+
\unexpanded\def\startregisteroutput
{\endgraf
\begingroup
+ \d_strc_registers_distance\registerparameter\c!distance\relax
\dostarttagged\t!register\currentregister
\forgeteverypar
\forgetparindent
@@ -654,9 +674,13 @@
{\endgraf
\begingroup
\dostarttagged\t!registerentries\empty
+ \let\savedcurrentregister\currentregister
+ \edef\currentregister{\currentregister:#1}%
\useregisterstyleandcolor\c!textstyle\c!textcolor
- \advance\leftskip\numexpr#1-1\relax\dimexpr\registerparameter\c!distance\relax
- \hangindent\registerparameter\c!distance\hangafter\plusone}
+ \advance\leftskip\numexpr#1-\plusone\relax\dimexpr\d_strc_registers_distance\relax
+ \hangindent\registerparameter\c!distance\relax
+ \hangafter\plusone
+ \let\currentregister\savedcurrentregister}
\unexpanded\def\stopregisterentries
{\endgraf
@@ -673,12 +697,10 @@
{\dostoptagged
\endgraf}
-\newconditional\registerpagedone
-
\unexpanded\def\startregisterpages
{\begingroup
\dostarttagged\t!registerpages\empty
- \setfalse\registerpagedone
+ \setfalse\c_strc_registers_page_done
\useregisterstyleandcolor\c!pagestyle\c!pagecolor}
\unexpanded\def\stopregisterpages
@@ -688,7 +710,7 @@
\unexpanded\def\startregisterseewords
{\ifhmode\crlf\fi
\begingroup
- \setfalse\registerpagedone
+ \setfalse\c_strc_registers_page_done
\dostarttagged\t!registerpage\empty
\useregisterstyleandcolor\c!pagestyle\c!pagecolor}
@@ -696,15 +718,16 @@
{\dostoptagged
\endgroup}
-\def\registerpageseparator% todo: , configurable
- {\ifconditional\registerpagedone
+\unexpanded\def\registerpageseparator% todo: , configurable
+ {\ifconditional\c_strc_registers_page_done
\registerpageseparatorsymbol
\else
- \hskip\registerparameter\c!distance\relax
- \settrue\registerpagedone
+ \hskip\d_strc_registers_distance\relax
+ \settrue\c_strc_registers_page_done
\fi}
-\def\registeronepagerangeseparator{|\endash|}
+\unexpanded\def\registeronepagerangeseparator
+ {|\endash|}
\def\withregisterpagecommand#1#2#3#4%
{\def\currentregisterpageindex{#2}%
@@ -714,13 +737,13 @@
\applyprocessor{#1}{\registerparameter\c!pagecommand{#4}}%
\fi}
-\def\registeronepage#1#2#3#4% #1:processor content
+\unexpanded\def\registeronepage#1#2#3#4% #1:processor content
{\registerpageseparator
\dostarttagged\t!registerpage\empty
\withregisterpagecommand{#1}{#2}{#3}{#4}%
\dostoptagged}
-\def\registerpagerange#1#2#3#4#5#6#7% #1:processor content, content todo: -- configurable
+\unexpanded\def\registerpagerange#1#2#3#4#5#6#7% #1:processor content, content todo: -- configurable
{\registerpageseparator
\dostarttagged\t!registerpagerange\empty
\dostarttagged\t!registerfrompage\empty
@@ -732,7 +755,7 @@
\dostoptagged
\dostoptagged}
-\def\doapplyregisterentrycommand#1#2% processor text
+\unexpanded\def\doapplyregisterentrycommand#1#2% processor text
{\dostarttagged\t!registerentry\empty
\ifx\currentregisterseeindex\empty \else
\dontleavehmode
@@ -741,7 +764,7 @@
\applyprocessor{#1}{\registerparameter\c!textcommand{\limitedregisterentry{\registerparameter\c!deeptextcommand{#2}}}}%
\dostoptagged}
-\def\defaultregisterentry#1#2#3#4% #1:processor #2:internal #3:seeindex #4:word
+\unexpanded\def\defaultregisterentry#1#2#3#4% #1:processor #2:internal #3:seeindex #4:word
{\def\currentregisterpageindex{#2}%
\iflocation
\def\currentregisterseeindex{#3}%
@@ -761,11 +784,11 @@
\goto{\applyprocessor{#1}{#2}}[seeindex:\currentregisterseeindex]%
\fi}
-\def\defaultregisterseeword#1#2#3#4#5#6% i n #3:processor #4:internal #5:seeindex #6:word
+\unexpanded\def\defaultregisterseeword#1#2#3#4#5#6% i n #3:processor #4:internal #5:seeindex #6:word
{%\registerpageseparator
\def\currentregisterpageindex{#4}%
\dostarttagged\t!registersee\empty
- \settrue\registerpagedone
+ \settrue\c_strc_registers_page_done
\iflocation
\def\currentregisterseeindex{#5}%
\else
@@ -805,41 +828,44 @@
% not yet ok : new internal handler names
-\def\registerpagebuttonsymbol{\vrule\!!width1em\!!height1ex\!!depth\zeropoint\relax}
+\unexpanded\def\registerpagebuttonsymbol
+ {\vrule\!!width1em\!!height1ex\!!depth\zeropoint\relax}
+
+\installcorenamespace{registersymbol}
-\setvalue{\??id:\c!symbol:\c!n}%
+\setvalue{\??registersymbol n}%
{\def\registerpageseparatorsymbol{, }}
-\setvalue{\??id:\c!symbol:\c!a}%
+\setvalue{\??registersymbol a}%
{\def\registerpageseparatorsymbol{, }} % now done via conversion
-\setvalue{\??id:\c!symbol:\v!none}%
+\setvalue{\??registersymbol\v!none}%
{\let\registerpageseparatorsymbol\empty
\let\registeronepage \gobblefourarguments
\let\registerpagerange \gobblesevenarguments}
-\setvalue{\??id:\c!symbol:1}%
+\setvalue{\??registersymbol 1}%
{\let\registerpageseparatorsymbol\space
- \def\registeronepage {\symbol[1]\gobblefourarguments}%
- \def\registerpagerange {\symbol[1]\gobblesevenarguments}}
+ \def\registeronepage {\symbol[1]\gobblefourarguments}%
+ \def\registerpagerange{\symbol[1]\gobblesevenarguments}}
-\setvalue{\??id:\c!symbol:2}%
+\setvalue{\??registersymbol 2}%
{\let\registerpageseparatorsymbol\space
- \def\registeronepage {\registerpagebuttonsymbol\gobblefourarguments}%
- \def\registerpagerange {\registerpagebuttonsymbol\gobblesevenarguments}}
+ \def\registeronepage {\registerpagebuttonsymbol\gobblefourarguments}%
+ \def\registerpagerange{\registerpagebuttonsymbol\gobblesevenarguments}}
\def\setregisterpagerendering
{\doifelse{\registerparameter\c!pagenumber}\v!no
{\let \currentregisterpagesymbol\v!none}
{\edef\currentregisterpagesymbol{\registerparameter\c!symbol}}%
\ifx\currentregisterpagesymbol\empty
- \csname\??id:\c!symbol:\c!n\endcsname
- \else\ifcsname\??id:\c!symbol:\currentregisterpagesymbol\endcsname
- \csname\??id:\c!symbol:\currentregisterpagesymbol\endcsname
+ \csname\??registersymbol n\endcsname
+ \else\ifcsname\??registersymbol\currentregisterpagesymbol\endcsname
+ \csname\??registersymbol\currentregisterpagesymbol\endcsname
\else
\let\registerpageseparatorsymbol\space
- \def\registeronepage {\registerparameter\c!symbol\gobblefourarguments}%
- \def\registerpagerange {\registerparameter\c!symbol\gobblesevenarguments}%
+ \def\registeronepage{\registerparameter\c!symbol\gobblefourarguments}%
+ \def\registerpagerange{\registerparameter\c!symbol\gobblesevenarguments}%
\fi\fi}
\appendtoks
@@ -853,6 +879,6 @@
\defineregister
[\v!index]
- [\v!indices]
+% [\v!indices]
\protect \endinput
diff --git a/tex/context/base/supp-mat.mkiv b/tex/context/base/supp-mat.mkiv
index 0c2402671..d07560d9c 100644
--- a/tex/context/base/supp-mat.mkiv
+++ b/tex/context/base/supp-mat.mkiv
@@ -192,25 +192,47 @@
% \ht\scratchbox-\scratchdimen
% \box\scratchbox}
-\def\math_cramped#1#2%
+% mkii:
+%
+% \def\math_cramped#1#2%
+% {\begingroup % added HH, made even more cramped
+% \setbox\scratchbox\hbox
+% {\nulldelimiterspace\zeropoint
+% \normalstartimath\mathsurround\zeropoint#1\radical\zerocount{#2}\normalstopimath}%
+% \ht\scratchbox-\dimexpr
+% \ifx#1\displaystyle
+% \fontdimen\pluseight\textfont\plusthree
+% +.25\fontdimen\plusfive\textfont\plustwo
+% \else
+% 1.25\fontdimen\pluseight
+% \ifx#1\textstyle
+% \textfont
+% \else\ifx#1\scriptstyle
+% \scriptfont
+% \else
+% \scriptscriptfont
+% \fi \fi
+% \plusthree
+% \fi
+% -\ht\scratchbox
+% \relax
+% \box\scratchbox
+% \endgroup}
+
+\def\math_cramped#1#2% we have all in one family
{\begingroup % added HH, made even more cramped
\setbox\scratchbox\hbox
{\nulldelimiterspace\zeropoint
\normalstartimath\mathsurround\zeropoint#1\radical\zerocount{#2}\normalstopimath}%
\ht\scratchbox-\dimexpr
\ifx#1\displaystyle
- \fontdimen8\textfont3
- +.25\fontdimen5\textfont2
+ \fontdimen\pluseight\textfont\plusone
+ + .25\fontdimen\plusfive \textfont\plusone
\else
- 1.25\fontdimen8
- \ifx#1\textstyle
- \textfont
- \else\ifx#1\scriptstyle
- \scriptfont
- \else
- \scriptscriptfont
- \fi \fi
- \plusthree
+ 1.25\fontdimen\pluseight
+ \ifx#1\textstyle \textfont \else
+ \ifx#1\scriptstyle\scriptfont \else
+ \scriptscriptfont\fi\fi \plusone
\fi
-\ht\scratchbox
\relax
diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv
index 0de742bd3..fb8d68d17 100644
--- a/tex/context/base/syst-aux.mkiv
+++ b/tex/context/base/syst-aux.mkiv
@@ -2446,7 +2446,7 @@
{\syst_helpers_seventuple_empty_four_yes#1{#2}{#3}{#4}}%
{\syst_helpers_seventuple_empty_four_nop#1{#2}{#3}{#4}}}
-\def\syst_helpers_seventupleempty_four_yes#1#2#3#4[#5]%
+\def\syst_helpers_seventuple_empty_four_yes#1#2#3#4[#5]%
{\fourthargumenttrue
\doifnextoptionalelse
{\syst_helpers_seventuple_empty_five_yes#1{#2}{#3}{#4}{#5}}%
@@ -3332,7 +3332,8 @@
{\csname\??recurseaction\recursedepth\endcsname}
\unexpanded\def\syst_helpers_stepwise_recurse_yes
- {\syst_helpers_recurse_content\syst_helpers_stepwise_recurse}
+ {\syst_helpers_recurse_content
+ \syst_helpers_stepwise_recurse}
\unexpanded\def\syst_helpers_stepwise_reverse#1#2#3% from to step
{\ifnum#1<#2\relax
@@ -3345,7 +3346,8 @@
\fi\expandafter{\the\innerrecurse}{#2}{#3}}
\unexpanded\def\syst_helpers_stepwise_reverse_yes
- {\syst_helpers_recurse_content\syst_helpers_stepwise_reverse}
+ {\syst_helpers_recurse_content
+ \syst_helpers_stepwise_reverse}
\unexpanded\def\syst_helpers_stepwise_exit
{\syst_helpers_stepwise_recurse_nop\relax}
@@ -3354,14 +3356,14 @@
{\expandafter\let\expandafter\recurselevel\csname\??recurseindex\recursedepth\endcsname
\global\advance\outerrecurse\minusone}
-\unexpanded\def\nonostepwiserecurse#1#2#3%
- {\expandafter\let\expandafter\recurselevel\csname\??recurseindex\recursedepth\endcsname
- \global\advance\outerrecurse\minusone}
+% \unexpanded\def\nonostepwiserecurse#1#2#3%
+% {\expandafter\let\expandafter\recurselevel\csname\??recurseindex\recursedepth\endcsname
+% \global\advance\outerrecurse\minusone}
\unexpanded\def\dorecurse#1%
{\dostepwiserecurse\plusone{#1}\plusone}
-\def\doexpandedrecurse#1#2%
+\def\doexpandedrecurse#1#2% user macro
{\ifnum#1>\zerocount
#2\expandafter\doexpandedrecurse\expandafter{\the\numexpr#1-1\relax}{#2}%
\fi}
@@ -3426,7 +3428,8 @@
\fi\expandafter{\the\innerrecurse}{#2}}
\unexpanded\def\syst_helpers_recurse_indeed_yes
- {\syst_helpers_recurse_content\syst_helpers_recurse_indeed}
+ {\syst_helpers_recurse_content
+ \syst_helpers_recurse_indeed}
\unexpanded\def\syst_helpers_recurse_indeed_nop#1#2#3%
{\expandafter\let\expandafter\recurselevel\csname\??recurseindex\recursedepth\endcsname
@@ -3464,7 +3467,8 @@
\expandafter\syst_helpers_loop_yes\expandafter{\the\numexpr\recurselevel+\plusone\relax}}
\unexpanded\def\syst_helpers_loop_yes
- {\syst_helpers_recurse_content\endofloop}
+ {\syst_helpers_recurse_content
+ \endofloop}
\unexpanded\def\syst_helpers_loop_nop#1%
{\let\endofloop\syst_helpers_loop % new, permits nested \doloop's
@@ -3565,21 +3569,40 @@
% faster
+% \unexpanded\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
+% {\global\advance\outerrecurse \plusone
+% \global\expandafter\def\csname\??recurseaction\recursedepth\endcsname##1##2{#4}%
+% \global\expandafter\let\csname\??recurseindex\recursedepth\endcsname\recurselevel
+% \csname @swr%
+% \ifnum#3>\zerocount
+% \ifnum#2<#1\else d\fi
+% \else\ifnum#3<\zerocount
+% \ifnum#1<#2\else r\fi
+% \fi\fi
+% \expandafter\endcsname\normalexpanded{{\number#1}{\number#2}{\number#3}}}
+
+% \let\@swr \syst_helpers_stepwise_exit
+% \let\@swrd\syst_helpers_stepwise_recurse
+% \let\@swrr\syst_helpers_stepwise_reverse
+
+\installsystemnamespace{recursestepwise}
+
\unexpanded\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
{\global\advance\outerrecurse \plusone
\global\expandafter\def\csname\??recurseaction\recursedepth\endcsname##1##2{#4}%
\global\expandafter\let\csname\??recurseindex\recursedepth\endcsname\recurselevel
- \csname @swr%
+ \csname\??recursestepwise
\ifnum#3>\zerocount
\ifnum#2<#1\else d\fi
\else\ifnum#3<\zerocount
\ifnum#1<#2\else r\fi
\fi\fi
\expandafter\endcsname\normalexpanded{{\number#1}{\number#2}{\number#3}}}
+ % \expandafter\endcsname\expandafter{\number#1\expandafter}\expandafter{\number#2\expandafter}\expandafter{\number#3}}
-\let\@swr \syst_helpers_stepwise_exit
-\let\@swrd\syst_helpers_stepwise_recurse
-\let\@swrr\syst_helpers_stepwise_reverse
+\letvalue{\??recursestepwise }\syst_helpers_stepwise_exit
+\letvalue{\??recursestepwise d}\syst_helpers_stepwise_recurse
+\letvalue{\??recursestepwise r}\syst_helpers_stepwise_reverse
% quite okay too, but untested
%
diff --git a/tex/context/base/tabl-ltb.mkiv b/tex/context/base/tabl-ltb.mkiv
index 542d256f2..b126883c6 100644
--- a/tex/context/base/tabl-ltb.mkiv
+++ b/tex/context/base/tabl-ltb.mkiv
@@ -63,6 +63,8 @@
\newconstant\linetableheadstate
\newconstant\linetablemode
+\definesystemvariable {le} % LinetablE
+
\edef\??ler{\??le:r:}
\edef\??lec{\??le:c:}
\edef\??lew{\??le:w:}
diff --git a/tex/context/base/type-ini.mkvi b/tex/context/base/type-ini.mkvi
index 8ca42854f..f41c392d1 100644
--- a/tex/context/base/type-ini.mkvi
+++ b/tex/context/base/type-ini.mkvi
@@ -27,6 +27,8 @@
\unprotect
+\definesystemvariable {ts} % TypeScript / for the moment we keep this one
+
\newcount \c_font_typescripts_n_of_preloaded
\newconditional\c_font_typescripts_quit
\newtoks \c_font_typescripts_document
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 3bdd6a383..f90596a98 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 07/04/12 14:44:07
+-- merge date : 07/04/12 23:48:37
do -- begin closure to overcome local limits and interference