* [NTG-context] Vertically aligned alternating fillers
@ 2023-11-16 19:32 Marco Patzer
0 siblings, 0 replies; only message in thread
From: Marco Patzer @ 2023-11-16 19:32 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-16 19:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-16 19:32 [NTG-context] Vertically aligned alternating fillers Marco Patzer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).