supp-dir.mkiv /size: 2058 b    last modification: 2021-10-28 13:50
1%D \module
2%D   [       file=supp-dir,
3%D        version=2004.11.11,
4%D          title=\CONTEXT\ Support Macros,
5%D       subtitle=Directional Things,
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\unprotect
15
16% \immutable\chardef\directionlefttoright\zerocount
17% \immutable\chardef\directionrighttoleft\plusone
18
19\setnewconstant\directionlefttoright\zerocount
20\setnewconstant\directionrighttoleft\plusone
21
22\immutable\edef\??bdir{\ifdefined\bodydir bdir\else direction\fi}
23
24\permanent\protected\edef\naturalhbox  {\hbox  \??bdir\directionlefttoright}
25\permanent\protected\edef\naturalvbox  {\vbox  \??bdir\directionlefttoright}
26\permanent\protected\edef\naturalvtop  {\vtop  \??bdir\directionlefttoright}
27\permanent\protected\edef\naturalhpack {\hpack \??bdir\directionlefttoright}
28\permanent\protected\edef\naturalvpack {\vpack \??bdir\directionlefttoright}
29\permanent\protected\edef\naturaltpack {\tpack \??bdir\directionlefttoright}
30
31\permanent\protected\edef\reversehbox  {\hbox  \??bdir\directionrighttoleft}
32\permanent\protected\edef\reversevbox  {\vbox  \??bdir\directionrighttoleft}
33\permanent\protected\edef\reversevtop  {\vtop  \??bdir\directionrighttoleft}
34\permanent\protected\edef\reversehpack {\hpack \??bdir\directionrighttoleft}
35\permanent\protected\edef\reversevpack {\vpack \??bdir\directionrighttoleft}
36\permanent\protected\edef\reversetpack {\tpack \??bdir\directionrighttoleft}
37
38% \expanded{\defineactivecharacter \number"2000E} {\textdirection\directionrighttoleft\relax}
39% \expanded{\defineactivecharacter \number"2000F} {\textdirection\directionlefttoright\relax}
40
41\def\syst_direction_string#1{\ifcase#1=\plusone r2l\else l2r\fi}
42
43\permanent\protected\def\showdirsinmargin
44  {\normalexpanded{\inleft{\naturalhbox
45     {\ttxx[\syst_direction_string\pardirection,\syst_direction_string\textdirection]}}}}
46
47\protect \endinput
48