diff options
Diffstat (limited to 'tex/context/base/syst-aux.mkiv')
-rw-r--r-- | tex/context/base/syst-aux.mkiv | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv index 5f00960e0..1fbf98296 100644 --- a/tex/context/base/syst-aux.mkiv +++ b/tex/context/base/syst-aux.mkiv @@ -5130,21 +5130,48 @@ %D These examples show us that an optional can be used. The %D value provided is added to \type{\localhsize}. -\newdimen\localhsize +% todo: a fast non argument variant -\def\complexsetlocalhsize[#1]% don't change ! - {\localhsize\hsize - \ifnum\hangafter<\zerocount - \advance\localhsize\ifdim\hangindent>\zeropoint-\fi\hangindent - \fi - \advance\localhsize -\leftskip - \advance\localhsize -\rightskip - \advance\localhsize #1\relax} +\newdimen\localhsize -\def\simplesetlocalhsize - {\complexsetlocalhsize[\zeropoint]} +% \def\complexsetlocalhsize[#1]% don't change ! +% {\localhsize\hsize +% \ifnum\hangafter<\zerocount +% \advance\localhsize\ifdim\hangindent>\zeropoint-\fi\hangindent +% \fi +% \advance\localhsize -\leftskip +% \advance\localhsize -\rightskip +% \advance\localhsize #1\relax} +% +% \def\simplesetlocalhsize +% {\complexsetlocalhsize[\zeropoint]} +% +% \definecomplexorsimple\setlocalhsize + +\unexpanded\def\setlocalhsize % don't change ! + {\doifnextoptionalelse + \syst_helpers_set_local_hsize_yes + \syst_helpers_set_local_hsize_nop} + +% \def\syst_helpers_set_local_hsize_nop +% {\localhsize\hsize +% \ifnum\hangafter<\zerocount +% \advance\localhsize\ifdim\hangindent>\zeropoint-\fi\hangindent +% \fi +% \advance\localhsize -\leftskip +% \advance\localhsize -\rightskip} + +\def\syst_helpers_set_local_hsize_nop + {\localhsize\dimexpr + \hsize -\leftskip -\rightskip + \ifnum\hangafter<\zerocount + \ifdim\hangindent>\zeropoint-\else+\fi\hangindent + \fi + \relax} -\definecomplexorsimple\setlocalhsize +\def\syst_helpers_set_local_hsize_yes[#1]% + {\syst_helpers_set_local_hsize_nop + \advance\localhsize#1\relax} %D \macros %D {doifvalue,doifnotvalue,doifelsevalue, |