texlive[43148] Master/texmf-dist: xepersian (5feb17)

commits+karl at tug.org commits+karl at tug.org
Mon Feb 6 00:19:43 CET 2017


Revision: 43148
          http://tug.org/svn/texlive?view=revision&revision=43148
Author:   karl
Date:     2017-02-06 00:19:42 +0100 (Mon, 06 Feb 2017)
Log Message:
-----------
xepersian (5feb17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/xelatex/xepersian/README
    trunk/Master/texmf-dist/doc/xelatex/xepersian/xepersian.pdf
    trunk/Master/texmf-dist/source/xelatex/xepersian/xepersian.dtx
    trunk/Master/texmf-dist/tex/xelatex/xepersian/algorithm-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/algorithmic-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/amsart-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/amsbook-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/appendix-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/article-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/artikel1-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/artikel2-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/artikel3-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/backref-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/bidimoderncv-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/bidituftesidenote-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/boek-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/boek3-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/book-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/bookest-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/breqn-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/color-localise-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/enumerate-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/extarticle-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/extbook-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/extrafootnotefeatures-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/extreport-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/flowfram-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/footnote-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/framed-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/glossaries-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/hyperref-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/imsproc-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/kashida-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-commands-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-environments-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-messages-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-misc-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/listings-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/loadingorder-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/localise-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/memoir-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/minitoc-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/natbib-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/packages-localise-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/rapport1-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/rapport3-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/refrep-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/report-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/scrartcl-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/scrbook-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/scrreprt-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/soul-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/tkz-linknodes-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/tocloft-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-localise-commands-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-localise-environments-xepersian.def
    trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-magazine.cls
    trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty
    trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-multiplechoice.sty
    trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-persiancal.sty
    trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty

Modified: trunk/Master/texmf-dist/doc/xelatex/xepersian/README
===================================================================
--- trunk/Master/texmf-dist/doc/xelatex/xepersian/README	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/doc/xelatex/xepersian/README	2017-02-05 23:19:42 UTC (rev 43148)
@@ -1,6 +1,6 @@
 ____________________
 The XePersian package
-v17.3
+v17.5
 
 XePersian is a package written for XeLaTeX that allows users to typeset
 Persian easily.
@@ -20,7 +20,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/02/04
+Current version release date: 2017/02/05
 ______________
 Vafa Khalighi
 persian-tex at tug.org

Modified: trunk/Master/texmf-dist/doc/xelatex/xepersian/xepersian.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/xelatex/xepersian/xepersian.dtx
===================================================================
--- trunk/Master/texmf-dist/source/xelatex/xepersian/xepersian.dtx	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/source/xelatex/xepersian/xepersian.dtx	2017-02-05 23:19:42 UTC (rev 43148)
@@ -5,7 +5,7 @@
 %<*readme>
 ____________________
 The XePersian package
-v17.3
+v17.5
 
 XePersian is a package written for XeLaTeX that allows users to typeset
 Persian easily. 
@@ -28,7 +28,7 @@
 label for your query (i.e. if you are reporting any bugs, choose `Bug' label). 
 
 
-Current version release date: 2017/02/04
+Current version release date: 2017/02/05
 ______________
 Vafa Khalighi
 persian-tex at tug.org
@@ -272,7 +272,7 @@
 %\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 17.3}}
+%\large Documentation for \textcolor{blue!65!black}{version 17.5}}
 % \author{Vafa Khalighi\\
 %  \url{persian-tex at tug.org}}
 %\setcounter{page}{0}
@@ -283,7 +283,7 @@
 %\textcolor{blue!65!black}{\Huge The \textsf{\XePersian} \textit{Package}}
 %
 %\Large
-%Documentation for \textcolor{blue!65!black}{version 17.3}}
+%Documentation for \textcolor{blue!65!black}{version 17.5}}
 %
 %\vskip 0pt plus 3fill
 %\textit{\large to my Master, \textbf{Ferdowsi The Great}}
@@ -338,7 +338,7 @@
 %* 
 %* Copyright (c) 2008--2017 Vafa Khalighi
 %* 
-%* v17.3, 2017/02/04
+%* v17.5, 2017/02/05
 %* 
 %* License: LaTeX Project Public License, version
 %* 1.3c or higher (your choice)
@@ -2359,7 +2359,7 @@
 %\iffalse
 %<*table>
 %\fi
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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
@@ -2406,68 +2406,12 @@
 %\fi
 % \subsection{\textsf{amsart-xepersian.def}}
 %    \begin{macrocode}
-\ProvidesFile{amsart-xepersian.def}[2013/04/26 v0.3 adaptations for amsart class]
+\ProvidesFile{amsart-xepersian.def}[2017/02/04 v0.4 adaptations for amsart class]
 \renewcommand \thepart {\@tartibi\c at part}
 \def\appendix{\par\c at section\z@ \c at subsection\z@
    \let\sectionname\appendixname
    \def\thesection{\@harfi\c at section}}
 
-\long\def\@footnotetext#1{%
-  \insert\footins{%
-    \if at RTL@footnote\@RTLtrue\else\@RTLfalse\fi%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\if at RTL@footnote#1\else\@nonlatinfalse\latinfont#1\fi\unskip\strut\par}}}
-
-
-
-
-
-\long\def\@RTLfootnotetext#1{%
-  \insert\footins{%
-    \@RTLtrue%
-    \@nonlatintrue%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\persianfont #1\unskip\strut\par}}}
-
-
-
-
-
-    
-    
-\long\def\@LTRfootnotetext#1{%
-  \insert\footins{%
-    \@RTLfalse%
-    \@nonlatinfalse%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\latinfont  #1\unskip\strut\par}}}    
-      
-      
-\footdir at temp\footdir at ORG@xepersian at amsart@footnotetext\@footnotetext{\bidi at footdir@footnote}%
-\footdir at temp\footdir at ORG@xepersian at amsart@RTLfootnotetext\@RTLfootnotetext{R}%
-\footdir at temp\footdir at ORG@xepersian at amsart@LTRfootnotetext\@LTRfootnotetext{L}%      
-
 %    \end{macrocode}
 % \iffalse
 %</amsart-xepersian.def>
@@ -2475,7 +2419,7 @@
 %\fi
 % \subsection{\textsf{amsbook-xepersian.def}}
 %    \begin{macrocode}
-\ProvidesFile{amsbook-xepersian.def}[2013/04/26 v0.4 adaptations for amsbook class]
+\ProvidesFile{amsbook-xepersian.def}[2017/02/04 v0.5 adaptations for amsbook class]
 \def\frontmatter{\cleardoublepage\pagenumbering{harfi}}
 \renewcommand \thepart {\@tartibi\c at part}
 \def\appendix{\par
@@ -2483,61 +2427,7 @@
   \let\chaptername\appendixname
   \def\thechapter{\@harfi\c at chapter}}
 
-\long\def\@footnotetext#1{%
-  \insert\footins{%
-    \if at RTL@footnote\@RTLtrue\else\@RTLfalse\fi%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\if at RTL@footnote#1\else\@nonlatinfalse\latinfont#1\fi\unskip\strut\par}}}
-
-
-
-
-
-\long\def\@RTLfootnotetext#1{%
-  \insert\footins{%
-    \@RTLtrue%
-    \@nonlatintrue%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\persianfont #1\unskip\strut\par}}}
-
-
-
-
-
-    
-    
-\long\def\@LTRfootnotetext#1{%
-  \insert\footins{%
-    \@RTLfalse%
-    \@nonlatinfalse%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\latinfont  #1\unskip\strut\par}}}    
       
-\footdir at temp\footdir at ORG@xepersian at amsbook@footnotetext\@footnotetext{\bidi at footdir@footnote}%
-\footdir at temp\footdir at ORG@xepersian at amsbook@RTLfootnotetext\@RTLfootnotetext{R}%
-\footdir at temp\footdir at ORG@xepersian at amsbook@LTRfootnotetext\@LTRfootnotetext{L}%
-      
 %    \end{macrocode}
 % \iffalse
 %</amsbook-xepersian.def>
@@ -2646,76 +2536,15 @@
 %\fi
 % \subsection{\textsf{bidituftesidenote-xepersian.def}}
 %    \begin{macrocode}
-\ProvidesFile{bidituftesidenote-xepersian.def}[2014/12/28 v0.2 xepersian changes to bidituftesidenote package]
-\setLTRcitationfont{\@bidituftesidenote at marginfont\@nonlatinfalse\latinfont}
-\long\def\@LTRbidituftesidenote at sidenote[#1][#2]#3{%
-  \let\cite\@bidituftesidenote at infootnote@cite%   use the in-sidenote \cite command
-  \gdef\@bidituftesidenote at citations{}%           clear out any old citations
-  \ifthenelse{\NOT\isempty{#2}}{%
-    \gsetlength{\@bidituftesidenote at sidenote@vertical at offset}{#2}%
-  }{%
-    \gsetlength{\@bidituftesidenote at sidenote@vertical at offset}{0pt}%
-  }%
-  \ifthenelse{\isempty{#1}}{%
-    % no specific footnote number provided
-    \stepcounter\@mpfn%
-    \protected at xdef\@thefnmark{\thempfn}%
-    \@footnotemark\@LTRfootnotetext[\@bidituftesidenote at sidenote@vertical at offset]{\@nonlatinfalse\latinfont#3}%
-  }{%
-    % specific footnote number provided
-    \begingroup%
-      \csname c@\@mpfn\endcsname #1\relax%
-      \unrestored at protected@xdef\@thefnmark{\thempfn}%
-    \endgroup%
-    \@footnotemark\@LTRfootnotetext[\@bidituftesidenote at sidenote@vertical at offset]{\@nonlatinfalse\latinfont#3}%
-  }%
-  \@bidituftesidenote at print@citations%            print any citations
-  \let\cite\@bidituftesidenote at normal@cite%       go back to using normal in-text \cite 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
-}
-\long\def\@RTLbidituftesidenote at sidenote[#1][#2]#3{%
-  \let\cite\@bidituftesidenote at infootnote@cite%   use the in-sidenote \cite command
-  \gdef\@bidituftesidenote at citations{}%           clear out any old citations
-  \ifthenelse{\NOT\isempty{#2}}{%
-    \gsetlength{\@bidituftesidenote at sidenote@vertical at offset}{#2}%
-  }{%
-    \gsetlength{\@bidituftesidenote at sidenote@vertical at offset}{0pt}%
-  }%
-  \ifthenelse{\isempty{#1}}{%
-    % no specific footnote number provided
-    \stepcounter\@mpfn%
-    \protected at xdef\@thefnmark{\thempfn}%
-    \@footnotemark\@RTLfootnotetext[\@bidituftesidenote at sidenote@vertical at offset]{\@nonlatintrue\persianfont#3}%
-  }{%
-    % specific footnote number provided
-    \begingroup%
-      \csname c@\@mpfn\endcsname #1\relax%
-      \unrestored at protected@xdef\@thefnmark{\thempfn}%
-    \endgroup%
-    \@footnotemark\@RTLfootnotetext[\@bidituftesidenote at sidenote@vertical at offset]{\@nonlatintrue\persianfont#3}%
-  }%
-  \@bidituftesidenote at print@citations%            print any citations
-  \let\cite\@bidituftesidenote at normal@cite%       go back to using normal in-text \cite 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
-}
-\renewcommand\LTRmarginnote[2][0pt]{%
-  \let\cite\@bidituftesidenote at infootnote@cite%   use the in-sidenote \cite command
-  \gdef\@bidituftesidenote at citations{}%           clear out any old citations
-  \LTRbidituftesidenotemarginpar{\hbox{}\vspace*{#1}\@bidituftesidenote at marginnote@font\@nonlatinfalse\latinfont\@bidituftesidenote at marginnote@justification\@bidituftesidenote at margin@par\vspace*{-1\baselineskip}\noindent #2}%
-  \@bidituftesidenote at print@citations%            print any citations
-  \let\cite\@bidituftesidenote at normal@cite%       go back to using normal in-text \cite command
-}
-\renewcommand\RTLmarginnote[2][0pt]{%
-  \let\cite\@bidituftesidenote at infootnote@cite%   use the in-sidenote \cite command
-  \gdef\@bidituftesidenote at citations{}%           clear out any old citations
-  \RTLbidituftesidenotemarginpar{\hbox{}\vspace*{#1}\@bidituftesidenote at marginnote@font\@nonlatintrue\persianfont\@bidituftesidenote at marginnote@justification\@bidituftesidenote at margin@par\vspace*{-1\baselineskip}\noindent #2}%
-  \@bidituftesidenote at print@citations%            print any citations
-  \let\cite\@bidituftesidenote at normal@cite%       go back to using normal in-text \cite command
-}
+\ProvidesFile{bidituftesidenote-xepersian.def}[2017/02/04 v0.3 xepersian changes to bidituftesidenote package]
+
+\setLTRcitationfont{\resetlatinfont\footnotesize}
+
+\renewcommand*{\@bidituftesidenote at LTRmarginfont}{\resetlatinfont\footnotesize}
+
+\renewcommand*{\@bidituftesidenote at RTLmarginfont}{\setpersianfont\footnotesize}
+
+
 %    \end{macrocode}
 % \iffalse
 %</bidituftesidenote-xepersian.def>
@@ -4008,9 +3837,9 @@
 % \subsection{\textsf{extrafootnotefeatures-xepersian.def}}
 %    \begin{macrocode}
 \ProvidesFile{extrafootnotefeatures-xepersian.def}[2012/01/01 v0.2 footnote macros for extrafootnotefeatures option of xepersian package]
-\renewcommand{\foottextfont}{\footnotesize\if at RTL@footnote\else\@nonlatinfalse\latinfont\fi}
-\renewcommand{\LTRfoottextfont}{\@nonlatinfalse\footnotesize\latinfont}
-\renewcommand{\RTLfoottextfont}{\@nonlatintrue\footnotesize\persianfont}
+\renewcommand{\foottextfont}{\footnotesize\if at RTL@footnote\else\resetlatinfont\fi}
+\renewcommand{\LTRfoottextfont}{\footnotesize\resetlatinfont}
+\renewcommand{\RTLfoottextfont}{\footnotesize\setpersianfont}
 %    \end{macrocode}
 % \iffalse
 %</extrafootnotefeatures-xepersian.def>
@@ -4068,117 +3897,14 @@
 %\fi
 % \subsection{\textsf{footnote-xepersian.def}}
 %    \begin{macrocode}
-\ProvidesFile{footnote-xepersian.def}[2013/04/26 v0.4 footnote macros for xepersian package]
+\ProvidesFile{footnote-xepersian.def}[2017/02/04 v0.5 footnote macros for xepersian package]
 
-    
-    
-\long\def\@footnotetext#1{\insert\footins{%
-    \if at RTL@footnote\@RTLtrue\else\@RTLfalse\fi%
-    \reset at font\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep
-    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
-    \hsize\columnwidth \@parboxrestore
-    \protected at edef\@currentlabel{%
-       \csname p at footnote\endcsname\@thefnmark
-    }%
-    \color at begingroup
-      \@makefntext{%
-        \rule\z@\footnotesep\ignorespaces\if at RTL@footnote#1\else\@nonlatinfalse\latinfont#1\fi\@finalstrut\strutbox}%
-    \color at endgroup}}%
-    
-    
+\renewcommand*{\bidi@@footnotetext at font}{\if at RTL@footnote\reset at font\else\resetlatinfont\fi\footnotesize} 
 
-    
-    
-\long\def\@RTLfootnotetext#1{\insert\footins{%
-    \@RTLtrue%
-    \@nonlatintrue%
-    \reset at font\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep
-    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
-    \hsize\columnwidth \@parboxrestore
-    \protected at edef\@currentlabel{%
-       \csname p at footnote\endcsname\@thefnmark
-    }%
-    \color at begingroup
-      \@makefntext{%
-        \rule\z@\footnotesep\ignorespaces\persianfont #1\@finalstrut\strutbox}%
-    \color at endgroup}}%
-    
-    
+\renewcommand*{\bidi@@LTRfootnotetext at font}{\resetlatinfont\footnotesize} 
 
+\renewcommand*{\bidi@@RTLfootnotetext at font}{\setpersianfont\footnotesize}  
     
-    
-\long\def\@LTRfootnotetext#1{\insert\footins{%
-    \@RTLfalse%
-    \@nonlatinfalse%
-    \reset at font\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep
-    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
-    \hsize\columnwidth \@parboxrestore
-    \protected at edef\@currentlabel{%
-       \csname p at footnote\endcsname\@thefnmark
-    }%
-    \color at begingroup
-      \@makefntext{%
-        \rule\z@\footnotesep\ignorespaces\latinfont #1\@finalstrut\strutbox}%
-    \color at endgroup}}%
-    
-\footdir at temp\footdir at ORG@xepersian at footnotetext\@footnotetext{\bidi at footdir@footnote}%
-\footdir at temp\footdir at ORG@xepersian at RTLfootnotetext\@RTLfootnotetext{R}%
-\footdir at temp\footdir at ORG@xepersian at LTRfootnotetext\@LTRfootnotetext{L}%    
-
-    
-    
-\long\def\@mpfootnotetext#1{%
- \ifbidi at autofootnoterule\ifnum\c at mpfootnote=\@ne\if at RTL@footnote\global\let\bidi at mpfootnoterule\right at footnoterule\else\global\let\bidi at mpfootnoterule\left at footnoterule\fi\fi\fi%
-  \global\setbox\@mpfootins\vbox{\if at RTL@footnote\@RTLtrue\else\@RTLfalse\fi%
-    \unvbox\@mpfootins
-    \reset at font\footnotesize
-    \hsize\columnwidth
-    \@parboxrestore
-    \protected at edef\@currentlabel
-         {\csname p at mpfootnote\endcsname\@thefnmark}%
-    \color at begingroup
-      \@makefntext{%
-        \rule\z@\footnotesep\ignorespaces\if at RTL@footnote#1\else\@nonlatinfalse\latinfont#1\fi\@finalstrut\strutbox}%
-    \color at endgroup}}    
-    
-    
-
-    
-    
-\long\def\@mpRTLfootnotetext#1{%
-  \ifbidi at autofootnoterule\ifnum\c at mpfootnote=\@ne\global\let\bidi at mpfootnoterule\right at footnoterule\fi\fi%
-  \global\setbox\@mpfootins\vbox{\@RTLtrue\@nonlatintrue%
-    \unvbox\@mpfootins
-    \reset at font\footnotesize
-    \hsize\columnwidth
-    \@parboxrestore
-    \protected at edef\@currentlabel
-         {\csname p at mpfootnote\endcsname\@thefnmark}%
-    \color at begingroup
-      \@makefntext{%
-        \rule\z@\footnotesep\ignorespaces\persianfont #1\@finalstrut\strutbox}%
-    \color at endgroup}}    
-    
-    
-\long\def\@mpLTRfootnotetext#1{%
- \ifbidi at autofootnoterule\ifnum\c at mpfootnote=\@ne\global\let\bidi at mpfootnoterule\left at footnoterule\fi\fi%
-  \global\setbox\@mpfootins\vbox{\@RTLfalse\@nonlatinfalse%
-    \unvbox\@mpfootins
-    \reset at font\footnotesize
-    \hsize\columnwidth
-    \@parboxrestore
-    \protected at edef\@currentlabel
-         {\csname p at mpfootnote\endcsname\@thefnmark}%
-    \color at begingroup
-      \@makefntext{%
-        \rule\z@\footnotesep\ignorespaces\latinfont #1\@finalstrut\strutbox}%
-    \color at endgroup}}
 %    \end{macrocode}
 % \iffalse
 %</footnote-xepersian.def>
@@ -4312,63 +4038,8 @@
   \raise.9ex\hbox{\fontsize\sf at size\z@\normalfont\@thefnmark}%
 }
 
-
-
-\long\def\@footnotetext#1{%
-  \insert\footins{%
-    \if at RTL@footnote\@RTLtrue\else\@RTLfalse\fi%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\if at RTL@footnote#1\else\@nonlatinfalse\latinfont#1\fi\unskip\strut\par}}}
-
-
-
-
-
-\long\def\@RTLfootnotetext#1{%
-  \insert\footins{%
-    \@RTLtrue%
-    \@nonlatintrue%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\persianfont #1\unskip\strut\par}}}
-
-
-
-
-
+ 
     
-    
-\long\def\@LTRfootnotetext#1{%
-  \insert\footins{%
-    \@RTLfalse%
-    \@nonlatinfalse%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\latinfont  #1\unskip\strut\par}}}    
-
-\footdir at temp\footdir at ORG@xepersian at imsproc@footnotetext\@footnotetext{\bidi at footdir@footnote}%
-\footdir at temp\footdir at ORG@xepersian at imsproc@RTLfootnotetext\@RTLfootnotetext{R}%
-\footdir at temp\footdir at ORG@xepersian at imsproc@LTRfootnotetext\@LTRfootnotetext{L}%    
-    
 \def\part{\@startsection{part}{0}%
   \z@{\linespacing\@plus\linespacing}{.5\linespacing}%
   {\normalfont\bfseries\if at RTL\raggedleft\else\raggedright\fi}}
@@ -5676,8 +5347,8 @@
 % \subsection{\textsf{xepersian.sty}}
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\def\xepersianversion{v17.3}
-\def\xepersiandate{2017/02/04}
+\def\xepersianversion{v17.5}
+\def\xepersiandate{2017/02/05}
 \ProvidesPackage{xepersian}[\xepersiandate\space \xepersianversion\space 
 Persian typesetting in XeLaTeX]
 \RequirePackage{fontspec}
@@ -5778,7 +5449,6 @@
 \DeclareDocumentCommand \setlatintextfont { O{} m O{} }
  {
   \fontspec_set_family:Nnn \g__xepersian_latinfont_family {Mapping=tex-text,#1,#3} {#2}
-  \tl_set_eq:NN \rmdefault \g__xepersian_latinfont_family
   \use:x { \exp_not:n { \DeclareRobustCommand \latinfont }
    {
     \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl }
@@ -5959,28 +5629,29 @@
 
 \ExplSyntaxOff
 \def\resetlatinfont{%
+\@nonlatinfalse%
 \let\normalfont\latinfont%
 \let\reset at font\normalfont%
 \latinfont}
 \def\setpersianfont{%
+\@nonlatintrue%
 \let\normalfont\persianfont%
 \let\reset at font\normalfont%
 \persianfont}
-\bidi at newrobustcmd*{\lr}[1]{\LRE{\@nonlatinfalse\latinfont#1}}
-\bidi at newrobustcmd*{\rl}[1]{\RLE{\@nonlatintrue\persianfont#1}}
-\def\latin{\LTR\LatinAlphs\@nonlatinfalse\@RTL at footnotefalse\resetlatinfont}
+\bidi at newrobustcmd*{\lr}[1]{\LRE{\resetlatinfont#1}}
+\bidi at newrobustcmd*{\rl}[1]{\RLE{\setpersianfont#1}}
+\def\latin{\LTR\LatinAlphs\@RTL at footnotefalse\resetlatinfont}
 \def\endlatin{\endLTR}
-\def\persian{\RTL\PersianAlphs\@nonlatintrue\@RTL at footnotetrue\setpersianfont}
+\def\persian{\RTL\PersianAlphs\@RTL at footnotetrue\setpersianfont}
 \def\endpersian{\endRTL}
-\newenvironment{latinitems}{\begin{LTRitems}\LatinAlphs\@nonlatinfalse\@RTL at footnotefalse\resetlatinfont}{\end{LTRitems}}
-\newenvironment{parsiitems}{\begin{RTLitems}\PersianAlphs\@nonlatintrue\@RTL at footnotetrue\setpersianfont}{\end{RTLitems}}
+\newenvironment{latinitems}{\begin{LTRitems}\LatinAlphs\@RTL at footnotefalse\resetlatinfont}{\end{LTRitems}}
+\newenvironment{parsiitems}{\begin{RTLitems}\PersianAlphs\@RTL at footnotetrue\setpersianfont}{\end{RTLitems}}
 \let\originaltoday=\today
 \def\latintoday{\lr{\originaltoday}}
 \def\today{\rl{\persiantoday}}
 \def \@LTRmarginparreset {%
         \reset at font
-        \@nonlatinfalse
-        \latinfont
+        \resetlatinfont
         \normalsize
         \@minipagetrue
         \everypar{\@minipagefalse\everypar{}\beginL}%
@@ -5998,76 +5669,10 @@
        \@latex at warning
          {Citation `\@citeb' on page \thepage \space undefined}}%
        {\@cite at ofmt{\csname b@\@citeb\endcsname}}}}}{#1}}
-\def\@outputpage{%
-\begingroup           % the \endgroup is put in by \aftergroup
-  \let \protect \noexpand
-  \@resetactivechars
-  \global\let\@@if at newlist\if at newlist
-  \global\@newlistfalse
-  \@parboxrestore
-  \shipout \vbox{%
-    \set at typeset@protect
-    \aftergroup \endgroup
-    \aftergroup \set at typeset@protect
-                                % correct? or just restore by ending
-                                % the group?
-  \if at specialpage
-    \global\@specialpagefalse\@nameuse{ps@\@specialstyle}%
-  \fi
-  \if at twoside
-    \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
-       \if at RTLmain
-          \let\@themargin\evensidemargin
-        \else
-          \let\@themargin\oddsidemargin
-        \fi
-    \else \let\@thehead\@evenhead \let\@thefoot\@evenfoot 
-       \if at RTLmain
-         \let\@themargin\oddsidemargin
-       \else
-         \let\@themargin\evensidemargin
-       \fi
-    \fi
-    \ifx\@thehead\@empty \let\@thehead\hfil \fi
-    \ifx\@thefoot\@empty \let\@thefoot\hfil \fi
-    \else %% not @twoside
-    \ifx\@oddhead\@empty \let\@thehead\hfil \fi
-    \ifx\@oddfoot\@empty \let\@thefoot\hfil \fi
-  \fi
-  \reset at font
-  \normalsize
-  \if at RTLmain\@nonlatintrue\setpersianfont\else\@nonlatinfalse\resetlatinfont\fi
-  \normalsfcodes
-  \let\label\@gobble
-  \let\index\@gobble
-  \let\glossary\@gobble
-  \baselineskip\z at skip \lineskip\z at skip \lineskiplimit\z@
-    \@begindvi
-    \vskip \topmargin
-    \moveright\@themargin \vbox {%
-      \setbox\@tempboxa \vbox to\headheight{%
-        \vfil
-        \color at hbox
-          \normalcolor
-          \hb at xt@\textwidth{\if at RTLmain\@RTLtrue\beginR\else\@RTLfalse\beginL\fi\@thehead\if at RTLmain\endR\else\endL\fi}%
-        \color at endbox
-        }%                        %% 22 Feb 87
-      \dp\@tempboxa \z@
-      \box\@tempboxa
-      \vskip \headsep
-      \box\@outputbox
-      \baselineskip \footskip
-      \color at hbox
-        \normalcolor
-        \hb at xt@\textwidth{\if at RTLmain\@RTLtrue\beginR\else\@RTLfalse\beginL\fi\@thefoot\if at RTLmain\endR\else\endL\fi}%
-      \color at endbox
-      }%
-    }%
-  \global\let\if at newlist\@@if at newlist
-  \global \@colht \textheight
-  \stepcounter{page}%
-  \let\firstmark\botmark
-}
+       
+\renewcommand*{\bidi at font@@outputpage}{\if at RTLmain\setpersianfont\else\resetlatinfont\fi}
+       
+
 \newcommand\twocolumnstableofcontents{%
 \if at bidi@csundef{multi at column@out}{%
 \PackageError{xepersian}{Oops! you should load multicol package before xepersian package for being able to use this command}{}}{%
@@ -6376,6 +5981,7 @@
  for the main Persian text}{Use `\settextfont' to load a font.}%
 }{}}
 \@ifdefinitionfileloaded{loadingorder-xetex-bidi}{\input{loadingorder-xepersian.def}}{}
+\@ifdefinitionfileloaded{footnote-xetex-bidi}{\input{footnote-xepersian.def}}{}
 \@ifpackageloaded{appendix}{\input{appendix-xepersian.def}}{}
 \@ifpackageloaded{listings}{\input{listings-xepersian.def}}{}
 \@ifpackageloaded{algorithmic}{\input{algorithmic-xepersian.def}}{}
@@ -6382,7 +5988,7 @@
 \@ifpackageloaded{algorithm}{\input{algorithm-xepersian.def}}{}
 \@ifpackageloaded{backref}{\input{backref-xepersian.def}}{}
 \@ifpackageloaded{flowfram}{\input{flowfram-xepersian.def}}{}
-\@ifpackageloaded{bidituftesidenote}{\input{bidituftesidenote-xepersian.def}}{\input{footnote-xepersian.def}}
+\@ifpackageloaded{bidituftesidenote}{\input{bidituftesidenote-xepersian.def}}{}
 \@ifpackageloaded{breqn}{\input{breqn-xepersian.def}}{}
 \@ifpackageloaded{enumerate}{\input{enumerate-xepersian.def}}{}
 \@ifpackageloaded{framed}{\input{framed-xepersian.def}}{}
@@ -7584,7 +7190,7 @@
 \DeclareDocumentCommand \setdigitfont { O{} m O{} }
  {
   \let\glb at currsize\relax
-  \fontspec_set_family:Nnn \g__xepersian_digitsfamily_family {Mapping=parsidigits,#1} {#2}
+  \fontspec_set_family:Nnn \g__xepersian_digitsfamily_family {Mapping=parsidigits,#1,#3} {#2}
   \xepersian at PackageInfo{Defining the default Persian maths digits font as '#2'}
   \DeclareSymbolFont{OPERATORS}   {\g_fontspec_encoding_tl}{\g__xepersian_digitsfamily_family} {m}{n}
   \DeclareSymbolFont{new at mathbf@font at digits}{\g_fontspec_encoding_tl}{\g__xepersian_digitsfamily_family}{bx}{n}
@@ -7614,7 +7220,7 @@
 
 \DeclareDocumentCommand \setmathsfdigitfont { O{} m O{} }
  {
-  \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {Mapping=parsidigits,#1} {#2}
+  \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {Mapping=parsidigits,#1,#3} {#2}
     \DeclareSymbolFont{new at mathsf@font at digits}{\g_fontspec_encoding_tl}{\g__fontspec_mathsf_tl}{m}{n}
     \def\persianmathsfdigits{\tl_set_eq:NN \mathsf \new at mathsf}
  }
@@ -7623,7 +7229,7 @@
 
 \DeclareDocumentCommand \setmathttdigitfont { O{} m O{} }
  {
-  \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {Mapping=parsidigits,#1} {#2}
+  \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {Mapping=parsidigits,#1,#3} {#2}
     \DeclareSymbolFont{new at mathtt@font at digits}{\g_fontspec_encoding_tl}{\g__fontspec_mathtt_tl}{m}{n}
     \def\persianmathttdigits{\tl_set_eq:NN \mathtt \new at mathtt}
  }

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/algorithm-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/algorithm-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/algorithm-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/algorithmic-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/algorithmic-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/algorithmic-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/amsart-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/amsart-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/amsart-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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
@@ -34,57 +34,12 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 %%
-\ProvidesFile{amsart-xepersian.def}[2013/04/26 v0.3 adaptations for amsart class]
+\ProvidesFile{amsart-xepersian.def}[2017/02/04 v0.4 adaptations for amsart class]
 \renewcommand \thepart {\@tartibi\c at part}
 \def\appendix{\par\c at section\z@ \c at subsection\z@
    \let\sectionname\appendixname
    \def\thesection{\@harfi\c at section}}
 
-\long\def\@footnotetext#1{%
-  \insert\footins{%
-    \if at RTL@footnote\@RTLtrue\else\@RTLfalse\fi%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\if at RTL@footnote#1\else\@nonlatinfalse\latinfont#1\fi\unskip\strut\par}}}
-
-\long\def\@RTLfootnotetext#1{%
-  \insert\footins{%
-    \@RTLtrue%
-    \@nonlatintrue%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\persianfont #1\unskip\strut\par}}}
-
-\long\def\@LTRfootnotetext#1{%
-  \insert\footins{%
-    \@RTLfalse%
-    \@nonlatinfalse%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\latinfont  #1\unskip\strut\par}}}
-
-\footdir at temp\footdir at ORG@xepersian at amsart@footnotetext\@footnotetext{\bidi at footdir@footnote}%
-\footdir at temp\footdir at ORG@xepersian at amsart@RTLfootnotetext\@RTLfootnotetext{R}%
-\footdir at temp\footdir at ORG@xepersian at amsart@LTRfootnotetext\@LTRfootnotetext{L}%
-
 \endinput
 %%
 %% End of file `amsart-xepersian.def'.

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/amsbook-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/amsbook-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/amsbook-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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
@@ -34,7 +34,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 %%
-\ProvidesFile{amsbook-xepersian.def}[2013/04/26 v0.4 adaptations for amsbook class]
+\ProvidesFile{amsbook-xepersian.def}[2017/02/04 v0.5 adaptations for amsbook class]
 \def\frontmatter{\cleardoublepage\pagenumbering{harfi}}
 \renewcommand \thepart {\@tartibi\c at part}
 \def\appendix{\par
@@ -42,51 +42,6 @@
   \let\chaptername\appendixname
   \def\thechapter{\@harfi\c at chapter}}
 
-\long\def\@footnotetext#1{%
-  \insert\footins{%
-    \if at RTL@footnote\@RTLtrue\else\@RTLfalse\fi%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\if at RTL@footnote#1\else\@nonlatinfalse\latinfont#1\fi\unskip\strut\par}}}
-
-\long\def\@RTLfootnotetext#1{%
-  \insert\footins{%
-    \@RTLtrue%
-    \@nonlatintrue%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\persianfont #1\unskip\strut\par}}}
-
-\long\def\@LTRfootnotetext#1{%
-  \insert\footins{%
-    \@RTLfalse%
-    \@nonlatinfalse%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\latinfont  #1\unskip\strut\par}}}
-
-\footdir at temp\footdir at ORG@xepersian at amsbook@footnotetext\@footnotetext{\bidi at footdir@footnote}%
-\footdir at temp\footdir at ORG@xepersian at amsbook@RTLfootnotetext\@RTLfootnotetext{R}%
-\footdir at temp\footdir at ORG@xepersian at amsbook@LTRfootnotetext\@LTRfootnotetext{L}%
-
 \endinput
 %%
 %% End of file `amsbook-xepersian.def'.

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/appendix-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/appendix-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/appendix-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/article-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/article-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/article-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/artikel1-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/artikel1-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/artikel1-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/artikel2-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/artikel2-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/artikel2-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/artikel3-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/artikel3-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/artikel3-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/backref-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/backref-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/backref-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/bidimoderncv-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/bidimoderncv-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/bidimoderncv-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/bidituftesidenote-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/bidituftesidenote-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/bidituftesidenote-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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
@@ -34,76 +34,14 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 %%
-\ProvidesFile{bidituftesidenote-xepersian.def}[2014/12/28 v0.2 xepersian changes to bidituftesidenote package]
-\setLTRcitationfont{\@bidituftesidenote at marginfont\@nonlatinfalse\latinfont}
-\long\def\@LTRbidituftesidenote at sidenote[#1][#2]#3{%
-  \let\cite\@bidituftesidenote at infootnote@cite%   use the in-sidenote \cite command
-  \gdef\@bidituftesidenote at citations{}%           clear out any old citations
-  \ifthenelse{\NOT\isempty{#2}}{%
-    \gsetlength{\@bidituftesidenote at sidenote@vertical at offset}{#2}%
-  }{%
-    \gsetlength{\@bidituftesidenote at sidenote@vertical at offset}{0pt}%
-  }%
-  \ifthenelse{\isempty{#1}}{%
-    % no specific footnote number provided
-    \stepcounter\@mpfn%
-    \protected at xdef\@thefnmark{\thempfn}%
-    \@footnotemark\@LTRfootnotetext[\@bidituftesidenote at sidenote@vertical at offset]{\@nonlatinfalse\latinfont#3}%
-  }{%
-    % specific footnote number provided
-    \begingroup%
-      \csname c@\@mpfn\endcsname #1\relax%
-      \unrestored at protected@xdef\@thefnmark{\thempfn}%
-    \endgroup%
-    \@footnotemark\@LTRfootnotetext[\@bidituftesidenote at sidenote@vertical at offset]{\@nonlatinfalse\latinfont#3}%
-  }%
-  \@bidituftesidenote at print@citations%            print any citations
-  \let\cite\@bidituftesidenote at normal@cite%       go back to using normal in-text \cite 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
-}
-\long\def\@RTLbidituftesidenote at sidenote[#1][#2]#3{%
-  \let\cite\@bidituftesidenote at infootnote@cite%   use the in-sidenote \cite command
-  \gdef\@bidituftesidenote at citations{}%           clear out any old citations
-  \ifthenelse{\NOT\isempty{#2}}{%
-    \gsetlength{\@bidituftesidenote at sidenote@vertical at offset}{#2}%
-  }{%
-    \gsetlength{\@bidituftesidenote at sidenote@vertical at offset}{0pt}%
-  }%
-  \ifthenelse{\isempty{#1}}{%
-    % no specific footnote number provided
-    \stepcounter\@mpfn%
-    \protected at xdef\@thefnmark{\thempfn}%
-    \@footnotemark\@RTLfootnotetext[\@bidituftesidenote at sidenote@vertical at offset]{\@nonlatintrue\persianfont#3}%
-  }{%
-    % specific footnote number provided
-    \begingroup%
-      \csname c@\@mpfn\endcsname #1\relax%
-      \unrestored at protected@xdef\@thefnmark{\thempfn}%
-    \endgroup%
-    \@footnotemark\@RTLfootnotetext[\@bidituftesidenote at sidenote@vertical at offset]{\@nonlatintrue\persianfont#3}%
-  }%
-  \@bidituftesidenote at print@citations%            print any citations
-  \let\cite\@bidituftesidenote at normal@cite%       go back to using normal in-text \cite 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
-}
-\renewcommand\LTRmarginnote[2][0pt]{%
-  \let\cite\@bidituftesidenote at infootnote@cite%   use the in-sidenote \cite command
-  \gdef\@bidituftesidenote at citations{}%           clear out any old citations
-  \LTRbidituftesidenotemarginpar{\hbox{}\vspace*{#1}\@bidituftesidenote at marginnote@font\@nonlatinfalse\latinfont\@bidituftesidenote at marginnote@justification\@bidituftesidenote at margin@par\vspace*{-1\baselineskip}\noindent #2}%
-  \@bidituftesidenote at print@citations%            print any citations
-  \let\cite\@bidituftesidenote at normal@cite%       go back to using normal in-text \cite command
-}
-\renewcommand\RTLmarginnote[2][0pt]{%
-  \let\cite\@bidituftesidenote at infootnote@cite%   use the in-sidenote \cite command
-  \gdef\@bidituftesidenote at citations{}%           clear out any old citations
-  \RTLbidituftesidenotemarginpar{\hbox{}\vspace*{#1}\@bidituftesidenote at marginnote@font\@nonlatintrue\persianfont\@bidituftesidenote at marginnote@justification\@bidituftesidenote at margin@par\vspace*{-1\baselineskip}\noindent #2}%
-  \@bidituftesidenote at print@citations%            print any citations
-  \let\cite\@bidituftesidenote at normal@cite%       go back to using normal in-text \cite command
-}
+\ProvidesFile{bidituftesidenote-xepersian.def}[2017/02/04 v0.3 xepersian changes to bidituftesidenote package]
+
+\setLTRcitationfont{\resetlatinfont\footnotesize}
+
+\renewcommand*{\@bidituftesidenote at LTRmarginfont}{\resetlatinfont\footnotesize}
+
+\renewcommand*{\@bidituftesidenote at RTLmarginfont}{\setpersianfont\footnotesize}
+
 \endinput
 %%
 %% End of file `bidituftesidenote-xepersian.def'.

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/boek-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/boek-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/boek-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/boek3-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/boek3-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/boek3-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/book-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/book-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/book-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/bookest-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/bookest-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/bookest-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/breqn-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/breqn-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/breqn-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/color-localise-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/color-localise-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/color-localise-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/enumerate-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/enumerate-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/enumerate-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/extarticle-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/extarticle-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/extarticle-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/extbook-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/extbook-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/extbook-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/extrafootnotefeatures-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/extrafootnotefeatures-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/extrafootnotefeatures-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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
@@ -35,9 +35,9 @@
 %%   Right brace   \}     Tilde         \~}
 %%
 \ProvidesFile{extrafootnotefeatures-xepersian.def}[2012/01/01 v0.2 footnote macros for extrafootnotefeatures option of xepersian package]
-\renewcommand{\foottextfont}{\footnotesize\if at RTL@footnote\else\@nonlatinfalse\latinfont\fi}
-\renewcommand{\LTRfoottextfont}{\@nonlatinfalse\footnotesize\latinfont}
-\renewcommand{\RTLfoottextfont}{\@nonlatintrue\footnotesize\persianfont}
+\renewcommand{\foottextfont}{\footnotesize\if at RTL@footnote\else\resetlatinfont\fi}
+\renewcommand{\LTRfoottextfont}{\footnotesize\resetlatinfont}
+\renewcommand{\RTLfoottextfont}{\footnotesize\setpersianfont}
 \endinput
 %%
 %% End of file `extrafootnotefeatures-xepersian.def'.

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/extreport-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/extreport-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/extreport-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/flowfram-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/flowfram-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/flowfram-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/footnote-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/footnote-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/footnote-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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
@@ -34,100 +34,14 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 %%
-\ProvidesFile{footnote-xepersian.def}[2013/04/26 v0.4 footnote macros for xepersian package]
+\ProvidesFile{footnote-xepersian.def}[2017/02/04 v0.5 footnote macros for xepersian package]
 
-\long\def\@footnotetext#1{\insert\footins{%
-    \if at RTL@footnote\@RTLtrue\else\@RTLfalse\fi%
-    \reset at font\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep
-    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
-    \hsize\columnwidth \@parboxrestore
-    \protected at edef\@currentlabel{%
-       \csname p at footnote\endcsname\@thefnmark
-    }%
-    \color at begingroup
-      \@makefntext{%
-        \rule\z@\footnotesep\ignorespaces\if at RTL@footnote#1\else\@nonlatinfalse\latinfont#1\fi\@finalstrut\strutbox}%
-    \color at endgroup}}%
+\renewcommand*{\bidi@@footnotetext at font}{\if at RTL@footnote\reset at font\else\resetlatinfont\fi\footnotesize}
 
-\long\def\@RTLfootnotetext#1{\insert\footins{%
-    \@RTLtrue%
-    \@nonlatintrue%
-    \reset at font\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep
-    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
-    \hsize\columnwidth \@parboxrestore
-    \protected at edef\@currentlabel{%
-       \csname p at footnote\endcsname\@thefnmark
-    }%
-    \color at begingroup
-      \@makefntext{%
-        \rule\z@\footnotesep\ignorespaces\persianfont #1\@finalstrut\strutbox}%
-    \color at endgroup}}%
+\renewcommand*{\bidi@@LTRfootnotetext at font}{\resetlatinfont\footnotesize}
 
-\long\def\@LTRfootnotetext#1{\insert\footins{%
-    \@RTLfalse%
-    \@nonlatinfalse%
-    \reset at font\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep
-    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
-    \hsize\columnwidth \@parboxrestore
-    \protected at edef\@currentlabel{%
-       \csname p at footnote\endcsname\@thefnmark
-    }%
-    \color at begingroup
-      \@makefntext{%
-        \rule\z@\footnotesep\ignorespaces\latinfont #1\@finalstrut\strutbox}%
-    \color at endgroup}}%
+\renewcommand*{\bidi@@RTLfootnotetext at font}{\setpersianfont\footnotesize}
 
-\footdir at temp\footdir at ORG@xepersian at footnotetext\@footnotetext{\bidi at footdir@footnote}%
-\footdir at temp\footdir at ORG@xepersian at RTLfootnotetext\@RTLfootnotetext{R}%
-\footdir at temp\footdir at ORG@xepersian at LTRfootnotetext\@LTRfootnotetext{L}%
-
-\long\def\@mpfootnotetext#1{%
- \ifbidi at autofootnoterule\ifnum\c at mpfootnote=\@ne\if at RTL@footnote\global\let\bidi at mpfootnoterule\right at footnoterule\else\global\let\bidi at mpfootnoterule\left at footnoterule\fi\fi\fi%
-  \global\setbox\@mpfootins\vbox{\if at RTL@footnote\@RTLtrue\else\@RTLfalse\fi%
-    \unvbox\@mpfootins
-    \reset at font\footnotesize
-    \hsize\columnwidth
-    \@parboxrestore
-    \protected at edef\@currentlabel
-         {\csname p at mpfootnote\endcsname\@thefnmark}%
-    \color at begingroup
-      \@makefntext{%
-        \rule\z@\footnotesep\ignorespaces\if at RTL@footnote#1\else\@nonlatinfalse\latinfont#1\fi\@finalstrut\strutbox}%
-    \color at endgroup}}
-
-\long\def\@mpRTLfootnotetext#1{%
-  \ifbidi at autofootnoterule\ifnum\c at mpfootnote=\@ne\global\let\bidi at mpfootnoterule\right at footnoterule\fi\fi%
-  \global\setbox\@mpfootins\vbox{\@RTLtrue\@nonlatintrue%
-    \unvbox\@mpfootins
-    \reset at font\footnotesize
-    \hsize\columnwidth
-    \@parboxrestore
-    \protected at edef\@currentlabel
-         {\csname p at mpfootnote\endcsname\@thefnmark}%
-    \color at begingroup
-      \@makefntext{%
-        \rule\z@\footnotesep\ignorespaces\persianfont #1\@finalstrut\strutbox}%
-    \color at endgroup}}
-
-\long\def\@mpLTRfootnotetext#1{%
- \ifbidi at autofootnoterule\ifnum\c at mpfootnote=\@ne\global\let\bidi at mpfootnoterule\left at footnoterule\fi\fi%
-  \global\setbox\@mpfootins\vbox{\@RTLfalse\@nonlatinfalse%
-    \unvbox\@mpfootins
-    \reset at font\footnotesize
-    \hsize\columnwidth
-    \@parboxrestore
-    \protected at edef\@currentlabel
-         {\csname p at mpfootnote\endcsname\@thefnmark}%
-    \color at begingroup
-      \@makefntext{%
-        \rule\z@\footnotesep\ignorespaces\latinfont #1\@finalstrut\strutbox}%
-    \color at endgroup}}
 \endinput
 %%
 %% End of file `footnote-xepersian.def'.

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/framed-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/framed-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/framed-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/glossaries-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/glossaries-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/glossaries-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/hyperref-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/hyperref-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/hyperref-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/imsproc-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/imsproc-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/imsproc-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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
@@ -76,51 +76,6 @@
   \raise.9ex\hbox{\fontsize\sf at size\z@\normalfont\@thefnmark}%
 }
 
-\long\def\@footnotetext#1{%
-  \insert\footins{%
-    \if at RTL@footnote\@RTLtrue\else\@RTLfalse\fi%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\if at RTL@footnote#1\else\@nonlatinfalse\latinfont#1\fi\unskip\strut\par}}}
-
-\long\def\@RTLfootnotetext#1{%
-  \insert\footins{%
-    \@RTLtrue%
-    \@nonlatintrue%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\persianfont #1\unskip\strut\par}}}
-
-\long\def\@LTRfootnotetext#1{%
-  \insert\footins{%
-    \@RTLfalse%
-    \@nonlatinfalse%
-    \normalfont\footnotesize
-    \interlinepenalty\interfootnotelinepenalty
-    \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
-    \floatingpenalty\@MM \hsize\columnwidth
-    \@parboxrestore \parindent\normalparindent \sloppy
-    \protected at edef\@currentlabel{%
-      \csname p at footnote\endcsname\@thefnmark}%
-    \@makefntext{%
-      \rule\z@\footnotesep\ignorespaces\latinfont  #1\unskip\strut\par}}}
-
-\footdir at temp\footdir at ORG@xepersian at imsproc@footnotetext\@footnotetext{\bidi at footdir@footnote}%
-\footdir at temp\footdir at ORG@xepersian at imsproc@RTLfootnotetext\@RTLfootnotetext{R}%
-\footdir at temp\footdir at ORG@xepersian at imsproc@LTRfootnotetext\@LTRfootnotetext{L}%
-
 \def\part{\@startsection{part}{0}%
   \z@{\linespacing\@plus\linespacing}{.5\linespacing}%
   {\normalfont\bfseries\if at RTL\raggedleft\else\raggedright\fi}}

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/kashida-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/kashida-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/kashida-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-commands-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-commands-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-commands-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-environments-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-environments-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-environments-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-messages-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-messages-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-messages-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-misc-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-misc-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/latex-localise-misc-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/listings-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/listings-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/listings-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/loadingorder-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/loadingorder-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/loadingorder-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/localise-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/localise-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/localise-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/memoir-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/memoir-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/memoir-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/minitoc-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/minitoc-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/minitoc-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/natbib-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/natbib-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/natbib-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/packages-localise-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/packages-localise-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/packages-localise-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/rapport1-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/rapport1-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/rapport1-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/rapport3-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/rapport3-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/rapport3-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/refrep-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/refrep-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/refrep-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/report-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/report-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/report-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/scrartcl-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/scrartcl-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/scrartcl-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/scrbook-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/scrbook-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/scrbook-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/scrreprt-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/scrreprt-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/scrreprt-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/soul-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/soul-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/soul-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/tkz-linknodes-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/tkz-linknodes-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/tkz-linknodes-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/tocloft-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/tocloft-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/tocloft-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-localise-commands-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-localise-commands-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-localise-commands-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-localise-environments-xepersian.def
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-localise-environments-xepersian.def	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-localise-environments-xepersian.def	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-magazine.cls
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-magazine.cls	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-magazine.cls	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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
@@ -165,7 +165,7 @@
 \DeclareDocumentCommand \setdigitfont { O{} m O{} }
  {
   \let\glb at currsize\relax
-  \fontspec_set_family:Nnn \g__xepersian_digitsfamily_family {Mapping=parsidigits,#1} {#2}
+  \fontspec_set_family:Nnn \g__xepersian_digitsfamily_family {Mapping=parsidigits,#1,#3} {#2}
   \xepersian at PackageInfo{Defining the default Persian maths digits font as '#2'}
   \DeclareSymbolFont{OPERATORS}   {\g_fontspec_encoding_tl}{\g__xepersian_digitsfamily_family} {m}{n}
   \DeclareSymbolFont{new at mathbf@font at digits}{\g_fontspec_encoding_tl}{\g__xepersian_digitsfamily_family}{bx}{n}
@@ -191,7 +191,7 @@
 
 \DeclareDocumentCommand \setmathsfdigitfont { O{} m O{} }
  {
-  \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {Mapping=parsidigits,#1} {#2}
+  \fontspec_set_family:Nnn \g__fontspec_mathsf_tl {Mapping=parsidigits,#1,#3} {#2}
     \DeclareSymbolFont{new at mathsf@font at digits}{\g_fontspec_encoding_tl}{\g__fontspec_mathsf_tl}{m}{n}
     \def\persianmathsfdigits{\tl_set_eq:NN \mathsf \new at mathsf}
  }
@@ -198,7 +198,7 @@
 
 \DeclareDocumentCommand \setmathttdigitfont { O{} m O{} }
  {
-  \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {Mapping=parsidigits,#1} {#2}
+  \fontspec_set_family:Nnn \g__fontspec_mathtt_tl {Mapping=parsidigits,#1,#3} {#2}
     \DeclareSymbolFont{new at mathtt@font at digits}{\g_fontspec_encoding_tl}{\g__fontspec_mathtt_tl}{m}{n}
     \def\persianmathttdigits{\tl_set_eq:NN \mathtt \new at mathtt}
  }

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-multiplechoice.sty
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-multiplechoice.sty	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-multiplechoice.sty	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-persiancal.sty
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-persiancal.sty	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian-persiancal.sty	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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

Modified: trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty	2017-02-05 23:19:16 UTC (rev 43147)
+++ trunk/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty	2017-02-05 23:19:42 UTC (rev 43148)
@@ -17,7 +17,7 @@
 %%   by Vafa Khalighi.
 %% 
 %% 
-%% \CheckSum{10291}
+%% \CheckSum{9307}
 %% \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
@@ -35,8 +35,8 @@
 %%   Right brace   \}     Tilde         \~}
 %%
 \NeedsTeXFormat{LaTeX2e}
-\def\xepersianversion{v17.3}
-\def\xepersiandate{2017/02/04}
+\def\xepersianversion{v17.5}
+\def\xepersiandate{2017/02/05}
 \ProvidesPackage{xepersian}[\xepersiandate\space \xepersianversion\space
 Persian typesetting in XeLaTeX]
 \RequirePackage{fontspec}
@@ -137,7 +137,6 @@
 \DeclareDocumentCommand \setlatintextfont { O{} m O{} }
  {
   \fontspec_set_family:Nnn \g__xepersian_latinfont_family {Mapping=tex-text,#1,#3} {#2}
-  \tl_set_eq:NN \rmdefault \g__xepersian_latinfont_family
   \use:x { \exp_not:n { \DeclareRobustCommand \latinfont }
    {
     \exp_not:N \fontencoding { \l__fontspec_nfss_enc_tl }
@@ -317,28 +316,29 @@
 
 \ExplSyntaxOff
 \def\resetlatinfont{%
+\@nonlatinfalse%
 \let\normalfont\latinfont%
 \let\reset at font\normalfont%
 \latinfont}
 \def\setpersianfont{%
+\@nonlatintrue%
 \let\normalfont\persianfont%
 \let\reset at font\normalfont%
 \persianfont}
-\bidi at newrobustcmd*{\lr}[1]{\LRE{\@nonlatinfalse\latinfont#1}}
-\bidi at newrobustcmd*{\rl}[1]{\RLE{\@nonlatintrue\persianfont#1}}
-\def\latin{\LTR\LatinAlphs\@nonlatinfalse\@RTL at footnotefalse\resetlatinfont}
+\bidi at newrobustcmd*{\lr}[1]{\LRE{\resetlatinfont#1}}
+\bidi at newrobustcmd*{\rl}[1]{\RLE{\setpersianfont#1}}
+\def\latin{\LTR\LatinAlphs\@RTL at footnotefalse\resetlatinfont}
 \def\endlatin{\endLTR}
-\def\persian{\RTL\PersianAlphs\@nonlatintrue\@RTL at footnotetrue\setpersianfont}
+\def\persian{\RTL\PersianAlphs\@RTL at footnotetrue\setpersianfont}
 \def\endpersian{\endRTL}
-\newenvironment{latinitems}{\begin{LTRitems}\LatinAlphs\@nonlatinfalse\@RTL at footnotefalse\resetlatinfont}{\end{LTRitems}}
-\newenvironment{parsiitems}{\begin{RTLitems}\PersianAlphs\@nonlatintrue\@RTL at footnotetrue\setpersianfont}{\end{RTLitems}}
+\newenvironment{latinitems}{\begin{LTRitems}\LatinAlphs\@RTL at footnotefalse\resetlatinfont}{\end{LTRitems}}
+\newenvironment{parsiitems}{\begin{RTLitems}\PersianAlphs\@RTL at footnotetrue\setpersianfont}{\end{RTLitems}}
 \let\originaltoday=\today
 \def\latintoday{\lr{\originaltoday}}
 \def\today{\rl{\persiantoday}}
 \def \@LTRmarginparreset {%
         \reset at font
-        \@nonlatinfalse
-        \latinfont
+        \resetlatinfont
         \normalsize
         \@minipagetrue
         \everypar{\@minipagefalse\everypar{}\beginL}%
@@ -356,76 +356,9 @@
        \@latex at warning
          {Citation `\@citeb' on page \thepage \space undefined}}%
        {\@cite at ofmt{\csname b@\@citeb\endcsname}}}}}{#1}}
-\def\@outputpage{%
-\begingroup           % the \endgroup is put in by \aftergroup
-  \let \protect \noexpand
-  \@resetactivechars
-  \global\let\@@if at newlist\if at newlist
-  \global\@newlistfalse
-  \@parboxrestore
-  \shipout \vbox{%
-    \set at typeset@protect
-    \aftergroup \endgroup
-    \aftergroup \set at typeset@protect
-                                % correct? or just restore by ending
-                                % the group?
-  \if at specialpage
-    \global\@specialpagefalse\@nameuse{ps@\@specialstyle}%
-  \fi
-  \if at twoside
-    \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
-       \if at RTLmain
-          \let\@themargin\evensidemargin
-        \else
-          \let\@themargin\oddsidemargin
-        \fi
-    \else \let\@thehead\@evenhead \let\@thefoot\@evenfoot
-       \if at RTLmain
-         \let\@themargin\oddsidemargin
-       \else
-         \let\@themargin\evensidemargin
-       \fi
-    \fi
-    \ifx\@thehead\@empty \let\@thehead\hfil \fi
-    \ifx\@thefoot\@empty \let\@thefoot\hfil \fi
-    \else %% not @twoside
-    \ifx\@oddhead\@empty \let\@thehead\hfil \fi
-    \ifx\@oddfoot\@empty \let\@thefoot\hfil \fi
-  \fi
-  \reset at font
-  \normalsize
-  \if at RTLmain\@nonlatintrue\setpersianfont\else\@nonlatinfalse\resetlatinfont\fi
-  \normalsfcodes
-  \let\label\@gobble
-  \let\index\@gobble
-  \let\glossary\@gobble
-  \baselineskip\z at skip \lineskip\z at skip \lineskiplimit\z@
-    \@begindvi
-    \vskip \topmargin
-    \moveright\@themargin \vbox {%
-      \setbox\@tempboxa \vbox to\headheight{%
-        \vfil
-        \color at hbox
-          \normalcolor
-          \hb at xt@\textwidth{\if at RTLmain\@RTLtrue\beginR\else\@RTLfalse\beginL\fi\@thehead\if at RTLmain\endR\else\endL\fi}%
-        \color at endbox
-        }%                        %% 22 Feb 87
-      \dp\@tempboxa \z@
-      \box\@tempboxa
-      \vskip \headsep
-      \box\@outputbox
-      \baselineskip \footskip
-      \color at hbox
-        \normalcolor
-        \hb at xt@\textwidth{\if at RTLmain\@RTLtrue\beginR\else\@RTLfalse\beginL\fi\@thefoot\if at RTLmain\endR\else\endL\fi}%
-      \color at endbox
-      }%
-    }%
-  \global\let\if at newlist\@@if at newlist
-  \global \@colht \textheight
-  \stepcounter{page}%
-  \let\firstmark\botmark
-}
+
+\renewcommand*{\bidi at font@@outputpage}{\if at RTLmain\setpersianfont\else\resetlatinfont\fi}
+
 \newcommand\twocolumnstableofcontents{%
 \if at bidi@csundef{multi at column@out}{%
 \PackageError{xepersian}{Oops! you should load multicol package before xepersian package for being able to use this command}{}}{%
@@ -731,6 +664,7 @@
  for the main Persian text}{Use `\settextfont' to load a font.}%
 }{}}
 \@ifdefinitionfileloaded{loadingorder-xetex-bidi}{\input{loadingorder-xepersian.def}}{}
+\@ifdefinitionfileloaded{footnote-xetex-bidi}{\input{footnote-xepersian.def}}{}
 \@ifpackageloaded{appendix}{\input{appendix-xepersian.def}}{}
 \@ifpackageloaded{listings}{\input{listings-xepersian.def}}{}
 \@ifpackageloaded{algorithmic}{\input{algorithmic-xepersian.def}}{}
@@ -737,7 +671,7 @@
 \@ifpackageloaded{algorithm}{\input{algorithm-xepersian.def}}{}
 \@ifpackageloaded{backref}{\input{backref-xepersian.def}}{}
 \@ifpackageloaded{flowfram}{\input{flowfram-xepersian.def}}{}
-\@ifpackageloaded{bidituftesidenote}{\input{bidituftesidenote-xepersian.def}}{\input{footnote-xepersian.def}}
+\@ifpackageloaded{bidituftesidenote}{\input{bidituftesidenote-xepersian.def}}{}
 \@ifpackageloaded{breqn}{\input{breqn-xepersian.def}}{}
 \@ifpackageloaded{enumerate}{\input{enumerate-xepersian.def}}{}
 \@ifpackageloaded{framed}{\input{framed-xepersian.def}}{}



More information about the tex-live-commits mailing list