diff options
author | Karl Berry <karl@freefriends.org> | 2017-05-06 21:42:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-05-06 21:42:10 +0000 |
commit | c4073f6b0dc17821a33b9df327cd34b637564c9b (patch) | |
tree | c78e2fee944e389a0df785b176c91adacf8d603d /Master/texmf-dist/source/xelatex | |
parent | 8e60bf45d712bf161ce57890a158e5c8149f9dbc (diff) |
bidi (6may17)
git-svn-id: svn://tug.org/texlive/trunk@44229 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/xelatex')
-rw-r--r-- | Master/texmf-dist/source/xelatex/bidi/bidi.dtx | 165 |
1 files changed, 135 insertions, 30 deletions
diff --git a/Master/texmf-dist/source/xelatex/bidi/bidi.dtx b/Master/texmf-dist/source/xelatex/bidi/bidi.dtx index 0636e1ee951..affe2a1c90b 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 -v30.3 +v30.4 This package provides a convenient interface for typesetting bidirectional texts in Plain TeX and LaTeX, using XeTeX engine. @@ -25,11 +25,12 @@ 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: 2017/04/27 +Current version release date: 2017/05/06 ___________________ Vafa Khalighi persian-tex@tug.org +https://www.instagram.com/persiantex Copyright (c) 2007--2017 It may be distributed and/or modified under the LaTeX Project Public License, @@ -321,9 +322,10 @@ 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 30.3}} +%\large Documentation for \textcolor{blue!65!black}{version 30.4}} % \author{Vafa Khalighi\\ -% \url{persian-tex@tug.org}} +% \url{persian-tex@tug.org} +% \url{https://www.instagram.com/persiantex}} %\setcounter{page}{0} %\thispagestyle{empty} %\includegraphics[width=.3\textwidth]{bidi-logo}\qquad @@ -332,7 +334,7 @@ by Vafa Khalighi. %\textcolor{blue!65!black}{\Huge The \textsf{bidi} \textit{Package}} % %\Large -%Documentation for \textcolor{blue!65!black}{version 30.3}} +%Documentation for \textcolor{blue!65!black}{version 30.4}} % %\vskip 0pt plus 3fill %\textit{\large to my Master, \textbf{Ferdowsi The Great}} @@ -383,7 +385,7 @@ by Vafa Khalighi. %* %* Copyright (c) 2009--2017 Vafa Khalighi %* -%* 2017/04/27, v30.3 +%* 2017/05/06, v30.4 %* %* License: LaTeX Project Public License, version %* 1.3c or higher (your choice) @@ -393,6 +395,8 @@ by Vafa Khalighi. %* Issue tracker: https://github.com/tex-xet/bidi/issues %* %* Support: persian-tex@tug.org +%* +%* Instagram: https://www.instagram.com/persiantex %**************************************************** %\end{verbatim} %\part{\LaTeX\ Manual} @@ -1137,7 +1141,7 @@ by Vafa Khalighi. %\iffalse %<*table> %\fi -%% \CheckSum{47809} +%% \CheckSum{47931} %% \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 @@ -2980,8 +2984,8 @@ by Vafa Khalighi. % \subsection{\textsf{bidi.sty}} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\def\bididate{2017/04/27} -\def\bidiversion{v30.3} +\def\bididate{2017/05/06} +\def\bidiversion{v30.4} \ProvidesPackage{bidi}[\bididate\space \bidiversion\space Bidirectional typesetting in plain TeX and LaTeX] \edef\@bidi@info{****************************************************^^J% @@ -3006,6 +3010,8 @@ Bidirectional typesetting in plain TeX and LaTeX] * Issue tracker: https://github.com/tex-xet/bidi/issues^^J% * ^^J% * Support: persian-tex@tug.org^^J% +* ^^J% +* Instagram: https://www.instagram.com/persiantex^^J% ****************************************************} \typeout{\@bidi@info} \edef\bidi@everyjob{\the\everyjob} @@ -3132,6 +3138,24 @@ Bidirectional typesetting in plain TeX and LaTeX] \or \@extrafootnotefeaturesfalse \fi} + +\define@choicekey{bidi.sty}{DetectColumn}[\bidi@tempa\bidi@tempb]{on,off}[on]{% + \ifcase\bidi@tempb\relax + \def\bidi@firstcolumn@status@write{% + \protected@write\@auxout{}% + {\string\bidi@column@status + {1}}}% + \def\bidi@lastcolumn@status@write{% + \protected@write\@auxout{}% + {\string\bidi@column@status{2}}}% + \or + \let\bidi@firstcolumn@status@write\relax + \let\bidi@lastcolumn@status@write\relax + \fi} + +\ExecuteOptionsX{% + DetectColumn=off +} \ProcessOptionsX @@ -3186,6 +3210,8 @@ Bidirectional typesetting in plain TeX and LaTeX] * Issue tracker: https://github.com/tex-xet/bidi/issues^^J% * ^^J% * Support: persian-tex@tug.org^^J% +* ^^J% +* Instagram: https://www.instagram.com/persiantex^^J% ****************************************************} \message{\@bidi@info} \edef\bidi@everyjob{\the\everyjob} @@ -8203,7 +8229,7 @@ bidi implementation of tufte title] %\fi % \subsection{\textsf{cuted-xetex-bidi.def}} % \begin{macrocode} -\ProvidesFile{cuted-xetex-bidi.def}[2017/04/27 v0.5 bidi adaptations for cuted package for XeTeX engine] +\ProvidesFile{cuted-xetex-bidi.def}[2017/05/06 v0.6 bidi adaptations for cuted package for XeTeX engine] \def\RTL@outputdblcol{% \if@firstcolumn @@ -8232,9 +8258,13 @@ bidi implementation of tufte title] \hfil {\normalcolor\vrule \@width\columnseprule}% \hfil - \hb@xt@\columnwidth{\box\@leftcolumn \hss}% + \hb@xt@\columnwidth{% + \bidi@firstcolumn@status@write% + \box\@leftcolumn \hss}% \hskip -\textwidth - \hb@xt@\columnwidth{\box\@outputbox \hss}% + \hb@xt@\columnwidth{% + \bidi@lastcolumn@status@write% + \box\@outputbox \hss}% \hskip \columnsep \hskip \columnwidth }}% \ifvoid\hold@viper @@ -8287,11 +8317,15 @@ bidi implementation of tufte title] \global\@firstcolumntrue \setbox\@outputbox\vbox{% \hb@xt@\textwidth{% - \hb@xt@\columnwidth{\box\@leftcolumn \hss}% + \hb@xt@\columnwidth{% + \bidi@firstcolumn@status@write% + \box\@leftcolumn \hss}% \hfil {\normalcolor\vrule \@width\columnseprule}% \hfil - \hb@xt@\columnwidth{\box\@outputbox \hss}}}% + \hb@xt@\columnwidth{% + \bidi@lastcolumn@status@write% + \box\@outputbox \hss}}}% \ifvoid\hold@viper \else \setbox\@outputbox \vbox to\textheight{% @@ -11775,7 +11809,7 @@ bidi implementation of tufte title] %\fi % \subsection{\textsf{fix2col-xetex-bidi.def}} % \begin{macrocode} -\ProvidesFile{fix2col-xetex-bidi.def}[2013/04/10 v0.3 bidi adaptations for fix2col package for XeTeX engine] +\ProvidesFile{fix2col-xetex-bidi.def}[2017/05/06 v0.4 bidi adaptations for fix2col package for XeTeX engine] \def\RTL@outputdblcol{% \if@firstcolumn \global\@firstcolumnfalse @@ -11798,9 +11832,13 @@ bidi implementation of tufte title] \setbox\@outputbox \vbox {\hbox to\textwidth {% \hskip \columnwidth \hfil \vrule width\columnseprule \hfil -\hbox to\columnwidth {\box\@leftcolumn \hss}% +\hbox to\columnwidth {% +\bidi@firstcolumn@status@write% +\box\@leftcolumn \hss}% \hskip -\textwidth -\hbox to\columnwidth{\box\@outputbox \hss}% +\hbox to\columnwidth{% +\bidi@lastcolumn@status@write% +\box\@outputbox \hss}% \hskip \columnsep \hskip \columnwidth }}% \@combinedblfloats \@setmarks \@outputpage @@ -11830,11 +11868,15 @@ bidi implementation of tufte title] \global\@firstcolumntrue \setbox\@outputbox\vbox{% \hb@xt@\textwidth{% - \hb@xt@\columnwidth{\box\@leftcolumn \hss}% + \hb@xt@\columnwidth{% + \bidi@firstcolumn@status@write% + \box\@leftcolumn \hss}% \hfil \vrule \@width\columnseprule \hfil - \hb@xt@\columnwidth{\box\@outputbox \hss}}}% + \hb@xt@\columnwidth{% + \bidi@lastcolumn@status@write% + \box\@outputbox \hss}}}% \@combinedblfloats \@setmarks \@outputpage @@ -12583,7 +12625,7 @@ bidi implementation of tufte title] %\fi % \subsection{\textsf{ftnright-xetex-bidi.def}} % \begin{macrocode} -\ProvidesFile{ftnright-xetex-bidi.def}[2016/05/10 v0.4 bidi adaptations for ftnright package for XeTeX engine] +\ProvidesFile{ftnright-xetex-bidi.def}[2017/05/06 v0.5 bidi adaptations for ftnright package for XeTeX engine] \def\LTR@outputdblcol{% \if@firstcolumn @@ -12611,11 +12653,15 @@ bidi implementation of tufte title] \global\@firstcolumntrue \setbox\@outputbox\vbox{% \hb@xt@\textwidth{% - \hb@xt@\columnwidth{\box\@leftcolumn \hss}% + \hb@xt@\columnwidth{% + \bidi@firstcolumn@status@write% + \box\@leftcolumn \hss}% \hfil {\normalcolor\vrule \@width\columnseprule}% \hfil - \hb@xt@\columnwidth{\box\@outputbox \hss}}}% + \hb@xt@\columnwidth{% + \bidi@lastcolumn@status@write% + \box\@outputbox \hss}}}% \@combinedblfloats \@setmarks \@outputpage @@ -12659,9 +12705,13 @@ bidi implementation of tufte title] \hfil {\normalcolor\vrule \@width\columnseprule}% \hfil - \hb@xt@\columnwidth{\box\@leftcolumn \hss}% + \hb@xt@\columnwidth{% + \bidi@firstcolumn@status@write% + \box\@leftcolumn \hss}% \hskip -\textwidth - \hb@xt@\columnwidth{\box\@outputbox \hss}% + \hb@xt@\columnwidth{% + \bidi@lastcolumn@status@write% + \box\@outputbox \hss}% \hskip \columnsep \hskip \columnwidth }}% \@combinedblfloats @@ -15296,7 +15346,7 @@ bidi implementation of tufte title] %\fi % \subsection{\textsf{midfloat-xetex-bidi.def}} % \begin{macrocode} -\ProvidesFile{midfloat-xetex-bidi.def}[2016/05/10 v0.3 bidi adaptations for midfloat package for XeTeX engine] +\ProvidesFile{midfloat-xetex-bidi.def}[2017/05/06 v0.4 bidi adaptations for midfloat package for XeTeX engine] \def\RTL@outputdblcol{% \if@firstcolumn \global \@firstcolumnfalse @@ -15371,9 +15421,11 @@ bidi implementation of tufte title] \vrule \@width\columnseprule \hfil \hb@xt@\columnwidth {% + \bidi@firstcolumn@status@write% \box\@leftcolumn \hss}% \hskip-\textwidth \hb@xt@\columnwidth {% + \bidi@lastcolumn@status@write% \box\@outputbox \hss}% \hskip\columnwidth \hskip\columnsep}% @@ -15465,11 +15517,13 @@ bidi implementation of tufte title] \setbox\@outputbox \vbox {% \hb@xt@\textwidth {% \hb@xt@\columnwidth {% + \bidi@firstcolumn@status@write% \box\@leftcolumn \hss}% \hfil \vrule \@width\columnseprule \hfil \hb@xt@\columnwidth {% + \bidi@lastcolumn@status@write% \box\@outputbox \hss}% }% }% @@ -21466,7 +21520,7 @@ to\rtside{\box\bslice\hfil}} %\fi % \subsection{\textsf{latex-xetex-bidi.def}} % \begin{macrocode} -\ProvidesFile{latex-xetex-bidi.def}[2016/09/11 v1.2.8 bidi adaptations for `latex.ltx' for XeTeX engine] +\ProvidesFile{latex-xetex-bidi.def}[2017/05/06 v1.2.9 bidi adaptations for `latex.ltx' for XeTeX engine] \newcommand{\TeXXeTOn}{\TeXXeTstate=1 } \newcommand{\TeXXeTOff}{\TeXXeTstate=0 } \TeXXeTOn @@ -21809,7 +21863,50 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi} \hb@xt@\@pnumwidth{{\hfil\normalfont \normalcolor #5}}% \par}% \fi} + +\newcount\bidi@column@check@number + +\def\bidi@column@status#1{\gdef\bidi@current@column@status{#1}} +\def\bidi@set@column@status#1#2{% + \global\expandafter\let\csname #1\endcsname\bidi@current@column@status} + +\if@twocolumn +\newcommand\DetectColumn[3][1]{% + \ifx\bidi@firstcolumn@status@write\relax + \PackageError{bidi}% + {Option 'DetectColumn' not selected}% + {\string\DetectColumn\space + requires the use of the 'DetectColumn' + option on the package}% + \fi + \global\advance\bidi@column@check@number\@ne + \edef\bidi@column@type{\expandafter\ifx + \csname bidi@column-\the\bidi@column@check@number\endcsname\relax + 0\else + \csname bidi@column-\the\bidi@column@check@number\endcsname + \fi}% + \ifcase \bidi@column@type\relax + \ifcase #1\or #2\or#3\fi % 0 not known use first column as default + \or + #2% % 1 First column + \or + #3% % 2 Second (Last column) + \else + \ERROR + \fi + \edef\next{\write\@auxout + {\string\bidi@set@column@status{bidi@column-\the\bidi@column@check@number}% + {\bidi@column@type}}}% + \next +} + +\AtEndDocument{\def\bidi@set@column@status#1#2{% + \ifnum #2=\bidi@current@column@status\else + \@tempswatrue + \fi}% +} +\fi \def\RTL@outputdblcol{% \if@firstcolumn @@ -21838,9 +21935,13 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi} \hfil {\normalcolor\vrule \@width\columnseprule}% \hfil - \hb@xt@\columnwidth{\box\@leftcolumn \hss}% + \hb@xt@\columnwidth{% + \bidi@firstcolumn@status@write% + \box\@leftcolumn \hss}% \hskip -\textwidth - \hb@xt@\columnwidth{\box\@outputbox \hss}% + \hb@xt@\columnwidth{% + \bidi@lastcolumn@status@write% + \box\@outputbox \hss}% \hskip \columnsep \hskip \columnwidth }}% \@combinedblfloats @@ -21877,11 +21978,15 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi} \global\@firstcolumntrue \setbox\@outputbox\vbox{% \hb@xt@\textwidth{% - \hb@xt@\columnwidth{\box\@leftcolumn \hss}% + \hb@xt@\columnwidth{% + \bidi@firstcolumn@status@write% + \box\@leftcolumn \hss}% \hfil {\normalcolor\vrule \@width\columnseprule}% \hfil - \hb@xt@\columnwidth{\box\@outputbox \hss}}}% + \hb@xt@\columnwidth{% + \bidi@lastcolumn@status@write% + \box\@outputbox \hss}}}% \@combinedblfloats \@setmarks \@outputpage |