[NTG-context] Change the dots of the macro \periods[n]

Hans Hagen pragma at wxs.nl
Fri Mar 6 20:02:25 CET 2015


On 3/6/2015 6:42 PM, Fabrice Couvreur wrote:
>
> Hi,
> Is it possible to change the shape of the dots of macro \periods[n] to
> be like the dots of macro \definefiller[dots][left=\dontleavehmode,
> right=\hskip\ZeroPoint\par] ?

% in cont-new.mkiv :

\unprotect

\def\periodsymbol  {.}

\unexpanded\def\enco_periods[#1]%
   {\dontleavehmode
    \hbox\bgroup
    \enco_periods_indeed[#1,\periodsymbol,]}

\unexpanded\def\enco_periods_indeed[#1,#2,#3]%
   {\setbox\scratchbox\hbox to \periodswidth{\hss#2\hss}%
    \dorecurse{\iffirstargument#1\else\periodsdefault\fi}{\copy\scratchbox}%
    \egroup}

\protect

test:

\starttext
     \startlines
         x\periods x
         x\periods[10]x
         x\periods[10,{,}]x
         x\periods[10,{!}]x
     \stoplines
\stoptext


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list