diff options
Diffstat (limited to 'Master/texmf-dist/source/xelatex/bidi/bidi.dtx')
-rw-r--r-- | Master/texmf-dist/source/xelatex/bidi/bidi.dtx | 119 |
1 files changed, 94 insertions, 25 deletions
diff --git a/Master/texmf-dist/source/xelatex/bidi/bidi.dtx b/Master/texmf-dist/source/xelatex/bidi/bidi.dtx index a9fa357faa7..031efea6a02 100644 --- a/Master/texmf-dist/source/xelatex/bidi/bidi.dtx +++ b/Master/texmf-dist/source/xelatex/bidi/bidi.dtx @@ -5,7 +5,7 @@ %<*readme> ___________________ The bidi package -v16.4 +v16.5 This package provides a convenient interface for typesetting bidirectional texts in Plain TeX and LaTeX, using XeTeX engine. @@ -25,13 +25,13 @@ a minimal working example showing the issue, and always choose the appropriate label for your query (i.e. if you are reporting any bugs, choose `Bug' label). -Current version release date: 2014/12/28 +Current version release date: 2015/02/01 ___________________ Vafa Khalighi persian-tex@tug.org -Copyright © 2007–2014 +Copyright (c) 2007--2015 It may be distributed and/or modified under the LaTeX Project Public License, version 1.3c or higher (your choice). The latest version of this license is at: http://www.latex-project.org/lppl.txt @@ -49,7 +49,7 @@ by Vafa Khalighi. \preamble __________________________________________________ - Copyright © 2009–2014 Vafa Khalighi <persian-tex@tug.org> + Copyright (c) 2009--2015 Vafa Khalighi <persian-tex@tug.org> It may be distributed and/or modified under the LaTeX Project Public License, version 1.3c or higher (your choice). The latest version of @@ -61,6 +61,7 @@ by Vafa Khalighi. \endpreamble \askforoverwritefalse +\generate{\file{algorithm2e-xetex-bidi.def}{\from{\jobname.dtx}{table,algorithm2e-xetex-bidi.def}}} \generate{\file{amsart-xetex-bidi.def}{\from{\jobname.dtx}{table,amsart-xetex-bidi.def}}} \generate{\file{amsbook-xetex-bidi.def}{\from{\jobname.dtx}{table,amsbook-xetex-bidi.def}}} \generate{\file{amsmath-xetex-bidi.def}{\from{\jobname.dtx}{table,amsmath-xetex-bidi.def}}} @@ -317,7 +318,7 @@ by Vafa Khalighi. %\changes{v13.9}{2013/09/23}{Added implementaion of the package.} % \title{\textcolor{blue!65!black}{\Huge The \textsf{bidi} \textit{Package}}\\ %\LARGE Bidirectional typesetting in plain \TeX{} and \LaTeX, using \XeTeX{} engine\\[5pt] -%\large Documentation for \textcolor{blue!65!black}{version 16.4}} +%\large Documentation for \textcolor{blue!65!black}{version 16.5}} % \author{Vafa Khalighi\\ % \url{persian-tex@tug.org}} %\setcounter{page}{0} @@ -328,7 +329,7 @@ by Vafa Khalighi. %\textcolor{blue!65!black}{\Huge The \textsf{bidi} \textit{Package}} % %\Large -%Documentation for \textcolor{blue!65!black}{version 16.4}} +%Documentation for \textcolor{blue!65!black}{version 16.5}} % %\vskip 0pt plus 3fill %\textit{\large to my Master, \textbf{Ferdowsi The Great}} @@ -352,7 +353,7 @@ by Vafa Khalighi. % %\vskip 0pt plus 3fill % -%Copyright © 2007–2014 Vafa Khalighi +%Copyright (c) 2007--2015 Vafa Khalighi % %\medskip %Permission is granted to distribute and/or modify \emph{both the documentation and the code} under the conditions of the \LaTeX{} Project Public License, either version 1.3c of this license or (at your option) any later version. @@ -377,9 +378,9 @@ by Vafa Khalighi. %* and LaTeX. The package includes adaptations %* for use with many other commonly-used packages. %* -%* Copyright © 2009–2014 Vafa Khalighi +%* Copyright (c) 2009--2015 Vafa Khalighi %* -%* 2014/12/28, v16.4 +%* 2015/02/01, v16.5 %* %* License: LaTeX Project Public License, version %* 1.3c or higher (your choice) @@ -1136,7 +1137,7 @@ by Vafa Khalighi. %\iffalse %<*table> %\fi -%% \CheckSum{43075} +%% \CheckSum{43241} %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z @@ -1291,6 +1292,55 @@ by Vafa Khalighi. % %\iffalse %</amsart-xetex-bidi.def> +%<*algorithm2e-xetex-bidi.def> +%\fi +% \subsection{\textsf{algorithm2e-xetex-bidi.def}} +% \begin{macrocode} +\ProvidesFile{algorithm2e-xetex-bidi.def}[2015/02/01 v0.1 bidi adaptations for algorithm2e package for XeTeX engine] +\expandafter\ifx\csname algocf@within\endcsname\relax% if \algocf@within doesn't exist +\else% else +\renewcommand\thealgocf{\csname the\algocf@within\endcsname\@SepMark\@arabic\c@algocf}% +\fi% + +\def\@algocf@pre@boxed{\noindent\begin{bidi@lrbox}{\algocf@algoframe}} +\def\@algocf@post@boxed{\end{bidi@lrbox}\framebox[\hsize]{\box\algocf@algoframe}\par}% +\def\@algocf@pre@boxruled{\noindent\begin{bidi@lrbox}{\algocf@algoframe}}% +\def\@algocf@post@boxruled{\end{bidi@lrbox}\framebox[\hsize]{\box\algocf@algoframe}\par}% +\renewcommand{\@algocf@start}{% + \@algoskip% + \begin{bidi@lrbox}{\algocf@algobox}% + \setlength{\algowidth}{\hsize}% + \vbox\bgroup% save all the algo in a box + \hbox to\algowidth\bgroup\hbox to \algomargin{\hfill}\vtop\bgroup% + \ifthenelse{\boolean{algocf@slide}}{\parskip 0.5ex\color{black}}{}% + % initialization + \addtolength{\hsize}{-1.5\algomargin}% + \let\@mathsemicolon=\;\def\;{\ifmmode\@mathsemicolon\else\@endalgoln\fi}% + \raggedright\AlFnt{}% + \ifthenelse{\boolean{algocf@slide}}{\IncMargin{\skipalgocfslide}}{}% + \@algoinsideskip% +% \let\@emathdisplay=\]\def\]{\algocf@endline\@emathdisplay\nl}% +}% +\renewcommand{\@algocf@finish}{% + \@algoinsideskip% + \egroup%end of vtop which contain all the text + \hfill\egroup%end of hbox wich contains [margin][vtop] + \ifthenelse{\boolean{algocf@slide}}{\DecMargin{\skipalgocfslide}}{}% + % + \egroup%end of main vbox + \end{bidi@lrbox}% + \algocf@makethealgo% print the algo + \@algoskip% + % restore dimension and macros + \setlength{\hsize}{\algowidth}% + \lineskip\normallineskip\setlength{\skiptotal}{\@defaultskiptotal}% + \let\;=\@mathsemicolon% + \let\]=\@emathdisplay% +}% +% \end{macrocode} +% +%\iffalse +%</algorithm2e-xetex-bidi.def> %<*amsbook-xetex-bidi.def> %\fi % \subsection{\textsf{amsbook-xetex-bidi.def}} @@ -2667,8 +2717,8 @@ by Vafa Khalighi. % \subsection{\textsf{bidi.sty}} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\def\bididate{2014/12/28} -\def\bidiversion{v16.4} +\def\bididate{2015/02/01} +\def\bidiversion{v16.5} \ProvidesPackage{bidi}[\bididate\space \bidiversion\space Bidirectional typesetting in plain TeX and LaTeX] \edef\@bidi@info{****************************************************^^J% @@ -2681,7 +2731,7 @@ Bidirectional typesetting in plain TeX and LaTeX] * and LaTeX. The package includes adaptations^^J% * for use with many other commonly-used packages.^^J% * ^^J% -* Copyright © 2009–2014 Vafa Khalighi^^J% +* Copyright (c) 2009--2015 Vafa Khalighi^^J% * ^^J% * \bididate, \bidiversion^^J% * ^^J% @@ -2790,7 +2840,7 @@ Bidirectional typesetting in plain TeX and LaTeX] %\fi % \subsection{\textsf{bidi.tex}} % \begin{macrocode} -\def\bididate{2014/12/28} +\def\bididate{2015/02/01} \def\bidiversion{v0.2} \catcode`@=11 \let \protect \relax @@ -2805,7 +2855,7 @@ Bidirectional typesetting in plain TeX and LaTeX] * and LaTeX. The package includes adaptations^^J% * for use with many other commonly-used packages.^^J% * ^^J% -* Copyright © 2009–2014 Vafa Khalighi^^J% +* Copyright (c) 2009--2015 Vafa Khalighi^^J% * ^^J% * \bididate, \bidiversion^^J% * ^^J% @@ -3586,7 +3636,7 @@ Bidirectional typesetting in plain TeX and LaTeX] % \subsection{\textsf{biditools.sty}} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{biditools}[2013/04/10 v0.2 Programming tools for bidi package] +\ProvidesPackage{biditools}[2015/02/01 v0.3 Programming tools for bidi package] \providecommand{\@bidi@saveprimitive}[2]{\begingroup\escapechar`\\\relax \edef\@tempa{\string#1}\edef\@tempb{\meaning#1}% \ifx\@tempa\@tempb \global\let#2#1% @@ -4081,11 +4131,11 @@ Bidirectional typesetting in plain TeX and LaTeX] \bidi@@end}} \bidi@newrobustcmd{\bidi@AtBeginEnvironment}[1]{% - \bidi@csgappto{@begin@#1@hook}} + \bidi@csgappto{@bidi@begin@#1@hook}} \bidi@patchcmd\begin {\csname #1\endcsname} - {\bidi@csuse{@begin@#1@hook}% + {\bidi@csuse{@bidi@begin@#1@hook}% \csname #1\endcsname} {} {\bidi@warning{% @@ -4095,11 +4145,11 @@ Bidirectional typesetting in plain TeX and LaTeX] \bidi@newrobustcmd{\bidi@AtEndEnvironment}[1]{% - \bidi@csgappto{@end@#1@hook}} + \bidi@csgappto{@bidi@end@#1@hook}} \bidi@patchcmd\end {\csname end#1\endcsname} - {\bidi@csuse{@end@#1@hook}% + {\bidi@csuse{@bidi@end@#1@hook}% \csname end#1\endcsname} {} {\bidi@warning{% @@ -4109,10 +4159,10 @@ Bidirectional typesetting in plain TeX and LaTeX] \bidi@newrobustcmd{\bidi@BeforeBeginEnvironment}[1]{% - \bidi@csgappto{@beforebegin@#1@hook}} + \bidi@csgappto{@bidi@beforebegin@#1@hook}} \bidi@pretocmd\begin - {\bidi@csuse{@beforebegin@#1@hook}} + {\bidi@csuse{@bidi@beforebegin@#1@hook}} {} {\bidi@warning{% Patching '\string\begin' failed!\MessageBreak @@ -4121,11 +4171,11 @@ Bidirectional typesetting in plain TeX and LaTeX] \bidi@newrobustcmd{\bidi@AfterEndEnvironment}[1]{% - \bidi@csgappto{@afterend@#1@hook}} + \bidi@csgappto{@bidi@afterend@#1@hook}} \bidi@patchcmd\end {\if@ignore} - {\bidi@csuse{@afterend@#1@hook}% + {\bidi@csuse{@bidi@afterend@#1@hook}% \if@ignore} {} {\bidi@warning{% @@ -18257,7 +18307,7 @@ to\rtside{\box\bslice\hfil}} %\fi % \subsection{\textsf{latex-xetex-bidi.def}} % \begin{macrocode} -\ProvidesFile{latex-xetex-bidi.def}[2014/11/29 v1.1.8 bidi adaptations for `latex.ltx' for XeTeX engine] +\ProvidesFile{latex-xetex-bidi.def}[2015/02/01 v1.1.9 bidi adaptations for `latex.ltx' for XeTeX engine] \newcommand{\TeXXeTOn}{\TeXXeTstate=1 } \newcommand{\TeXXeTOff}{\TeXXeTstate=0 } \TeXXeTOn @@ -18479,6 +18529,18 @@ to\rtside{\box\bslice\hfil}} \csname bm@#3\endcsname}% \if@pboxsw \m@th$\fi \@end@tempboxa} +\def\bidi@lrbox#1{% + \edef\reserved@a{% + \endgroup + \setbox#1\hbox{% + \begingroup\aftergroup}% + \def\noexpand\@currenvir{\@currenvir}% + \def\noexpand\@currenvline{\on@line}}% + \reserved@a + \@endpefalse + \color@begingroup + \ignorespaces} +\def\endbidi@lrbox{\unskip\color@endgroup} \newenvironment{LTRitems} {\par\@RTLfalse \if@bidi@list@minipage@parbox @@ -18930,6 +18992,13 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi} \@ifpackageloaded{crop}{\RequirePackage{graphicx}}{} \@ifpackageloaded{sidecap}{\RequirePackage{ragged2e}}{} \@ifpackageloaded{floatrow}{\RequirePackage{color}}{} +\@ifpackageloaded{algorithm2e}{\input{algorithm2e-xetex-bidi.def}}{} +\@ifpackagewith{algorithm2e}{algonl}{% +\renewcommand{\theAlgoLine}{\expandafter\csname the\algocf@float\endcsname\@SepMark\arabic{AlgoLine}}% +}{} +\@ifpackagewith{algorithm2e}{algopart}{\renewcommand{\algocf@within}{part}}{} +\@ifpackagewith{algorithm2e}{algochapter}{\renewcommand{\algocf@within}{chapter}}{} +\@ifpackagewith{algorithm2e}{algosection}{\renewcommand{\algocf@within}{section}}{} \@ifpackageloaded{amsmath}{\input{amsmath-xetex-bidi.def}}{} \@ifpackageloaded{amstext}{\input{amstext-xetex-bidi.def}}{} \@ifpackageloaded{amsthm}{\input{amsthm-xetex-bidi.def}}{} |