summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-05-12 22:28:50 +0000
committerKarl Berry <karl@freefriends.org>2007-05-12 22:28:50 +0000
commit93ea72b1e370ead6127c322de9056d1a9da9286a (patch)
tree36568678c8626a28d78ffa2f3be14d975841fcfc /Master/texmf-dist/tex/xelatex
parentd64b1266aa8e76eed5e75a45d71c2a56ad3af048 (diff)
bidi update (10may07)
git-svn-id: svn://tug.org/texlive/trunk@4276 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex')
-rw-r--r--Master/texmf-dist/tex/xelatex/bidi/bidi.sty48
1 files changed, 37 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi/bidi.sty b/Master/texmf-dist/tex/xelatex/bidi/bidi.sty
index 9d4fe981f0d..7ac709c9eaf 100644
--- a/Master/texmf-dist/tex/xelatex/bidi/bidi.sty
+++ b/Master/texmf-dist/tex/xelatex/bidi/bidi.sty
@@ -12,11 +12,11 @@
%% License information appended
%%
%%
+%% \section{Implementation}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{bidi}
- [2007/03/06 v0.2 Bidirectional typesetting in XeLaTeX]
-%% this is not used for now:
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ [2007/04/30 v0.2.2 Bidirectional typesetting in XeLaTeX]
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifx\TeXXeTstate\undefined\else%
\TeXXeTstate=1
\fi
@@ -40,16 +40,12 @@
\everydisplay{\if@rl\aftergroup\beginR\fi }
\def\rl@everypar{\if@rl{\setbox\z@\lastbox\beginR\usebox\z@}\fi}
\let\o@everypar=\everypar
-%% The following, surely, will not play well with all packages, e.g. ledmac
-%% But we now use this instead, taken from Arabicore.sty in the Arabi package.
-%% Thanks to Youssef Jabri! Shukran jazilan!
\newtoks\n@everypar
\n@everypar\expandafter{\the\o@everypar}
\o@everypar{\rl@everypar\the\n@everypar}
\let\everypar=\n@everypar
\def\@ensure@RL#1{\if@rl#1\else\RL{#1}\fi}
\def\@ensure@LR#1{\if@rl\LR{#1}\else#1\fi}
-%%%preserve logos
\let\@@TeX\TeX
\def\TeX{\LR{\@@TeX}}
\let\@@LaTeX\LaTeX
@@ -60,7 +56,6 @@
\let\@@XeTeX\XeTeX
\def\XeTeX{\LR{\@@XeTeX}}
}{}
-%%VARIOUS LATEX MACROS
\def\list#1#2{%
\ifnum \@listdepth >5\relax
\@toodeep
@@ -87,7 +82,7 @@
\fi
\parshape \@ne \@totalleftmargin \linewidth
\ignorespaces}
-%%%
+%%
\def\@dottedtocline#1#2#3#4#5{%
\ifnum #1>\c@tocdepth \else
\vskip \z@ \@plus.2\p@
@@ -108,7 +103,7 @@
\hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor \beginL#5\endL}%
\par}%
\fi}
-%%%
+%%
\def\raggedright{%
\let\\\@centercr
\leftskip\z@skip\rightskip\@flushglue
@@ -167,7 +162,9 @@
\ifx\@textcolor\@undefined\else%
\AtBeginDocument{%
\def\@textcolor#1#2#3{%
- \if@rl%
+ \if@rl\PackageWarning{bidi}{%
+ \textcolor will not work in RL mode if the textual argument spans more than one line.^^J%
+ With XeTeX you should set color as a font feature instead.}%
\beginL\protect\leavevmode{\color#1{#2}\beginR#3\endR}\endL%
\else%
\protect\leavevmode{\color#1{#2}#3}%
@@ -235,8 +232,25 @@
\fi
\fi
}
+
+\def\abjadsyriac#1{%
+\ifnum#1>499 \PackageWarning{bidi}{Illegal value (#1) for Syriac abjad numeral} {#1}
+\else
+ \ifnum#1<\z@\space\PackageWarning{bidi}{Illegal value (#1) for Syriac abjad numeral}%
+ \else
+ \ifnum#1<10\expandafter\abj@syr@num@i\number#1%
+ \else
+ \ifnum#1<100\expandafter\abj@syr@num@ii\number#1%
+ \else
+ \expandafter\abj@syr@num@iii\number#1%
+ \fi
+ \fi
+ \fi
+\fi
+}
\def\abjad@zero{}
\def\hebnum@zero{}
+\def\syriac@zero{}
\def\abj@num@i#1{%
\ifcase#1\or\char"0627 \or\char"0628 \or\char"062C \char"200D\or\char"062F %
\or\char"0647 \or\char"0648 \or\char"0632 \or\char"062D \or\char"0637 \fi
@@ -282,6 +296,18 @@
\or\char"05D3\char"05F3 \or\char"05D4\char"05F3 \or\char"05D5\char"05F3 %
\or\char"05D6\char"05F3 \or\char"05D7\char"05F3 \or\char"05D8\char"05F3 \fi
\ifnum#1=\z@\fi\heb@num@iii}
+
+\def\abj@syr@num@i#1{%
+ \ifcase#1\or\char"0710 \or\char"0712 \or\char"0713 \or\char"0715 %
+ \or\char"0717 \or\char"0718 \or\char"0719 \or\char"071A \or\char"071B\fi
+ \ifnum#1=\z@\syriac@zero\fi}
+\def\abj@syr@num@ii#1{%
+ \ifcase#1\or\char"071D \or\char"071F \or\char"0720 \or\char"0721 \or\char"0722 %
+ \or\char"0723 \or\char"0725 \or\char"0726 \or\char"0728 \fi
+ \ifnum#1=\z@\fi\abj@syr@num@i}
+\def\abj@syr@num@iii#1{%
+ \ifcase#1\or\char"0729 \or\char"072A \or\char"072B \or\char"072C \fi
+ \ifnum#1=\z@\fi\abj@syr@num@ii}
%%
%% Copyright (C) 2007 by François Charette <firmicus at gmx dot net>
%%