tabl-ali.mkxl /size: 1424 b    last modification: 2024-01-16 10:22
1%D \module
2%D   [       file=core-ali,
3%D        version=2023.06.15,
4%D          title=\CONTEXT\ Table Macros,
5%D       subtitle=Text Simple Alignment,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\writestatus{loading}{ConTeXt Table Macros / Alignment}
15
16%D This module is for Bruce Horrocks (and a follow up on a chat session). Watch out,
17%D when a shift results in a newline we get oscillation!
18
19\unprotect
20
21\newinteger  \c_align_point_index
22\newdimension\d_align_point_delta
23
24\registerctxluafile{tabl-ali}{autosuffix}
25
26\permanent\protected\def\ap[#1]%
27  {\ifchknum#1\or
28     \dontleavehmode
29     \global\advance\c_align_point_index\plusone
30     \d_align_point_delta\clf_align_point_delta
31       \numexpr#1\relax
32       \c_align_point_index
33     \relax
34     \xypos{ap::\number#1:\the\c_align_point_index}%
35     \hkern\d_align_point_delta
36  \fi}
37
38\protect \endinput
39
40% \starttext
41%     \dostepwiserecurse{10}{10000}{10}{
42%                    \ap[1]{\bf\darkred 1} test       test \ap[2]{\bf\darkblue 2} test #1.#1 \ap[3]{\bf \darkgreen 3} test       \par
43%         test #1.#1 \ap[1]{\bf\darkred 1} test #1.#1 test \ap[2]{\bf\darkblue 2} test       \ap[3]{\bf \darkgreen 3} test #1.#1 \par
44%     }
45% \stoptext
46
47