Am 04.11.2025 um 16:42 schrieb vm via ntg-context:
Given a chunk of text,

8<---
\setuppapersize[A1]
\setupheader [state=empty, no]
\usetypescript[ibmplex]
\setupbodyfont[ibmplex, mono, 10pt]
\setupinterlinespace[12=pt]
\hyphenation[off]
\definelayer[behindtext]
\definelayer[beforetext]
\setupbackgrounds[text][background={behindtext,foreground,beforetext}]
\definecolor[achter][r=.95,g=.95,b=.95]
\startTEXpage[offset=10mm]
\setlayer[behindtext][x=63mm,y=0mm]{\framed[width=2mm,height=\textheight,background=color,backgroundcolor=achter,frame=off]{}} \setlayer[behindtext][x=139mm,y=0mm]{\framed[width=2mm,height=\textheight,background=color,backgroundcolor=achter,frame=off]{}}

\setlayer[behindtext][x=\MPx{period-1}]{\blackrule[width=2mm,height=th,color=achter]}
\setlayer[behindtext][x=\MPx{period-2}]{\blackrule[width=2mm,height=th,color=achter]}

\startlines
~~~~~~~~~~~~~~~~~~~~~~~~~.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~\hpos{period-1}{.}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\hpos{period-2}{.}~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~haken~&~ogen~~~~~~~~~~~~~~~~~~~~~~~~~~~~taxatie~&~advies~~~~~~~~ ~~~~~~~~~~~~~~~~bloemen~&~planten~~~~~~~~~~~~~~~~inspireren~&~innoveren~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~rijst~&~linzen~~~~~~~~~~~~~~~~~~~~~~~~~~mager~&~bleek~~~~~~~~~~~~~~~
\stoplines
\stopTEXpage
\stoptext
--->8

what would be the simple way to extract the position of the two period (.) symbols in the first line, to be used in the two vertical bars definitions above.

See above, use \hpos to mark the content where you need the position and \MPx to access the horizontal position.

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
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