summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/xelatex/bidi/bidi.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/xelatex/bidi/bidi.dtx')
-rw-r--r--Master/texmf-dist/source/xelatex/bidi/bidi.dtx254
1 files changed, 186 insertions, 68 deletions
diff --git a/Master/texmf-dist/source/xelatex/bidi/bidi.dtx b/Master/texmf-dist/source/xelatex/bidi/bidi.dtx
index 2ab76fe941e..d01f5455df7 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
-v34.0
+v34.1
This package provides a convenient interface for typesetting
bidirectional texts in Plain TeX and LaTeX, using XeTeX engine.
@@ -39,14 +39,12 @@ on a regular basis. Therefore, I ask all users to not email me
and ask for help. However, there is a Persian TeX mailing list where
everyone can discuss Persian TeX related topics, ask and/or answer questions. This mailing list is the default media for Persian TeX
communications. I will try my best to answer questions on this
-mailing list whenever I have time. I will also be posting
-announcements regarding new versions of the `bidi' package on this
-mailing list. You can subscribe to the mailing list at
+mailing list whenever I have time. You can subscribe to the mailing list at
- <https://lists.sourceforge.net/lists/listinfo/persian-tex-dist-discuss>
+ <http://tug.org/mailman/listinfo/persiantex>
-Current version release date: 2018/09/29
+Current version release date: 2018/10/01
___________________
Vafa Khalighi
@@ -101,6 +99,7 @@ by Vafa Khalighi.
\generate{\file{bidicode.sty}{\from{\jobname.dtx}{table,bidicode.sty}}}
\generate{\file{bidiftnxtra.sty}{\from{\jobname.dtx}{table,bidiftnxtra.sty}}}
\generate{\file{bidimoderncv.cls}{\from{\jobname.dtx}{table,bidimoderncv.cls}}}
+\generate{\file{bidi-perpagefootnote.sty}{\from{\jobname.dtx}{table,bidi-perpagefootnote.sty}}}
\generate{\file{biditools.sty}{\from{\jobname.dtx}{table,biditools.sty}}}
\generate{\file{bidituftefloat.sty}{\from{\jobname.dtx}{table,bidituftefloat.sty}}}
\generate{\file{bidituftesidenote.sty}{\from{\jobname.dtx}{table,bidituftesidenote.sty}}}
@@ -243,7 +242,7 @@ by Vafa Khalighi.
\documentclass{ltxdoc}
\input{bidi-doc-preamble.ltx}
\hypersetup{%
- pdftitle={Source documentation for version 34.0 of the bidi
+ pdftitle={Source documentation for version 34.1 of the bidi
package}%
}
\EnableCrossrefs
@@ -262,7 +261,7 @@ by Vafa Khalighi.
% \GetFileInfo{\jobname.dtx}
% \title{\textcolor{blue!65!black}{\Huge The \textsf{bidi} \textit{Package}}\\
%\LARGE Bidirectional typesetting in plain \TeX{} and \LaTeX, using \XeTeX{} engine\\[5pt]
-%\large Source documentation for \textcolor{blue!65!black}{version 34.0}}
+%\large Source documentation for \textcolor{blue!65!black}{version 34.1}}
% \author{Vafa Khalighi\\
% \url{persian-tex@tug.org}}
%\setcounter{page}{0}
@@ -273,7 +272,7 @@ by Vafa Khalighi.
%\textcolor{blue!65!black}{\Huge The \textsf{bidi} \textit{Package}}
%
%\Large
-%Source documentation for \textcolor{blue!65!black}{version 34.0}}
+%Source documentation for \textcolor{blue!65!black}{version 34.1}}
%
%\vskip 0pt plus 3fill
%\textit{\large to my Master, \textbf{Ferdowsi The Great}}
@@ -316,11 +315,10 @@ by Vafa Khalighi.
%and ask for help. However, there is a Persian \TeX{} mailing list where
%everyone can discuss Persian \TeX{} related topics, ask and/or answer questions. This mailing list is the default media for Persian \TeX{}
%communications. I will try my best to answer questions on this
-%mailing list whenever I have time. I will also be posting announcements
-%regarding new versions of the \textsf{bidi} package on this mailing list.
+%mailing list whenever I have time.
%You can subscribe to the mailing list at
%\medskip
-% \centerline{\url{https://lists.sourceforge.net/lists/listinfo/persian-tex-dist-discuss}}
+% \centerline{\url{http://tug.org/mailman/listinfo/persiantex}}
%\end{minipage}
%}}
%
@@ -340,7 +338,7 @@ by Vafa Khalighi.
%\iffalse
%<*table>
%\fi
-%% \CheckSum{50462}
+%% \CheckSum{50625}
%% \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
@@ -1953,8 +1951,8 @@ by Vafa Khalighi.
% \section{File \texttt{bidi.sty}}
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\def\bididate{2018/09/29}
-\def\bidi@version{34.0}
+\def\bididate{2018/10/01}
+\def\bidi@version{34.1}
\ProvidesPackage{bidi}[\bididate\space v\bidi@version\space
Bidirectional typesetting in plain TeX and LaTeX]
\edef\@bidi@info{****************************************************^^J%
@@ -1978,7 +1976,7 @@ Bidirectional typesetting in plain TeX and LaTeX]
* ^^J%
* Issue tracker: https://sourceforge.net/p/persian-tex-dist/tickets^^J%
* ^^J%
-* Support: https://lists.sourceforge.net/lists/listinfo/persian-tex-dist-discuss^^J%
+* Support: http://tug.org/mailman/listinfo/persiantex^^J%
* ^^J%
****************************************************}
\typeout{\@bidi@info}
@@ -2013,6 +2011,7 @@ Bidirectional typesetting in plain TeX and LaTeX]
\eqnewif{\if@RTLmain}{\if@rlmain}
\eqnewif{\if@RTL}{\if@rl}
\newif\if@nonlatin
+\newif\if@bidi@perpage@footnote
\newcommand*{\setlatin}{\@nonlatinfalse}
\newcommand*{\setnonlatin}{\@nonlatintrue}
\eqnewif{\if@RTLtab}{\if@tab@rl}
@@ -2038,7 +2037,7 @@ Bidirectional typesetting in plain TeX and LaTeX]
}
\newcommand*{\@bidi@pdfcustomproperties}{%
This is the bidi package, Version \bidi@version,
- Released September 29, 2018.
+ Released October 1, 2018.
}
\@RTLmainfalse
\AtBeginDocument{%
@@ -2200,6 +2199,13 @@ Bidirectional typesetting in plain TeX and LaTeX]
\@bidi@pdfm@markfalse
\fi}
+\define@choicekey{bidi.sty}{perpagefootnote}[\bidi@tempa\bidi@tempb]{on,off}[on]{%
+ \ifcase\bidi@tempb\relax
+ \@bidi@perpage@footnotetrue
+ \or
+ \@bidi@perpage@footnotefalse
+ \fi}
+
\ExecuteOptionsX{%
DetectColumn=off%
}
@@ -2227,6 +2233,9 @@ Bidirectional typesetting in plain TeX and LaTeX]
\XeTeXinterchartoks \bidi@sepmark@charclass \bidi@digits@charclass = {\DigitsDotDashInterCharToks}
\newcommand*{\DigitsDotDashInterCharToks}{\if@nonlatin\char"200F \fi}
\bidi@AtEndPreamble{%
+ \if@bidi@perpage@footnote
+ \RequirePackage{bidi-perpagefootnote}%
+ \fi
\special{pdf:encrypt
userpw (\bidi@pdfencrypt@userpassword)
ownerpw (\bidi@pdfencrypt@ownerpassword)
@@ -2255,9 +2264,9 @@ Bidirectional typesetting in plain TeX and LaTeX]
%\fi
% \section{File \texttt{bidi.tex}}
% \begin{macrocode}
-\def\bididate{2018/09/29}
+\def\bididate{2018/10/01}
\catcode`@=11
-\def\bidi@version{34.0}
+\def\bidi@version{34.1}
\let \protect \relax
\newlinechar`\^^J
\edef\@bidi@info{****************************************************^^J%
@@ -2281,7 +2290,7 @@ Bidirectional typesetting in plain TeX and LaTeX]
* ^^J%
* Issue tracker: https://sourceforge.net/p/persian-tex-dist/tickets^^J%
* ^^J%
-* Support: https://lists.sourceforge.net/lists/listinfo/persian-tex-dist-discuss^^J%
+* Support: http://tug.org/mailman/listinfo/persiantex^^J%
* ^^J%
****************************************************}
\message{\@bidi@info}
@@ -2356,7 +2365,7 @@ Bidirectional typesetting in plain TeX and LaTeX]
}
\def\@bidi@pdfcustomproperties{%
This is the bidi package, Version \bidi@version,
- Released September 29, 2018.
+ Released October 1, 2018.
}
\def\bidi@pdfm@mark{%
\special{pdf:%
@@ -3037,6 +3046,90 @@ Bidirectional typesetting in plain TeX and LaTeX]
% \end{macrocode}
% \iffalse
%</bidimoderncv.cls>
+%<*bidi-perpagefootnote.sty>
+%\fi
+% \section{File \texttt{bidi-perpagefootnote.sty}}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{bidi-perpagefootnote}[2018/10/01 v0.1 Reset bidi footnotes counter on each page]
+\newcount\bidi@footnote@count
+\bidi@footnote@count\z@
+\newcount\bidi@page@count
+\bidi@page@count\@ne
+\newcount\bidi@previous@page@count
+\bidi@previous@page@count\z@
+\let\bidi@footnote\footnote
+\let\bidi@RTLfootnote\RTLfootnote
+\let\bidi@LTRfootnote\LTRfootnote
+\def\footnote{%
+ \@ifnextchar[%
+ \bidi@footnote
+ {%
+ \ifx\@mpfn\bidi@mpfn
+ \bidi@reset@footnote@perpage
+ \fi
+ \bidi@footnote
+ }%
+}
+\def\RTLfootnote{%
+ \@ifnextchar[%
+ \bidi@RTLfootnote
+ {%
+ \ifx\@mpfn\bidi@mpfn
+ \bidi@reset@footnote@perpage
+ \fi
+ \bidi@RTLfootnote
+ }%
+}
+\def\LTRfootnote{%
+ \@ifnextchar[%
+ \bidi@LTRfootnote
+ {%
+ \ifx\@mpfn\bidi@mpfn
+ \bidi@reset@footnote@perpage
+ \fi
+ \bidi@LTRfootnote
+ }%
+}
+\let\bidi@footnotemark\footnotemark
+\def\footnotemark{%
+ \@ifnextchar[%
+ \bidi@footnotemark
+ {\bidi@reset@footnote@perpage \bidi@footnotemark}%
+}
+\let\bidi@mpfn\@mpfn
+\def\bidi@reset@footnote@perpage{%
+ \global\advance\bidi@footnote@count \@ne
+ \if@filesw
+ \edef\@tempa{%
+ \write\@auxout{%
+ \string\bidi@footnote@page
+ {\number\bidi@footnote@count}%
+ {\noexpand\number\noexpand\bidi@page@count}%
+ }%
+ }%
+ \@tempa
+ \fi
+ \expandafter\ifx\csname bidi@footnote@@\number
+ \bidi@footnote@count\endcsname\relax
+ \global\c@footnote\z@
+ \else
+ \expandafter\@tempcnta\csname bidi@footnote@@\number
+ \bidi@footnote@count\endcsname\relax
+ \ifnum\@tempcnta=\bidi@previous@page@count
+ \else
+ \global\bidi@previous@page@count\@tempcnta
+ \global\c@footnote\z@
+ \fi
+ \fi
+}
+\def\bidi@footnote@page#1#2{\global\@namedef{bidi@footnote@@#1}{#2}}
+\bidi@AtEndOutputPage{%
+ \global\advance\bidi@page@count\@ne
+}
+% \end{macrocode}
+% \iffalse
+%</bidi-perpagefootnote.sty>
%<*biditools.sty>
%\fi
% \section{File \texttt{biditools.sty}}
@@ -14061,10 +14154,11 @@ bidi implementation of tufte title]
%\fi
% \section{File \texttt{lettrine-xetex-bidi.def}}
% \begin{macrocode}
-\ProvidesFile{lettrine-xetex-bidi.def}[2015/02/17 v0.5 bidi adaptations for lettrine package for XeTeX engine]
+\ProvidesFile{lettrine-xetex-bidi.def}[2018/10/01 v0.6 bidi adaptations for lettrine package for XeTeX engine]
\def\@lettrine[#1]#2#3{%
- \setcounter{L@lines}{\theDefaultLines}%
- \setcounter{L@depth}{\theDefaultDepth}%
+ \def\l@initial{#2}\let\l@refstring\l@initial
+ \setcounter{L@lines}{\value{DefaultLines}}%
+ \setcounter{L@depth}{\value{DefaultDepth}}%
\renewcommand*{\L@hang}{\DefaultLhang}%
\renewcommand*{\L@oversize}{\DefaultLoversize}%
\renewcommand*{\L@raise}{\DefaultLraise}%
@@ -14075,6 +14169,20 @@ bidi implementation of tufte title]
\setlength{\L@novskip}{\DiscardVskip}%
\ifLettrineImage\L@imagetrue\else\L@imagefalse\fi
\ifLettrineOnGrid\L@gridtrue\else\L@gridfalse\fi
+ \ifLettrineRealHeight\L@realhtrue\else\L@realhfalse\fi
+ \ifLettrineSelfRef\L@selfreftrue\else\L@selfreffalse\fi
+ \setkeys{L}{#1}%
+ \sbox{\L@tbox}{\LettrineTextFont{\LettrineSecondString}}%
+ \ifL@realh
+ \def\@tempa{#3}%
+ \ifx\@tempa\@empty
+ \PackageWarning{lettrine.sty}%
+ {Empty second argument,\MessageBreak
+ ignoring option `realheight';}%
+ \else
+ \sbox{\L@tbox}{\LettrineTextFont{#3}}%
+ \fi
+ \fi
\if\DefaultOptionsFile\relax
\else
\begingroup
@@ -14096,51 +14204,52 @@ bidi implementation of tufte title]
\def\KV@prefix{KV@L@}%
\let\@tempc\relax
\expandafter\KV@do\l@LOKeys,\relax,
- \sbox{\L@lbox}{\LettrineFont #2}%
+ \setupL@lbox
\setlength{\LettrineWidth}{\wd\L@lbox}%
\def\KV@prefix{KV@L@}%
\let\@tempc\relax
\expandafter\KV@do\l@LOKeys,\relax,
+ \setkeys{L}{#1}%
\fi
- \setkeys{L}{#1}%
- \ifL@image
- \sbox{\L@lbox}{\LettrineFontEPS{#2}}%
+ \setupL@lbox
+ \setlength{\LettrineWidth}{\wd\L@lbox}%
+ \setlength{\LettrineHeight}{\ht\L@lbox}%
+ \setlength{\LettrineDepth}{\dp\L@lbox}%
+ \begingroup
+ \def\IeC##1{##1}%
+ \@tempdima=\L@oversize pt\relax
+ \PackageInfo{lettrine.sty}%
+ {Targeted height = \the\L@target@tht\MessageBreak
+ (no accent, loversize=0),\MessageBreak
+ Lettrine height = \the\LettrineHeight\space (#2)%
+ \ifdim\@tempdima=\z@\else\space loversize=\L@oversize\fi;%
+ \MessageBreak reported}%
+ \endgroup
+ \sbox{\L@tbox}{\LettrineTextFont{#3}}%
+ \setlength{\L@first}{\LettrineHeight}%
+ \setlength{\L@lraise}{\L@raise\L@target@tht}%
+ \addtolength{\L@first}{\L@lraise}%
+ \ifnum\value{L@lines}=1
+ \addtolength{\L@first}{-\ht\L@tbox}%
\else
- \sbox{\L@lbox}{\LettrineFont #2}%
+ \addtolength{\L@first}{-\L@target@tht}%
+ \addtolength{\L@lraise}{-\L@target@dp}%
\fi
- \sbox{\L@tbox}{\LettrineTextFont{#3}}%
- \@tempdima=\baselineskip
- \ifnum\theL@lines=1
- \setlength{\L@first}{\ht\L@lbox}%
- \addtolength{\L@first}{-\ht\L@tbox}%
- \setlength{\L@lraise}{\z@}%
- \else
- \setlength{\L@first}{-\theL@lines\@tempdima}%
- \addtolength{\L@first}{\@tempdima}%
- \sbox{\@tempboxa}{\LettrineTextFont x}%
- \addtolength{\L@first}{-\ht\@tempboxa}%
- \setlength{\L@lraise}{-\L@raise\L@first}%
- \addtolength{\L@first}{\L@lraise}%
- \addtolength{\L@first}{\ht\L@lbox}%
- \addtolength{\L@lraise}{-\theL@lines\@tempdima}%
- \addtolength{\L@lraise}{\@tempdima}%
- \fi
- \par
- \ifdim\L@first>\L@novskip
- \ifL@grid
- \@tempdima=\baselineskip
- \@tempdimb=\@tempdima
- \advance\@tempdimb by \L@novskip
- \@tempcnta=1
- \loop\ifdim\L@first>\@tempdimb
+ \par
+ \ifdim\L@first>\L@novskip
+ \ifL@grid
+ \@tempdima=\baselineskip
+ \@tempdimb=\@tempdima
+ \advance\@tempdimb by \L@novskip
+ \@tempcnta=1
+ \loop\ifdim\L@first>\@tempdimb
\advance\@tempcnta by 1
\advance\L@first by -\@tempdima
- \repeat
- \vskip\@tempcnta\baselineskip
- \else
- \vskip\L@first
- \fi
- \fi
+ \repeat
+ \L@first=\@tempcnta\baselineskip
+ \fi
+ \vskip\L@first
+ \fi
\setlength{\L@Pindent}{\wd\L@lbox}%
\addtolength{\L@Pindent}{-\L@hang\wd\L@lbox}%
\settowidth{\L@first}{\L@ante}%
@@ -14153,23 +14262,32 @@ bidi implementation of tufte title]
\addtolength{\L@next}{-\L@Nindent}%
\addtolength{\L@Pindent}{\rightmargin}%
\addtolength{\L@Nindent}{\rightmargin}%
- \setlength{\LettrineWidth}{\wd\L@lbox}%
- \setlength{\LettrineHeight}{\ht\L@lbox}%
- \setlength{\LettrineDepth}{\dp\L@lbox}%
\addtocounter{L@lines}{1}%
- \addtocounter{L@lines}{\the\c@L@depth}%
- \if@RTL\def\L@parshape{\c@L@lines 0pt \the\L@first}\else\def\L@parshape{\c@L@lines \the\L@Pindent \the\L@first}\fi
+ \addtocounter{L@lines}{\value{L@depth}}%
+ \if@RTL
+ \def\L@parshape{\c@L@lines \z@ \the\L@first}%
+ \else
+ \def\L@parshape{\c@L@lines \the\L@Pindent \the\L@first}%
+ \fi
\@tempcnta=\tw@
\@whilenum \@tempcnta<\c@L@lines\do{%
- \if@RTL\edef\L@parshape{\L@parshape 0pt \the\L@next}\else\edef\L@parshape{\L@parshape \the\L@Nindent \the\L@next}\fi
+ \if@RTL
+ \edef\L@parshape{\L@parshape \z@ \the\L@next}%
+ \else
+ \edef\L@parshape{\L@parshape \the\L@Nindent \the\L@next}%
+ \fi
\addtolength{\L@Nindent}{\L@slope}%
\addtolength{\L@next}{-\L@slope}%
\advance\@tempcnta\@ne}%
- \if@RTL \edef\L@parshape{\L@parshape 0pt \the\linewidth}\else\edef\L@parshape{\L@parshape \rightmargin \the\linewidth}\fi
+ \if@RTL
+ \edef\L@parshape{\L@parshape \z@ \the\linewidth}%
+ \else
+ \edef\L@parshape{\L@parshape \rightmargin \the\linewidth}%
+ \fi
\noindent
\parshape=\L@parshape\relax
\smash{\llap{\mbox{\L@ante}\raisebox{\L@lraise}{\usebox{\L@lbox}}%
- \hskip \the\L@Findent}}%
+ \hskip \the\L@Findent}}%
\usebox{\L@tbox}%
}
% \end{macrocode}