summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/supp-dir.mkxl
blob: e6c2a58693c1bb2c02e84bd6db53ac4deccc52e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
%D \module
%D   [       file=supp-dir,
%D        version=2004.11.11,
%D          title=\CONTEXT\ Support Macros,
%D       subtitle=Directional Things,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\unprotect

\chardef\directionlefttoright\zerocount
\chardef\directionrighttoleft\plusone

\edef\??bdir{\ifdefined\bodydir bdir\else direction\fi}

\protected\edef\naturalhbox  {\hbox  \??bdir\directionlefttoright}
\protected\edef\naturalvbox  {\vbox  \??bdir\directionlefttoright}
\protected\edef\naturalvtop  {\vtop  \??bdir\directionlefttoright}
\protected\edef\naturalhpack {\hpack \??bdir\directionlefttoright}
\protected\edef\naturalvpack {\vpack \??bdir\directionlefttoright}
\protected\edef\naturaltpack {\tpack \??bdir\directionlefttoright}

\protected\edef\reversehbox  {\hbox  \??bdir\directionrighttoleft}
\protected\edef\reversevbox  {\vbox  \??bdir\directionrighttoleft}
\protected\edef\reversevtop  {\vtop  \??bdir\directionrighttoleft}
\protected\edef\reversehpack {\hpack \??bdir\directionrighttoleft}
\protected\edef\reversevpack {\vpack \??bdir\directionrighttoleft}
\protected\edef\reversetpack {\tpack \??bdir\directionrighttoleft}

\ifdefined\bodydir
    \let\bodydir      \undefined \let\normalbodydir      \undefined
    \let\bodydirection\undefined \let\normalbodydirection\undefined
\fi

\ifdefined\pagedir
    \let\pagedir      \undefined \let\normalpagedir      \undefined
    \let\pagedirection\undefined \let\normalpagedirection\undefined
\fi

% \expanded{\defineactivecharacter \number"2000E} {\textdirection\directionrighttoleft\relax}
% \expanded{\defineactivecharacter \number"2000F} {\textdirection\directionlefttoright\relax}

\def\syst_direction_string#1{\ifcase#1=\plusone r2l\else l2r\fi}

\protected\def\showdirsinmargin
  {\normalexpanded{\inleft{\naturalhbox
     {\ttxx[\syst_direction_string\pardirection,\syst_direction_string\textdirection]}}}}

\protect \endinput