summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/cals/rtl.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-11-25 22:39:44 +0000
committerKarl Berry <karl@freefriends.org>2016-11-25 22:39:44 +0000
commit4a55147e264bbcb051fbb9a51b05b190e52bd6b7 (patch)
tree93f4c55dd1e9badbcc219df8ac9663e5690329ba /Master/texmf-dist/source/latex/cals/rtl.dtx
parentdc4d59f0c0a68d9586f1d3f32d9f7a3bb32e29d9 (diff)
cals (25nov16)
git-svn-id: svn://tug.org/texlive/trunk@42577 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/cals/rtl.dtx')
-rw-r--r--Master/texmf-dist/source/latex/cals/rtl.dtx42
1 files changed, 42 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/cals/rtl.dtx b/Master/texmf-dist/source/latex/cals/rtl.dtx
new file mode 100644
index 00000000000..ed891fd4243
--- /dev/null
+++ b/Master/texmf-dist/source/latex/cals/rtl.dtx
@@ -0,0 +1,42 @@
+% \subsection{RTL (right-to-left) hooks}
+
+% \begin{macro}{\if@RTL}
+% \begin{macro}{\if@RTLtab}
+% \begin{macro}{\@RTLtabtrue}
+% Provide RTL status commands even if the RTL packages are not loaded.
+% \begin{macrocode}
+\def\next{%
+ \let\if@RTL=\iffalse
+ \let\if@RTLtab=\iffalse
+ \let\@RTLtabtrue=\relax
+}
+\ifdefined\if@RTL \relax \else \next \fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+
+% \begin{macro}{\cals@setup@alignment}
+% Swap alignment in the RTL mode.
+% \begin{macrocode}
+\newcommand\cals@setup@alignment[1]{%
+\if c#1\relax \cals@vfillAdd \leftskip \cals@vfillAdd \rightskip \fi
+\if@RTL
+ \if l#1\relax \cals@vfillAdd \leftskip \cals@vfillDrop\rightskip \fi
+ \if r#1\relax \cals@vfillDrop\leftskip \cals@vfillDrop\rightskip \fi
+\else
+ \if l#1\relax \cals@vfillDrop\leftskip \cals@vfillDrop\rightskip \fi
+ \if r#1\relax \cals@vfillAdd \leftskip \cals@vfillDrop\rightskip \fi
+\fi
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\cals@hskip@lr}
+% Do |hskip| with the first argument, unless in the RTL mode.
+% \begin{macrocode}
+\newcommand\cals@hskip@lr[2]{%
+\if@RTL \hskip#2\relax \else \hskip#1\relax \fi}
+% \end{macrocode}
+% \end{macro}
+