diff options
author | Karl Berry <karl@freefriends.org> | 2017-12-26 22:08:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-12-26 22:08:01 +0000 |
commit | 6b80d8a626ad8862dde2035d12d9633f91773303 (patch) | |
tree | 5274fac533e2cfc72d3cf42b757f9d86409dfd9e /Master/texmf-dist/source | |
parent | ab34d559eee3be0fcacb000229e72c45e2a56ad2 (diff) |
xepersian (26dec17)
git-svn-id: svn://tug.org/texlive/trunk@46143 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/xelatex/xepersian/xepersian.dtx | 282 |
1 files changed, 274 insertions, 8 deletions
diff --git a/Master/texmf-dist/source/xelatex/xepersian/xepersian.dtx b/Master/texmf-dist/source/xelatex/xepersian/xepersian.dtx index 5466b20927d..d15f2f43d1c 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.8 +v19.9 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/24 +Current version release date: 2017/12/27 ______________ 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.8}} +%\large Documentation for \textcolor{blue!65!black}{version 19.9}} % \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.8}} +%Documentation for \textcolor{blue!65!black}{version 19.9}} % %\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.8, 2017/12/24 +%* v19.9, 2017/12/27 %* %* License: LaTeX Project Public License, version %* 1.3c or higher (your choice) @@ -2361,7 +2361,7 @@ by Vafa Khalighi. %\iffalse %<*table> %\fi -%% \CheckSum{9558} +%% \CheckSum{10290} %% \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.8} -\def\xepersiandate{2017/12/24} +\def\xepersianversion{v19.9} +\def\xepersiandate{2017/12/27} \ProvidesPackage{xepersian}[\xepersiandate\space \xepersianversion\space Persian typesetting in XeLaTeX] \RequirePackage{fontspec} @@ -5724,6 +5724,268 @@ Persian typesetting in XeLaTeX] % \fi } +\newcommand*\xepersian@setlength[4]{% + \ifdim #2<\ifdim #2=\z@ \z@ \else \p@\fi + \ifdim #3<\ifdim #3=\z@ \z@ \else \p@\fi + \ifdim #4<\ifdim #4=\z@ \z@ \else \p@\fi + \setlength{#1}{\p@ \@plus\p@ \@minus\p@}% + \else + \setlength{#1}{\p@ \@plus\p@ \@minus#4}% + \fi + \else + \ifdim #4<\ifdim #4=\z@ \z@ \else \p@\fi + \setlength{#1}{\p@ \@plus#3 \@minus\p@}% + \else + \setlength{#1}{\p@ \@plus#3 \@minus#4}% + \fi + \fi + \else + \ifdim #3<\ifdim #3=\z@ \z@ \else \p@\fi + \ifdim #4<\ifdim #4=\z@ \z@ \else \p@\fi + \setlength{#1}{#2 \@plus\p@ \@minus\p@}% + \else + \setlength{#1}{#2 \@plus\p@ \@minus#4}% + \fi + \else + \ifdim #4<\ifdim #4=\z@ \z@ \else \p@\fi + \setlength{#1}{#2 \@plus#3 \@minus\p@}% + \else + \setlength{#1}{#2 \@plus#3 \@minus#4}% + \fi + \fi + \fi +} + +\newcommand*{\setfontsize}[2][1.2\@tempdima]{% + \@defaultunits\@tempdima#2pt\relax\@nnil + \setlength{\@tempdimc}{\@tempdima}% + \addtolength{\@tempdimc}{-10\p@}% + \edef\@ptsize{\strip@pt\@tempdimc}% + \@defaultunits\@tempdimb#1pt\relax\@nnil + \setlength{\@tempdimc}{\dimexpr (100\@tempdimb / \@tempdima * \p@)}% + \edef\@tempb{\the\@tempdimc}% + \setlength{\@tempdimc}{\@tempdima}% + \def\@tempa##1##2##3##4##5\@nnil{\def##1{##2.##3##4}}% + \expandafter\@tempa\expandafter\@tempb\@tempb\@nnil% + \xepersian@setlength{\abovedisplayskip}% + {.8333\@tempdimb}{.1667\@tempdimb}{.5\@tempdimb}% + \xepersian@setlength{\abovedisplayshortskip}{\z@}{.25\@tempdimb}{\z@}% + \xepersian@setlength{\belowdisplayshortskip}% + {.5\@tempdimb}{.25\@tempdimb}{.25\@tempdimb}% + \setlength{\belowdisplayskip}{\abovedisplayskip}% + \edef\normalsize{% + \noexpand\@setfontsize\noexpand\normalsize + {\the\@tempdima}{\the\@tempdimb}% + \abovedisplayskip \the\abovedisplayskip + \abovedisplayshortskip \the\abovedisplayshortskip + \belowdisplayskip \the\belowdisplayskip + \belowdisplayshortskip \the\belowdisplayshortskip + \let\noexpand\@listi\noexpand\@listI + }% + \setlength{\@tempdima}{0.9125\@tempdimc}% + \setlength{\@tempdimb}{\@tempb\@tempdima}% + \xepersian@setlength{\abovedisplayskip}% + {.8333\@tempdimb}{.1667\@tempdimb}{.5\@tempdimb}% + \xepersian@setlength{\abovedisplayshortskip}{\z@}{.25\@tempdimb}{\z@}% + \xepersian@setlength{\belowdisplayshortskip}% + {.5\@tempdimb}{.25\@tempdimb}{.25\@tempdimb}% + \setlength{\belowdisplayskip}{\abovedisplayskip}% + \edef\small{% + \noexpand\@setfontsize\noexpand\small + {\the\@tempdima}{\the\@tempdimb}% + \abovedisplayskip \the\abovedisplayskip + \abovedisplayshortskip \the\abovedisplayshortskip + \belowdisplayskip \the\belowdisplayskip + \belowdisplayshortskip \the\belowdisplayshortskip + \let\noexpand\@listi\noexpand\@listi@small + }% + \setlength{\@tempdima}{.83334\@tempdimc}% + \setlength{\@tempdimb}{\@tempb\@tempdima}% + \xepersian@setlength{\abovedisplayskip}% + {.8333\@tempdimb}{.1667\@tempdimb}{.5\@tempdimb}% + \xepersian@setlength{\abovedisplayshortskip}{\z@}{.25\@tempdimb}{\z@}% + \xepersian@setlength{\belowdisplayshortskip}% + {.5\@tempdimb}{.25\@tempdimb}{.25\@tempdimb}% + \setlength{\belowdisplayskip}{\abovedisplayskip}% + \edef\footnotesize{% + \noexpand\@setfontsize\noexpand\footnotesize + {\the\@tempdima}{\the\@tempdimb}% + \abovedisplayskip \the\abovedisplayskip + \abovedisplayshortskip \the\abovedisplayshortskip + \belowdisplayskip \the\belowdisplayskip + \belowdisplayshortskip \the\belowdisplayshortskip + \let\noexpand\@listi\noexpand\@listi@footnotesize + }% + \setlength{\@tempdima}{.66667\@tempdimc}% + \setlength{\@tempdimb}{\@tempb\@tempdima}% + \edef\scriptsize{% + \noexpand\@setfontsize\noexpand\scriptsize + {\the\@tempdima}{\the\@tempdimb}% + }% + \setlength{\@tempdima}{.5\@tempdimc}% + \setlength{\@tempdimb}{\@tempb\@tempdima}% + \edef\tiny{% + \noexpand\@setfontsize\noexpand\tiny + {\the\@tempdima}{\the\@tempdimb}% + }% + \setlength{\@tempdima}{1.2\@tempdimc}% + \setlength{\@tempdimb}{\@tempb\@tempdima}% + \edef\large{% + \noexpand\@setfontsize\noexpand\large + {\the\@tempdima}{\the\@tempdimb}% + }% + \setlength{\@tempdima}{1.44\@tempdimc}% + \setlength{\@tempdimb}{\@tempb\@tempdima}% + \edef\Large{% + \noexpand\@setfontsize\noexpand\Large + {\the\@tempdima}{\the\@tempdimb}% + }% + \setlength{\@tempdima}{1.728\@tempdimc}% + \setlength{\@tempdimb}{\@tempb\@tempdima}% + \edef\LARGE{% + \noexpand\@setfontsize\noexpand\LARGE + {\the\@tempdima}{\the\@tempdimb}% + }% + \setlength{\@tempdima}{2.074\@tempdimc}% + \setlength{\@tempdimb}{\@tempb\@tempdima}% + \edef\huge{% + \noexpand\@setfontsize\noexpand\huge + {\the\@tempdima}{\the\@tempdimb}% + }% + \setlength{\@tempdima}{2.488\@tempdimc}% + \setlength{\@tempdimb}{\@tempb\@tempdima}% + \edef\Huge{% + \noexpand\@setfontsize\noexpand\Huge + {\the\@tempdima}{\the\@tempdimb}% + }% + \normalsize + \setlength{\@tempdimb}{\f@baselineskip}% + \xepersian@setlength{\parsep}% + {.3333\@tempdimb}{.1667\@tempdimb}{.0833\@tempdimb}% + \xepersian@setlength{\topsep}% + {.6667\@tempdimb}{.1667\@tempdimb}{.3333\@tempdimb}% + \@tempswafalse + \begingroup + \def\@list@extra{\aftergroup\@tempswatrue}% + \csname @listi\endcsname + \endgroup + \edef\@listi{\leftmargin\leftmargini + \topsep \the\topsep + \parsep \the\parsep + \itemsep \parsep + \if@tempswa\noexpand\@list@extra\fi + }% + \let\@listI\@listi + \xepersian@setlength{\parsep}% + {.1667\@tempdimb}{.0833\@tempdimb}{.0833\@tempdimb}% + \xepersian@setlength{\topsep}% + {.3333\@tempdimb}{.1667\@tempdimb}{.1667\@tempdimb}% + \@tempswafalse + \begingroup + \def\@list@extra{\aftergroup\@tempswatrue}% + \csname @listi\endcsname + \endgroup + \edef\@listi@small{\leftmargin\leftmargini + \topsep \the\topsep + \parsep \the\parsep + \itemsep \parsep + \if@tempswa\noexpand\@list@extra\fi + }% + \xepersian@setlength{\parsep}% + {.125\@tempdimb}{.0625\@tempdimb}{.0625\@tempdimb}% + \xepersian@setlength{\topsep}% + {.25\@tempdimb}{.125\@tempdimb}{.125\@tempdimb} + \@tempswafalse + \begingroup + \def\@list@extra{\aftergroup\@tempswatrue}% + \csname @listi\endcsname + \endgroup + \edef\@listi@footnotesize{\leftmargin\leftmargini + \topsep \the\topsep + \parsep \the\parsep + \itemsep \parsep + \if@tempswa\noexpand\@list@extra\fi + }% + \xepersian@setlength{\parsep}% + {.1667\@tempdimb}{.0833\@tempdimb}{.0833\@tempdimb}% + \xepersian@setlength{\topsep}% + {.3333\@tempdimb}{.1667\@tempdimb}{.0833\@tempdimb}% + \@tempswafalse + \begingroup + \def\@list@extra{\aftergroup\@tempswatrue}% + \csname @listii\endcsname + \endgroup + \edef\@listii{\leftmargin\leftmarginii + \labelwidth=\dimexpr \leftmargin-\labelsep + \topsep \the\topsep + \parsep \the\parsep + \itemsep \parsep + \if@tempswa\noexpand\@list@extra\fi + }% + \xepersian@setlength{\topsep}% + {.1667\@tempdimb}{.0833\@tempdimb}{.0833\@tempdimb}% + \setlength{\partopsep}{\z@ \@plus\z@ \@minus\p@}% + \@tempswafalse + \begingroup + \def\@list@extra{\aftergroup\@tempswatrue}% + \csname @listiii\endcsname + \endgroup + \edef\@listiii{\leftmargin\leftmarginiii + \labelwidth=\dimexpr \leftmargin-\labelsep + \topsep \the\topsep + \parsep \z@ + \partopsep \the\partopsep + \itemsep \topsep + \if@tempswa\noexpand\@list@extra\fi + }% + \@tempswafalse + \begingroup + \def\@list@extra{\aftergroup\@tempswatrue}% + \csname @listiv\endcsname + \endgroup + \edef\@listiv{\leftmargin\leftmarginiv + \labelwidth=\dimexpr \leftmargin-\labelsep\relax + \if@tempswa\noexpand\@list@extra\fi + }% + \@tempswafalse + \begingroup + \def\@list@extra{\aftergroup\@tempswatrue}% + \csname @listv\endcsname + \endgroup + \edef\@listv{\leftmargin\leftmarginv + \labelwidth=\dimexpr \leftmargin-\labelsep\relax + \if@tempswa\noexpand\@list@extra\fi + }% + \@tempswafalse + \begingroup + \def\@list@extra{\aftergroup\@tempswatrue}% + \csname @listvi\endcsname + \endgroup + \edef\@listvi{\leftmargin\leftmarginvi + \labelwidth=\dimexpr \leftmargin-\labelsep\relax + \if@tempswa\noexpand\@list@extra\fi + }% + \@listi + \setlength{\@tempdimb}{\f@baselineskip}% + \setlength{\footnotesep}{.555\@tempdimb}% + \xepersian@setlength{\skip\footins}% + {.75\@tempdimb}{.3333\@tempdimb}{.1667\@tempdimb}% + \xepersian@setlength{\floatsep}% + {\@tempdimb}{.1667\@tempdimb}{.1667\@tempdimb}% + \xepersian@setlength{\textfloatsep}% + {1.6667\@tempdimb}{.1667\@tempdimb}{.3333\@tempdimb}% + \setlength{\intextsep}{\floatsep}% + \setlength{\dblfloatsep}{\floatsep}% + \setlength{\dbltextfloatsep}{\textfloatsep}% + \setlength{\@fptop}{\z@ \@plus 1fil}% + \setlength{\@fpsep}{.6667\@tempdimb \@plus 2fil}% + \setlength{\@fpbot}{\@fptop}% + \setlength{\@dblfptop}{\@fptop}% + \setlength{\@dblfpsep}{\@fpsep}% + \setlength{\@dblfpbot}{\@fptop}% + \xepersian@setlength{\partopsep}{.2\@tempdimb}{.1\@tempdimb}{.1\@tempdimb}% +} + \newcommand\twocolumnstableofcontents{% \if@bidi@csundef{multi@column@out}{% \PackageError{xepersian}{Oops! you should load multicol package before xepersian package for being able to use this command}{}}{% @@ -6239,6 +6501,10 @@ number is 999,999,999.}% \def\xepersian@@fontsize@scale{#1}% } +\DeclareOptionX{fontsize}{% + \setfontsize{#1}% + } + \DeclareOptionX{latinfontsizescale}{% \def\xepersian@@latin@fontsize@scale{#1}% } |