diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-08-02 21:03:52 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-08-02 21:03:52 +0200 |
commit | 3668eb2ecc0f7dcc6c44fd1e971cbe37fa010fd6 (patch) | |
tree | 1bb01a58b6f193a42fc99189e5437313650ee39f /tex/context/base/mkiv/pack-rul.mkxl | |
parent | 1873d112b56f49e40ece29916ede51933412bca8 (diff) | |
download | context-3668eb2ecc0f7dcc6c44fd1e971cbe37fa010fd6.tar.gz |
2019-08-02 19:47:00
Diffstat (limited to 'tex/context/base/mkiv/pack-rul.mkxl')
-rw-r--r-- | tex/context/base/mkiv/pack-rul.mkxl | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/tex/context/base/mkiv/pack-rul.mkxl b/tex/context/base/mkiv/pack-rul.mkxl index e21f5f1c2..0da5bff61 100644 --- a/tex/context/base/mkiv/pack-rul.mkxl +++ b/tex/context/base/mkiv/pack-rul.mkxl @@ -1589,10 +1589,38 @@ \egroup} %D Anchoring is experimental and was prototyped around the ctx meeting in 2018 but -%D never mede it into the core yet. It operates indepedent of the orientation -%D mechanism already present. +%D never mede it into the core yet. It operates independent of the orientation +%D mechanism already present. It's a rather efficient feature. Best is to use +%D predefined orientations, like: +%D +%D \starttyping +%D \defineorientation[leftflushleft] [orientation=left,horizontal=flushleft] +%D +%D \framed [anchoring={leftflushleft}] {anchoring} +%D \stoptyping +%D +%D But this also works: +%D +%D \starttyping +%D \framed [anchoring={flushleft,top,up}] {anchoring} +%D \stoptyping +%D +%D When an anchoring is given (use \type {normal} for the default) you can also +%D use the \type {xanchor} and \type {yanchor} offsets. -\let\pack_framed_handle_anchoring\relax +% because we mess with the width later on, we need double wrapping: + +\def\pack_framed_handle_anchoring + {\scratchcounter\autoorientation\p_framed_anchoring\relax + \edef\p_xanchor{\framedparameter\c!xanchor}% + \edef\p_yanchor{\framedparameter\c!yanchor}% + \setbox\b_framed_normal\hpack{\hpack % here + % using the keyword approachs works ok, don't mess with orientation + % directly here using \boxorientation ... it doesn't work that well + \s!orientation\scratchcounter + \ifx\p_xanchor\empty\else \s!xoffset \p_xanchor\fi + \ifx\p_yanchor\empty\else \s!yoffset \p_yanchor\fi + {\box\b_framed_normal}}} \installcorenamespace{framedlocatorbefore} \installcorenamespace{framedlocatorafter} @@ -1771,7 +1799,7 @@ \setbox\b_framed_normal\hpack{\lower\d_framed_locator_dp\box\b_framed_normal}% \ht\b_framed_normal\d_framed_locator_ht \dp\b_framed_normal\d_framed_locator_dp - \hpack{\box\b_framed_normal}} % why do we pack .. dange of loosing? + \hpack{\box\b_framed_normal}} % why do we pack .. danger of loosing? % also used in fastlocalframed |