diff options
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/simurgh/simurgh-ltx.sty')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/simurgh/simurgh-ltx.sty | 84 |
1 files changed, 30 insertions, 54 deletions
diff --git a/Master/texmf-dist/tex/lualatex/simurgh/simurgh-ltx.sty b/Master/texmf-dist/tex/lualatex/simurgh/simurgh-ltx.sty index 0679d1b5935..d4be533583a 100644 --- a/Master/texmf-dist/tex/lualatex/simurgh/simurgh-ltx.sty +++ b/Master/texmf-dist/tex/lualatex/simurgh/simurgh-ltx.sty @@ -1,5 +1,5 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{simurgh-ltx}[2013/12/01 v0.01a changes to `latex.ltx'] +\ProvidesPackage{simurgh-ltx}[2013/09/18 v0.01a changes to `latex.ltx'] \newif\if@RTLtab \newif\if@RTLmarginpar \newif\if@LTRmarginpar @@ -8,6 +8,8 @@ \def\SepMark#1{\gdef\@SepMark{\if@RTL\fi#1\if@RTL\fi}} \SepMark{.} +\def\CaptionLabelSep#1{\gdef\@CaptionLabelSep{\if@RTL\fi#1\if@RTL\fi}} +\CaptionLabelSep{:} \def\setRTLbibitems{\@RTLbibitemstrue\@LTRbibitemsfalse} \def\setLTRbibitems{\@LTRbibitemstrue\@RTLbibitemsfalse} @@ -29,6 +31,8 @@ \def\@thmcountersep{\@SepMark} +\def\@mklab#1{\hfil \if@RTL\hboxR\else\hboxL\fi{#1}} + \def\list#1#2{% \ifnum \@listdepth >5\relax \@toodeep @@ -148,7 +152,7 @@ \if#1b\vbox \else\if #1t\vtop \else\ifmmode\vcenter - \else\@pboxswtrue \if@RTL\simurgh@mathdir TRT\fi$\vcenter + \else\@pboxswtrue \if@RTL\mathdir TRT\fi$\vcenter \fi\fi\fi \@parboxto{\let\hss\vss\let\unhbox\unvbox \csname bm@#3\endcsname}% @@ -157,15 +161,15 @@ \newenvironment{LTRitems} {\par\@RTLfalse% - \simurgh@pardir TLT% - \simurgh@textdir TLT% + \pardir TLT% + \textdir TLT% \parshape \@ne \dimexpr(\@totalleftmargin-\leftmargin) \linewidth% \ignorespaces}{\vskip\z@} \newenvironment{RTLitems} {\par\@RTLtrue% - \simurgh@pardir TRT% - \simurgh@textdir TRT% + \pardir TRT% + \textdir TRT% \parshape \@ne \dimexpr(\@totalleftmargin+\leftmargin) \linewidth% \ignorespaces}{\vskip\z@} @@ -216,55 +220,17 @@ % here we redefine \rlap and \llap so that right means `at the end of line' and left means `at the beggining of the line' % independent of the mode (RTL or LTR) we are in. this way, we make sure that specific macros that has to deal with % `at the beginning of the line' or `at the end of the line' still works correctly and there is no need to modify them. -\def\llap#1{% - \if@RTL% - \hb@xt@\z@{\hss#1}% - \else% - \ifvmode% - \hb@xt@\z@{#1\hss}% - \else% - \hb@xt@\z@{\hss#1}% - \fi% -\fi% -} - -\def\rlap#1{% - \if@RTL% - \hb@xt@\z@{#1\hss}% - \else% - \ifvmode% - \hb@xt@\z@{\hss#1}% - \else% - \hb@xt@\z@{#1\hss}% - \fi% -\fi% -} +\def\rlapR#1{\hbox to \z@{\textdir TRT #1\hss}} +\def\rlapL#1{\hbox dir TLT to \z@{\textdir TLT #1\hss}} +\def\llapR#1{\hbox to \z@{\hss \textdir TRT #1}} +\def\llapL#1{\hbox dir TLT to \z@{\hss \textdir TLT #1}} +\def\llap#1{\if@RTL\llapR{#1}\else\llapL{#1}\fi} +\def\rlap#1{\if@RTL\rlapR{#1}\else\rlapL{#1}\fi} % logical \llap and \rlap macros -\def\simurghllap#1{% - \if@RTL% - \hb@xt@\z@{#1\hss}% - \else% - \ifvmode% - \hb@xt@\z@{#1\hss}% - \else% - \hb@xt@\z@{\hss#1}% - \fi% -\fi% -} - -\def\simurghrlap#1{% - \if@RTL% - \hb@xt@\z@{\hss#1}% - \else% - \ifvmode% - \hb@xt@\z@{\hss#1}% - \else% - \hb@xt@\z@{#1\hss}% - \fi% -\fi% -} +\def\simurghllap#1{\if@RTL\rlapR{#1}\else\llapL{#1}\fi} +\def\simurghrlap#1{\if@RTL\llapR{#1}\else\rlapL{#1}\fi} \def\@hangfrom#1{\setbox\@tempboxa\hbox{{#1}}% @@ -638,7 +604,7 @@ \set@typeset@protect \lineskip\z@skip\baselineskip\z@skip \ifhmode \@preamerr\z@ \@@par\fi - \if@RTLtab\simurgh@textdir TRT\fi% + \if@RTLtab\textdir TRT\fi% \@preamble} \def\array{\let\@acol\@arrayacol \let\@classz\@arrayclassz \let\@classiv\@arrayclassiv @@ -682,8 +648,18 @@ \fi - +% math macros \everydisplay\expandafter{\the\everydisplay\predisplaydirection\z@} +\@ifpackageloaded{amsmath}{}{% +\def\endequation{\eqno \if@RTL\hboxR\else\hboxL\fi{\@eqnnum}$$\@ignoretrue}} +\def\@@eqncr{\let\reserved@a\relax + \ifcase\@eqcnt \def\reserved@a{& & &}\or \def\reserved@a{& &}% + \or \def\reserved@a{&}\else + \let\reserved@a\@empty + \@latex@error{Too many columns in eqnarray environment}\@ehc\fi + \reserved@a \if@eqnsw\if@RTL\hboxR\else\hboxL\fi{\@eqnnum}\stepcounter{equation}\fi + \global\@eqnswtrue\global\@eqcnt\z@\cr} + \simurgh@newrobustcmd*{\parsirq}{«} |