summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/xelatex/xepersian/xepersian.dtx71
1 files changed, 59 insertions, 12 deletions
diff --git a/Master/texmf-dist/source/xelatex/xepersian/xepersian.dtx b/Master/texmf-dist/source/xelatex/xepersian/xepersian.dtx
index b38f0c7ad03..d4cae748786 100644
--- a/Master/texmf-dist/source/xelatex/xepersian/xepersian.dtx
+++ b/Master/texmf-dist/source/xelatex/xepersian/xepersian.dtx
@@ -5,7 +5,7 @@
%<*readme>
____________________
The XePersian package
-v19.5
+v19.7
XePersian is a package written for XeLaTeX that allows users to typeset
Persian easily.
@@ -28,7 +28,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/12/19
+Current version release date: 2017/12/20
______________
Vafa Khalighi
persian-tex@tug.org
@@ -273,7 +273,7 @@ by Vafa Khalighi.
%\changes{v13.1}{2013/09/23}{Added implementation of the package.}
% \title{\textcolor{blue!65!black}{\Huge The \textsf{\XePersian} \textit{Package}}\\
%\LARGE Persian for \LaTeXe, using {\XeTeX} engine\\[5pt]
-%\large Documentation for \textcolor{blue!65!black}{version 19.5}}
+%\large Documentation for \textcolor{blue!65!black}{version 19.7}}
% \author{Vafa Khalighi\\
% \url{persian-tex@tug.org}}
%\setcounter{page}{0}
@@ -284,7 +284,7 @@ by Vafa Khalighi.
%\textcolor{blue!65!black}{\Huge The \textsf{\XePersian} \textit{Package}}
%
%\Large
-%Documentation for \textcolor{blue!65!black}{version 19.5}}
+%Documentation for \textcolor{blue!65!black}{version 19.7}}
%
%\vskip 0pt plus 3fill
%\textit{\large to my Master, \textbf{Ferdowsi The Great}}
@@ -339,7 +339,7 @@ by Vafa Khalighi.
%*
%* Copyright (c) 2008--2017 Vafa Khalighi
%*
-%* v19.5, 2017/12/19
+%* v19.7, 2017/12/20
%*
%* License: LaTeX Project Public License, version
%* 1.3c or higher (your choice)
@@ -2361,7 +2361,7 @@ by Vafa Khalighi.
%\iffalse
%<*table>
%\fi
-%% \CheckSum{9425}
+%% \CheckSum{9517}
%% \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
@@ -5289,8 +5289,8 @@ U+003E U+003E <> U+00BB ; >> -> RIGHT POINTING GUILLEMET
% \subsection{\textsf{xepersian.sty}}
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\def\xepersianversion{v19.5}
-\def\xepersiandate{2017/12/19}
+\def\xepersianversion{v19.7}
+\def\xepersiandate{2017/12/20}
\ProvidesPackage{xepersian}[\xepersiandate\space \xepersianversion\space
Persian typesetting in XeLaTeX]
\RequirePackage{fontspec}
@@ -5612,19 +5612,31 @@ Persian typesetting in XeLaTeX]
\ExplSyntaxOff
\def\resetlatinfont{%
+\let\@xepersian@@fontsize@scale\xepersian@@fontsize@scale%
+\def\xepersian@@fontsize@scale{%
+ \strip@pt\dimexpr 1pt * \dimexpr
+ \xepersian@@latin@fontsize@scale pt\relax
+ / \dimexpr \@xepersian@@fontsize@scale pt\relax\relax
+}%
\@nonlatinfalse%
\let\normalfont\latinfont%
\let\reset@font\normalfont%
\latinfont%
\fontsize\f@size\f@baselineskip%
-\selectfont}
+\selectfont%
+\let\xepersian@@fontsize@scale\xepersian@@latin@fontsize@scale%
+}
\def\setpersianfont{%
+\let\@xepersian@@fontsize@scale\xepersian@@fontsize@scale%
+\let\xepersian@@fontsize@scale\@ne%
\@nonlatintrue%
\let\normalfont\persianfont%
\let\reset@font\normalfont%
\persianfont%
\fontsize\f@size\f@baselineskip%
-\selectfont}
+\selectfont%
+\let\xepersian@@fontsize@scale\@xepersian@@fontsize@scale%
+}
\bidi@newrobustcmd*{\lr}[1]{\LRE{\resetlatinfont#1}}
\bidi@newrobustcmd*{\rl}[1]{\RLE{\setpersianfont#1}}
\def\latin{\LTR\LatinAlphs\@RTL@footnotefalse\resetlatinfont}
@@ -6209,11 +6221,17 @@ number is 999,999,999.}%
{#1}
}
-
+\DeclareOptionX{mathfontsizescale}{%
+ \def\xepersian@@math@fontsize@scale{#1}%
+ }
\DeclareOptionX{fontsizescale}{%
\def\xepersian@@fontsize@scale{#1}%
}
+
+\DeclareOptionX{latinfontsizescale}{%
+ \def\xepersian@@latin@fontsize@scale{#1}%
+ }
\define@choicekey{xepersian.sty}{computeautoilg}[\xepersian@tempa\xepersian@tempb]{on,off}[on]{%
\ifcase\xepersian@tempb\relax
@@ -6245,7 +6263,9 @@ number is 999,999,999.}%
footnoterule=automatic,
abjadvariant=two,
DetectColumn=off,
- fontsizescale=\@ne
+ fontsizescale=\@ne,
+ latinfontsizescale=\@ne,
+ mathfontsizescale=\@ne
}
\ProcessOptionsX
@@ -6259,6 +6279,33 @@ number is 999,999,999.}%
\@tempdimb\xepersian@@fontsize@scale\dimexpr#2pt\relax
}{}{}
+
+\newcommand*{\xepersian@@update@math@fontsize}[1]{%
+ \strip@pt\dimexpr\xepersian@@math@fontsize@scale
+ \dimexpr 1pt * \dimexpr #1 pt\relax /
+ \dimexpr \xepersian@@fontsize@scale pt\relax
+ \relax\relax
+}
+
+\bidi@patchcmd{\getanddefine@fonts}{%
+ \xdef\font@name{\csname \string#2/\tf@size\endcsname}%
+}{%
+ \xdef\font@name{\csname \string#2/\xepersian@@update@math@fontsize\tf@size\endcsname}%
+}{}{}
+
+\bidi@patchcmd{\getanddefine@fonts}{%
+ \xdef\font@name{\csname \string#2/\sf@size\endcsname}%
+}{%
+ \xdef\font@name{\csname \string#2/\xepersian@@update@math@fontsize\sf@size\endcsname}%
+}{}{}
+
+\bidi@patchcmd{\getanddefine@fonts}{%
+ \xdef\font@name{\csname \string#2/\ssf@size\endcsname}%
+}{%
+ \xdef\font@name{\csname \string#2/\xepersian@@update@math@fontsize\ssf@size\endcsname}%
+}{}{}
+
+
\if@xepersian@@computeautoilg
\bidi@patchcmd{\set@fontsize}{%
\baselineskip\f@baselineskip\relax