From 97a0e0c7302ff82b2b09585b96c27d9cdb02003b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 29 Dec 2014 23:23:23 +0000 Subject: bidi (27dec14) git-svn-id: svn://tug.org/texlive/trunk@35918 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/xelatex/bidi/bidi.dtx | 76 ++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 11 deletions(-) (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/xelatex/bidi/bidi.dtx b/Master/texmf-dist/source/xelatex/bidi/bidi.dtx index 777fdedfabe..a9fa357faa7 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.3 +v16.4 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: 2014/11/29 +Current version release date: 2014/12/28 ___________________ Vafa Khalighi @@ -317,7 +317,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.3}} +%\large Documentation for \textcolor{blue!65!black}{version 16.4}} % \author{Vafa Khalighi\\ % \url{persian-tex@tug.org}} %\setcounter{page}{0} @@ -328,7 +328,7 @@ by Vafa Khalighi. %\textcolor{blue!65!black}{\Huge The \textsf{bidi} \textit{Package}} % %\Large -%Documentation for \textcolor{blue!65!black}{version 16.3}} +%Documentation for \textcolor{blue!65!black}{version 16.4}} % %\vskip 0pt plus 3fill %\textit{\large to my Master, \textbf{Ferdowsi The Great}} @@ -379,7 +379,7 @@ by Vafa Khalighi. %* %* Copyright © 2009–2014 Vafa Khalighi %* -%* 2014/11/29, v16.3 +%* 2014/12/28, v16.4 %* %* License: LaTeX Project Public License, version %* 1.3c or higher (your choice) @@ -1136,7 +1136,7 @@ by Vafa Khalighi. %\iffalse %<*table> %\fi -%% \CheckSum{42939} +%% \CheckSum{43075} %% \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 @@ -2667,8 +2667,8 @@ by Vafa Khalighi. % \subsection{\textsf{bidi.sty}} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\def\bididate{2014/11/29} -\def\bidiversion{v16.3} +\def\bididate{2014/12/28} +\def\bidiversion{v16.4} \ProvidesPackage{bidi}[\bididate\space \bidiversion\space Bidirectional typesetting in plain TeX and LaTeX] \edef\@bidi@info{****************************************************^^J% @@ -2790,7 +2790,7 @@ Bidirectional typesetting in plain TeX and LaTeX] %\fi % \subsection{\textsf{bidi.tex}} % \begin{macrocode} -\def\bididate{2014/11/29} +\def\bididate{2014/12/28} \def\bidiversion{v0.2} \catcode`@=11 \let \protect \relax @@ -4716,7 +4716,7 @@ bidi implementation of tufte float] % \subsection{\textsf{bidituftesidenote.sty}} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{bidituftesidenote}[2011/06/17 v0.1 +\ProvidesPackage{bidituftesidenote}[2014/12/28 v0.2 bidi implementation of tufte sidenote] \RequirePackage{xifthen} \RequirePackage{ragged2e} @@ -4858,9 +4858,11 @@ bidi implementation of tufte sidenote] \newcommand*{\@bidituftesidenote@sidenote@font}{\@bidituftesidenote@marginfont} \newcommand*{\@bidituftesidenote@marginnote@font}{\@bidituftesidenote@marginfont} \newcommand*{\@bidituftesidenote@citation@font}{\@bidituftesidenote@marginfont} +\newcommand*{\@biditufteLTRsidenote@citation@font}{\@bidituftesidenote@marginfont} \newcommand*{\setsidenotefont}[1]{\renewcommand*{\@bidituftesidenote@sidenote@font}{#1}} \newcommand*{\setmarginnotefont}[1]{\renewcommand*{\@bidituftesidenote@marginnote@font}{#1}} \newcommand*{\setcitationfont}[1]{\renewcommand*{\@bidituftesidenote@citation@font}{#1}} +\newcommand*{\setLTRcitationfont}[1]{\renewcommand*{\@biditufteLTRsidenote@citation@font}{#1}} \newcommand*{\@bidituftesidenote@sidenote@justification}{\@bidituftesidenote@justification@autodetect} \newcommand*{\@bidituftesidenote@marginnote@justification}{\@bidituftesidenote@justification@autodetect} \newcommand*{\@bidituftesidenote@citation@justification}{\@bidituftesidenote@justification@autodetect} @@ -4932,7 +4934,7 @@ bidi implementation of tufte sidenote] {\BR@bibitem[#1]{#2}}% \BR@c@bibitem{#2}% } -\nobibliography* % pre-loads the bibliography keys +\hopatch@AfterPackage{bidi}{\nobibliography*} % pre-loads the bibliography keys %% % Normal \cite behavior \newcounter{@bidituftesidenote@num@bibkeys}% @@ -4955,6 +4957,44 @@ bidi implementation of tufte sidenote] }% }% } +\newcommand{\@biditufteLTRsidenote@normal@cite}[2][0pt]{% + % Snag the last bibentry in the list for later comparison + \let\@temp@last@bibkey\@empty% + \@for\@temp@bibkey:=#2\do{\let\@temp@last@bibkey\@temp@bibkey}% + \LTRsidenote[][#1]{% + % Loop through all the bibentries, separating them with semicolons and spaces + \normalsize\normalfont\@biditufteLTRsidenote@citation@font% + \setcounter{@bidituftesidenote@num@bibkeys}{0}% + \@for\@temp@bibkeyx:=#2\do{% + \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}% + {\ifthenelse{\equal{\value{@bidituftesidenote@num@bibkeys}}{0}}{}{and\ }% + \@bidituftesidenote@trim@spaces\@temp@bibkeyx% trim spaces around bibkey + \bibentry{\@temp@bibkeyx}}% + {\@bidituftesidenote@trim@spaces\@temp@bibkeyx% trim spaces around bibkey + \bibentry{\@temp@bibkeyx};\ }% + \stepcounter{@bidituftesidenote@num@bibkeys}% + }% + }% +} +\newcommand{\@biditufteRTLsidenote@normal@cite}[2][0pt]{% + % Snag the last bibentry in the list for later comparison + \let\@temp@last@bibkey\@empty% + \@for\@temp@bibkey:=#2\do{\let\@temp@last@bibkey\@temp@bibkey}% + \RTLsidenote[][#1]{% + % Loop through all the bibentries, separating them with semicolons and spaces + \normalsize\normalfont\@bidituftesidenote@citation@font% + \setcounter{@bidituftesidenote@num@bibkeys}{0}% + \@for\@temp@bibkeyx:=#2\do{% + \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}% + {\ifthenelse{\equal{\value{@bidituftesidenote@num@bibkeys}}{0}}{}{and\ }% + \@bidituftesidenote@trim@spaces\@temp@bibkeyx% trim spaces around bibkey + \bibentry{\@temp@bibkeyx}}% + {\@bidituftesidenote@trim@spaces\@temp@bibkeyx% trim spaces around bibkey + \bibentry{\@temp@bibkeyx};\ }% + \stepcounter{@bidituftesidenote@num@bibkeys}% + }% + }% +} %% % Macros for holding the list of cite keys until after the \sidenote \gdef\@bidituftesidenote@citations{}% list of cite keys @@ -4996,6 +5036,8 @@ bidi implementation of tufte sidenote] %% % Set the default \cite style. This is set and reset by the \sidenote command. \let\cite\@bidituftesidenote@normal@cite +\let\LTRcite\@biditufteLTRsidenote@normal@cite +\let\RTLcite\@biditufteRTLsidenote@normal@cite %% % Transform existing \footnotes into \sidenotes % Sidenote: ``Where God meant footnotes to go.'' ---bidituftesidenote @@ -5111,6 +5153,8 @@ bidi implementation of tufte sidenote] }% \@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 + \let\RTLcite\@biditufteRTLsidenote@normal@cite% go back to using normal in-text \RTLcite command \unskip\ignorespaces% remove extra white space \kern-\multiplefootnotemarker% remove \kern left behind by sidenote \kern\multiplefootnotemarker\relax% add new \kern here to replace the one we yanked @@ -5138,6 +5182,8 @@ bidi implementation of tufte sidenote] }% \@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 + \let\RTLcite\@biditufteRTLsidenote@normal@cite% go back to using normal in-text \RTLcite command \unskip\ignorespaces% remove extra white space \kern-\multiplefootnotemarker% remove \kern left behind by sidenote \kern\multiplefootnotemarker\relax% add new \kern here to replace the one we yanked @@ -5165,6 +5211,8 @@ bidi implementation of tufte sidenote] }% \@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 + \let\RTLcite\@biditufteRTLsidenote@normal@cite% go back to using normal in-text \RTLcite command \unskip\ignorespaces% remove extra white space \kern-\multiplefootnotemarker% remove \kern left behind by sidenote \kern\multiplefootnotemarker\relax% add new \kern here to replace the one we yanked @@ -5185,6 +5233,8 @@ bidi implementation of tufte sidenote] \bidituftesidenotemarginpar{\hbox{}\vspace*{#1}\@bidituftesidenote@marginnote@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 + \let\RTLcite\@biditufteRTLsidenote@normal@cite% go back to using normal in-text \RTLcite command } \newcommand\LTRmarginnote[2][0pt]{% \let\cite\@bidituftesidenote@infootnote@cite% use the in-sidenote \cite command @@ -5192,6 +5242,8 @@ bidi implementation of tufte sidenote] \LTRbidituftesidenotemarginpar{\hbox{}\vspace*{#1}\@bidituftesidenote@marginnote@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 + \let\RTLcite\@biditufteRTLsidenote@normal@cite% go back to using normal in-text \RTLcite command } \newcommand\RTLmarginnote[2][0pt]{% \let\cite\@bidituftesidenote@infootnote@cite% use the in-sidenote \cite command @@ -5199,6 +5251,8 @@ bidi implementation of tufte sidenote] \RTLbidituftesidenotemarginpar{\hbox{}\vspace*{#1}\@bidituftesidenote@marginnote@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 + \let\RTLcite\@biditufteRTLsidenote@normal@cite% go back to using normal in-text \RTLcite command } % \end{macrocode} % \iffalse -- cgit v1.2.3