diff options
author | Hans Hagen <pragma@wxs.nl> | 2022-12-07 21:44:10 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2022-12-07 21:44:10 +0100 |
commit | fb63eac7402fbd3bb00d7591cc4fbac1b2db2582 (patch) | |
tree | bf692e177e1d157ddf6a038407fc86539ff5048f /tex/context/base/mkxl/pack-box.mkxl | |
parent | 265ba2a85e0945a37972e22f23bcaac16d6c08a1 (diff) | |
download | context-fb63eac7402fbd3bb00d7591cc4fbac1b2db2582.tar.gz |
2022-12-07 20:24:00
Diffstat (limited to 'tex/context/base/mkxl/pack-box.mkxl')
-rw-r--r-- | tex/context/base/mkxl/pack-box.mkxl | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/tex/context/base/mkxl/pack-box.mkxl b/tex/context/base/mkxl/pack-box.mkxl index ecd793056..7c64b0032 100644 --- a/tex/context/base/mkxl/pack-box.mkxl +++ b/tex/context/base/mkxl/pack-box.mkxl @@ -1236,6 +1236,24 @@ \newcount\registeredboxanchor +\installmacrostack\boxanchoringclass + +\mutable\let\boxanchoringclass\empty + +\newcount\c_anchor_auto_box_class + +\permanent\protected\def\startboxanchoring[#1]% + == auto + {\push_macro_boxanchoringclass + \iftok{#1}{+}% + \global\advance\c_anchor_auto_box_class\plusone + \edef\boxanchoringclass{\the\c_anchor_auto_box_class::}% + \else + \edef\boxanchoringclass{#1} + \fi} + +\permanent\protected\def\stopboxanchoring + {\pop_macro_boxanchoringclass} + \permanent\protected\def\registerboxanchor {\global\advance\registeredboxanchor\minusone} @@ -1243,6 +1261,13 @@ {\registerboxanchor \global\expandafter\integerdef\csname\??boxanchors#1\endcsname\registeredboxanchor} +\permanent\protected\def\doifnotanchorbox#1% + {\ifcsname\??boxanchors#1\endcsname + \expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + \permanent\def\namedboxanchor#1% {\normalexpanded{\ifcsname\??boxanchors#1\endcsname\lastnamedcs\orelse\ifchknum#1\or#1\else\zerocount\fi}} @@ -1290,11 +1315,14 @@ %D The name might change: -\permanent\protected\def\mathboxanchored#1#2{#2\Umathsource\namedboxanchor{#1}\relax} - \permanent\protected\def\mathrowanchored #1{\alignmentwrapsource\namedboxanchor{#1}\relax} \permanent\protected\def\mathcellanchored#1{\alignmentcellsource\namedboxanchor{#1}\relax} +%permanent\protected\def\mathboxanchored#1#2{#2\Umathsource\namedboxanchor{#1}\relax} + +\permanent\tolerant\protected\def\mathboxanchored[#1]#:#2#3% + {#3\Umathsource\iftok{#1}{nucleus}#1\fi\namedboxanchor{\boxanchoringclass:#2}\relax} + % to be used as: % % \scratchcounter\registeredboxanchor |