Hi Hans, here is a new attempt to get a more generalized version of the startnarrower macros, now mkiv only. Wolfgang \unprotect \def\narrowerparameter #1{\csname\donarrowerparameter{\??sl \@@narrower}#1\endcsname} \def\donarrowerparameter #1#2{\ifcsname#1#2\endcsname#1#2\else \expandafter\donarrowerparentparameter\csname#1\s!parent\endcsname#2\fi} \def\donarrowerparentparameter#1#2{\ifx#1\relax\s!empty\else \donarrowerparameter#1#2\fi} \getparameters [\??sl] [\c!before=\endgraf, \c!after=\endgraf, \c!left=1.5em, \c!right=1.5em, \c!middle=1.5em] \def\definenarrower {\dodoubleempty\dodefinenarrower} \def\dodefinenarrower[#1][#2]% {\getparameters[\??sl#1][\s!parent=\??sl,#2]% \setvalue{\e!start#1}{\dodoubleempty\dostartnarrower[#1]}% \setvalue{\e!stop #1}{\dostopnarrower}} \def\setupnarrower {\dodoubleempty\dosetupnarrower} \def\dosetupnarrower[#1][#2]% {\doifelsenothing{#2} {\getparameters[\??sl][#1]} {\def\docommand##1{\getparameters[\??sl##1][#2]}% \processcommacommand[#1]\docommand}} \definenarrowermethod[\v!left ]{\global\advance\ctxleftskip \narrowerparameter\c!left \relax} \definenarrowermethod[\v!middle ]{\global\advance\ctxmidskip \narrowerparameter\c!middle\relax} \definenarrowermethod[\v!right ]{\global\advance\ctxrightskip \narrowerparameter\c!right \relax} \definenarrowermethod[-\v!left ]{\global\advance\ctxleftskip - \narrowerparameter\c!left \relax} \definenarrowermethod[-\v!middle]{\global\advance\ctxmidskip - \narrowerparameter\c!middle\relax} \definenarrowermethod[-\v!right ]{\global\advance\ctxrightskip- \narrowerparameter\c!right \relax} \definenarrowermethod[\v!reset ]{\global\ctxleftskip \zeropoint \global\ctxmidskip \zeropoint \global\ctxrightskip\zeropoint\relax} \definenarrowermethod[\v!none ]{} \def\dostartnarrower[#1][#2]% {\bgroup \ifsecondargument % \doifsomethingelse{#2}? \dodostartnarrower[#1][#2]% \else \dodostartnarrower[#1][\v!middle]% \fi} \def\dodostartnarrower[#1][#2]% {\edef\@@narrower{#1}% \narrowerparameter\c!before \global\ctxleftskip \zeropoint \global\ctxrightskip\zeropoint \global\ctxmidskip \zeropoint \processcommalistwithparameters[#2]\donarrower \advance\leftskip \dimexpr\ctxleftskip +\ctxmidskip\relax \advance\rightskip\dimexpr\ctxrightskip+\ctxmidskip\relax \seteffectivehsize} \def\dostopnarrower {\narrowerparameter\c!after \egroup} \def\v!narrower{narrower} \definenarrower[\v!narrower] \protect \definenarrower[wide] [before={\blank[2*line]},after={\blank [2*line]},middle=0.5em] \definenarrower[narrow][before={\blank[4*line]},after={\blank [4*line]},middle=4.0em] \starttext \input ward \startnarrower \input ward\endgraf \stopnarrower \input ward \startnarrow \input ward\endgraf \stopnarrow \input ward \startwide \input ward\endgraf \stopwide \input ward \stoptext
participants (1)
-
Wolfgang Schuster