From 4a55147e264bbcb051fbb9a51b05b190e52bd6b7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 25 Nov 2016 22:39:44 +0000 Subject: cals (25nov16) git-svn-id: svn://tug.org/texlive/trunk@42577 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/cals/rtl.dtx | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Master/texmf-dist/source/latex/cals/rtl.dtx (limited to 'Master/texmf-dist/source/latex/cals/rtl.dtx') 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} + -- cgit v1.2.3