diff options
author | Karl Berry <karl@freefriends.org> | 2017-02-05 23:19:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-02-05 23:19:16 +0000 |
commit | 8e694411f8e4a4860f1120975ac14b0bc6d632de (patch) | |
tree | dbecc1173dcef2f0809b73f8ca1e736a371399d0 /Master/texmf-dist/source/xelatex/bidi/bidi.dtx | |
parent | ecaeb42668cb657473da301c3e39c4cf387152d6 (diff) |
bidi (5feb17)
git-svn-id: svn://tug.org/texlive/trunk@43147 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/xelatex/bidi/bidi.dtx')
-rw-r--r-- | Master/texmf-dist/source/xelatex/bidi/bidi.dtx | 89 |
1 files changed, 60 insertions, 29 deletions
diff --git a/Master/texmf-dist/source/xelatex/bidi/bidi.dtx b/Master/texmf-dist/source/xelatex/bidi/bidi.dtx index 712f71a0098..796a2d29030 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 -v20.7 +v20.9 This package provides a convenient interface for typesetting bidirectional texts in Plain TeX and LaTeX, using XeTeX engine. @@ -25,7 +25,7 @@ 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/01/16 +Current version release date: 2017/02/05 ___________________ Vafa Khalighi @@ -321,7 +321,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 20.7}} +%\large Documentation for \textcolor{blue!65!black}{version 20.9}} % \author{Vafa Khalighi\\ % \url{persian-tex@tug.org}} %\setcounter{page}{0} @@ -332,7 +332,7 @@ by Vafa Khalighi. %\textcolor{blue!65!black}{\Huge The \textsf{bidi} \textit{Package}} % %\Large -%Documentation for \textcolor{blue!65!black}{version 20.7}} +%Documentation for \textcolor{blue!65!black}{version 20.9}} % %\vskip 0pt plus 3fill %\textit{\large to my Master, \textbf{Ferdowsi The Great}} @@ -383,7 +383,7 @@ by Vafa Khalighi. %* %* Copyright (c) 2009--2017 Vafa Khalighi %* -%* 2017/01/16, v20.7 +%* 2017/02/05, v20.9 %* %* License: LaTeX Project Public License, version %* 1.3c or higher (your choice) @@ -1137,7 +1137,7 @@ by Vafa Khalighi. %\iffalse %<*table> %\fi -%% \CheckSum{47651} +%% \CheckSum{47744} %% \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 @@ -1198,7 +1198,7 @@ by Vafa Khalighi. \long\def\@footnotetext#1{% \insert\footins{% \if@RTL@footnote\@RTLtrue\else\@RTLfalse\fi% - \normalfont\footnotesize + \bidi@@footnotetext@font% \normalfont\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty\@MM \hsize\columnwidth @@ -1211,7 +1211,7 @@ by Vafa Khalighi. \long\def\@RTLfootnotetext#1{% \insert\footins{% \@RTLtrue% - \normalfont\footnotesize + \bidi@@RTLfootnotetext@font% \normalfont\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty\@MM \hsize\columnwidth @@ -1226,7 +1226,7 @@ by Vafa Khalighi. \long\def\@LTRfootnotetext#1{% \insert\footins{% \@RTLfalse% - \normalfont\footnotesize + \bidi@@LTRfootnotetext@font% \normalfont\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty\@MM \hsize\columnwidth @@ -1431,7 +1431,7 @@ by Vafa Khalighi. \long\def\@footnotetext#1{% \insert\footins{% \if@RTL@footnote\@RTLtrue\else\@RTLfalse\fi% - \normalfont\footnotesize + \bidi@@footnotetext@font% \normalfont\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty\@MM \hsize\columnwidth @@ -1444,7 +1444,7 @@ by Vafa Khalighi. \long\def\@RTLfootnotetext#1{% \insert\footins{% \@RTLtrue% - \normalfont\footnotesize + \bidi@@RTLfootnotetext@font% \normalfont\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty\@MM \hsize\columnwidth @@ -1458,7 +1458,7 @@ by Vafa Khalighi. \long\def\@LTRfootnotetext#1{% \insert\footins{% \@RTLfalse% - \normalfont\footnotesize + \bidi@@LTRfootnotetext@font% \normalfont\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty\@MM \hsize\columnwidth @@ -2980,8 +2980,8 @@ by Vafa Khalighi. % \subsection{\textsf{bidi.sty}} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\def\bididate{2017/01/16} -\def\bidiversion{v20.7} +\def\bididate{2017/02/05} +\def\bidiversion{v20.9} \ProvidesPackage{bidi}[\bididate\space \bidiversion\space Bidirectional typesetting in plain TeX and LaTeX] \edef\@bidi@info{****************************************************^^J% @@ -5126,6 +5126,9 @@ bidi implementation of tufte float] \newcommand{\bidituftefloatError}[2]{\PackageError{\@bidituftefloat@pkgname}{#1}{#2}} \newcommand{\bidituftefloatDebugInfoNL}[1]{\ifthenelse{\boolean{@bidituftefloat@debug}}{\bidituftefloatInfoNL{#1}}{}} \newcommand{\bidituftefloatInfoNL}[1]{\PackageInfo{\@bidituftefloat@pkgname}{#1\@gobble}} +\newboolean{@bidituftefloat@reversegeometry} +\setboolean{@bidituftefloat@reversegeometry}{false} +\DeclareOption{reversegeometry}{\setboolean{@bidituftefloat@reversegeometry}{true}} \newboolean{@bidituftefloat@afourpaper} \DeclareOption{a4paper}{\setboolean{@bidituftefloat@afourpaper}{true}} \newboolean{@bidituftefloat@bfivepaper} @@ -5181,13 +5184,21 @@ bidi implementation of tufte float] \setlength{\parskip}{0pt}% } \RequirePackage{ragged2e} +\ifthenelse{\boolean{@bidituftefloat@reversegeometry}}{% +\RequirePackage[letterpaper,right=1in,top=1in,headsep=2\baselineskip,textwidth=26pc,marginparsep=2pc,marginparwidth=12pc,textheight=44\baselineskip,headheight=\baselineskip]{geometry} +\ifthenelse{\boolean{@bidituftefloat@afourpaper}} + {\geometry{a4paper,right=24.8mm,top=27.4mm,headsep=2\baselineskip,textwidth=107mm,marginparsep=8.2mm,marginparwidth=49.4mm,textheight=49\baselineskip,headheight=\baselineskip}} + {} +\ifthenelse{\boolean{@bidituftefloat@bfivepaper}} + {\geometry{paperwidth=176mm,paperheight=250mm,right=14.66mm,top=13.88mm,textwidth=102.66mm,marginparsep=7.33mm,marginparwidth=36.66mm,textheight=38\baselineskip,includehead}} + {}}{% \RequirePackage[letterpaper,left=1in,top=1in,headsep=2\baselineskip,textwidth=26pc,marginparsep=2pc,marginparwidth=12pc,textheight=44\baselineskip,headheight=\baselineskip]{geometry} \ifthenelse{\boolean{@bidituftefloat@afourpaper}} {\geometry{a4paper,left=24.8mm,top=27.4mm,headsep=2\baselineskip,textwidth=107mm,marginparsep=8.2mm,marginparwidth=49.4mm,textheight=49\baselineskip,headheight=\baselineskip}} {} \ifthenelse{\boolean{@bidituftefloat@bfivepaper}} {\geometry{paperwidth=176mm,paperheight=250mm,left=14.66mm,top=13.88mm,textwidth=102.66mm,marginparsep=7.33mm,marginparwidth=36.66mm,textheight=38\baselineskip,includehead}} - {} + {}} \ifthenelse{\boolean{@bidituftefloat@symmetric}} {} {\geometry{asymmetric}}% forces internal LaTeX `twoside' @@ -5813,15 +5824,27 @@ bidi implementation of tufte sidenote] \@minipagetrue \everypar{\@minipagefalse\everypar{}\beginR}% } -\newcommand{\@bidituftesidenote@marginfont}{\normalfont\footnotesize} +\newcommand*{\@bidituftesidenote@marginfont}{\normalfont\footnotesize} +\newcommand*{\@bidituftesidenote@LTRmarginfont}{\normalfont\footnotesize} +\newcommand*{\@bidituftesidenote@RTLmarginfont}{\normalfont\footnotesize} \newcommand*{\@bidituftesidenote@sidenote@font}{\@bidituftesidenote@marginfont} +\newcommand*{\@bidituftesidenote@LTRsidenote@font}{\@bidituftesidenote@LTRmarginfont} +\newcommand*{\@bidituftesidenote@RTLsidenote@font}{\@bidituftesidenote@RTLmarginfont} \newcommand*{\@bidituftesidenote@marginnote@font}{\@bidituftesidenote@marginfont} +\newcommand*{\@bidituftesidenote@LTRmarginnote@font}{\@bidituftesidenote@LTRmarginfont} +\newcommand*{\@bidituftesidenote@RTLmarginnote@font}{\@bidituftesidenote@RTLmarginfont} \newcommand*{\@bidituftesidenote@citation@font}{\@bidituftesidenote@marginfont} -\newcommand*{\@biditufteLTRsidenote@citation@font}{\@bidituftesidenote@marginfont} +\newcommand*{\@bidituftesidenote@LTRcitation@font}{\@bidituftesidenote@LTRmarginfont} +\newcommand*{\@bidituftesidenote@RTLcitation@font}{\@bidituftesidenote@RTLmarginfont} \newcommand*{\setsidenotefont}[1]{\renewcommand*{\@bidituftesidenote@sidenote@font}{#1}} +\newcommand*{\setLTRsidenotefont}[1]{\renewcommand*{\@bidituftesidenote@LTRsidenote@font}{#1}} +\newcommand*{\setRTLsidenotefont}[1]{\renewcommand*{\@bidituftesidenote@RTLsidenote@font}{#1}} \newcommand*{\setmarginnotefont}[1]{\renewcommand*{\@bidituftesidenote@marginnote@font}{#1}} +\newcommand*{\setLTRmarginnotefont}[1]{\renewcommand*{\@bidituftesidenote@LTRmarginnote@font}{#1}} +\newcommand*{\setRTLmarginnotefont}[1]{\renewcommand*{\@bidituftesidenote@RTLmarginnote@font}{#1}} \newcommand*{\setcitationfont}[1]{\renewcommand*{\@bidituftesidenote@citation@font}{#1}} -\newcommand*{\setLTRcitationfont}[1]{\renewcommand*{\@biditufteLTRsidenote@citation@font}{#1}} +\newcommand*{\setLTRcitationfont}[1]{\renewcommand*{\@bidituftesidenote@LTRcitation@font}{#1}} +\newcommand*{\setRTLcitationfont}[1]{\renewcommand*{\@bidituftesidenote@RTLcitation@font}{#1}} \newcommand*{\@bidituftesidenote@sidenote@justification}{\@bidituftesidenote@justification@autodetect} \newcommand*{\@bidituftesidenote@marginnote@justification}{\@bidituftesidenote@justification@autodetect} \newcommand*{\@bidituftesidenote@citation@justification}{\@bidituftesidenote@justification@autodetect} @@ -6024,7 +6047,7 @@ bidi implementation of tufte sidenote] \bidituftesidenotemarginpar{% \hbox{}\vspace*{#1}% \def\baselinestretch {\setspace@singlespace}% - \reset@font\footnotesize% + \bidi@@footnotetext@font% \reset@font\footnotesize% \@bidituftesidenote@margin@par% use parindent and parskip settings for marginal text \vspace*{-1\baselineskip}\noindent% \protected@edef\@currentlabel{% @@ -6041,7 +6064,7 @@ bidi implementation of tufte sidenote] \LTRbidituftesidenotemarginpar{% \hbox{}\vspace*{#1}% \def\baselinestretch {\setspace@singlespace}% - \reset@font\footnotesize% + \bidi@@LTRfootnotetext@font% \reset@font\footnotesize% \@bidituftesidenote@margin@par% use parindent and parskip settings for marginal text \vspace*{-1\baselineskip}\noindent% \protected@edef\@currentlabel{% @@ -6058,7 +6081,7 @@ bidi implementation of tufte sidenote] \RTLbidituftesidenotemarginpar{% \hbox{}\vspace*{#1}% \def\baselinestretch {\setspace@singlespace}% - \reset@font\footnotesize% + \bidi@@RTLfootnotetext@font% \reset@font\footnotesize% \@bidituftesidenote@margin@par% use parindent and parskip settings for marginal text \vspace*{-1\baselineskip}\noindent% \protected@edef\@currentlabel{% @@ -6186,7 +6209,7 @@ bidi implementation of tufte sidenote] \newcommand\LTRmarginnote[2][0pt]{% \let\cite\@bidituftesidenote@infootnote@cite% use the in-sidenote \cite command \gdef\@bidituftesidenote@citations{}% clear out any old citations - \LTRbidituftesidenotemarginpar{\hbox{}\vspace*{#1}\@bidituftesidenote@marginnote@font\@bidituftesidenote@marginnote@justification\@bidituftesidenote@margin@par\vspace*{-1\baselineskip}\noindent #2}% + \LTRbidituftesidenotemarginpar{\hbox{}\vspace*{#1}\@bidituftesidenote@LTRmarginnote@font\@bidituftesidenote@marginnote@justification\@bidituftesidenote@margin@par\vspace*{-1\baselineskip}\noindent #2}% \@bidituftesidenote@print@citations% print any citations \let\cite\@bidituftesidenote@normal@cite% go back to using normal in-text \cite command \let\LTRcite\@biditufteLTRsidenote@normal@cite% go back to using normal in-text \LTRcite command @@ -6195,7 +6218,7 @@ bidi implementation of tufte sidenote] \newcommand\RTLmarginnote[2][0pt]{% \let\cite\@bidituftesidenote@infootnote@cite% use the in-sidenote \cite command \gdef\@bidituftesidenote@citations{}% clear out any old citations - \RTLbidituftesidenotemarginpar{\hbox{}\vspace*{#1}\@bidituftesidenote@marginnote@font\@bidituftesidenote@marginnote@justification\@bidituftesidenote@margin@par\vspace*{-1\baselineskip}\noindent #2}% + \RTLbidituftesidenotemarginpar{\hbox{}\vspace*{#1}\@bidituftesidenote@RTLmarginnote@font\@bidituftesidenote@marginnote@justification\@bidituftesidenote@margin@par\vspace*{-1\baselineskip}\noindent #2}% \@bidituftesidenote@print@citations% print any citations \let\cite\@bidituftesidenote@normal@cite% go back to using normal in-text \cite command \let\LTRcite\@biditufteLTRsidenote@normal@cite% go back to using normal in-text \LTRcite command @@ -12173,9 +12196,13 @@ bidi implementation of tufte title] \def\unsetfootnoteRL{\@RTL@footnotefalse} \def\setfootnoteLR{\unsetfootnoteRL} +\newcommand*{\bidi@@footnotetext@font}{\reset@font\footnotesize} +\newcommand*{\bidi@@LTRfootnotetext@font}{\reset@font\footnotesize} +\newcommand*{\bidi@@RTLfootnotetext@font}{\reset@font\footnotesize} + \long\def\@footnotetext#1{\insert\footins{% \if@RTL@footnote\@RTLtrue\else\@RTLfalse\fi% - \reset@font\footnotesize + \bidi@@footnotetext@font% \reset@font\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty \@MM @@ -12191,7 +12218,7 @@ bidi implementation of tufte title] \long\def\@RTLfootnotetext#1{\insert\footins{% \@RTLtrue% - \reset@font\footnotesize + \bidi@@RTLfootnotetext@font% \reset@font\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty \@MM @@ -12206,7 +12233,7 @@ bidi implementation of tufte title] \long\def\@LTRfootnotetext#1{\insert\footins{% \@RTLfalse% - \reset@font\footnotesize + \bidi@@LTRfootnotetext@font% \reset@font\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty \@MM @@ -12235,7 +12262,7 @@ bidi implementation of tufte title] \ifbidi@autofootnoterule\ifnum\c@mpfootnote=\@ne\global\let\bidi@mpfootnoterule\right@footnoterule\fi\fi% \global\setbox\@mpfootins\vbox{\@RTLtrue% \unvbox\@mpfootins - \reset@font\footnotesize + \bidi@@RTLfootnotetext@font% \reset@font\footnotesize \hsize\columnwidth \@parboxrestore \protected@edef\@currentlabel @@ -12248,7 +12275,7 @@ bidi implementation of tufte title] \ifbidi@autofootnoterule\ifnum\c@mpfootnote=\@ne\global\let\bidi@mpfootnoterule\left@footnoterule\fi\fi% \global\setbox\@mpfootins\vbox{\@RTLfalse% \unvbox\@mpfootins - \reset@font\footnotesize + \bidi@@LTRfootnotetext@font% \reset@font\footnotesize \hsize\columnwidth \@parboxrestore \protected@edef\@currentlabel @@ -12261,7 +12288,7 @@ bidi implementation of tufte title] \ifbidi@autofootnoterule\ifnum\c@mpfootnote=\@ne\if@RTL@footnote\global\let\bidi@mpfootnoterule\right@footnoterule\else\global\let\bidi@mpfootnoterule\left@footnoterule\fi\fi\fi% \global\setbox\@mpfootins\vbox{\if@RTL@footnote\@RTLtrue\else\@RTLfalse\fi% \unvbox\@mpfootins - \reset@font\footnotesize + \bidi@@footnotetext@font% \reset@font\footnotesize \hsize\columnwidth \@parboxrestore \protected@edef\@currentlabel @@ -21979,6 +22006,9 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi} \hbox to\linewidth{\if@RTL\beginR\fi\@itemfudge \hskip\dimen\@curtabmar\box\@curline\hfil\if@RTL\endR\fi}% \fi} + +\newcommand*{\bidi@font@@outputpage}{} + \def\@outputpage{% \begingroup % the \endgroup is put in by \aftergroup \let \protect \noexpand @@ -22017,6 +22047,7 @@ $\@@underline{\hbox{#1}}\m@th$\relax\fi\fi} \fi \reset@font \normalsize + \bidi@font@@outputpage \normalsfcodes \let\label\@gobble \let\index\@gobble |