Hi!

A while back Wolfgang presented a nice solution for alternating
fillers:

  https://www.mail-archive.com/ntg-context@ntg.nl/msg67677.html

It works if the text has a constant width. But if the width changes,
the alternating look is lost. Is there a way to align the dots
vertically even if the text has variable width? Example:

\usemodule
  [visual]

\definefiller
  [pavel-0]
  [alterntive=symbol,
   method=global,
   width=2em,
   leftmargin=.5em,
   rightmargin=.5em,
   symbol=\clap{.}]

\definefiller
  [pavel-1]
  [pavel-0]
  [align=left]

\definefiller
  [pavel-2]
  [pavel-0]
  [align=middle]

\newconditional\PavelState
\global\setfalse\PavelState

\define\PavelFiller
  {\ifconditional\PavelState
     \global\setfalse\PavelState
     \filler[pavel-1]%%
   \else
     \global\settrue\PavelState
     \filler[pavel-2]%%
   \fi}

\def\oneword
  {\getrandomnumber\n{1}{100}\fakenwords{1}{\n}}

\starttext
  %% dots are vertically aligned
  \dorecurse{6}{%%
    Foo \PavelFiller Bar\par}

  \hairline

  %% dots are not aligned
  \dorecurse{6}{%%
    \oneword\PavelFiller\oneword\par}
\stoptext

Marco

LMTX 2023.09.04 19:15
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to