summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-01-14 18:49:06 +0000
committerKarl Berry <karl@freefriends.org>2009-01-14 18:49:06 +0000
commitae54731f22c86144ff5705f3db206fba358c04be (patch)
tree17c50cb6bab0b43cfcf93019675d7f31f4043123 /Master/texmf-dist/tex
parent899fb3d535cb0d801d8f1f8b528b47581e73f2f7 (diff)
xepersian update (5jan09)
git-svn-id: svn://tug.org/texlive/trunk@11873 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/xelatex/xepersian/beamerthemexepersian-JLTree.sty123
-rw-r--r--Master/texmf-dist/tex/xelatex/xepersian/xepersian-magazine.cls879
-rw-r--r--Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty316
-rw-r--r--Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.tex50
-rw-r--r--Master/texmf-dist/tex/xelatex/xepersian/xepersian-presentation.cls86
-rw-r--r--Master/texmf-dist/tex/xelatex/xepersian/xepersian-thesis.cls904
-rw-r--r--Master/texmf-dist/tex/xelatex/xepersian/xepersian-user.cls799
-rw-r--r--Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty1361
8 files changed, 3902 insertions, 616 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xepersian/beamerthemexepersian-JLTree.sty b/Master/texmf-dist/tex/xelatex/xepersian/beamerthemexepersian-JLTree.sty
new file mode 100644
index 00000000000..a479d0537e8
--- /dev/null
+++ b/Master/texmf-dist/tex/xelatex/xepersian/beamerthemexepersian-JLTree.sty
@@ -0,0 +1,123 @@
+%% This is beamerthemexepersian-JLTree.sty (Modified version of beamerthemeJLTree.sty)
+%%
+%% Copyright 2009 by Vafa Khalighi
+%%
+%%%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%%
+%%%% this is versin 1.1 2006/11/18
+%%%%
+%% Copyright Jerome LELONG <jerome.lelong@gmail.com> 2006
+%% This program can be redistributed and/or modified under the terms
+%% of the GNU Public License, version 2 or later.
+\ProvidesPackage{beamerthemexepersian-JLTree}
+
+\newif\ifbeamer@tree@showhooks
+\beamer@tree@showhookstrue
+
+\DeclareOptionBeamer{hooks}[true]{\csname beamer@tree@showhooks#1\endcsname}
+
+\ProcessOptionsBeamer
+\mode
+<presentation>
+
+\setbeamertemplate{navigation symbols}{}
+\usecolortheme{rose}
+\useinnertheme[shadow=true]{rounded}% les block
+
+
+\defbeamertemplate*{footline}{xepersian-JLTree theme}
+{
+ \begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
+ \end{beamercolorbox}
+ \hbox{%
+ \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.25ex,dp=1ex,left]{date in head/foot}%
+ \usebeamerfont{date in head/foot}
+ \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
+ \end{beamercolorbox}%
+ \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.25ex,dp=1ex,right]{title in head/foot}%
+ \usebeamerfont{title in head/foot}\RL{\hspace*{2ex}\insertauthor \hspace*{1ex} (\insertshortinstitute) \hspace*{2ex} \insertdate}
+ \end{beamercolorbox}}%
+}
+
+
+\defbeamertemplate*{sidebar right}{xepersian-JLTree theme}{}
+
+\usesectionheadtemplate
+{\hfil\insertsectionhead}
+{\hfill\color{fg!50!bg}\insertsectionhead}
+
+
+\usesubsectionheadtemplate
+{\hfil\insertsubsectionhead}
+{\hfill\color{fg!50!bg}\insertsubsectionhead}
+
+
+
+\defbeamertemplate*{headline}{xepersian-JLTree theme}
+{%
+ \leavevmode%
+ \begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{upper separation line head}
+ \end{beamercolorbox}
+ \@tempdimb=3.625ex% 2.4375ex%
+ \multiply\@tempdimb by\beamer@sectionmax%
+%% \advance\@tempdimb by 1.125ex%
+ \advance\@tempdimb by -1.125ex%
+ \ifdim\@tempdimb<10.9ex% 3*(2.5+1.125)
+ \@tempdimb=10.9ex%
+ \fi
+ \begin{beamercolorbox}[wd=.45\paperwidth, ht=\@tempdimb]{left block}%
+ \usebeamerfont{section in head/foot}%
+ \vbox to\@tempdimb{\vfill\insertsectionnavigation{.45\paperwidth}\vfill}%
+ \end{beamercolorbox}%
+ \begin{beamercolorbox}[wd=1.125ex,ht=\@tempdimb,dp=1.125ex]{middle separation line head}%
+ \end{beamercolorbox}%
+ \begin{beamercolorbox}[wd=.44\paperwidth]{middle block}%
+ \vbox to\@tempdimb{\vfill%
+ \begin{beamercolorbox}[wd=.44\paperwidth,ht=2.5ex,dp=1.125ex,%
+ leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
+ \usebeamerfont{title in head/foot}\insertshorttitle
+ \end{beamercolorbox}
+ \begin{beamercolorbox}[wd=.44\paperwidth,ht=2.5ex,dp=1.125ex,%
+ leftskip=.3cm,rightskip=.3cm plus1fil]{section in head/foot}
+ \usebeamerfont{section in head/foot}%
+ \ifbeamer@tree@showhooks
+ \setbox\beamer@tempbox=\hbox{\insertsectionhead}%
+ \ifdim\wd\beamer@tempbox>1pt%
+ \hskip2pt\raise1.9pt\hbox{\vrule width0.4pt height1.875ex\vrule width 5pt height0.4pt}%
+ \hskip1pt%
+ \fi%
+ \else%
+ \hskip6pt%
+ \fi%
+ \insertsectionhead
+ \end{beamercolorbox}
+ \begin{beamercolorbox}[wd=.44\paperwidth,ht=2.5ex,dp=1.125ex,%
+ leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
+ \usebeamerfont{subsection in head/foot}%
+ \ifbeamer@tree@showhooks
+ \setbox\beamer@tempbox=\hbox{\insertsubsectionhead}%
+ \ifdim\wd\beamer@tempbox>1pt%
+ \hskip9.4pt\raise1.9pt\hbox{\vrule width0.4pt height1.875ex\vrule width 5pt height0.4pt}%
+ \hskip1pt%
+ \fi%
+ \else%
+ \hskip12pt%
+ \fi%
+ \insertsubsectionhead
+ \end{beamercolorbox}%
+ \vfill}%
+ \end{beamercolorbox}%
+ \begin{beamercolorbox}[wd=.1\paperwidth,ht=\@tempdimb,right]{right block}%
+ \vbox to\@tempdimb{\vfill\insertlogo\vfill}
+ \end{beamercolorbox}
+ \vfill
+ \begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{lower separation line head}
+ \end{beamercolorbox}
+}
+\setbeamercolor{separation line}{use=structure,bg=structure.fg!50!bg}
+
+
+\mode
+<all>
diff --git a/Master/texmf-dist/tex/xelatex/xepersian/xepersian-magazine.cls b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-magazine.cls
new file mode 100644
index 00000000000..21816c47aa7
--- /dev/null
+++ b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-magazine.cls
@@ -0,0 +1,879 @@
+%% This file is xepersian-magazine.cls
+%%
+%% Copyright 2009 by Vafa Khalighi
+%%
+%%%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesClass{xepersian-magazine}[2009/01/05 v0.1 Typesetting Persian magazines in XeLaTeX (Author: Vafa Khalighi)]
+\RequirePackage{ifthen}
+\newlength{\xepersian@imgsize}
+\newlength{\xepersian@coltitsize}
+\newlength{\xepersian@pageneed}
+\newlength{\xepersian@pageleft}
+\newlength{\xepersian@indexwidth}
+\newcommand{\xepersian@ncolumns}{0}
+\newlength{\columnlines}
+\setlength{\columnlines}{0 pt} % no lines by default
+\newboolean{xepersian@hyphenatedtitles}
+\setboolean{xepersian@hyphenatedtitles}{true}
+\newboolean{xepersian@ninepoints}
+\setboolean{xepersian@ninepoints}{false}
+\newboolean{xepersian@showgrid}
+\setboolean{xepersian@showgrid}{false}
+\newboolean{xepersian@a3paper}
+\setboolean{xepersian@a3paper}{false}
+\newboolean{xepersian@insidefrontpage}
+\setboolean{xepersian@insidefrontpage}{false}
+\newboolean{xepersian@insideweather}
+\setboolean{xepersian@insideweather}{false}
+\newboolean{xepersian@insideindex}
+\setboolean{xepersian@insideindex}{false}
+\newcount\xepersian@gridrows
+\newcount\xepersian@gridcolumns
+\xepersian@gridrows=40
+\xepersian@gridcolumns=50
+\newcount\minraggedcols
+\minraggedcols=5
+\DeclareOption{10pt}{\PassOptionsToClass{10pt}{article}}
+\DeclareOption{11pt}{\PassOptionsToClass{11pt}{article}}
+\DeclareOption{12pt}{\PassOptionsToClass{12pt}{article}}
+\DeclareOption{twocolumn}%
+{\ClassWarning{xepersian-magazine}{Option 'twocolumn' not available for xepersian-magazine.}}
+\DeclareOption{notitlepage}%
+{\ClassWarning{xepersian-magazine}{Option 'notitlepage' not available for xepersian-magazine.}}
+\DeclareOption{twoside}%
+{\ClassWarning{xepersian-magazine}{Option 'twoside' not available for xepersian-magazine.}}
+\DeclareOption{9pt}{\setboolean{xepersian@ninepoints}{true}}
+\DeclareOption{hyphenatedtitles}{\setboolean{xepersian@hyphenatedtitles}{false}}
+\DeclareOption{columnlines}{\setlength{\columnlines}{0.1 pt}}
+\DeclareOption{showgrid}{\setboolean{xepersian@showgrid}{true}}
+\DeclareOption{a3paper}{\setboolean{xepersian@a3paper}{true}}
+\ProcessOptions\relax
+\LoadClass[10pt, onecolumn, titlepage, a4paper]{article}
+\RequirePackage{ifxetex}
+\RequirePackage{multido}
+\RequirePackage{datetime}
+\RequirePackage{fmultico}
+\RequirePackage{fancyhdr}
+\RequirePackage{fancybox}
+\ifthenelse{\boolean{xepersian@a3paper}}{%
+\RequirePackage[a3paper,headsep=0.5cm,vmargin={2cm,2cm},hmargin={1.5cm,1.5cm}]{geometry}
+}{
+\RequirePackage[headsep=0.5cm,vmargin={2cm,2cm},hmargin={1.5cm,1.5cm}]{geometry}
+}
+\RequirePackage[absolute]{textpos} % absoulte positioning
+\RequirePackage{hyphenat} % when hyphenate
+\RequirePackage{lastpage} % to know the last page number
+\RequirePackage{setspace} % set space between lines
+\RequirePackage{ragged2e}
+\newcommand{\raggedFormat}{\RaggedLeft}
+\AtEndOfClass{\xepersianInit}
+\ifthenelse{\boolean{xepersian@showgrid}}{%
+\AtBeginDocument{
+\grid[show]{\xepersian@gridrows}{\xepersian@gridcolumns}}
+\advance\minraggedcols by -1
+}{%
+\AtBeginDocument{
+\grid[]{\xepersian@gridrows}{\xepersian@gridcolumns}}
+\advance\minraggedcols by -1
+}
+\ifthenelse{\boolean{xepersian@ninepoints}}{
+\renewcommand{\normalsize}{%
+ \@setfontsize{\normalsize}{9pt}{10pt}%
+ \setlength{\abovedisplayskip}{5pt plus 1pt minus .5pt}%
+ \setlength{\belowdisplayskip}{\abovedisplayskip}%
+ \setlength{\abovedisplayshortskip}{3pt plus 1pt minus 2pt}%
+ \setlength{\belowdisplayshortskip}{\abovedisplayshortskip}}
+
+\renewcommand{\tiny}{\@setfontsize{\tiny}{5pt}{6pt}}
+
+\renewcommand{\scriptsize}{\@setfontsize{\scriptsize}{7pt}{8pt}}
+
+\renewcommand{\small}{%
+ \@setfontsize{\small}{8pt}{9pt}%
+ \setlength{\abovedisplayskip}{4pt plus 1pt minus 1pt}%
+ \setlength{\belowdisplayskip}{\abovedisplayskip}%
+ \setlength{\abovedisplayshortskip}{2pt plus 1pt}%
+ \setlength{\belowdisplayshortskip}{\abovedisplayshortskip}}
+
+\renewcommand{\footnotesize}{%
+ \@setfontsize{\footnotesize}{8pt}{9pt}%
+ \setlength{\abovedisplayskip}{4pt plus 1pt minus .5pt}%
+ \setlength{\belowdisplayskip}{\abovedisplayskip}%
+ \setlength{\abovedisplayshortskip}{2pt plus 1pt}%
+ \setlength{\belowdisplayshortskip}{\abovedisplayshortskip}}
+
+\renewcommand{\large}{\@setfontsize{\large}{11pt}{13pt}}
+\renewcommand{\Large}{\@setfontsize{\Large}{14pt}{18pt}}
+\renewcommand{\LARGE}{\@setfontsize{\LARGE}{18pt}{20pt}}
+\renewcommand{\huge}{\@setfontsize{\huge}{20pt}{25pt}}
+\renewcommand{\Huge}{\@setfontsize{\Huge}{25pt}{30pt}}
+}{}
+\def\customwwwTxt#1{\gdef\@customwwwTxt{\lr{#1}}}
+\newcommand{\xepersian@wwwFormat}{\sffamily}
+\newcommand{\xepersian@www}{%
+\raisebox{-3pt}{{\xepersian@wwwFormat\@customwwwTxt}}
+}
+\newcommand{\xepersian@edition}{ویرایش من}
+\newcommand{\editionFormat}{\large\bfseries\texttt}
+\newcommand{\xepersian@editionLogo}{%
+\raisebox{-3pt}{%
+{\editionFormat\xepersian@edition}%
+}%
+}
+\newcommand{\indexFormat}{\large\bfseries}
+\newcommand{\xepersian@indexFrameTitle}[1]
+{\begin{flushright}{{\indexFormat #1}}\end{flushright}}
+
+\newcommand{\indexEntryFormat}{\normalsize}
+\newcommand{\xepersian@indexEntry}[1]{\begin{minipage}{13\TPHorizModule}%
+{\indexEntryFormat\noindent\ignorespaces{#1}}%
+\end{minipage}}
+\newcommand{\indexEntrySeparator}{\rule{\xepersian@indexwidth}{.1pt}}
+\newcommand{\indexEntryPageTxt}{صفحهٔ}
+\newcommand{\indexEntryPageFormat}{\footnotesize}
+\newcommand{\xepersian@indexEntryPage}[1]{%
+{\indexEntryPageFormat{\indexEntryPageTxt{}~#1}}%
+}
+\newcommand{\headDateTimeFormat}{}
+\newcommand{\xepersian@headDateTime}{%
+\headDateTimeFormat\date\hspace{5pt}$\parallel$\hspace{5pt}%
+\currenttime %
+}
+\newcommand{\weatherFormat}{\bfseries}
+\newcommand{\xepersian@weather}[1]{%
+\noindent{\weatherFormat #1}%
+}
+\newcommand{\weatherTempFormat}{\small}
+\newcommand{\weatherUnits}{\textdegree{}C}
+\newcommand{\xepersian@section}[0]{صفحهٔ جلو}
+\newcommand{\xepersian@headleft}{%
+{\small\bfseries \@custommagazinename}، \date
+}
+\newcommand{\xepersian@headcenter}{%
+\xepersian@section{}
+}
+\newcommand{\xepersian@headright}{%
+\small\xepersian@edition%
+\hspace*{5pt}\LR{\thepage\ / \pageref{LastPage}}
+}
+
+\newcommand{\heading}[3]{%
+\renewcommand{\xepersian@headleft}{\RL{#1}}%
+\renewcommand{\xepersian@headcenter}{\RL{#2}}%
+\renewcommand{\xepersian@headright}{\RL{#3}}%
+}
+\newcommand{\xepersian@footright}{%
+{\footnotesize\lr{\copyright\ \@customwwwTxt{}}---تهیه‌شده توسط \lr{\XePersian}}%
+}
+\newcommand{\xepersian@footcenter}{%
+}
+\newcommand{\xepersian@footleft}{%
+}
+
+\newcommand{\foot}[3]{%
+\renewcommand{\xepersian@footleft}{\RL{#1}}%
+\renewcommand{\xepersian@footcenter}{\RL{#2}}%
+\renewcommand{\xepersian@footright}{\RL{#3}}%
+}
+\newcommand{\firstTitleFormat}{\Huge\bfseries\flushright}
+\newcommand{\xepersian@firstTitle}[1]{%
+{%
+\begin{spacing}{2.0}{%
+\noindent\ignorespaces
+\ifthenelse{\boolean{xepersian@hyphenatedtitles}}%
+{\nohyphens{\firstTitleFormat #1}}%
+{{\firstTitleFormat #1}}%
+}%
+\end{spacing}%
+}%
+}
+\newcommand{\firstTextFormat}{}
+\newcommand{\xepersian@firstText}[1]{%
+{\noindent\ignorespaces\firstTextFormat #1}%
+}
+\newcommand{\secondTitleFormat}{\LARGE\bfseries}
+\newcommand{\xepersian@secondTitle}[1]{%
+\begin{spacing}{1.5}{%
+\noindent\ignorespaces\flushright
+\ifthenelse{\boolean{xepersian@hyphenatedtitles}}%
+{\nohyphens{\secondTitleFormat #1}}%
+{{\secondTitleFormat #1}}%
+}\end{spacing}%
+}
+\newcommand{\secondSubtitleFormat}{\large}
+\newcommand{\xepersian@secondSubtitle}[1]{%
+{\noindent\ignorespaces{\secondSubtitleFormat #1}}%
+}
+\newcommand{\secondTextFormat}{}
+\newcommand{\xepersian@secondText}[1]{%
+\begin{multicols}{2}
+{\noindent\ignorespaces\secondTextFormat #1}
+\end{multicols}
+}
+\newcommand{\thirdTitleFormat}{\Large\bfseries}
+\newcommand{\xepersian@thirdTitle}[1]{%
+\begin{spacing}{1.5}{%
+\noindent\ignorespaces\flushright
+\ifthenelse{\boolean{xepersian@hyphenatedtitles}}%
+{\nohyphens{\thirdTitleFormat #1}}%
+{{\thirdTitleFormat #1}}%
+}\end{spacing}%
+}
+\newcommand{\thirdSubtitleFormat}{\large}
+\newcommand{\xepersian@thirdSubtitle}[1]%
+{{\noindent\ignorespaces\thirdSubtitleFormat #1}}
+\newcommand{\thirdTextFormat}{}
+\newcommand{\xepersian@thirdText}[1]{{\thirdTextFormat #1}}
+\newcommand{\pictureCaptionFormat}{\small\bfseries}
+\newcommand{\xepersian@pictureCaption}[1]{%
+{\noindent\pictureCaptionFormat #1}%
+}
+\newcommand{\pagesFormat}{\bfseries\footnotesize}
+\newcommand{\xepersian@pages}[1]%
+{\noindent{\pagesFormat\MakeUppercase{#1}}}
+\newcommand{\innerTitleFormat}{\Huge}
+\newcommand{\xepersian@innerTitle}[1]{%
+\begin{flushright}{%
+\noindent
+\ifthenelse{\boolean{xepersian@hyphenatedtitles}}%
+{\nohyphens{\innerTitleFormat #1}}%
+{{\innerTitleFormat #1}}%
+}%
+\\%
+\end{flushright}%
+}
+\newcommand{\innerSubtitleFormat}{\large}
+\newcommand{\xepersian@innerSubtitle}[1]{{\innerSubtitleFormat #1}}
+\newcommand{\timestampTxt}{}
+\newcommand{\timestampSeparator}{|}
+\newcommand{\timestampFormat}{\small}
+\newcommand{\timestamp}[1]{%
+{\timestampFormat%
+#1~\timestampTxt{}%
+}~\timestampSeparator{}%
+}
+\newcommand{\innerAuthorFormat}{\footnotesize}
+\newcommand{\innerPlaceFormat}{\footnotesize\bfseries}
+\newcommand{\innerTextFinalMark}{\rule{0.65em}{0.65em}}
+\newcommand{\editorialTitleFormat}{\LARGE\textit}
+\newcommand{\xepersian@editorialTitle}[1]{\editorialTitleFormat{#1}}
+\newcommand{\editorialAuthorFormat}{\textsc}
+\newcommand{\shortarticleTitleFormat}{\LARGE\bfseries}
+\newcommand{\xepersian@shortarticleTitle}[1]{{\shortarticleTitleFormat #1}}
+\newcommand{\shortarticleSubtitleFormat}{\Large}
+\newcommand{\xepersian@shortarticleSubtitle}[1]{{\shortarticleSubtitleFormat #1}}
+\newcommand{\shortarticleItemTitleFormat}{\large\bfseries}
+\newcommand{\xepersian@shortarticleItemTitle}[1]{{\shortarticleItemTitleFormat #1}}
+\renewcommand{\maketitle}{\begin{titlepage}%
+ \let\footnotesize\small
+ \let\footnoterule\relax
+ \let \footnote \thanks
+ \null\vfil
+ \vskip 60\p@
+ \begin{center}%
+ {\LARGE \@title \par}%
+ \vskip 1em%
+ {\LARGE «\xepersian@edition» \par}%
+ \vskip 3em%
+ {\large
+ \lineskip .75em%
+ \begin{tabular}[t]{c}%
+ \@author
+ \end{tabular}\par}%
+ \vskip 1.5em%
+ {\large \@date \par}%
+ \end{center}\par
+ \@thanks
+ \vfil\null
+ \end{titlepage}%
+ \setcounter{footnote}{0}%
+ \global\let\thanks\relax
+ \global\let\maketitle\relax
+ \global\let\@thanks\@empty
+ \global\let\@author\@empty
+ \global\let\@date\@empty
+ \global\let\@title\@empty
+ \global\let\title\relax
+ \global\let\author\relax
+ \global\let\date\relax
+ \global\let\and\relax
+}
+\newcommand{\xepersian@say}[1]{\typeout{#1}}
+\newsavebox{\xepersian@fmbox}
+\newenvironment{xepersian@fmpage}[1]
+ {\begin{lrbox}{\xepersian@fmbox}\begin{minipage}{#1}}
+ {\end{minipage}\end{lrbox}\fbox{\usebox{\xepersian@fmbox}}}
+\newcommand{\image}[2]{
+\vspace{5pt}
+\setlength{\fboxsep}{1pt}
+\addtolength{\xepersian@imgsize}{\columnwidth}
+\addtolength{\xepersian@imgsize}{-1\columnsep}
+\ifxetex
+\setlength{\xepersian@pageneed}{1.5\xepersian@imgsize}
+\addtolength{\xepersian@pageneed}{50pt}
+\ClassWarning{xepersian-magazine}{%
+Image #1 needs: \the\xepersian@pageneed \space %
+and there is left: \the\page@free\space%
+}
+\ifdim \xepersian@pageneed < \page@free
+
+{\centering\fbox{%
+\includegraphics[width = \xepersian@imgsize,
+height = \xepersian@imgsize,
+keepaspectratio ]{#1}}}
+\xepersian@pictureCaption{#2}
+
+\vspace{5pt}
+\else
+\ClassWarning{Image #1 needs more space!%
+ It was not inserted!}
+\fi
+\fi
+}
+\textblockorigin{1cm}{1cm}
+\newdimen\xepersian@dx
+\newdimen\xepersian@dy
+\newcount\xepersian@cx
+\newcount\xepersian@cy
+\newcommand{\grid}[3][]{
+\xepersian@dx=\textwidth%
+\xepersian@dy=\textheight%
+\xepersian@cx=#3% %columns
+\xepersian@cy=#2% %rows
+
+\count1=#3%
+\advance\count1 by 1
+
+\count2=#2%
+\advance\count2 by 1
+
+\divide\xepersian@dx by #3
+\divide\xepersian@dy by #2
+
+\setlength{\TPHorizModule}{\xepersian@dx}
+\setlength{\TPVertModule}{\xepersian@dy}
+
+\ifthenelse{\equal{#1}{show}}{
+\multido{\xepersian@nrow=0+1}{\count2}{
+\begin{textblock}{\xepersian@cx}(0,\xepersian@nrow)
+\rule[0pt]{\textwidth}{.1pt}
+\end{textblock}
+}
+
+\multido{\xepersian@ncol=0+1}{\count1}{
+\begin{textblock}{\xepersian@cy}(\xepersian@ncol,0)
+\rule[0pt]{.1pt}{\textheight}
+\end{textblock}
+}
+}{}
+}
+\newcommand{\xepersianInit}{
+\setlength{\headheight}{14pt}
+\renewcommand{\headrulewidth}{0.4pt}
+
+\pagestyle{fancy}
+
+\setlength{\columnseprule}{\columnlines}
+\setlength{\fboxrule}{0.1 pt}
+
+}
+
+\def\customlogo#1{\gdef\@customlogo{\RL{#1}}}
+\def\customminilogo#1{\gdef\@customminilogo{\RL{#1}}}
+\def\custommagazinename#1{\gdef\@custommagazinename{\RL{#1}}}
+\newcommand{\logo}[0]{
+%% Heading %%
+\noindent\hrulefill\hspace{10pt}\xepersian@editionLogo\hspace{5pt}\xepersian@www
+
+\vspace*{-3pt}
+
+{\Large\bfseries \@customlogo}
+\hrulefill
+\hspace{10pt}\xepersian@headDateTime
+
+}
+\newcommand{\minilogo}[0]{
+{\large\bfseries \@customminilogo}
+
+\vspace*{5pt}
+}
+\newcommand{\mylogo}[1]{
+{\RL{#1}}
+
+\noindent
+\xepersian@editionLogo\hspace{5pt}
+\hrulefill
+\hspace{5pt}\xepersian@headDateTime
+}
+\newcommand{\edition}[1]{\renewcommand{\xepersian@edition}{#1}}
+\newenvironment{frontpage}[0]
+{
+\setboolean{xepersian@insidefrontpage}{true}
+\thispagestyle{empty}
+%\pdfbookmark[1]{صفحهٔ اول}{\thepage}
+\logo
+
+}%
+{
+\thispagestyle{empty}
+\clearpage
+\newpage
+\fancyhead{}
+ \fancyfoot{}
+\fancyhead[RO,LE]{\RL{\xepersian@headright}}
+\fancyhead[LO,RE]{\RL{\xepersian@headleft}}
+ \fancyhead[C]{\RL{\xepersian@headcenter}}
+ \fancyfoot[RO,LE]{\RL{\xepersian@footright}}
+ \fancyfoot[LO,RE]{\RL{\xepersian@footleft}}
+\fancyfoot[C]{\RL{\xepersian@footcenter}}
+\renewcommand{\headrulewidth}{0.4pt}
+\setboolean{xepersian@insidefrontpage}{false}
+
+}
+\newcommand{\firstarticle}[3]
+{
+\ifthenelse{\boolean{xepersian@insidefrontpage}}{%
+\ifthenelse{\boolean{xepersian@hyphenatedtitles}}{%
+\begin{textblock}{24}(22,5)
+}
+{
+\begin{textblock}{28}(22,5)
+}
+\vspace{-7pt}
+\xepersian@firstTitle{#1}
+\end{textblock}
+\begin{textblock}{29}(22,10)
+\vspace{5pt plus 2pt minus 2pt}
+
+\xepersian@firstText{\timestamp{#3}~#2}
+
+\end{textblock}
+
+\begin{textblock}{50}(0,15)
+\rule{50\TPHorizModule}{.3pt}
+\end{textblock}
+}{%else
+\ClassError{xepersian-magazine}{%
+\protect\firstarticle\space in a wrong place.\MessageBreak
+\protect\firstarticle\space may only appear inside frontpage environment.
+}{%
+\protect\firstarticle\space may only appear inside frontpage environment.
+}%
+}
+}
+\newcommand{\secondarticle}[5]
+{
+\ifthenelse{\boolean{xepersian@insidefrontpage}}{%
+\begin{textblock}{33}(2,16)
+\xepersian@pages{#4}
+\vspace{-5pt}
+\xepersian@secondTitle{#1}
+
+\vspace*{5pt}
+
+\xepersian@secondSubtitle{#2}
+
+\vspace*{-7pt}
+
+\xepersian@secondText{\timestamp{#5}~#3}
+
+\end{textblock}
+
+\begin{textblock}{33}(2,25)
+\vspace{5pt plus 2pt minus 2pt}
+
+\noindent\ignorespaces\rule{33\TPHorizModule}{.3pt}
+\end{textblock}
+}{%else
+\ClassError{xepersian-magazine}{%
+\protect\secondarticle\space in a wrong place.\MessageBreak
+\protect\secondarticle\space may only appear inside frontpage environment.
+}{%
+\protect\secondarticle\space may only appear inside frontpage environment.
+}%
+}
+}
+\newcommand{\thirdarticle}[6]
+{
+\ifthenelse{\boolean{xepersian@insidefrontpage}}{%
+\begin{textblock}{32}(2,26)
+\xepersian@pages{#5}
+\vspace{-5pt}
+\setlength{\fboxsep}{1pt}
+\xepersian@thirdTitle{#1}
+
+\vspace*{5pt}
+
+\xepersian@thirdSubtitle{#2}
+
+\vspace*{5pt}
+
+{\noindent\ignorespaces %
+\ifthenelse{\equal{#4}{}}{}
+
+\xepersian@thirdText{\timestamp{#6}~#3}
+
+}
+
+\vspace*{5pt}
+
+\end{textblock}
+}{%else
+\ClassError{xepersian-magazine}{%
+\protect\thirdarticle\space in a wrong place.\MessageBreak
+\protect\thirdarticle\space may only appear inside frontpage environment.
+}{%
+\protect\thirdarticle\space may only appear inside frontpage environment.
+}%
+}
+}
+\newcommand{\firstimage}[2]
+{
+\ifthenelse{\boolean{xepersian@insidefrontpage}}{%
+\begin{textblock}{18}(2,5)
+\setlength{\fboxsep}{1pt}
+\ifxetex % only in PDF
+\noindent\fbox{\includegraphics[width = 18\TPHorizModule ]{#1}}
+\fi
+
+\xepersian@pictureCaption{#2}
+\end{textblock}%
+}
+{\ClassError{xepersian-magazine}{%
+\protect\firstimage\space in a wrong place.\MessageBreak
+\protect\firstimage\space may only appear inside frontpage environment.
+}{%
+\protect\firstimage\space may only appear inside frontpage environment.
+}}
+}%
+\newcommand{\weatheritem}[5]{%
+\ifthenelse{\boolean{xepersian@insideweather}}{
+\begin{minipage}{45pt}
+\ifxetex
+\includegraphics[width=40pt]{#1}
+\fi
+\end{minipage}
+\begin{minipage}{50pt}
+\weatherTempFormat
+#2\\
+\LR{#3 $\|$ #4 \lr{\weatherUnits{}}}\\
+#5
+\end{minipage}
+}{%else
+\ClassError{xepersian-magazine}{%
+\protect\weatheritem\space in a wrong place.\MessageBreak
+\protect\weatheritem\space may only appear inside weatherblock environment.
+}{%
+\protect\weatheritem\space may only appear inside weatherblock environment.\MessageBreak
+weatherblock environment may only appear inside frontpage environment.
+}%
+}
+}
+\newenvironment{weatherblock}[1]
+{
+\ifthenelse{\boolean{xepersian@insidefrontpage}}{%
+\setboolean{xepersian@insideweather}{true}
+\begin{textblock}{32}(2,38)
+\vspace*{-15pt}
+
+\xepersian@weather{\RL{#1}}
+
+\vspace*{5pt}
+
+\noindent\begin{xepersian@fmpage}{32\TPHorizModule}
+\begin{minipage}{32\TPHorizModule}
+\hspace{5pt}
+
+}{%
+\ClassError{xepersian-magazine}{%
+weatherblock in a wrong place.\MessageBreak
+weatherblock may only appear inside frontpage environment.
+}{%
+weatherblock may only appear inside frontpage environment.
+}
+}
+}%
+{
+\end{minipage}
+\end{xepersian@fmpage}
+\end{textblock}
+\setboolean{xepersian@insideweather}{false}
+}
+\newenvironment{authorblock}[0]
+{
+\ifthenelse{\boolean{xepersian@insidefrontpage}}{%
+\begin{textblock}{15}(36,35)
+\setlength{\fboxsep}{5pt}
+\begin{xepersian@fmpage}{13\TPHorizModule}
+\begin{minipage}{13\TPHorizModule}
+\centering
+\minilogo
+
+}{%else
+\ClassError{xepersian-magazine}{%
+authorblock in a wrong place.\MessageBreak
+authorblock may only appear inside frontpage environment.
+}{%
+authorblock may only appear inside frontpage environment.
+}
+}
+}
+{
+\end{minipage}
+\end{xepersian@fmpage}
+\end{textblock}
+}
+\newenvironment{indexblock}[1]
+{
+\ifthenelse{\boolean{xepersian@insidefrontpage}}{%
+\setboolean{xepersian@insideindex}{true}%let's in
+\begin{textblock}{15}(36,16)
+\setlength{\xepersian@indexwidth}{13\TPHorizModule}
+\xepersian@indexFrameTitle{#1}
+
+\setlength{\fboxsep}{5pt} %espacio entre el frame y la imagen
+\begin{xepersian@fmpage}{\xepersian@indexwidth}
+\begin{minipage}{\xepersian@indexwidth}
+\vspace*{10pt}
+}{%else
+\ClassError{xepersian-magazine}{%
+indexblock in a wrong place.\MessageBreak
+indexblock may only appear inside frontpage environment.
+}{%
+indexblock may only appear inside frontpage environment.
+}
+}
+}%
+{
+\end{minipage}
+\end{xepersian@fmpage}
+\end{textblock}
+\setboolean{xepersian@insideindex}{false}%let's out
+}
+\newcommand{\indexitem}[2]
+{
+\ifthenelse{\boolean{xepersian@insideindex}}{
+\xepersian@indexEntry{#1، \xepersian@indexEntryPage{\pageref{#2}}}
+
+\vspace{0.5cm}
+
+\noindent\ignorespaces\indexEntrySeparator{}
+}{%else
+\ClassError{xepersian-magazine}{%
+\protect\indexitem\space in a wrong place.\MessageBreak
+\protect\indexitem\space may only appear inside indexblock environment.
+}{%
+\protect\indexitem\space may only appear inside indexblock environment.\MessageBreak
+indexblock environment may only appear inside frontpage environment.
+}%
+}
+}
+\newcommand{\xepersian@inexpandedtitle}[1]{
+\begin{minipage}{.95\textwidth}
+\begin{center}
+\noindent\Large\textbf{\RL{#1}}
+\end{center}
+\end{minipage}
+}
+\newcommand{\expandedtitle}[2]{
+\end{multicols}
+
+\begin{center}
+\setlength{\fboxsep}{5pt}
+\setlength{\shadowsize}{2pt}
+\ifthenelse{\equal{#1}{shadowbox}}{%
+\shadowbox{%
+\xepersian@inexpandedtitle{#2}%
+}%
+}{}
+\ifthenelse{\equal{#1}{doublebox}}{%
+\doublebox{%
+\xepersian@inexpandedtitle{#2}%
+}%
+}{}
+\ifthenelse{\equal{#1}{ovalbox}}{%
+\ovalbox{%
+\xepersian@inexpandedtitle{#2}%
+}%
+}{}
+\ifthenelse{\equal{#1}{Ovalbox}}{%
+\Ovalbox{%
+\xepersian@inexpandedtitle{#2}%
+}%
+}{}
+\ifthenelse{\equal{#1}{lines}}{
+\hrule
+\vspace*{8pt}
+\begin{center}
+\noindent\Large\textbf{#2}
+\end{center}
+\vspace*{8pt}
+\hrule
+}{}
+\end{center}
+
+\begin{multicols}{\xepersian@ncolumns{}}
+\ifnum \xepersian@ncolumns > \minraggedcols
+\raggedFormat
+\fi
+}
+\newcommand{\xepersian@incolumntitle}[2]{
+\begin{minipage}{#1}
+\begin{center}
+\noindent\normalsize\textbf{#2}
+\end{center}
+\end{minipage}
+}
+
+\newcommand{\columntitle}[2]{
+\vspace*{5pt}
+\begin{center}
+\setlength{\fboxsep}{5pt}
+\setlength{\shadowsize}{2pt}
+\addtolength{\xepersian@coltitsize}{\columnwidth}
+\addtolength{\xepersian@coltitsize}{-1\columnsep}
+\addtolength{\xepersian@coltitsize}{-5pt}
+\addtolength{\xepersian@coltitsize}{-1\shadowsize}
+\ifthenelse{\equal{#1}{shadowbox}}{%
+\shadowbox{%
+\xepersian@incolumntitle{\xepersian@coltitsize}{#2}%
+}%
+}{}
+\ifthenelse{\equal{#1}{doublebox}}{%
+\doublebox{%
+\xepersian@incolumntitle{\xepersian@coltitsize}{#2}%
+}%
+}{}
+\ifthenelse{\equal{#1}{ovalbox}}{%
+\ovalbox{%
+\xepersian@incolumntitle{\xepersian@coltitsize}{#2}%
+}%
+}{}
+\ifthenelse{\equal{#1}{Ovalbox}}{%
+\Ovalbox{%
+\xepersian@incolumntitle{\xepersian@coltitsize}{#2}%
+}%
+}{}
+\ifthenelse{\equal{#1}{lines}}{
+\hrule
+\vspace*{5pt}
+\begin{center}
+\noindent\normalsize\textbf{#2}
+\end{center}
+\vspace*{5pt}
+\hrule
+}{}
+\end{center}
+}
+\renewcommand{\date}{%
+\longdate{\today}%
+}
+\newcommand{\authorandplace}[2]{%
+\rightline{%
+{\innerAuthorFormat #1},\space{}{\innerPlaceFormat #2}%
+}%
+\par %
+}
+\newcommand{\newsection}[1]{
+%\pdfbookmark[0]{#1}{\thepage} %bookmark para el pdf
+\renewcommand{\xepersian@section}{#1}
+}
+\newenvironment{article}[5]
+{
+\xepersian@say{Adding a new piece of article}
+\renewcommand{\xepersian@ncolumns}{#1}
+\begin{multicols}{#1}[
+\xepersian@pages{#4}
+\xepersian@innerTitle{#2}%
+\xepersian@innerSubtitle{#3}%
+][4cm]%
+\label{#5}
+\ifnum #1 > \minraggedcols
+\raggedFormat
+\fi
+}
+{~\innerTextFinalMark{}
+\end{multicols}
+}
+\newcommand{\articlesep}{%
+\setlength{\xepersian@pageneed}{16000pt}
+\setlength\xepersian@pageleft{\pagegoal}
+\addtolength\xepersian@pageleft{-\pagetotal}
+
+\xepersian@say{How much left \the\xepersian@pageleft}
+
+\ifdim \xepersian@pageneed < \xepersian@pageleft
+\xepersian@say{Not enough space}
+\else
+\xepersian@say{Adding sep line between articles}
+\vspace*{10pt plus 10pt minus 5pt}
+\hrule
+\vspace*{10pt plus 5pt minus 5pt}
+\fi
+
+}
+\newcommand{\xepersian@editorialTit}[2]{
+\setlength{\arrayrulewidth}{.1pt}
+\begin{center}
+\begin{tabular}{c}
+\noindent
+\xepersian@editorialTitle{#1}
+\vspace{2pt plus 1pt minus 1pt}
+\\
+\hline
+\vspace{2pt plus 1pt minus 1pt}
+\\
+\editorialAuthorFormat{#2}
+\end{tabular}
+\end{center}
+}
+\newenvironment{editorial}[4]
+{
+\xepersian@say{Adding a new editorial}
+\begin{multicols}{#1}[%
+\xepersian@editorialTit{#2}{#3}%
+][4cm]
+\label{#4}
+\ifnum #1 > \minraggedcols
+\raggedFormat
+\fi
+}
+{
+\end{multicols}
+}
+\newcommand{\xepersian@shortarticleTit}[2]{
+\begin{center}
+\vbox{%
+\noindent
+\xepersian@shortarticleTitle{#1}
+\vspace{4pt plus 2pt minus 2pt}
+\hrule
+\vspace{4pt plus 2pt minus 2pt}
+\xepersian@shortarticleSubtitle{#2}
+}
+\end{center}
+}
+\newenvironment{shortarticle}[4]
+{
+\xepersian@say{Adding a short article block}
+\begin{multicols}{#1}[\xepersian@shortarticleTit{#2}{#3}][4cm] %
+ \label{#4}
+\par %
+\ifnum #1 > \minraggedcols
+\raggedFormat
+\fi
+}
+{
+\end{multicols}
+}
+\newcommand{\shortarticleitem}[2]{
+\goodbreak
+\vspace{5pt plus 3pt minus 3pt}
+{\vbox{\noindent\xepersian@shortarticleItemTitle{#1}}}
+\vspace{5pt plus 3pt minus 3pt}
+{\noindent #2}\\
+}
+\endinput
diff --git a/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty
index 9317c8dccc5..b2f5b4ec1b2 100644
--- a/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty
+++ b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty
@@ -1,24 +1,15 @@
+%% This file is xepersian-mathsdigitspec.sty
+%%
+%% Copyright 2009 by Vafa Khalighi
+%%
+%%%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{xepersian-mathsdigitspec}
- [2008/09/27 v0.1 Unicode Farsi maths digits in XeLaTeX]
-
-\begingroup
- \def\notXeLaTeXformat{%
- \@latex@error{*** this package currently works only with XeLaTeX ***^^J
- You are not using XeLaTeX, so we are exiting cleanly!^^J
- Continuing may lead to 'unavailable font metrics' errors!^^J}\@ehc
- \endgroup\endinput}
-\expandafter\ifx\csname XeTeXpicfile\endcsname\relax\expandafter\notXeLaTeXformat\fi
-\endgroup
-
-\RequirePackage[quiet]{fontspec}
-\@ifpackageloaded{xepersian-mathsdigitspec}{\@zf@mathfalse}{}
-\newcounter{um@fam}
+ [2009/01/05 v0.2 Unicode Persian maths digits in XeLaTeX (Author: Vafa Khalighi)]
+\@zf@mathfalse
\newif\if@um@fontspec@feature
-\newif\if@um@ot@math@
-\newif\if@um@init
-\providecommand\def@cn[2]{%
- \expandafter\def\csname#1\endcsname{#2}}
\def\um@Loop#1\um@Pool{#1\um@Loop#1\um@Pool}
\def\um@Break#1\um@Pool{}
\long\def\um@FOR#1=[#2:#3]\do#4{%
@@ -29,124 +20,21 @@
\expandafter\um@Break
\fi
\um@Pool}
-\newcommand\um@PackageError[2]{\PackageError{xepersian-mathsdigitspec}{#1}{#2}}
-\newcommand\um@PackageWarning[1]{\PackageWarning{xepersian-mathsdigitspec}{#1}}
\newcommand\um@PackageInfo[1]{\PackageInfo{xepersian-mathsdigitspec}{#1}}
\def\um@usv@num{`\0}
-\def\um@usv@bbnum{"1D7D8}
-\def\um@usv@sfnum{"1D7E2}
-\def\um@usv@ttnum{"1D7F6}
-
-\def\um@usv@bfnum{"1D7CE}
-
-\def\um@usv@bfsfnum{"1D7EC}
-\define@choicekey*{xepersian-mathsdigitspec.sty}
- {math-style}[\@tempa\@tempb]{iso,tex,french,literal}{%
- \ifcase\@tempb\relax
- \or
- \@um@literaltrue
- \fi}
-\define@choicekey*{xepersian-mathsdigitspec.sty}{bold-style}[\@tempa\@tempb]{iso,tex,french,literal}{%
- \ifcase\@tempb\relax
- \or
- \@um@bfliteraltrue
- \fi}
-\ExecuteOptionsX{math-style=iso}
-\ProcessOptionsX
-\def\@preamblecmds{}
-
-\newcommand\not@onlypreamble[1]{{%
- \def\do##1{\ifx#1##1\else\noexpand\do\noexpand##1\fi}%
- \xdef\@preamblecmds{\@preamblecmds}}}
-\def\gm@notprerr{ can be used only in preamble (\on@line)}
-\AtBeginDocument{%
- \def\do#1{\noexpand\do\noexpand#1}%
- \edef\@preamblecmds{%
- \def\noexpand\do##1{%
- \def##1{\noexpand\PackageError{gmutils/LaTeX}%
- {\noexpand\string##1 \noexpand\gm@notprerr}\noexpand\@eha}}%
- \@preamblecmds}}
-\def\nocite#1{%
- \@bsphack{\setbox0=\hbox{\cite{#1}}}\@esphack}
-
-\def\um@fontdimen@percent#1#2{%
- 0.\strip@pt\dimexpr\fontdimen#1#2 *65536\relax}
-\def\um@scaled@apply#1#2#3{%
- \ifx#1\scriptstyle
- #2\um@fontdimen@percent{10}\um@font#3%
- \else
- \ifx#1\scriptscriptstyle
- #2\um@fontdimen@percent{11}\um@font#3%
- \else
- #2#3%
- \fi
- \fi}
-\def\new@mathgroup{\alloc@8\mathgroup\chardef\@cclvi}
-\let\newfam\new@mathgroup
-\def\um@mathsymbol#1#2#3#4{%
- \expandafter\um@set@mathsymbol\csname sym#3\endcsname#1#2{#4}}
-\def\um@set@mathsymbol#1#2#3#4{%
- \ifx\mathop#3\relax
- \begingroup
- \catcode#4=\active
- \global\mathcode#4="8000\relax
- \um@scanactivedef#4\@nil{\csname\string#2@op\endcsname}%
- \endgroup
- \expandafter\global\expandafter\XeTeXmathchardef
- \csname\string#2@sym\endcsname
- ="\mathchar@type#3 #1 #4\relax
- \expandafter\gdef\csname\string#2@op\endcsname{%
- \csname\string#2@sym\endcsname
- \expandafter\in@\expandafter#2\expandafter{\um@nolimits}%
- \ifin@
- \expandafter\nolimits
- \fi}%
- \else
- \expandafter\in@\expandafter#2\expandafter{\um@radicals,}%
- \ifin@
- \expandafter\gdef\csname
- \expandafter\@gobble\string#2sign\endcsname
- {\XeTeXradical#1 #4\relax}%
- \else
- \ifx\mathopen#3\relax
- \gdef#2{\XeTeXdelimiter "\mathchar@type#3 #1 #4}%
- \global\XeTeXdelcode#4=#1 #4\relax
- \global\XeTeXmathcode#4="\mathchar@type#3 #1 #4\relax
- \else
- \ifx\mathclose#3\relax
- \gdef#2{\XeTeXdelimiter "\mathchar@type#3 #1 #4}%
- \global\XeTeXdelcode#4=#1 #4\relax
- \global\XeTeXmathcode#4="\mathchar@type#3 #1 #4\relax
- \else
- \ifx\mathaccent#3\relax
- \xdef#2{\XeTeXmathaccent "\mathchar@type#3 #1 #4\relax}%
- \else
- \global\XeTeXmathcode#4="\mathchar@type#3 #1 #4\relax
- \fi
- \fi
- \fi
- \fi
- \fi}
\newcommand\SetMathCode[4]{%
\XeTeXmathcode#1="\mathchar@type#2 \csname sym#3\endcsname #4\relax}
\newcommand\SetMathCharDef[4]{%
\XeTeXmathchardef#1="\mathchar@type#2 \csname sym#3\endcsname #4\relax}
\newcommand\setdigitfont[2][]{%
- \let\glb@currsize\relax
- \let\um@char@range\@empty
- \let\um@char@num@range\@empty
- \@um@initfalse
- \@um@fontspec@featuretrue
\csname S@\f@size\endcsname
- \def\um@mversion{normal}%
- \DeclareMathVersion{\um@mversion}%
\def\um@ScriptFeatures{ScriptStyle}%
\def\um@ScriptScriptFeatures{ScriptScriptStyle}%
\def\um@ScriptFont{#2}%
\def\um@ScriptScriptFont{#2}%
\setkeys*[um]{options}{#1}%
\edef\@tempa{\noexpand\zf@fontspec{%
- Script=Math,SizeFeatures={%
+ Mapping=parsidigits,SizeFeatures={%
{Size=\tf@size-},%
{Size=\sf@size-\tf@size,%
Font=\um@ScriptFont,%
@@ -155,102 +43,14 @@
Font=\um@ScriptScriptFont,%
\um@ScriptScriptFeatures}},%
\XKV@rm}{#2}}\@tempa
- \font\um@font="#2"\relax
- \ifdim \dimexpr\fontdimen9\um@font*65536\relax =65pt
- \@um@ot@math@true
- \fi
- \ifx\um@char@range\@empty
- \def\um@symfont{um@allsym}%
- \um@PackageInfo{Defining the default maths font as '#2'}%
- \let\UnicodeMathSymbol\um@mathsymbol@noparse
+ \def\um@digitfont{um@digitfont}%
+ \um@PackageInfo{Defining the default Persian maths digits font as '#2'}%
\DeclareSymbolFont{momayez}{EU1}{\zf@family}{m}{n}%
\SetMathCharDef{\momayez}{\mathpunct}{momayez}{"066B}%
- \else
- \stepcounter{um@fam}%
- \edef\um@symfont{um@fam\theum@fam}%
- \let\UnicodeMathSymbol\um@mathsymbol@parse
- \fi
- \DeclareSymbolFont{\um@symfont}
- {\encodingdefault}{\zf@family}{\mddefault}{\updefault}%
- \if@um@init
- \input xepersian-mathsdigitspec.tex\relax
- \else
- \unless\ifx\um@char@range\@empty
- \input xepersian-mathsdigitspec.tex\relax
- \fi
- \fi
- \ifx\um@char@range\@empty
- \um@def@numbers
- \fi
+\DeclareSymbolFont{\um@digitfont}
+ {\encodingdefault}{\zf@family}{\mddefault}{\updefault}%
+\um@def@numbers
}
-\newcommand\um@mathsymbol@noparse[4]{%
- \um@mathsymbol{#2}{#3}{\um@symfont}{#1}}
-\newcommand\um@mathsymbol@parse[4]{%
- \um@parse@term{#1}{#2}{#3}{%
- \um@mathsymbol{#2}{#3}{\um@symfont}{#1}}}
-\newcommand\um@mk@math[1]{%
- \expandafter\def\csname math#1\endcsname##1{%
- \begingroup
- \csname um@math#1\endcsname
- ##1
- \endgroup}}
-\newcommand\um@mathmap@noparse[3]{%
- \@for\@ii:=#2\do{%
- \expandafter\expandafter
- \expandafter\um@addto@mathmap
- \expandafter\expandafter
- \expandafter{%
- \expandafter\um@symfont
- \expandafter}%
- \expandafter{\@ii}{#1}{#3}%
- }}%
-\newcommand\um@mathmap@parse[3]{%
- \@for\@ii:=\um@char@num@range\do{%
- \ifnum\@ii=#3\relax
- \@for\@jj:=#2\do{%
- \expandafter\expandafter
- \expandafter\um@addto@mathmap
- \expandafter\expandafter
- \expandafter{%
- \expandafter\um@symfont
- \expandafter}%
- \expandafter{\@jj}{#1}{#3}}%
- \fi}}%
-\newcommand\um@addto@mathmap[4]{%
- \expandafter\g@addto@macro
- \csname um@\expandafter\@gobble\string#3\endcsname{%
- \SetMathCode{#2}{\mathalpha}{#1}{#4}}}
-\def\um@nolimits{%
- \@elt\int\@elt\iint\@elt\iiint\@elt\iiiint\@elt\oint\@elt\oiint\@elt\oiiint
- \@elt\intclockwise\@elt\varointclockwise\@elt\ointctrclockwise\@elt\sumint
- \@elt\intbar\@elt\intBar\@elt\fint\@elt\cirfnint\@elt\awint\@elt\rppolint
- \@elt\scpolint\@elt\npolint\@elt\pointint\@elt\sqint\@elt\intlarhk\@elt\intx
- \@elt\intcap\@elt\intcup\@elt\upint\@elt\lowint}
-\newcommand\addnolimits[1]{%
- \expandafter\def
- \expandafter\um@nolimits
- \expandafter{\um@nolimits\@elt#1}}
-\def\removenolimits#1{%
- \begingroup
- \def\@elt##1{%
- \ifx##1#1\else
- \noexpand\@elt\noexpand##1
- \fi}
- \xdef\um@nolimits{\um@nolimits}%
- \endgroup}
-\def\um@radicals{\sqrt}
-\def\r@@t#1#2{%
- \setbox\z@\hbox{$\m@th #1\sqrtsign{#2}$}%
- \um@scaled@apply{#1}{\kern}{\fontdimen63\um@font}%
- \raise \dimexpr(
- \um@fontdimen@percent{65}{\um@font}\ht\z@-
- \um@fontdimen@percent{65}{\um@font}\dp\z@
- )\relax
- \copy \rootbox%
- \um@scaled@apply{#1}{\kern}{\fontdimen64\um@font}%
- \box \z@}
-\let\left@primitive\left
-\def\left{\mathopen{}\left@primitive}
\newcommand\um@zf@feature[2]{%
\define@key[zf]{options}{#1}[]{%
\if@um@fontspec@feature
@@ -260,95 +60,13 @@
\zf@update@ff{+ssty=0}}
\um@zf@feature{ScriptScriptStyle}{%
\zf@update@ff{+ssty=1}}
-\define@cmdkey[um]{options}[um@]{ScriptFeatures}{}
-\define@cmdkey[um]{options}[um@]{ScriptScriptFeatures}{}
-\define@cmdkey[um]{options}[um@]{ScriptFont}{}
-\define@cmdkey[um]{options}[um@]{ScriptScriptFont}{}
-\define@choicekey+[um]{options}{Range}[\@tempa\@tempb]{ALL}{%
- \ifcase\@tempb\relax
- \@um@inittrue
- \fi}{% else:
- \xdef\um@char@range{\zap@space#1 \@empty}}
-\newcommand\um@parse@term[4]{%
- \@for\@ii:=\um@char@range\do{%
- \unless\ifx\@ii\@empty
- \@tempswafalse
- \expandafter\um@firstchar\expandafter{\@ii}%
- \ifx\@tempa\um@backslash
- \expandafter\ifx\@ii#2\relax
- \@tempswatrue
- \else
- \expandafter\ifx\@ii#3\relax
- \@tempswatrue
- \fi
- \fi
- \else
- \expandafter\um@parse@range\@ii-\@marker-\@nil#1\@nil
- \fi
- \if@tempswa
- \ifx\um@char@num@range\@empty
- \g@addto@macro\um@char@num@range{#1}%
- \else
- \g@addto@macro\um@char@num@range{,#1}%
- \fi
- #4%
- \fi
- \fi}}
-\def\um@firstof#1#2\@nil{#1}
-\edef\um@backslash{\expandafter\um@firstof\string\string\@nil}
-\def\um@firstchar#1{\edef\@tempa{\expandafter\um@firstof\string#1\@nil}}
-\def\um@parse@range#1-#2-#3\@nil#4\@nil{%
- \def\@tempa{#1}%
- \def\@tempb{#2}%
- \expandafter\ifx\expandafter\@marker\@tempb\relax
- \ifnum#4=#1\relax
- \@tempswatrue
- \fi
- \else
- \ifx\@empty\@tempb
- \ifnum#4>\numexpr#1-1\relax
- \@tempswatrue
- \fi
- \else
- \ifx\@empty\@tempa
- \ifnum#4<\numexpr#2+1\relax
- \@tempswatrue
- \fi
- \else
- \ifnum#4>\numexpr#1-1\relax
- \ifnum#4<\numexpr#2+1\relax
- \@tempswatrue
- \fi\fi\fi\fi\fi}
\newcommand\um@setmathcode[3][1]{%
\@for\um@inp:=#2\do{%
\um@FOR\@tempcnta=[1:#1]\do{%
\SetMathCode{\numexpr\um@inp+\@tempcnta-1\relax}
- {\mathalpha}{\um@symfont}{\numexpr#3+\@tempcnta-1\relax}}}}
-\newcommand\um@setmathalph[4][1]{%
- \@for\um@inp:=#3\do{%
- \um@FOR\@tempcnta=[1:#1]\do{%
- \edef\@tempa{%
- \noexpand\um@setsinglemathalph
- {\noexpand#2}
- {\number\numexpr \um@inp+\@tempcnta-1 \relax}
- {\number\numexpr #4+\@tempcnta-1 \relax}}\@tempa}}}
+ {\mathalpha}{\um@digitfont}{\numexpr#3+\@tempcnta-1\relax}}}}
\newcommand\um@def@numbers{%
\um@setmathcode[10]{\um@usv@num}{\um@usv@num}}
-\begingroup
- \catcode`\^=12\relax
- \gdef\um@scancharlet#1="#2\@nil{%
- \lowercase{\scantokens{\global\let#1=^^^^^#2}}}
- \catcode`\^=12\relax
- \gdef\um@scanactivedef"#1\@nil#2{%
- \lowercase{\scantokens{\global\def^^^^^#1{#2}}}}
-\endgroup
-\let\unicodemathgobble\@gobble
-\begingroup
- \def\UnicodeMathSymbol#1#2#3#4{%
- \um@scancharlet#2=#1\@nil}
- \input xepersian-mathsdigitspec.tex\relax
-\endgroup
-\DeclareRobustCommand\sqrt{\@ifnextchar[\@sqrt\sqrtsign}
\ifx\newcommand\undefined\else
\newcommand{\ZifferAn}{}
\fi
@@ -380,4 +98,4 @@
\fi}
\mathcode`.="8000\relax
\def\ZifferLeer{\ifx\momayez\undefied .\else \momayez\fi}
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.tex b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.tex
deleted file mode 100644
index 345dcdc7766..00000000000
--- a/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.tex
+++ /dev/null
@@ -1,50 +0,0 @@
-\UnicodeMathSymbol{"1D7CE}{\mbfzero }{\mathord}{mathematical bold digit 0}%
-\UnicodeMathSymbol{"1D7CF}{\mbfone }{\mathord}{mathematical bold digit 1}%
-\UnicodeMathSymbol{"1D7D0}{\mbftwo }{\mathord}{mathematical bold digit 2}%
-\UnicodeMathSymbol{"1D7D1}{\mbfthree }{\mathord}{mathematical bold digit 3}%
-\UnicodeMathSymbol{"1D7D2}{\mbffour }{\mathord}{mathematical bold digit 4}%
-\UnicodeMathSymbol{"1D7D3}{\mbffive }{\mathord}{mathematical bold digit 5}%
-\UnicodeMathSymbol{"1D7D4}{\mbfsix }{\mathord}{mathematical bold digit 6}%
-\UnicodeMathSymbol{"1D7D5}{\mbfseven }{\mathord}{mathematical bold digit 7}%
-\UnicodeMathSymbol{"1D7D6}{\mbfeight }{\mathord}{mathematical bold digit 8}%
-\UnicodeMathSymbol{"1D7D7}{\mbfnine }{\mathord}{mathematical bold digit 9}%
-\UnicodeMathSymbol{"1D7D8}{\Bbbzero }{\mathord}{mathematical double-struck digit 0}%
-\UnicodeMathSymbol{"1D7D9}{\Bbbone }{\mathord}{mathematical double-struck digit 1}%
-\UnicodeMathSymbol{"1D7DA}{\Bbbtwo }{\mathord}{mathematical double-struck digit 2}%
-\UnicodeMathSymbol{"1D7DB}{\Bbbthree }{\mathord}{mathematical double-struck digit 3}%
-\UnicodeMathSymbol{"1D7DC}{\Bbbfour }{\mathord}{mathematical double-struck digit 4}%
-\UnicodeMathSymbol{"1D7DD}{\Bbbfive }{\mathord}{mathematical double-struck digit 5}%
-\UnicodeMathSymbol{"1D7DE}{\Bbbsix }{\mathord}{mathematical double-struck digit 6}%
-\UnicodeMathSymbol{"1D7DF}{\Bbbseven }{\mathord}{mathematical double-struck digit 7}%
-\UnicodeMathSymbol{"1D7E0}{\Bbbeight }{\mathord}{mathematical double-struck digit 8}%
-\UnicodeMathSymbol{"1D7E1}{\Bbbnine }{\mathord}{mathematical double-struck digit 9}%
-\UnicodeMathSymbol{"1D7E2}{\msanszero }{\mathord}{mathematical sans-serif digit 0}%
-\UnicodeMathSymbol{"1D7E3}{\msansone }{\mathord}{mathematical sans-serif digit 1}%
-\UnicodeMathSymbol{"1D7E4}{\msanstwo }{\mathord}{mathematical sans-serif digit 2}%
-\UnicodeMathSymbol{"1D7E5}{\msansthree }{\mathord}{mathematical sans-serif digit 3}%
-\UnicodeMathSymbol{"1D7E6}{\msansfour }{\mathord}{mathematical sans-serif digit 4}%
-\UnicodeMathSymbol{"1D7E7}{\msansfive }{\mathord}{mathematical sans-serif digit 5}%
-\UnicodeMathSymbol{"1D7E8}{\msanssix }{\mathord}{mathematical sans-serif digit 6}%
-\UnicodeMathSymbol{"1D7E9}{\msansseven }{\mathord}{mathematical sans-serif digit 7}%
-\UnicodeMathSymbol{"1D7EA}{\msanseight }{\mathord}{mathematical sans-serif digit 8}%
-\UnicodeMathSymbol{"1D7EB}{\msansnine }{\mathord}{mathematical sans-serif digit 9}%
-\UnicodeMathSymbol{"1D7EC}{\mbfsanszero }{\mathord}{mathematical sans-serif bold digit 0}%
-\UnicodeMathSymbol{"1D7ED}{\mbfsansone }{\mathord}{mathematical sans-serif bold digit 1}%
-\UnicodeMathSymbol{"1D7EE}{\mbfsanstwo }{\mathord}{mathematical sans-serif bold digit 2}%
-\UnicodeMathSymbol{"1D7EF}{\mbfsansthree }{\mathord}{mathematical sans-serif bold digit 3}%
-\UnicodeMathSymbol{"1D7F0}{\mbfsansfour }{\mathord}{mathematical sans-serif bold digit 4}%
-\UnicodeMathSymbol{"1D7F1}{\mbfsansfive }{\mathord}{mathematical sans-serif bold digit 5}%
-\UnicodeMathSymbol{"1D7F2}{\mbfsanssix }{\mathord}{mathematical sans-serif bold digit 6}%
-\UnicodeMathSymbol{"1D7F3}{\mbfsansseven }{\mathord}{mathematical sans-serif bold digit 7}%
-\UnicodeMathSymbol{"1D7F4}{\mbfsanseight }{\mathord}{mathematical sans-serif bold digit 8}%
-\UnicodeMathSymbol{"1D7F5}{\mbfsansnine }{\mathord}{mathematical sans-serif bold digit 9}%
-\UnicodeMathSymbol{"1D7F6}{\mttzero }{\mathord}{mathematical monospace digit 0}%
-\UnicodeMathSymbol{"1D7F7}{\mttone }{\mathord}{mathematical monospace digit 1}%
-\UnicodeMathSymbol{"1D7F8}{\mtttwo }{\mathord}{mathematical monospace digit 2}%
-\UnicodeMathSymbol{"1D7F9}{\mttthree }{\mathord}{mathematical monospace digit 3}%
-\UnicodeMathSymbol{"1D7FA}{\mttfour }{\mathord}{mathematical monospace digit 4}%
-\UnicodeMathSymbol{"1D7FB}{\mttfive }{\mathord}{mathematical monospace digit 5}%
-\UnicodeMathSymbol{"1D7FC}{\mttsix }{\mathord}{mathematical monospace digit 6}%
-\UnicodeMathSymbol{"1D7FD}{\mttseven }{\mathord}{mathematical monospace digit 7}%
-\UnicodeMathSymbol{"1D7FE}{\mtteight }{\mathord}{mathematical monospace digit 8}%
-\UnicodeMathSymbol{"1D7FF}{\mttnine }{\mathord}{mathematical monospace digit 9}%
diff --git a/Master/texmf-dist/tex/xelatex/xepersian/xepersian-presentation.cls b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-presentation.cls
new file mode 100644
index 00000000000..97866df4bb3
--- /dev/null
+++ b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-presentation.cls
@@ -0,0 +1,86 @@
+%% This file is xepersian-presentation.cls
+%%
+%% Copyright 2009 by Vafa Khalighi
+%%
+%%%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesClass{xepersian-presentation}[2009/01/05 class for plain Persian electronic presentations in XeLaTeX (Author: Vafa Khalighi)]
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
+\ProcessOptions\relax
+\LoadClass{article}
+
+\RequirePackage[foot=10.2pt,head=0pt,paperwidth=128mm,paperheight=96mm,left=5mm,top=5mm,right=7mm,bottom=8mm]{geometry}
+
+\RequirePackage{fancyhdr}
+\renewcommand{\headrulewidth}{0mm}
+
+
+\renewcommand{\maketitle}%
+ {\ClassError{xepersian-presentation}{Caution: ``maketitle'' command not supported}%
+ {Please use ``titlepage'' environment instead}%
+}
+
+\fancypagestyle{pres}{%
+\fancyhf{}%
+\fancyfoot[RO,LE]{\footnotesize \thepage}%
+}
+
+\pagestyle{pres}
+
+\newcommand{\distance}[1]{\vspace*{\stretch{#1}}}
+\newcommand{\abstand}[1]{\vspace*{\stretch{#1}}}
+
+\setlength{\parskip}{0.6ex}
+\setlength{\parindent}{0mm}
+
+\newenvironment{plainslide}[1][]%
+ {{\raggedleft \large\bfseries #1\par}\par\vspace*{\stretch{1}}}%
+ {\par\vspace*{\stretch{1}}\newpage}
+
+
+\newenvironment{rawslide}{}{\newpage}%
+
+
+\def\itemize{%
+ \ifnum \@itemdepth >\thr@@\@toodeep\else
+ \advance\@itemdepth\@ne
+ \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
+ \expandafter
+ \list
+ \csname\@itemitem\endcsname
+ {\def\makelabel##1{\hss\llap{##1}}}%
+ \fi
+ \setlength{\itemsep}{0ex}%
+ \setlength{\parskip}{0.1ex}%
+ \setlength{\parsep}{0ex}%
+ }%
+\let\enditemize =\endlist
+
+
+\def\enumerate{%
+ \ifnum \@enumdepth >\thr@@\@toodeep\else
+ \advance\@enumdepth\@ne
+ \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
+ \expandafter
+ \list
+ \csname label\@enumctr\endcsname
+ {\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}%
+ \fi
+ \setlength{\itemsep}{0ex}%
+ \setlength{\parskip}{0.1ex}%
+ \setlength{\parsep}{0ex}%
+ }%
+\let\endenumerate =\endlist
+
+
+\renewenvironment{description}
+ {\list{}{\labelwidth\z@ \itemindent-\leftmargin
+ \let\makelabel\descriptionlabel}
+ \setlength{\itemsep}{0ex}%
+ \setlength{\parskip}{0.1ex}%
+ \setlength{\parsep}{0ex}}
+ {\endlist}
+
+\endinput
diff --git a/Master/texmf-dist/tex/xelatex/xepersian/xepersian-thesis.cls b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-thesis.cls
new file mode 100644
index 00000000000..e3913cabbc2
--- /dev/null
+++ b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-thesis.cls
@@ -0,0 +1,904 @@
+%% This file is xepersian-thesis.cls (Modified version of report.cls)
+%%
+%% Copyright 2009 by Vafa Khalighi
+%%
+%%%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%%
+%%
+%%
+%%
+%% This is file `report.cls',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% classes.dtx (with options: `report')
+%%
+%% This is a generated file.
+%%
+%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006
+%% The LaTeX3 Project and any individual authors listed elsewhere
+%% in this file.
+%%
+%% This file was generated from file(s) of the LaTeX base system.
+%% --------------------------------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This file has the LPPL maintenance status "maintained".
+%%
+%% This file may only be distributed together with a copy of the LaTeX
+%% base system. You may however distribute the LaTeX base system without
+%% such generated files.
+%%
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.txt'. See also `legal.txt' for additional
+%% information.
+%%
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+%% \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
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesClass{xepersian-thesis}
+ [2009/01/05 v0.1
+ Persian thesis document class in XeLaTeX (Author: Vafa Khalighi)]
+\newcommand\@ptsize{}
+\newif\if@restonecol
+\newif\if@titlepage
+\@titlepagetrue
+\newif\if@openright
+\if@compatibility\else
+\DeclareOption{a4paper}
+ {\setlength\paperheight {297mm}%
+ \setlength\paperwidth {210mm}}
+\DeclareOption{a5paper}
+ {\setlength\paperheight {210mm}%
+ \setlength\paperwidth {148mm}}
+\DeclareOption{b5paper}
+ {\setlength\paperheight {250mm}%
+ \setlength\paperwidth {176mm}}
+\DeclareOption{letterpaper}
+ {\setlength\paperheight {11in}%
+ \setlength\paperwidth {8.5in}}
+\DeclareOption{legalpaper}
+ {\setlength\paperheight {14in}%
+ \setlength\paperwidth {8.5in}}
+\DeclareOption{executivepaper}
+ {\setlength\paperheight {10.5in}%
+ \setlength\paperwidth {7.25in}}
+\DeclareOption{landscape}
+ {\setlength\@tempdima {\paperheight}%
+ \setlength\paperheight {\paperwidth}%
+ \setlength\paperwidth {\@tempdima}}
+\fi
+\if@compatibility
+ \renewcommand\@ptsize{0}
+\else
+\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
+\fi
+\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
+\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
+\if@compatibility\else
+\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
+\fi
+\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue}
+\DeclareOption{draft}{\setlength\overfullrule{5pt}}
+\if@compatibility\else
+\DeclareOption{final}{\setlength\overfullrule{0pt}}
+\fi
+\DeclareOption{titlepage}{\@titlepagetrue}
+\if@compatibility\else
+\DeclareOption{notitlepage}{\@titlepagefalse}
+\fi
+\if@compatibility
+\else
+\DeclareOption{openright}{\@openrighttrue}
+\DeclareOption{openany}{\@openrightfalse}
+\fi
+\if@compatibility\else
+\DeclareOption{onecolumn}{\@twocolumnfalse}
+\fi
+\DeclareOption{twocolumn}{\@twocolumntrue}
+\DeclareOption{leqno}{\input{leqno.clo}}
+\DeclareOption{fleqn}{\input{fleqn.clo}}
+\DeclareOption{openbib}{%
+ \AtEndOfPackage{%
+ \renewcommand\@openbib@code{%
+ \advance\leftmargin\bibindent
+ \itemindent -\bibindent
+ \listparindent \itemindent
+ \parsep \z@
+ }%
+ \renewcommand\newblock{\par}}%
+}
+\ExecuteOptions{letterpaper,10pt,oneside,onecolumn,final,openany}
+\ProcessOptions
+\input{size1\@ptsize.clo}
+\setlength\lineskip{1\p@}
+\setlength\normallineskip{1\p@}
+\renewcommand\baselinestretch{}
+\setlength\parskip{0\p@ \@plus \p@}
+\@lowpenalty 51
+\@medpenalty 151
+\@highpenalty 301
+\setcounter{topnumber}{2}
+\renewcommand\topfraction{.7}
+\setcounter{bottomnumber}{1}
+\renewcommand\bottomfraction{.3}
+\setcounter{totalnumber}{3}
+\renewcommand\textfraction{.2}
+\renewcommand\floatpagefraction{.5}
+\setcounter{dbltopnumber}{2}
+\renewcommand\dbltopfraction{.7}
+\renewcommand\dblfloatpagefraction{.5}
+\if@twoside
+ \def\ps@headings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\rl\thepage\hfil\rl\leftmark}%
+ \def\@oddhead{\rl\rightmark\hfil\rl\thepage}%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markboth {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \rl{\@chapapp\ \thechapter. \ }%
+ \fi
+ \rl{##1}}}{}}%
+ \def\sectionmark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\z@
+ \rl{\thesection. \ }%
+ \fi
+ \rl{##1}}}}}
+\else
+ \def\ps@headings{%
+ \let\@oddfoot\@empty
+ \def\@oddhead{\rl\rightmark\hfil\rl\thepage}%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \rl{\@chapapp\ \thechapter. \ }%
+ \fi
+ \rl{##1}}}}}
+\fi
+\def\ps@myheadings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\rl\thepage\hfil\rl\leftmark}%
+ \def\@oddhead{rl\rightmark\hfil\rl\thepage}%
+ \let\@mkboth\@gobbletwo
+ \let\chaptermark\@gobble
+ \let\sectionmark\@gobble
+ }
+ \if@titlepage
+ \newcommand\maketitle{\begin{titlepage}%
+ \let\footnotesize\small
+ \let\footnoterule\relax
+ \let \footnote \thanks
+ \null\vfil
+ \vskip 60\p@
+ \begin{center}%
+ {\LARGE \@title \par}%
+ \vskip 3em%
+ {\large
+ \lineskip .75em%
+ \begin{tabular}[t]{c}%
+ \@author
+ \end{tabular}\par}%
+ \vskip 1.5em%
+ {\large \@date \par}% % Set date in \large size.
+ \end{center}\par
+ \@thanks
+ \vfil\null
+ \end{titlepage}%
+ \setcounter{footnote}{0}%
+ \global\let\thanks\relax
+ \global\let\maketitle\relax
+ \global\let\@thanks\@empty
+ \global\let\@author\@empty
+ \global\let\@date\@empty
+ \global\let\@title\@empty
+ \global\let\title\relax
+ \global\let\author\relax
+ \global\let\date\relax
+ \global\let\and\relax
+}
+\else
+\newcommand\maketitle{\par
+ \begingroup
+ \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
+ \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
+ \long\def\@makefntext##1{\parindent 1em\noindent
+ \hb@xt@1.8em{%
+ \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+ \if@twocolumn
+ \ifnum \col@number=\@ne
+ \@maketitle
+ \else
+ \twocolumn[\@maketitle]%
+ \fi
+ \else
+ \newpage
+ \global\@topnum\z@ % Prevents figures from going at top of page.
+ \@maketitle
+ \fi
+ \thispagestyle{plain}\@thanks
+ \endgroup
+ \setcounter{footnote}{0}%
+ \global\let\thanks\relax
+ \global\let\maketitle\relax
+ \global\let\@maketitle\relax
+ \global\let\@thanks\@empty
+ \global\let\@author\@empty
+ \global\let\@date\@empty
+ \global\let\@title\@empty
+ \global\let\title\relax
+ \global\let\author\relax
+ \global\let\date\relax
+ \global\let\and\relax
+}
+\def\@maketitle{%
+ \newpage
+ \null
+ \vskip 2em%
+ \begin{center}%
+ \let \footnote \thanks
+ {\LARGE \@title \par}%
+ \vskip 1.5em%
+ {\large
+ \lineskip .5em%
+ \begin{tabular}[t]{c}%
+ \@author
+ \end{tabular}\par}%
+ \vskip 1em%
+ {\large \@date}%
+ \end{center}%
+ \par
+ \vskip 1.5em}
+\fi
+\newcommand*\chaptermark[1]{}
+\setcounter{secnumdepth}{2}
+\newcounter {part}
+\newcounter {chapter}
+\newcounter {section}[chapter]
+\newcounter {subsection}[section]
+\newcounter {subsubsection}[subsection]
+\newcounter {paragraph}[subsubsection]
+\newcounter {subparagraph}[paragraph]
+\renewcommand \thepart {\@tartibi\c@part}
+\renewcommand \thechapter {\@arabic\c@chapter}
+\renewcommand \thesection {\thechapter.\@arabic\c@section}
+\renewcommand\thesubsection {\thesection.\@arabic\c@subsection}
+\renewcommand\thesubsubsection{\thesubsection .\@arabic\c@subsubsection}
+\renewcommand\theparagraph {\thesubsubsection.\@arabic\c@paragraph}
+\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}
+\newcommand\@chapapp{\chaptername}
+\newcommand\part{%
+ \if@openright
+ \cleardoublepage
+ \else
+ \clearpage
+ \fi
+ \thispagestyle{plain}%
+ \if@twocolumn
+ \onecolumn
+ \@tempswatrue
+ \else
+ \@tempswafalse
+ \fi
+ \null\vfil
+ \secdef\@part\@spart}
+
+\def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ \markboth{}{}%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >-2\relax
+ \huge\bfseries \partname\nobreakspace\thepart
+ \par
+ \vskip 20\p@
+ \fi
+ \Huge \bfseries #2\par}%
+ \@endpart}
+\def\@spart#1{%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \Huge \bfseries #1\par}%
+ \@endpart}
+\def\@endpart{\vfil\newpage
+ \if@twoside
+ \if@openright
+ \null
+ \thispagestyle{empty}%
+ \newpage
+ \fi
+ \fi
+ \if@tempswa
+ \twocolumn
+ \fi}
+\newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
+ \thispagestyle{plain}%
+ \global\@topnum\z@
+ \@afterindentfalse
+ \secdef\@chapter\@schapter}
+\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}%
+ {\protect\numberline{\thechapter}#1}%
+ \else
+ \addcontentsline{toc}{chapter}{#1}%
+ \fi
+ \chaptermark{#1}%
+ \addtocontents{lof}{\protect\addvspace{10\p@}}%
+ \addtocontents{lot}{\protect\addvspace{10\p@}}%
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#2}]%
+ \else
+ \@makechapterhead{#2}%
+ \@afterheading
+ \fi}
+\def\@makechapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedright \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \huge\bfseries \@chapapp\space \thechapter
+ \par\nobreak
+ \vskip 20\p@
+ \fi
+ \interlinepenalty\@M
+ \Huge \bfseries #1\par\nobreak
+ \vskip 40\p@
+ }}
+\def\@schapter#1{\if@twocolumn
+ \@topnewpage[\@makeschapterhead{#1}]%
+ \else
+ \@makeschapterhead{#1}%
+ \@afterheading
+ \fi}
+\def\@makeschapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedright
+ \normalfont
+ \interlinepenalty\@M
+ \Huge \bfseries #1\par\nobreak
+ \vskip 40\p@
+ }}
+\newcommand\section{\@startsection {section}{1}{\z@}%
+ {-3.5ex \@plus -1ex \@minus -.2ex}%
+ {2.3ex \@plus.2ex}%
+ {\normalfont\Large\bfseries}}
+\newcommand\subsection{\@startsection{subsection}{2}{\z@}%
+ {-3.25ex\@plus -1ex \@minus -.2ex}%
+ {1.5ex \@plus .2ex}%
+ {\normalfont\large\bfseries}}
+\newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
+ {-3.25ex\@plus -1ex \@minus -.2ex}%
+ {1.5ex \@plus .2ex}%
+ {\normalfont\normalsize\bfseries}}
+\newcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
+ {3.25ex \@plus1ex \@minus.2ex}%
+ {-1em}%
+ {\normalfont\normalsize\bfseries}}
+\newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
+ {3.25ex \@plus1ex \@minus .2ex}%
+ {-1em}%
+ {\normalfont\normalsize\bfseries}}
+\if@twocolumn
+ \setlength\leftmargini {2em}
+\else
+ \setlength\leftmargini {2.5em}
+\fi
+\leftmargin \leftmargini
+\setlength\leftmarginii {2.2em}
+\setlength\leftmarginiii {1.87em}
+\setlength\leftmarginiv {1.7em}
+\if@twocolumn
+ \setlength\leftmarginv {.5em}
+ \setlength\leftmarginvi {.5em}
+\else
+ \setlength\leftmarginv {1em}
+ \setlength\leftmarginvi {1em}
+\fi
+\setlength \labelsep {.5em}
+\setlength \labelwidth{\leftmargini}
+\addtolength\labelwidth{-\labelsep}
+\@beginparpenalty -\@lowpenalty
+\@endparpenalty -\@lowpenalty
+\@itempenalty -\@lowpenalty
+\renewcommand\theenumi{\@arabic\c@enumi}
+\renewcommand\theenumii{\@alph\c@enumii}
+\renewcommand\theenumiii{\@roman\c@enumiii}
+\renewcommand\theenumiv{\@Alph\c@enumiv}
+\newcommand\labelenumi{\theenumi.}
+\newcommand\labelenumii{(\theenumii)}
+\newcommand\labelenumiii{\theenumiii.}
+\newcommand\labelenumiv{\theenumiv.}
+\renewcommand\p@enumii{\theenumi}
+\renewcommand\p@enumiii{\theenumi(\theenumii)}
+\renewcommand\p@enumiv{\p@enumiii\theenumiii}
+\newcommand\labelitemi{\textbullet}
+\newcommand\labelitemii{\normalfont\bfseries \textendash}
+\newcommand\labelitemiii{\textasteriskcentered}
+\newcommand\labelitemiv{\textperiodcentered}
+\newenvironment{description}
+ {\list{}{\labelwidth\z@ \itemindent-\leftmargin
+ \let\makelabel\descriptionlabel}}
+ {\endlist}
+\newcommand*\descriptionlabel[1]{\hspace\labelsep
+ \normalfont\bfseries #1}
+\if@titlepage
+ \newenvironment{abstract}{%
+ \titlepage
+ \null\vfil
+ \@beginparpenalty\@lowpenalty
+ \begin{center}%
+ \bfseries \abstractname
+ \@endparpenalty\@M
+ \end{center}}%
+ {\par\vfil\null\endtitlepage}
+\else
+ \newenvironment{abstract}{%
+ \if@twocolumn
+ \section*{\abstractname}%
+ \else
+ \small
+ \begin{center}%
+ {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}%
+ \end{center}%
+ \quotation
+ \fi}
+ {\if@twocolumn\else\endquotation\fi}
+\fi
+\newenvironment{verse}
+ {\let\\\@centercr
+ \list{}{\itemsep \z@
+ \itemindent -1.5em%
+ \listparindent\itemindent
+ \rightmargin \leftmargin
+ \advance\leftmargin 1.5em}%
+ \item\relax}
+ {\endlist}
+\newenvironment{quotation}
+ {\list{}{\listparindent 1.5em%
+ \itemindent \listparindent
+ \rightmargin \leftmargin
+ \parsep \z@ \@plus\p@}%
+ \item\relax}
+ {\endlist}
+\newenvironment{quote}
+ {\list{}{\rightmargin\leftmargin}%
+ \item\relax}
+ {\endlist}
+\if@compatibility
+\newenvironment{titlepage}
+ {%
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse\newpage
+ \fi
+ \thispagestyle{empty}%
+ \setcounter{page}\z@
+ }%
+ {\if@restonecol\twocolumn \else \newpage \fi
+ }
+\else
+\newenvironment{titlepage}
+ {%
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse\newpage
+ \fi
+ \thispagestyle{empty}%
+ \setcounter{page}\@ne
+ }%
+ {\if@restonecol\twocolumn \else \newpage \fi
+ \if@twoside\else
+ \setcounter{page}\@ne
+ \fi
+ }
+\fi
+\newcommand\appendix{\par
+ \setcounter{chapter}{0}%
+ \setcounter{section}{0}%
+ \gdef\@chapapp{\appendixname}%
+ \gdef\thechapter{\@Alph\c@chapter}}
+\setlength\arraycolsep{5\p@}
+\setlength\tabcolsep{6\p@}
+\setlength\arrayrulewidth{.4\p@}
+\setlength\doublerulesep{2\p@}
+\setlength\tabbingsep{\labelsep}
+\skip\@mpfootins = \skip\footins
+\setlength\fboxsep{3\p@}
+\setlength\fboxrule{.4\p@}
+\@addtoreset {equation}{chapter}
+\renewcommand\theequation
+ {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation}
+\newcounter{figure}[chapter]
+\renewcommand \thefigure
+ {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@figure}
+\def\fps@figure{tbp}
+\def\ftype@figure{1}
+\def\ext@figure{lof}
+\def\fnum@figure{\figurename\nobreakspace\thefigure}
+\newenvironment{figure}
+ {\@float{figure}}
+ {\end@float}
+\newenvironment{figure*}
+ {\@dblfloat{figure}}
+ {\end@dblfloat}
+\newcounter{table}[chapter]
+\renewcommand \thetable
+ {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@table}
+\def\fps@table{tbp}
+\def\ftype@table{2}
+\def\ext@table{lot}
+\def\fnum@table{\tablename\nobreakspace\thetable}
+\newenvironment{table}
+ {\@float{table}}
+ {\end@float}
+\newenvironment{table*}
+ {\@dblfloat{table}}
+ {\end@dblfloat}
+\newlength\abovecaptionskip
+\newlength\belowcaptionskip
+\setlength\abovecaptionskip{10\p@}
+\setlength\belowcaptionskip{0\p@}
+\long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}
+\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
+\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
+\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
+\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
+\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
+\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
+\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
+\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
+\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
+\newcommand\@pnumwidth{1.55em}
+\newcommand\@tocrmarg{2.55em}
+\newcommand\@dotsep{4.5}
+\setcounter{tocdepth}{2}
+\newcommand\tableofcontents{%
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+ \chapter*{\contentsname
+ \@mkboth{%
+ \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
+ \@starttoc{toc}%
+ \if@restonecol\twocolumn\fi
+ }
+\newcommand*\l@part[2]{%
+ \ifnum \c@tocdepth >-2\relax
+ \addpenalty{-\@highpenalty}%
+ \addvspace{2.25em \@plus\p@}%
+ \setlength\@tempdima{3em}%
+ \begingroup
+ \parindent \z@ \rightskip \@pnumwidth
+ \parfillskip -\@pnumwidth
+ {\leavevmode
+ \large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss #2}}\par
+ \nobreak
+ \global\@nobreaktrue
+ \everypar{\global\@nobreakfalse\everypar{}}%
+ \endgroup
+ \fi}
+\newcommand*\l@chapter[2]{%
+ \ifnum \c@tocdepth >\m@ne
+ \addpenalty{-\@highpenalty}%
+ \vskip 1.0em \@plus\p@
+ \setlength\@tempdima{1.5em}%
+ \begingroup
+ \parindent \z@ \rightskip \@pnumwidth
+ \parfillskip -\@pnumwidth
+ \leavevmode \bfseries
+ \advance\leftskip\@tempdima
+ \hskip -\leftskip
+ #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
+ \penalty\@highpenalty
+ \endgroup
+ \fi}
+\newcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}}
+\newcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
+\newcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
+\newcommand*\l@paragraph{\@dottedtocline{4}{10em}{5em}}
+\newcommand*\l@subparagraph{\@dottedtocline{5}{12em}{6em}}
+\newcommand\listoffigures{%
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+ \chapter*{\listfigurename}%
+ \@mkboth{\MakeUppercase\listfigurename}%
+ {\MakeUppercase\listfigurename}%
+ \@starttoc{lof}%
+ \if@restonecol\twocolumn\fi
+ }
+\newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
+\newcommand\listoftables{%
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+ \chapter*{\listtablename}%
+ \@mkboth{%
+ \MakeUppercase\listtablename}%
+ {\MakeUppercase\listtablename}%
+ \@starttoc{lot}%
+ \if@restonecol\twocolumn\fi
+ }
+\let\l@table\l@figure
+\newdimen\bibindent
+\setlength\bibindent{1.5em}
+\newenvironment{thebibliography}[1]
+ {\chapter*{\bibname}%
+ \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
+ \list{\@biblabel{\@arabic\c@enumiv}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \leftmargin\labelwidth
+ \advance\leftmargin\labelsep
+ \@openbib@code
+ \usecounter{enumiv}%
+ \let\p@enumiv\@empty
+ \renewcommand\theenumiv{\@arabic\c@enumiv}}%
+ \sloppy
+ \clubpenalty4000
+ \@clubpenalty \clubpenalty
+ \widowpenalty4000%
+ \sfcode`\.\@m}
+ {\def\@noitemerr
+ {\@latex@warning{Empty `thebibliography' environment}}%
+ \endlist}
+\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
+\let\@openbib@code\@empty
+\newenvironment{theindex}
+ {\if@twocolumn
+ \@restonecolfalse
+ \else
+ \@restonecoltrue
+ \fi
+ \twocolumn[\@makeschapterhead{\indexname}]%
+ \@mkboth{\MakeUppercase\indexname}%
+ {\MakeUppercase\indexname}%
+ \thispagestyle{plain}\parindent\z@
+ \parskip\z@ \@plus .3\p@\relax
+ \columnseprule \z@
+ \columnsep 35\p@
+ \let\item\@idxitem}
+ {\if@restonecol\onecolumn\else\clearpage\fi}
+\newcommand\@idxitem{\par\hangindent 40\p@}
+\newcommand\subitem{\@idxitem \hspace*{20\p@}}
+\newcommand\subsubitem{\@idxitem \hspace*{30\p@}}
+\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
+\renewcommand\footnoterule{%
+ \kern-3\p@
+ \hrule\@width.4\columnwidth
+ \kern2.6\p@}
+\@addtoreset{footnote}{chapter}
+\newcommand\@makefntext[1]{%
+ \parindent 1em%
+ \noindent
+ \hb@xt@1.8em{\hss\@makefnmark}#1}
+\newcommand\contentsname{فهرست مطالب}
+\newcommand\listfigurename{لیست تصاویر}
+\newcommand\listtablename{لیست جداول}
+\newcommand\bibname{کتاب‌نامه}
+\newcommand\indexname{نمایه}
+\newcommand\figurename{شکل}
+\newcommand\tablename{جدول}
+\newcommand\partname{قسمت}
+\newcommand\chaptername{فصل}
+\newcommand\appendixname{پیوست}
+\newcommand\abstractname{چکیده}
+\def\today{\ifcase\month\or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or December\fi
+ \space\number\day, \number\year}
+\setlength\columnsep{10\p@}
+\setlength\columnseprule{0\p@}
+\pagestyle{plain}
+\pagenumbering{arabic}
+\if@twoside
+\else
+ \raggedbottom
+\fi
+\if@twocolumn
+ \twocolumn
+ \sloppy
+ \flushbottom
+\else
+ \onecolumn
+\fi
+
+
+
+
+
+\def\university#1{\gdef\@university{#1}}
+\def\department#1{\gdef\@department{#1}}
+\def\degree#1{\gdef\@degree{#1}}
+\def\thesisdate#1{\gdef\@thesisdate{#1}}
+\def\supervisor#1{\gdef\@supervisor{#1}}
+\def\city#1{\gdef\@city{#1}}
+
+\def\romantitle#1{\gdef\@romantitle{#1}}
+\def\romanauthor#1{\gdef\@romanauthor{#1}}
+\def\romandegree#1{\gdef\@romandegree{#1}}
+\def\romandepartment#1{\gdef\@romandepartment{#1}}
+\def\romanthesisdate#1{\gdef\@romanthesisdate{#1}}
+\def\romansupervisor#1{\gdef\@romansupervisor{#1}}
+\def\romancity#1{\gdef\@romancity{#1}}
+\def\romanuniversity#1{\gdef\@romanuniversity{#1}}
+
+\def\maketitle{\begin{titlepage}
+{\includegraphics{logo}}
+\vskip 1.5cm
+{\Huge\bf \@title}\par
+\vskip 1cm
+{\large%
+ \by}\par
+{\Large\bf \@author}\par
+\vskip 5mm
+{\large\bf\writtenfor
+\par
+\@degree}
+\par
+\vskip 1cm
+{\large
+ \undersupervision\par
+\Large\bf \@supervisor}
+\par
+\vskip 1cm
+{\large \@thesisdate}
+\par
+\vskip 1cm
+{\large\bf\departmentof\space\@department}
+\par
+{\large\bf\universityof\space\@university \par\@city}
+\vfill
+\end{titlepage}%
+}
+
+\def\abstractpage{\newpage
+\thispagestyle{empty}
+\vskip 15mm
+\begin{center}{\large{\bf \@title} \\}
+\end{center}
+\par
+\begin{abstract}}
+\def\endabstractpage{\end{abstract}
+\newpage
+}
+
+\def\romanabstract{\newpage
+\thispagestyle{empty}
+\vskip 15mm
+\begin{center}{\Large\bf \@romantitle \\[5mm]}
+{\bf Abstract}
+\end{center}
+\vspace{5mm}}
+
+\def\endromanabstract{\newpage}
+
+\def\acknowledgementpage{\newpage
+\thispagestyle{empty}
+\centerline{\Large \bf\acknowledgementname}
+\vspace{1cm}
+\par\noindent}
+\def\endacknowledgementpage{\newpage}
+
+\def\titlepage{\newpage\centering
+ \thispagestyle{empty}
+ \parindent 0pt \parskip 10pt plus 1fil minus 1fil
+ \def\baselinestretch{1}\@normalsize\vbox to \vsize\bgroup\vbox to 9in\bgroup}
+\def\endtitlepage{\par\kern 0pt\egroup\vss\egroup\newpage}
+
+\def\signature#1#2{\par\noindent#1\dotfill\null\\*
+ {\raggedright #2\par}}
+\def\abstract{\subsection*{\abstractname}\small\def\baselinestretch{1}
+\@normalsize}
+\def\endabstract{\par}
+
+
+
+\pagenumbering{harfi}
+\let\ol@chapter\@chapter
+\def\@chapter{%
+ \ifnum\c@chapter=0 \pagenumbering{arabic}\setcounter{page}{1}\fi
+ \ol@chapter}
+
+
+
+\def\keywords#1{\par \vspace{5mm}
+{\textbf{واژه‌های کلیدی:}} {\textit{ #1}}}
+
+\def\romankeywords#1{\par \vspace{5mm}
+\noindent {\textbf{Keywords:}} {\textit{ #1}}}
+
+\font\titlefont=cmssbx10 scaled 2074
+\font\supervisorfont=cmbxti10
+\def\makeromantitle{\begin{titlepage}
+{\includegraphics{logo}}
+\vskip 1.5cm
+\addtolength{\baselineskip}{5mm}
+{\titlefont \@romantitle} \par
+\addtolength{\baselineskip}{-5mm}
+\vskip 1cm
+{\bf\romanby}\par
+{\Large\bf \@romanauthor}\par
+\vskip 5mm
+{\romanwrittenfor\par
+\large\@romandegree}
+\par
+\vskip 1cm
+Under supervision of \\
+{\supervisorfont\@romansupervisor}
+\par
+\vskip 1cm
+{\@romanthesisdate}
+\par
+\vskip 1cm
+\large\bf
+\@romandepartment\space Department
+\par
+\@romanuniversity \par\@romancity
+\vfill
+\end{titlepage}%
+}
+
+
+\def\acknowledgementname{قدردانی}
+\def\by{توسط}
+\def\writtenfor{ رسالهٔ ارائه شده به عنوان بخشی از ملزومات برای دریافت درجهٔ}
+\def\undersupervision{زیر نظر}
+\def\departmentof{دانشکدهٔ}
+\def\universityof{دانشگاه}
+\def\romanby{by}
+\def\romanwrittenfor{Submitted in Partial Fulfillment\\ of the Requirements\\ for the Degree of}
+\def\romanundersupervision{Under supervision of}
+\endinput
diff --git a/Master/texmf-dist/tex/xelatex/xepersian/xepersian-user.cls b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-user.cls
new file mode 100644
index 00000000000..d5d9f2c00c8
--- /dev/null
+++ b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-user.cls
@@ -0,0 +1,799 @@
+%% This file is xepersian-user.cls
+%%
+%% Copyright 2009 by Vafa Khalighi
+%%
+%%%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesClass{xepersian-user}[2009/01/05 Class for XePersian User's Guide (Author: Vafa Khalighi)]
+\TeXXeTstate=1
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
+\ProcessOptions\relax
+\LoadClass{article}
+\RequirePackage{pstcol}
+\RequirePackage{pst-coil}
+\RequirePackage{pst-plot}
+\RequirePackage{pst-tree}
+\RequirePackage{fancybox}
+\RequirePackage{fancyvrb}
+\RequirePackage{geometry}
+\RequirePackage{fontspec}
+\RequirePackage{xltxtra}
+\RequirePackage{url}
+\RequirePackage[hyperfootnotes=false,colorlinks=true,bookmarks=true]
+ {hyperref}
+\RequirePackage{pifont}
+\def\thetitle{\XePersian : User's Guide}
+\newcommand*\setPersianFont[2][]{%
+\newfontfamily\PersianFont[Script=Arabic,#1]{#2}
+}
+\def\PersianTxt#1{\begingroup\beginR\PersianFont#1\endR\endgroup}
+\let\theheadertitle\thetitle
+\let\fileversion\Version
+\let\filedate\Date
+\parindent 0pt
+\parskip 7pt plus 1pt minus 1pt
+\oddsidemargin 5cm
+\evensidemargin 5cm
+\textwidth 11.5cm
+\topmargin\z@
+\textheight 8.8in
+\footskip .625in
+\headheight 0pt
+\headsep 0pt
+\marginparwidth 3.5cm
+\marginparsep .5cm
+\reversemarginpar
+\ifdim\paperwidth=210mm \papersizeadjust\fi
+\def\arraystretch{1.2}
+\hfuzz 1pt
+\def\twosideclearpage{%
+ \clearpage
+ \if@twoside
+ \ifodd\c@page\else
+ \thispagestyle{empty}%
+ \null\leavevmode
+ \clearpage
+ \fi
+ \fi}
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{7pt plus 1pt minus 1pt}
+\def\@listI{%
+ \leftmargin\leftmargini
+ \parsep 5\p@ plus2.5\p@ minus\p@
+ \topsep 5\p@ plus2\p@ minus2\p@
+ \itemsep 5\p@ plus2.5\p@ minus\p@}
+\let\@listi\@listI
+\@listi
+\def\@listii{%
+ \leftmargin\leftmarginii
+ \labelwidth\leftmarginii
+ \advance\labelwidth-\labelsep
+ \topsep 2\p@ plus.5\p@ minus\p@
+ \parsep 2.5\p@ plus\p@ minus\p@
+ \itemsep \parsep}
+\def\@listiii{%
+ \leftmargin\leftmarginiii
+ \labelwidth\leftmarginiii
+ \advance\labelwidth-\labelsep
+ \topsep 1\p@ plus.2\p@ minus.2\p@
+ \parsep \z@
+ \partopsep \p@ plus\z@ minus\p@
+ \itemsep \topsep}
+\skip\footins 20pt plus 4pt minus 2pt
+\newcounter{faq}[section]
+\def\thefaq{\arabic{faq}}
+\let\l@faq\@gobbletwo
+\def\faq{\@startsection{faq}{2}{\z@}%
+ {3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}{\faqfont}}
+\def\faqfont{\normalsize\sffamily}
+\def\faqmark#1{}
+\def\error{\vskip 2ex\noindent}
+\def\section{\@startsection{section}{1}{\sechang}%
+ {-3ex plus -1ex minus -.2ex}{1.5ex plus .2ex}{\secfont}}
+\def\subsection{\@startsection{subsection}{2}{\subsechang}%
+ {-2.75ex plus -1ex minus -.2ex}{1.25ex plus .2ex}{\subsecfont}}
+\newdimen\sechang
+\newdimen\subsechang
+\sechang=-.75in
+\subsechang=-.375in
+\def\secfont{\sffamily\LARGE\bfseries}
+\def\subsecfont{\sffamily\Large\bfseries}
+\def\ps@docheadings{%
+ \let\@mkboth\markboth
+ \def\@oddhead{}%
+ \let\@evenhead\@oddhead%
+ \def\@oddfoot{%
+ \small\sffamily
+ \rightmark
+ \hfil
+ \thepage}%
+ \def\@evenfoot{%
+ \small\sffamily
+ \thepage
+ \hfil
+ \theheadertitle}%
+ \def\sectionmark##1{\markright {##1}}}%
+\pagestyle{docheadings}
+\newskip\tempskip
+\def\TOCshrink{.5}
+\def\TableOfContents{%
+ \begin{quote}
+ \begin{center} \Large\bf Contents \end{center}
+ \def\numberline##1{\hbox to 0pt{\hss##1\hskip 1em}}%
+ \let\oldaddvspace\addvspace
+ \def\addvspace##1{%
+ \tempskip##1\relax
+ \oldaddvspace{\TOCshrink\tempskip}}
+ \@starttoc{toc}%
+ \end{quote}}
+\def\tableofcontents{%
+ \clearpage
+ \markright{CONTENTS}%
+ \TableOfContents
+ \clearpage}
+\def\expanddate#1/#2/#3/{%
+ \number#3{}
+ \month=#2
+ \ifcase\month\or
+ January \or February \or March \or April \or May \or June \or
+ July \or August \or September \or October \or November \or December
+ \fi
+ 20#1}
+\def\thefiledate{\expandafter\expanddate\Date/}
+\date{\thefiledate}
+\def\NotNested{\def\begin##1{%
+ \@latexerr{Bad nesting of environments.
+ Perhaps missing \end{\@currenvir}}\@eha
+ \end{\@currenvir}%
+ \begin{##1}}}
+\def\Ex{%
+ \NotNested
+ \list{}{}\item[]%
+ \if@minipage\else\vskip\parskip\fi
+ \leftskip\@totalleftmargin
+ \rightskip\z@
+ \parindent\z@
+ \parskip\z@
+ \parfillskip\@flushglue
+ \hfuzz 1pt
+ \@@par
+ \global\@inlabelfalse}
+\def\endEx{\endlist}
+\begingroup
+ \catcode`\{=12 \catcode`\}=12
+ \catcode`\(=1 \catcode`\)=2
+ \catcode`\+=0 \catcode`\\=12
+ +gdef+|(\) % \| = character \
+ +gdef+{({) % \{ = character {
+ +gdef+}(}) % \} = character }
++endgroup
+\def\Backslash{\protect\|}
+\def\times@scale{.96}
+\def\helv@scale{.82}
+\def\courier@scale{.985}
+\def\AmS{AMS}
+\def\symchar#1{%
+ \mbox{%
+ \kern .3pt
+ \Pisymbol{psy}{#1}
+ \kern .3pt}}
+
+\def\lt{\symchar{'074}}
+\def\gt{\symchar{'076}}
+\def\leq{\symchar{'243}}
+\def\geq{\symchar{'263}}
+\def\bullet{\symchar{'267}}
+\def\ldots{\symchar{'274}}
+\mathcode`\-="20B1
+\renewcommand{\ttdefault}{\sfdefault}
+\def\MainFont{\ttfamily\bfseries\large}
+\def\UsageFont{\ttfamily\bfseries}
+\def\InlineFont{\ttfamily}
+\def\MetaFont{\sffamily\slshape}
+\def\OpArgFont{\normalfont}
+\begingroup
+ \catcode`\<=\active
+ \gdef\ShortMeta{%
+ \catcode`\<=\active
+ \def<##1>{{\MetaFont ##1\/}}}
+\endgroup
+\def\DeleteShortMeta{\catcode`\<=12\relax}
+\ShortMeta
+\def\x#1{{\MetaFont x#1\/}}
+\def\y#1{{\MetaFont y#1\/}}
+\def\c#1{{\InlineFont(\x{#1},\kern 1pt\y{#1})}}
+\def\cn{\c{n}}
+\def\FV@SetupFont{%
+ \FV@BaseLineStretch
+ \FV@FontSize
+ \FV@FontFamily
+ \FV@FontSeries
+ \FV@FontShape
+ \selectfont
+}
+\def\FV@GetLine{\expandafter\FV@CheckScan\FancyVerbGetLine}
+\AtBeginDocument{\DefineShortVerb{\"}}
+
+\VerbatimFootnotes
+
+\fvset{gobble=2,commentchar=\",codes={\catcode`\<=12},fontfamily=helvetica,
+ frame=single,numbers=left,numbersep=1mm}
+
+\DefineVerbatimEnvironment{LVerb}{LVerbatim}{fontsize=\small}
+\DefineVerbatimEnvironment{LVerb*}{LVerbatim}%
+ {fontsize=\small,codes={\catcode`\<=13}}
+
+\def\FV@Space{\ \ }
+
+% Verbatim items:
+
+\newcommand{\vitem}{\SaveVerb[codes={\catcode`\<=13},
+ aftersave={\item[\UseVerb{item}]}]{item}}
+
+
+\newcommand{\BeginExample}{%
+ \VerbatimEnvironment
+ \catcode`\<=12\relax
+ \catcode`\"=9\relax
+ \begin{VerbatimOut}[commentchar=none,codes={\catcode`\"=12}]{\jobname.tmp}}
+
+\newcommand{\EndExample}{%
+ \end{VerbatimOut}
+ \fvset{gobble=0,fontsize=\small}}
+
+\newenvironment{example}{\BeginExample}{%
+ \EndExample
+ \LVerbatimInput{\jobname.tmp}%
+ \begin{center}\leavevmode\input{\jobname.tmp}\end{center}}
+
+\newenvironment{example*}{\BeginExample}{%
+ \EndExample\LVerbatimInput{\jobname.tmp}\input{\jobname.tmp}}
+
+\newenvironment{example**}{\BeginExample}{%
+ \EndExample\SideBySideEx{\input{\jobname.tmp}}}
+
+\newif\ifgrid
+\newpsobject{usergrid}{psgrid}{subgriddiv=1,griddots=10,gridlabels=7pt}
+
+\def\MEx{\@ifnextchar[{\@MEx}{\@MEx[0,0]}}
+\def\@MEx[#1,#2](#3,#4){%
+ \def\PictureSize{(#1,#2)(#3,#4)}%
+ \BeginExample}
+\def\endMEx{%
+ \EndExample
+ \SideBySideEx{%
+ \expandafter\pspicture\PictureSize
+ \ifgrid\usergrid\fi\relax
+ \input{\jobname.tmp}%
+ \endpspicture}}
+
+\def\SideBySideEx#1{%
+ \trivlist\item[]%
+ \leavevmode\kern-\@totalleftmargin
+ \hbox{\valign{%
+ \vfil##\vfil\cr
+ \hbox to \z@{\hss#1}\cr
+ \hbox to \leftmargini{\hss}\cr
+ \@tempdimc=\textwidth
+ \advance\@tempdimc-\leftmargini
+ \advance\@tempdimc-\psframesep
+ \advance\@tempdimc-\psframesep
+ \advance\@tempdimc-\pslinewidth
+ \advance\@tempdimc-\pslinewidth
+ \hbox{\psframebox{\BVerbatimInput[frame=none,numbersep=2mm,
+ boxwidth=\@tempdimc]{\jobname.tmp}}}\cr}}%
+ \endtrivlist}
+
+\@namedef{MEx*}{\gridtrue\MEx}
+\@namedef{endMEx*}{\endMEx}
+
+
+\def\FV@BProcessLine#1{%
+\hbox\ifx\FV@boxwidth\relax\else to\FV@boxwidth\fi{%
+\FV@LeftListNumber
+\FV@LeftListFrame
+\FancyVerbFormatLine{#1}\hss
+\FV@RightListFrame
+\FV@RightListNumber}}
+
+\def\BUseVerbatim{\FV@Command{}{BNumbersUseVerbatim}}
+
+\def\FVC@BNumbersUseVerbatim#1{\FV@CheckIfSaved{#1}{\FV@BNumbersUseVerbatim}}
+
+\def\FV@BNumbersUseVerbatim#1{\FV@BNumbersVerbatimBegin#1\FV@BVerbatimEnd}
+
+\def\FV@BNumbersVerbatimBegin{%
+ \begingroup
+ \FV@UseKeyValues
+ \FV@BeginVBox
+ \let\FV@ProcessLine\FV@BNumbersProcessLine
+ \FV@FormattingPrep
+ \FV@ObeyTabsInit}%
+
+\def\FV@BNumbersProcessLine#1{%
+\global\advance\FV@CodeLineNo\@ne
+\FV@StepLineNo
+\FV@BProcessLine{#1}}
+
+
+%%%%%%%%%%%%%%%%%%%% Logos %%%%%%%%%%%%%%%%%%%%
+
+\def\b@LaTeX{%
+ \begingroup
+ \csname reset@font\endcsname
+ \rmfamily\bfseries
+ L\kern-.32em
+ \raise.36ex\hbox{%
+ \ifx\@currsize\Huge\LARGE\else
+ \ifx\@currsize\huge\Large\else
+ \ifx\@currsize\LARGE\large\else
+ \ifx\@currsize\Large\normalsize\else
+ \ifx\@currsize\large\small\else
+ \ifx\@currsize\normalsize\footnotesize\else
+ \ifx\@currsize\small\scriptsize\else
+ \ifx\@currsize\footnotesize\scriptscriptsize
+ \fi\fi\fi\fi\fi\fi\fi\fi
+ \textbf{A}}%
+ \kern-.15em
+ T\kern-.1667em
+ \lower.7ex\hbox{E}\kern-.125em
+ X%
+ \endgroup}
+\def\bLaTeX{\b@LaTeX}
+
+
+\@ifundefined{BibTeX}
+ {\def\BibTeX{{\rmfamily B\kern-.05em{\sc i\kern-.025em b}\kern-.08em%
+ T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}}{}
+\@ifundefined{ConTeXt}
+ {\def\ConTeXt{{\rmfamily Con\TeX t}}}{}
+%DG \@ifundefined{SliTeX}
+%DG {\def\SliTeX{{\rmfamily S\kern-.06emL\kern-.18em\raise.32ex\hbox
+%DG \textsc{i}\kern -.03em\TeX}}}{}
+\@ifundefined{PlainTeX}{\def\PlainTeX{\textsc{Plain}\kern2pt\TeX}}{}
+
+\def\reflect#1{{\setbox0=\hbox{#1}\rlap{\kern0.5\wd0
+ \special{x:gsave}\special{x:scale -1 1}}\box0 \special{x:grestore}}}
+\def\XePersian{\leavevmode$\smash{\hbox{X\lower.5ex
+ \hbox{\kern-.125em\reflect{E}}Persian}}$}
+
+%%%%%%%%%%%%%%%%%%%% Quick reference %%%%%%%%%%%%%%%%%%%%
+
+
+
+% An entry in \quickref is of the form: \qentry{type}{entry}
+\def\quickref{}
+\long\def\addtoquickref#1#2{%
+ \expandafter\gdef\expandafter\quickref\expandafter{%
+ \quickref\qentry{#1}{#2}}}
+\def\qentry#1{\@nameuse{qr@#1}}
+
+\long\def\addtoquickref#1#2{}
+
+\def\MakeQuickRef{%
+ \long\def\addtoquickref##1##2{%
+ \wlog{}%
+ \toks@{\qentry{##1}{##2}}%
+ \message{\the\toks@}%
+ \wlog{}%
+ \let\MakeQuickRef\relax}}
+
+%% For switching into landscape mode for the Quick Reference:
+\let\NormalShipout\shipout
+\newbox\OutputBox
+\def\LandscapeMode{%
+ \long\def\shipout##1##2{%
+ \setbox\OutputBox=\hbox{\rput[tl]{90}{\vbox{##2}}}%
+ \NormalShipout\box\OutputBox}%
+ \voffset 9in}
+
+% This makes the Quick Reference:
+\def\QuickReference{%
+ \begin{Landscape}{\paperwidth}{\paperheight}{\rotateleft}
+ \oddsidemargin 0pt
+ \evensidemargin 0pt
+ \topmargin -.5in
+ \textheight 6.5in
+ \textwidth 9in
+ \columnsep 60pt
+ \footskip 0pt
+ \footheight 0pt
+ \headheight 15pt
+ \headsep 40pt
+ \parskip 4pt plus 1pt minus 1pt
+ \UsePageParameters
+ \twocolumn
+ \def\label##1{}
+ \subsechang=-.25in
+ \pagenumbering{Roman}
+ \pagestyle{quickref}
+ \MacroDefCodes
+ \let\Main\string
+ \let\MainFont\UsageFont
+ \MainFont
+ \quickref
+ \end{Landscape}}
+\let\QuickReference\relax
+
+\def\ps@quickref{%
+ \def\@oddhead{%
+ \large\bfseries\sffamily
+ \hbox to .5\textwidth{\XePersian\ v\Version\hfill}%
+ \hbox to \z@{\hss Quick Reference\hss}%
+ \hbox to .5\textwidth{\hfill\thepage}}
+ \let\@evenhead\@oddhead
+ \def\@oddfoot{}\def\@evenfoot{}}
+
+% For page numbering in the QR:
+\setbox\pst@boxg=\hbox{\UsageFont 99}
+\newdimen\refnumdim
+\refnumdim=\wd\pst@boxg
+\def\refnum#1{\hbox to \refnumdim{\hss\rmfamily\bfseries\pageref{#1}}}
+
+% Section commands that add an entry to the QR:
+\def\Section#1{\addtoquickref{section}{#1}\@checksec\section{#1}}
+\def\Subsection#1{\addtoquickref{section}{#1}\subsection{#1}}
+
+% This is just an error checker:
+\def\@checksec{%
+ \def\@tempa{document}%
+ \ifx\@tempa\@currenvir\else
+ \@latexerr{\string\Section\space occurred inside
+ \@currenvir\space environment}\@ehc
+ \expandafter\end\expandafter{\@currenvir}%
+ \expandafter\@checksec
+ \fi}
+
+% The qr@ definitions:
+\def\qr@@object#1{\mbox{\begingroup\escapechar`\+%
+ \refnum{\string#1}\endgroup\hskip 1em\string#1}}
+\def\qr@object#1{\qr@@object#1\par}
+\def\qr@@param#1=#2\@nil{\refnum{\string#1}}
+\def\qr@param#1{\leavevmode\hbox to\hsize{\qr@@param#1\@nil\hskip 1em#1}\par}
+\def\qr@section#1{\subsection*{#1}}
+\long\def\qr@center#1{\begin{center}#1\end{center}}
+
+%%%%%%%%%%%%%%%%%%%% Parts %%%%%%%%%%%%%%%%%%%%
+
+\font\bighelv=phvb at 88bp
+
+
+\def\part{\clearpage\leavevmode\@ifstar{\part@ii}{\part@i}}
+\def\part@i#1{%
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\protect\pnumberline{\thepart}#1}%
+ \lower 20pt\hbox to \z@{\hss{\bighelv\Roman{part}}\hskip 2em}%
+ \part@iii{#1}}
+\def\part@ii#1{\addcontentsline{toc}{part}{#1}\part@iii{#1}}
+\def\part@iii#1{%
+\markright{#1}{\sffamily\Huge\bfseries#1}\par\vskip 2cm\@afterheading}
+\def\thepart{\Roman{part}}
+\def\pnumberline#1{Part #1\hspace{1cm}}
+
+\def\l@part#1#2{%
+ \addpenalty{\@secpenalty}%
+ \addvspace{\lpartskip}%
+ \begingroup
+ \@tempdima 1em
+ \parindent \z@ \rightskip \@pnumwidth
+ \parfillskip -\@pnumwidth
+ {\large\bfseries\leavevmode#1\hfil \hbox to\@pnumwidth{\hss #2}}\par
+ \nobreak
+ \endgroup}
+\newskip\lpartskip
+\lpartskip 1.25em plus 1pt minus 1pt
+
+%%%%%%%%%%%%%%%%%%%% Parameter definitions and indexing %%%%%%%%%%%%%%%%%%%%
+
+% Like \MainEnvIndex, etc., but for parameters:
+\def\MainParIndex{\SpecialIndex{parameter}{main}}
+\def\UsageParIndex{\SpecialIndex{parameter}{usage}}
+
+% Like \MainPar, but for parameters. Can optionally include =foo.
+\def\MainPar#1{\@MainPar#1==\@nil}
+\def\@MainPar#1=#2=#3\@nil{%
+ \MainParIndex{#1}%
+ \label{#1}%
+ {\MainFont #1\ifx#3=\relax=\MetaFont#2\fi}}
+
+% Analogous to \n, but optionally argument can include =foo.
+\def\p#1{\@p#1==\@nil}
+\def\@p#1=#2=#3\@nil{%
+ \UsageParIndex{#1}%
+ {\UsageFont #1\ifx#3=\relax=#2\fi}}
+
+% For listing parameter definitions in a {description} environment:
+\def\pitem[#1]{\@ifnextchar({\@pitem#1}{\@@pitem#1\@nil}}
+\def\@pitem#1=#2(#3){%
+ \item[\MainFont#1=\MetaFont#2]% % Set the definition in \MainFont
+ \MainParIndex{#1}%
+ \label{#1}%
+ \addtoquickref{param}{#1={\MetaFont #2}\hfill {\rmfamily Default:} #3}%
+ \hfill {\MainFont {\rmfamily Default:} #3}\par}
+\def\@@pitem#1=#2\@nil{%
+ \@ifundefined{default@#1}%
+ {\@warning{Parameter `#1' default not defined.}\@eha\@pitem#1=#2()}
+ {\@pitem#1=#2(\csname default@#1\endcsname)}}
+
+
+\begingroup
+ \catcode`\@=12
+ \catcode`\{=12
+ \catcode`\}=12
+ \catcode`\&=1
+ \catcode`\^=2
+ \def\psset@&%
+ \begingroup
+ \catcode`\\=12
+ \pssetxx^
+ \def\pssetxx#1{#2}&%
+ \expandafter\gdef\csname default@#1\endcsname&#2^%
+ \endgroup^
+ \csname @input\endcsname&defaults.pst^
+\endgroup
+
+% For putting parameter definitions in an Ex environment:
+\def\Par#1{\@ifnextchar({\@Par#1}{\@@Par#1\@nil}}
+\def\@Par#1=#2(#3){%
+ \leavevmode
+ \MainParIndex{#1}%
+ \label{#1}%
+ \addtoquickref{param}{#1={\MetaFont #2}\hfill {\rmfamily Default:} #3}%
+ \hbox to\linewidth{%
+ \MainFont #1={\MetaFont#2}\hfill {\rmfamily Default:} #3}\par}
+\def\@@Par#1=#2\@nil{%
+ \@ifundefined{default@#1}%
+ {\@warning{Parameter `#1' default not defined.}\@Par#1=#2()}
+ {\@Par#1=#2(\csname default@#1\endcsname)}}
+
+
+
+
+\begingroup
+ \catcode`\(=13
+ \catcode`\,=13
+ \catcode`\==13
+ \gdef\MacroDefCodes{%
+ \@MD
+ \catcode`\(13
+ \catcode`\^^M12
+ \catcode`\`13
+ \catcode`\,13
+ \catcode`\!1
+ \catcode`\@2
+ \def~{}%
+ \def={{\fontshape{n}\selectfont\string=}}%
+ \def,{{\fontshape{n}\selectfont\string,}}%
+ \def(##1){\string({\MetaFont ##1})}}
+\endgroup
+
+\begingroup
+ \catcode`\`=13 \gdef`#1'{{\OpArgFont #1}}
+\endgroup
+
+\begingroup
+ \catcode`\^^M=12\relax%
+ \gdef\GetMacroDef#1{\begingroup\MacroDefCodes\@GetMacroDef{#1}}%
+ \gdef\@GetMacroDef#1#2^^M{#1{#2}\endgroup}%
+\endgroup
+
+% For listing macro definitions in a "description" environment:
+\def\mitem{\GetMacroDef\@mitem}
+\def\@mitem#1{%
+ \item[{\MainFont\Main#1}]%
+ \addtoquickref{object}{#1}%
+ \leavevmode\par}
+
+% For listing graphics object definitions in a {description} environment:
+% The optional *[par] is inserted automatically.
+\def\oitem{\GetMacroDef\@oitem}
+\def\@oitem#1{\@@oitem#1\@nil}
+\def\@@oitem#1#2\@nil{\@mitem{#1{\OpArgFont*[{\MetaFont par}]}#2}}
+
+% For generic macro definition, usually to be put in a displayed env.
+\def\object{\GetMacroDef\@object}
+\def\@object#1{\addtoquickref{object}{#1}{\MainFont\Main#1\@@par}}
+
+% For a single displayed macro definition:
+\def\Mac{\GetMacroDef\@Mac}
+\def\@Mac#1{\begin{Ex}\@object{#1}\end{Ex}}
+
+
+%% We must hack the generation of indexes modified by `hyperref'
+\def\@@wrindex#1|#2|#3\\{%
+ \ifx\\#2\\%
+ \protected@write\@indexfile{}{%
+% \string\indexentry{#1|hyperpage}{\thepage}%
+ \string\indexentry{#1}{\thepage}%
+ }%
+ \else
+ \def\Hy@temp@A{#2}%
+ \ifcase0\ifx\Hy@temp@A\HyInd@ParenLeft 1\fi
+ \ifx\Hy@temp@A\HyInd@ParenRight 1\fi
+ \relax
+ \protected@write\@indexfile{}{%
+ \string\indexentry{#1|#2}{\thepage}%
+ }%
+ \else
+ \protected@write\@indexfile{}{%
+ \string\indexentry{#1|#2hyperpage}{\thepage}%
+ }%
+ \fi
+ \fi
+ \endgroup
+ \@esphack
+}
+
+%%%%%%%%%%%%%%%%%%%% Indexes %%%%%%%%%%%%%%%%%%%%
+
+\def\PrintUserIndex{%
+ \clearpage
+ \columnsep=20pt
+ \advance\oddsidemargin\sechang
+ \advance\evensidemargin\sechang
+ \advance\textwidth-\sechang
+ \sechang=0pt
+ \onecolumn
+ \@input{\jobname.ind}}
+
+%%%%%%%%%%%%%%%%%%%% Special indexing for User's Guides %%%%%%%%%%%%%%%%%%%%
+
+\@ifundefined{actualchar}{\def\actualchar{@}}{}
+\@ifundefined{quotechar}{\def\quotechar{"}}{}
+\@ifundefined{levelchar}{\def\levelchar{!}}{}
+\@ifundefined{encapchar}{\def\encapchar{|}}{}
+\@ifundefined{verbatimchar}{\def\verbatimchar{+}}{}
+
+%% These are the indexing commands:
+
+%% Commands: \MainIndex \UsageIndex
+%% Environments: \MainEnvIndex \UsageEnvIndex
+%% Style options: \MainOptionIndex \UsageOptionIndex
+%% Counters: \MainCntIndex \UsageCntIndex
+
+\def\@Index#1{\@bsphack\index{#1}\@esphack}
+\def\Index#1#2{%
+ \@bsphack
+ \index{\expandafter\@gobble\string#2\actualchar\string
+ \verb\quotechar*\verbatimchar\string#2\verbatimchar
+ \encapchar #1}}
+{\catcode`\!=0 !catcode`!\=12!gdef!special@gobble#1{!if\#1!else#1!fi}}
+\def\MainIndex{\Index{main}}
+\def\UsageIndex{\Index{usage}}
+\def\SpecialIndex#1#2#3{%
+ \@Index{#3\actualchar{\ttfamily #3} (#1)\encapchar #2}%
+ \@Index{#1s:\levelchar{\ttfamily #3}\encapchar #2}}
+\def\MainEnvIndex{\SpecialIndex{environment}{main}}
+\def\UsageEnvIndex{\SpecialIndex{environment}{usage}}
+\def\MainOptionIndex{\SpecialIndex{option}{main}}
+\def\UsageOptionIndex{\SpecialIndex{option}{usage}}
+\def\MainCntIndex{\SpecialIndex{counter}{main}}
+\def\UsageCntIndex{\SpecialIndex{counter}{usage}}
+
+%% Font for index page numbers:
+\def\main#1{\textbf{\hyperpage{#1}}}
+\def\usage#1{\hyperpage{#1}}
+
+%% These combine various functions:
+
+%% Commands: \Main \Usage
+%% Environments: \MainEnv \UsageEnv
+%% Style options: \MainOption \UsageOption
+%% Counters: \MainCnt \UsageCnt
+
+%% The "Main" ones
+%% * Index argument.
+%% * Print argument with \MainFont
+%% * Create label +foo, e+foo or o+foo.
+
+%% The "Usage" ones
+%% * Index argument.
+%% * Print argument with \UsageFont.
+
+\def\SpecialLabel#1#2+{\label{+#2}}
+\def\LabelIndex#1{\MainIndex{#1}\expandafter\SpecialLabel\string#1+}
+\def\Main#1{%
+ \MainIndex{#1}%
+ \expandafter\SpecialLabel\string#1+%
+ {\MainFont\string#1}}
+\def\Usage#1{\UsageIndex{#1}{\UsageFont\string#1}}
+\def\MainEnv#1{%
+ \MainEnvIndex{#1}%
+ \label{e+#1}%
+ {\MainFont #1}}
+\def\UsageEnv#1{\UsageEnvIndex{#1}{\UsageFont #1}}
+\def\MainOption#1{%
+ \MainOptionIndex{#1}%
+ \label{o+#1}%
+ {\MainFont #1}}
+\def\UsageOption#1{\UsageOptionIndex{#1}{\UsageFont #1}}
+\def\MainCnt#1{%
+ \MainCntIndex{#1}%
+ \label{c+#1}%
+ {\MainFont #1}}
+\def\UsageCnt#1{\UsageCntIndex{#1}{\UsageFont #1}}
+
+%% These are abbreviations.
+\def\N{\Main}
+\def\n{\Usage}
+\def\E{\MainEnv}
+\def\e{\UsageEnv}
+\def\O{\MainOption}
+\def\o{\UsageOption}
+\def\C{\MainCnt}
+% The \c macro was already defined for coordinates
+%\def\c{\UsageCnt}
+
+
+%% User's guide and documented code have different index prologue.
+\def\PrintUserIndex{{\let\ps@plain\@empty\@input{\jobname.ind}}}
+
+%% This is for listing commands in a description environment.
+\def\xitem#1{\item[\Main{#1}]}
+
+\begingroup
+ \catcode`\<=1 \catcode`\>=2
+ \catcode`\{=13 \catcode`\}=12
+ \catcode`\[=13
+ \gdef\@MD<%
+ \catcode`\{=13 \catcode`\}=12 \catcode`\[=13
+ \def{##1}<\{<\MetaFont ##1\/>\}>%
+ \def[##1]<\string[<\MetaFont ##1\/>]>>
+\endgroup
+\def\MD{%
+ \NotNested
+ \Ex
+ \begingroup
+ \@MD
+ \def\end{\par\endgroup\end}%
+ \def\\{\@centercr\Main}%
+ \MainFont
+ \Main}
+\def\endMD{\endEx}
+
+%%%%%%%%%%%%%%%%%%%% Framed warnings %%%%%%%%%%%%%%%%%%%%
+
+\newbox\bombbox
+\setbox\bombbox=\hbox to\z@{%
+ \hss
+ \rput[r](-1.5cm,0){%
+ \psset{unit=7pt}
+ \begin{pspicture}(-4,-4)(4,4)
+ \pscircle[fillcolor=gray,fillstyle=solid]{4}
+ \rput{45}{\psscaleboxto(6,0){\textsf{XE}\kern-1pt}}
+ \psellipse*(0,3.8)(1,.2)
+ \psellipse*(0,5.5)(1,.2)
+ \psframe*(-1,3.8)(1,5.5)
+ \psbezier(0,5.5)(0,7)(1,8)(3.5,8)
+ \multido{\r=-0+40}{9}{\rput{\r}(3.5,8){\psline(0,0)(.4,0)}}
+ \end{pspicture}}}
+
+\def\Warning{%
+ \trivlist\item[]
+ \leavevmode\kern\@totalleftmargin
+ \valign\bgroup%
+ \vfil##\vfil\cr
+ \copy\bombbox\cr
+ \minipage{\textwidth}
+ \quote
+ \emph{Warning:}\hskip 1em
+ \ignorespaces}
+\def\endWarning{\endquote\endminipage\cr\egroup\endtrivlist}
+
+\newbox\filebox
+\setbox\filebox=\hbox{%
+ \pspicture(-1,-.5)(1,.7)
+ \pspolygon[linearc=2pt,shadow=true,shadowangle=45,xunit=1.1]%
+ (-1,-.55)(-1,.5)(-.8,.5)(-.8,.65)(-.2,.65)(-.2,.5)(1,.5)(1,-.55)
+ \endpspicture}
+\def\File#1{%
+ \leavevmode
+ \marginpar{%
+ \leavevmode\lower 20pt\hbox{%
+ \hbox to0pt{\hbox to \linewidth{\hss\copy\filebox\hss}\hss}%
+ \raise 10pt\hbox to \linewidth{\hss\large\bfseries\sffamily #1\hss}}}%
+ \ignorespaces}
+\def\drivers{\noindent\small Driver notes:\hskip 1em\ignorespaces}
+\endinput
diff --git a/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty b/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
index 1c608d4bc46..aa56bf6bf59 100644
--- a/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
+++ b/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
@@ -1,54 +1,139 @@
+%% This file is xepersian.sty
+%%
+%% Copyright 2009 by Vafa Khalighi
+%%
+%%%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{xepersian}[2008/09/27 v0.162
- Persian typesetting in XeLaTeX]
-
-\begingroup
- \def\notXeLaTeXformat{%
- \@latex@error{*** this package currently works only with XeLaTeX ***^^J
- You are not using XeLaTeX, so we are exiting cleanly!^^J
- Continuing may lead to 'unavailable font metrics' errors!^^J}\@ehc
- \endgroup\endinput}
-\expandafter\ifx\csname XeTeXpicfile\endcsname\relax\expandafter\notXeLaTeXformat\fi
-\endgroup
-
+\ProvidesPackage{xepersian}[2009/01/05 v0.163
+ Persian typesetting in XeLaTeX (Author: Vafa Khalighi)]
+\AtBeginDocument{\special{pdf: docinfo <<
+ /Creator (XePersian v0.163)
+ >>}}
\RequirePackage{graphicx}
\RequirePackage{amssymb}
\RequirePackage{amsmath}
\RequirePackage{amsthm}
-\RequirePackage[quiet]{fontspec}
-\RequirePackage{bidi}
+\RequirePackage{fontspec}
\RequirePackage{xltxtra}
-\RequirePackage{xunicode}
+\RequirePackage{bidi}
\RequirePackage{etoolbox}
\RequirePackage{xepersian-mathsdigitspec}
+\RequirePackage{xunicode}
+
+\@rltrue
+\@rlmaintrue
+\@rl@footnotetrue
+
+\def\raggedright{%
+ \let\\\@centercr
+ \rightskip\z@skip\rightskip\@flushglue
+ \parindent\z@\parfillskip\z@skip}
+\renewcommand\raggedleft{\@@raggedleft}
+\renewcommand\raggedright{\@@raggedright}
+
+
+\@ifpackageloaded{graphicx}{%
+\def\Gin@ii[#1]#2{%
+ \def\@tempa{[}\def\@tempb{#2}%
+ \ifx\@tempa\@tempb
+ \def\@tempa{\Gin@iii[#1][}%
+ \expandafter\@tempa
+ \else
+ \begingroup
+ \@tempswafalse
+ \toks@{\beginL\Ginclude@graphics{#2}\endL}%
+ \setkeys{Gin}{#1}%
+ \Gin@esetsize
+ \the\toks@
+ \endgroup
+ \fi}%
+}{}
+
+\def\lr#1{\LR{\rmfamily#1}}
+\def\rl#1{\RL{\persianfont#1}}
+\def\LTR{\bgroup\par\@rlfalse}
+\def\endLTR{\par\egroup}
+\def\RTL{\bgroup\par\@rltrue}
+\def\endRTL{\par\egroup}
+\def\roman{\bgroup\par\@rlfalse\rmfamily}
+\def\endroman{\par\egroup}
+\def\persian{\bgroup\par\@rltrue\persianfont}
+\def\endpersian{\par\egroup}
+\def\Roman{\if@rl\par\@rlfalse\rmfamily\fi}
+\def\Persian{\if@rl\relax\else\par\@rltrue\persianfont\fi}
+
+\def\centerline#1{%
+\if@rl\@@line{\hss\beginR #1 \endR\hss}
+\else\@@line{\hss#1\hss}\fi}
+
+\def\leftline#1{%
+\if@rl\@@line{\beginR #1 \endR\hss}
+\else\@@line{#1\hss}\fi}
+
+\def\rightline#1{%
+\if@rl\@@line{\hss\beginR #1 \endR}
+\else\@@line{\hss#1}\fi}
+
+\newcommand*\settextfont[2][]{%
+\newfontfamily\persianfont[Script=Arabic,Mapping=parsidigits,#1]{#2}
+\let\rmdefault\zf@family
+ \normalfont
+}
+\newcommand*\setromantextfont[2][]{%
+\newfontfamily\rmfamily[Mapping=tex-text,#1]{#2}
+}
+
+
+\newcommand*\defpersianfont[1]{%
+ \@ifnextchar[{\defpersianfont@i#1}{\defpersianfont@i#1[]}}
+\def\defpersianfont@i#1[#2]#3{%
+ \zf@fontspec{Script=Arabic,Mapping=parsidigits,#2}{#3}%
+ \edef\@tempa{%
+ \noexpand\DeclareRobustCommand\noexpand#1
+ {\noexpand\fontfamily{\zf@family}\noexpand\selectfont}}%
+ \@tempa}
+
+
+
+
+
+\newcommand*\defromanfont[1]{%
+ \@ifnextchar[{\defromanfont@i#1}{\defromanfont@i#1[]}}
+\def\defromanfont@i#1[#2]#3{%
+ \zf@fontspec{Mapping=tex-text,#2}{#3}%
+ \edef\@tempa{%
+ \noexpand\DeclareRobustCommand\noexpand#1
+ {\noexpand\fontfamily{\zf@family}\noexpand\selectfont}}%
+ \@tempa}
+
+
+
\def\ps@plain{\ps@empty
- \def\@oddfoot{\hfil\farsifont\thepage\hfil}%
+ \def\@oddfoot{\hfil\thepage\hfil}%
\let\@evenfoot\@oddfoot
\let\@oddhead\@empty\let\@evenhead\@empty
}
-\AtBeginDocument{\setRL\farsifont\addfontfeature{Mapping=parsidigits}}
-
-
-%To convert the MILADI date to SHAMSI date, taken from farsitex
\newif\ifFT@leap \newif\ifFT@kabiseh
\newcount\FT@i \newcount\FT@y \newcount\FT@m \newcount\FT@d
-\newcount\FT@latini \newcount\FT@farsii
-\newcount\FT@latinii \newcount\FT@farsiii
-\newcount\FT@latiniii \newcount\FT@farsiiii
-\newcount\FT@latiniv \newcount\FT@farsiiv
-\newcount\FT@latinv \newcount\FT@farsiv
-\newcount\FT@latinvi \newcount\FT@farsivi
-\newcount\FT@latinvii \newcount\FT@farsivii
-\newcount\FT@latinviii \newcount\FT@farsiviii
-\newcount\FT@latinix \newcount\FT@farsiix
-\newcount\FT@latinx \newcount\FT@farsix
-\newcount\FT@latinxi \newcount\FT@farsixi
-\newcount\FT@latinxii \newcount\FT@farsixii
- \newcount\FT@farsixiii
+\newcount\FT@latini \newcount\FT@persiani
+\newcount\FT@latinii \newcount\FT@persianii
+\newcount\FT@latiniii \newcount\FT@persianiii
+\newcount\FT@latiniv \newcount\FT@persianiv
+\newcount\FT@latinv \newcount\FT@persianv
+\newcount\FT@latinvi \newcount\FT@persianvi
+\newcount\FT@latinvii \newcount\FT@persianvii
+\newcount\FT@latinviii \newcount\FT@persianviii
+\newcount\FT@latinix \newcount\FT@persianix
+\newcount\FT@latinx \newcount\FT@persianx
+\newcount\FT@latinxi \newcount\FT@persianxi
+\newcount\FT@latinxii \newcount\FT@persianxii
+ \newcount\FT@persianxiii
\newcount\FT@temp
\newcount\FT@temptwo
@@ -120,7 +205,7 @@
\fi
%
% --BE
-% In fact farsii is equal to the Leap years from a fixed year to the last
+% In fact persiani is equal to the Leap years from a fixed year to the last
% year minus the Kabise years from a fixed year to the last year plus a const.
%
\FT@tempthree=\FT@y % Number of Leap years
@@ -146,25 +231,25 @@
\divide\FT@tempthree by 4\relax % T := T - ((SY+10) mod 33) div 4
\advance\FT@temp by -\FT@tempthree
\advance\FT@temp by -137 % T := T - 137 Adjust the value
-\FT@farsii=31
-\advance\FT@farsii by -\FT@temp % now 31 - T is the farsii
+\FT@persiani=31
+\advance\FT@persiani by -\FT@temp % now 31 - T is the persiani
%
-\FT@farsiii = 30\relax
+\FT@persianii = 30\relax
\ifFT@kabiseh
- \FT@farsiiii = 30\relax
+ \FT@persianiii = 30\relax
\else
- \FT@farsiiii = 29\relax
+ \FT@persianiii = 29\relax
\fi
-\FT@farsiiv = 31\relax
-\FT@farsiv = 31\relax
-\FT@farsivi = 31\relax
-\FT@farsivii = 31\relax
-\FT@farsiviii= 31\relax
-\FT@farsiix = 31\relax
-\FT@farsix = 30\relax
-\FT@farsixi = 30\relax
-\FT@farsixii = 30\relax
-\FT@farsixiii= 30\relax
+\FT@persianiv = 31\relax
+\FT@persianv = 31\relax
+\FT@persianvi = 31\relax
+\FT@persianvii = 31\relax
+\FT@persianviii= 31\relax
+\FT@persianix = 31\relax
+\FT@persianx = 30\relax
+\FT@persianxi = 30\relax
+\FT@persianxii = 30\relax
+\FT@persianxiii= 30\relax
%
\FT@dn= 0\relax
\FT@sn= 0\relax
@@ -181,11 +266,11 @@
\advance \FT@dn by \FT@d
%
\FT@i=1\relax
-\FT@sn = \FT@farsii
+\FT@sn = \FT@persiani
\ifnum \FT@sn<\FT@dn
\loop
\advance \FT@i by 1\relax
-\advance\FT@sn by \csname FT@farsi\romannumeral\the\FT@i\endcsname
+\advance\FT@sn by \csname FT@persian\romannumeral\the\FT@i\endcsname
\ifnum \FT@sn<\FT@dn \repeat
\fi
\ifnum \FT@i < 4
@@ -195,19 +280,19 @@
\FT@m = \FT@i \advance \FT@m by -3\relax
\advance \FT@y by -621\relax
\fi
-\advance\FT@sn by -\csname FT@farsi\romannumeral\the\FT@i%
+\advance\FT@sn by -\csname FT@persian\romannumeral\the\FT@i%
\endcsname
\ifnum\FT@i = 1
- \FT@d = \FT@dn \advance \FT@d by 30 \advance\FT@d by -\FT@farsii
+ \FT@d = \FT@dn \advance \FT@d by 30 \advance\FT@d by -\FT@persiani
\else
\FT@d = \FT@dn \advance \FT@d by -\FT@sn
\fi
\beginL\number\FT@d\endL\space%
%Changedc from here YJ
-\farsimonth{\FT@m}\space\beginL\number\FT@y\endL%
+\persianmonth{\FT@m}\space\beginL\number\FT@y\endL%
}
-% added \farsimonth YJ
-\def\farsimonth#1{\ifcase#1\or فروردین\or
+% added \persianmonth YJ
+\def\persianmonth#1{\ifcase#1\or فروردین\or
اردیبهشت\or
خرداد\or تیر\or
مرداد\or
@@ -216,48 +301,137 @@
دی\or بهمن\or
اسفند\fi}
-\def\normalfont{\farsifont}
-\def\today{\ftoday}
-\let\@footnote=\footnote
-\def\footnote#1{\@footnote{\farsifont#1}}
-\let\@uthanks=\thanks
-\def\thanks#1{\@uthanks{\farsifont#1}}
-\let\@uframetitle=\frametitle
-\def\frametitle#1{\@uframetitle{\centerline{\farsifont#1}}}
-\let\@uframesubtitle=\framesubtitle
-\def\framesubtitle#1{\@uframesubtitle{\centerline{\farsifont#1}}}
-\let\@usubtitle=\subtitle
-\def\subtitle#1{\@usubtitle{\farsifont#1}}
-\let\@uinstitute=\institute
-\def\institute#1{\@uinstitute{\farsifont#1}}
-\let\@ucaption=\caption
-\def\caption#1{\@ucaption{\farsifont#1}}
-\let\@uleftmark=\leftmark
-\def\leftmark{\beginR\farsifont\@uleftmark\endR}
-\let\@urightmark=\rightmark
-\def\rightmark{\beginR\farsifont\@urightmark\endR}
-
-
-
-
-\renewcommand{\thefootnote}{\arabic{footnote}}
-\renewcommand{\thefigure}{\arabic{figure}}
-\renewcommand{\thetable}{\arabic{table}}
-\renewcommand{\theequation}{\arabic{equation}}
-
-
-\renewcommand{\figurename}{\farsifont شکل}
-\renewcommand{\tablename}{\farsifont جدول}
-\renewcommand{\contentsname}{فهرست مطالب}
-\renewcommand{\listfigurename}{لیست تصاویر}
-\renewcommand{\listtablename}{لیست جداول}
-\renewcommand{\appendixname}{پیوست}
-\renewcommand{\indexname}{نمایه}
+
+\let\originaltoday=\today
+\def\today{\lr{\originaltoday}}
+\let\romantoday\today
+\def\today{\rl{\ftoday}}
+\def\leftmark{\RL{\expandafter\@leftmark\botmark\@empty\@empty}}
+\def\rightmark{\RL{\expandafter\@rightmark\firstmark\@empty\@empty}}
+
+
+\newcommand\twocolumnstableofcontents{%
+ \begin{multicols}{2}[\section*{\contentsname}]%
+ \small
+ \@starttoc{toc}%
+ \end{multicols}}
+
+\def\rcases#1{\left.\vcenter{\normalbaselines\m@th
+ \ialign{$##\hfil$&\quad{##}\hfil\crcr#1\crcr}}\,\right\}}
+
+
+\def\thefootnote{\arabic{footnote}}
+\def\thefigure{\arabic{figure}}
+\def\thetable{\arabic{table}}
+\def\theequation{\arabic{equation}}
+
+\def\figurename{\@ensure@RL{شکل}}
+\def\tablename{\@ensure@RL{جدول}}
+\def\contentsname{\@ensure@RL{فهرست مطالب}}
+\def\listfigurename{\@ensure@RL{لیست تصاویر}}
+\def\listtablename{\@ensure@RL{لیست جداول}}
+\def\appendixname{\@ensure@RL{پیوست}}
+\def\indexname{\@ensure@RL{نمایه}}
+\def\refname{\@ensure@RL{مراجع}}
+\def\abstractname{\@ensure@RL{چکیده}}
+\def\partname{\@ensure@RL{بخش}}
+\def\datename{\@ensure@RL{تاریخ:}}
+\def\bibname{\@ensure@RL{کتاب‌نامه}}
+\def\chaptername{\@ensure@RL{فصل}}
+\def\ccname{\@ensure@RL{رونوشت}}
+\def\enclname{\@ensure@RL{پیوست}}
+\def\pagename{\@ensure@RL{صفحه}}
+\def\headtoname{\@ensure@RL{به}}
+\def\proofname{\@ensure@RL{اثبات}}
+
+
+\def\reflect#1{{\setbox0=\hbox{#1}\rlap{\kern0.5\wd0
+ \special{x:gsave}\special{x:scale -1 1}}\box0 \special{x:grestore}}}
+\def\XePersian{\leavevmode$\smash{\hbox{X\lower.5ex
+ \hbox{\kern-.125em\reflect{E}}Persian}}$}
+
+
+
+
+
+\renewenvironment{equation}{%
+\beginL
+ \incr@eqnum
+ \mathdisplay@push
+ \st@rredfalse \global\@eqnswtrue
+ \mathdisplay{equation}%
+}{%
+ \endmathdisplay{equation}%
+ \mathdisplay@pop
+ \ignorespacesafterend
+}
+
+
+\newif\if@RomanBibNum
+\def\@@number#1{\ifmmode\else\beginL\fi{\if@RomanBibNum#1\else\persianfont#1\fi}\ifmmode\else\endL\fi}
+\def\RomanBibNum{\@RomanBibNumtrue}
+\def\PersianBibNum{\@RomanBibNumfalse}
+\@RomanBibNumtrue
+\DeclareOption{PersianBibNum}{\@RomanBibNumfalse}
+\def\@number{\protect\@@number}
+\let\@persian=\@arabic
+\let\@@arabic=\@arabic
+\let\@@alph=\@alph
+\let\@@Alph=\@Alph
+\def\@arabic#1{\ifmmode\else\@number{\@@arabic#1}\fi}
+\def\arabicnorl#1{\expandafter\@@arabic\csname c@#1\endcsname}
+\def\make@lr#1{\begingroup
+ \toks@=\expandafter{#1}%
+ \edef\x{\endgroup
+ \def\noexpand#1{\noexpand\@number{\the\toks@}}}%
+ \x}
+\def\@character#1{\ifcase#1\or الف\char"200D\or ب\or پ\or ت\or ث\or
+ج\or چ\or ح\or خ\or د\or ذ\or ر\or ز\or س\or ش\or ص\or ض\or ع\or غ\or
+ف\or ق\or ک\or گ\or ل\or م\or ن\or ه\or و\or ی\fi}
+
+
+\def\@harfi#1{\@character{\@@arabic#1}}
+
+\def\@numeric#1{\ifcase#1 \or یک\or دو\or سه\or چهار\or پنج\or شش\or هفت\or هشت\or نه\or ده\or یازده\or دوازده\or سیزده\or چهارده\or پانزده\or شانزده\or هفده\or هجده\or نوزده\or بیست\fi}
+\def\@adadi#1{\@numeric{\@@arabic#1}}
+
+\def\@@tartibi#1{\ifcase#1 \or اول \or دوم \or سوم \or چهارم \or پنجم \or ششم \or هفتم \or هشتم \or نهم \or دهم \or یازدهم \or دوازدهم \or سیزدهم \or چهاردهم \or پانزدهم \or شانزدهم \or هفدهم \or هجدهم \or نوزدهم \or بیستم\fi}
+\def\@tartibi#1{\@@tartibi{\@@arabic#1}}
+
+
+
+
+
+
+\let\@@text=\text
+\def\text#1{\@@text{\RL{#1}}}
+
+\def\tagform@#1{\maketag@@@{)\ignorespaces\text{#1}\unskip\@@italiccorr(}}
+\renewcommand{\eqref}[1]{\LR{\textup{\tagform@{\ref{#1}}}}}
\@ifclassloaded{article}{%
+\def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ {\parindent \z@ \raggedleft
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \Large\bfseries \partname\nobreakspace\thepart
+ \par\nobreak
+ \fi
+ \huge \bfseries #2%
+ \markboth{}{}\par}%
+ \nobreak
+ \vskip 3ex
+ \@afterheading}
\def\ps@plain{\ps@empty
- \def\@oddfoot{\hfil\rl\thepage\hfil}%
+ \def\@oddfoot{\hfil\thepage\hfil}%
\let\@evenfoot\@oddfoot
}
\renewenvironment{thebibliography}[1]
@@ -281,53 +455,55 @@
\if@twoside
\def\ps@headings{%
\let\@oddfoot\@empty\let\@evenfoot\@empty
- \def\@evenhead{\rl\leftmark\hfil\rl\thepage}%
- \def\@oddhead{\rl\thepage\hfil\rl\rightmark}%
+ \def\@evenhead{\sl\RL{\leftmark}\hfil\thepage}%
+ \def\@oddhead{\sl\thepage\hfil\RL{\rightmark}}%
\let\@mkboth\markboth
\def\sectionmark##1{%
\markboth {\MakeUppercase{%
\ifnum \c@secnumdepth >\z@
\thesection\quad
\fi
- \rl{##1}}}{}}%
+ \RL{##1}}}{}}%
\def\subsectionmark##1{%
\markright {%
\ifnum \c@secnumdepth >\@ne
- \rl{\thesubsection\quad}
+ \RL{\thesubsection\quad}
\fi
- \rl{##1}}}}
+ \RL{##1}}}}
\else
\def\ps@headings{%
\let\@oddfoot\@empty
- \def\@oddhead{\rl\thepage\hfil\rl\rightmark}%
+ \def\@oddhead{\sl\thepage\hfil\RL{\rightmark}}%
\let\@mkboth\markboth
\def\sectionmark##1{%
\markright {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
- \rl{\thesection\quad}
+ \RL{\thesection\quad}
\fi
- \rl{##1}}}}}
+ \RL{##1}}}}}
\fi
\def\ps@myheadings{%
\let\@oddfoot\@empty\let\@evenfoot\@empty
- \def\@evenhead{\rl\thepage\hfil\rl\leftmark}%
- \def\@oddhead{\rl\rightmark\hfil\rl\thepage}%
+ \def\@evenhead{\sl\thepage\hfil\RL{\leftmark}}%
+ \def\@oddhead{\sl\RL{\rightmark}\hfil\thepage}%
\let\@mkboth\@gobbletwo
\let\sectionmark\@gobble
\let\subsectionmark\@gobble
}
\pagestyle{plain}
-\renewcommand{\refname}{مراجع}
-\renewcommand{\abstractname}{چکیده}
+\renewcommand \thepart {\@tartibi\c@part}
\renewcommand\appendix{\par
\setcounter{section}{0}%
\setcounter{subsection}{0}%
\gdef\thesection{\@harfi\c@section}}
}{}
+
+
+
\@ifclassloaded{amsart}{%
-\let\oldleftskip=\leftskip
-\let\leftskip=\rightskip
-\let\rightskip=\oldleftskip
+\def\part{\@startsection{part}{0}%
+ \z@{\linespacing\@plus\linespacing}{.5\linespacing}%
+ {\normalfont\bfseries\raggedleft}}
\renewenvironment{thebibliography}[1]{%
\@bibtitlestyle
\normalfont\bibliofont\labelsep .5em\relax
@@ -342,15 +518,36 @@
\def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
\endlist
}
-\renewcommand{\datename}{\rl{تاریخ:}}
-\renewcommand{\refname}{مراجع}
-\renewcommand{\abstractname}{چکیده}
+\renewcommand \thepart {\@tartibi\c@part}
\renewcommand\appendix{\par
\setcounter{section}{0}%
\setcounter{subsection}{0}%
\gdef\thesection{\@harfi\c@section}}
}{}
+
+
+
\@ifclassloaded{report}{%
+\def\@makechapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedleft \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \huge\bfseries \@chapapp\space \thechapter
+ \par\nobreak
+ \vskip 20\p@
+ \fi
+ \interlinepenalty\@M
+ \Huge \bfseries #1\par\nobreak
+ \vskip 40\p@
+ }}
+\def\@makeschapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedleft
+ \normalfont
+ \interlinepenalty\@M
+ \Huge \bfseries #1\par\nobreak
+ \vskip 40\p@
+ }}
\renewenvironment{thebibliography}[1]
{\chapter*{\bibname}%
\@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
@@ -373,47 +570,44 @@
\if@twoside
\def\ps@headings{%
\let\@oddfoot\@empty\let\@evenfoot\@empty
- \def\@evenhead{\rl\thepage\hfil\rl\leftmark}%
- \def\@oddhead{\rl\rightmark\hfil\rl\thepage}%
+ \def\@evenhead{\sl\thepage\hfil\RL{\leftmark}}%
+ \def\@oddhead{\sl\RL{\rightmark}\hfil\thepage}%
\let\@mkboth\markboth
\def\chaptermark##1{%
\markboth {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
- \rl{\@chapapp\ \thechapter. \ }%
+ \RL{\@chapapp\ \thechapter. \ }%
\fi
- \rl{##1}}}{}}%
+ \RL{##1}}}{}}%
\def\sectionmark##1{%
\markright {\MakeUppercase{%
\ifnum \c@secnumdepth >\z@
- \rl{\thesection. \ }%
+ \RL{\thesection. \ }%
\fi
- \rl{##1}}}}}
+ \RL{##1}}}}}
\else
\def\ps@headings{%
\let\@oddfoot\@empty
- \def\@oddhead{\rl\rightmark\hfil\rl\thepage}%
+ \def\@oddhead{\sl\RL{\rightmark}\hfil\thepage}%
\let\@mkboth\markboth
\def\chaptermark##1{%
\markright {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
- \rl{\@chapapp\ \thechapter. \ }%
+ \RL{\@chapapp\ \thechapter. \ }%
\fi
- \rl{##1}}}}}
+ \RL{##1}}}}}
\fi
\def\ps@myheadings{%
\let\@oddfoot\@empty\let\@evenfoot\@empty
- \def\@evenhead{\rl\thepage\hfil\rl\leftmark}%
- \def\@oddhead{rl\rightmark\hfil\rl\thepage}%
+ \def\@evenhead{\sl\thepage\hfil\RL{\leftmark}}%
+ \def\@oddhead{\sl\RL{\rightmark}\hfil\thepage}%
\let\@mkboth\@gobbletwo
\let\chaptermark\@gobble
\let\sectionmark\@gobble
}
\pagestyle{plain}
-\renewcommand{\bibname}{مراجع}
-\renewcommand{\abstractname}{چکیده}
-\renewcommand{\chaptername}{فصل}
-\renewcommand{\partname}{بخش}
-%to make appendix numbering farsi
+\renewcommand \thepart {\@tartibi\c@part}
+%to make appendix numbering Persian
\renewcommand\appendix{\par
\setcounter{chapter}{0}%
\setcounter{section}{0}%
@@ -421,6 +615,100 @@
\gdef\thechapter{\@harfi\c@chapter}
}%end appendix
}{}
+
+
+
+\@ifclassloaded{xepersian-thesis}{%
+\def\@makechapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedleft \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \huge\bfseries \@chapapp\space \thechapter
+ \par\nobreak
+ \vskip 20\p@
+ \fi
+ \interlinepenalty\@M
+ \Huge \bfseries #1\par\nobreak
+ \vskip 40\p@
+ }}
+\def\@makeschapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedleft
+ \normalfont
+ \interlinepenalty\@M
+ \Huge \bfseries #1\par\nobreak
+ \vskip 40\p@
+ }}
+\renewenvironment{thebibliography}[1]
+ {\chapter*{\bibname}%
+ \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
+ \list{\@biblabel{\@arabic\c@enumiv}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \rightmargin\labelwidth
+ \advance\rightmargin\labelsep
+ \@openbib@code
+ \usecounter{enumiv}%
+ \let\p@enumiv\@empty
+ \renewcommand\theenumiv{\@arabic\c@enumiv}}%
+ \sloppy
+ \clubpenalty4000
+ \@clubpenalty \clubpenalty
+ \widowpenalty4000%
+ \sfcode`\.\@m}
+ {\def\@noitemerr
+ {\@latex@warning{Empty `thebibliography' environment}}%
+ \endlist}
+\if@twoside
+ \def\ps@headings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\sl\thepage\hfil\RL{\leftmark}}%
+ \def\@oddhead{\sl\RL{\rightmark}\hfil\thepage}%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markboth {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \RL{\@chapapp\ \thechapter. \ }%
+ \fi
+ \RL{##1}}}{}}%
+ \def\sectionmark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\z@
+ \RL{\thesection. \ }%
+ \fi
+ \RL{##1}}}}}
+\else
+ \def\ps@headings{%
+ \let\@oddfoot\@empty
+ \def\@oddhead{\sl\RL{\rightmark}\hfil\thepage}%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markright {\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \RL{\@chapapp\ \thechapter. \ }%
+ \fi
+ \RL{##1}}}}}
+\fi
+\def\ps@myheadings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\sl\thepage\hfil\RL{\leftmark}}%
+ \def\@oddhead{\sl\RL{\rightmark}\hfil\thepage}%
+ \let\@mkboth\@gobbletwo
+ \let\chaptermark\@gobble
+ \let\sectionmark\@gobble
+ }
+\pagestyle{plain}
+\renewcommand \thepart {\@tartibi\c@part}
+%to make appendix numbering persian
+\renewcommand\appendix{\par
+ \setcounter{chapter}{0}%
+ \setcounter{section}{0}%
+ \gdef\@chapapp{\appendixname}%
+ \gdef\thechapter{\@harfi\c@chapter}
+}%end appendix
+}{}
+
+
+
\@ifclassloaded{amsbook}{%
\renewenvironment{thebibliography}[1]{%
\@bibtitlestyle
@@ -436,27 +724,99 @@
\def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
\endlist
}
-\let\oldleftskip=\leftskip
-\let\leftskip=\rightskip
-\let\rightskip=\oldleftskip
\def\frontmatter{\cleardoublepage\pagenumbering{harfi}}
-\renewcommand{\bibname}{کتاب‌نامه }
-\renewcommand{\chaptername}{فصل}
-\renewcommand{\partname}{بخش}
-%to make appendix numbering farsi
+\renewcommand \thepart {\@tartibi\c@part}
+%to make appendix numbering persian
\renewcommand\appendix{\par
\setcounter{chapter}{0}%
\setcounter{section}{0}%
\gdef\@chapapp{\appendixname}%
\gdef\thechapter{\@harfi\c@chapter}
}%end appendix
+\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
+\columnseprule\z@ \columnsep 35\p@
+\@indextitlestyle
+\thispagestyle{plain}%
+\let\item\@idxitem
+\parindent\z@ \parskip\z@\@plus.3\p@\relax
+\raggedleft
+\hyphenpenalty\@M
+\footnotesize}
+
+\def\@idxitem{\par\hangindent -2em}
+\def\subitem{\par\hangindent -2em\hspace*{1em}}
+\def\subsubitem{\par\hangindent -3em\hspace*{2em}}
}{}
+
+
+
\@ifclassloaded{bookest}{%
+\AtBeginDocument{
+\def\@makechapterhead#1{%
+ \vspace*{20\p@}
+ {\parindent \z@ \raggedleft \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ {\colorA\huge\scshape \@chapapp\space \thechapter}
+ \par\nobreak
+ \vskip 10\p@
+ \fi
+ \fi
+ \interlinepenalty\@M
+ {\colorB\hrule}
+ \vskip 15\p@
+ \begin{flushleft}
+ {\colorA\Huge \bfseries #1}\par\nobreak
+ \end{flushleft}
+ \vskip 5\p@
+ {\colorB\hrule}
+ \vskip 30\p@
+ }}
+\def\@makeschapterhead#1{%
+ \vspace*{20\p@}
+ {\parindent \z@ \raggedright \normalfont
+ {\colorB\hrule}
+ \vskip 15\p@
+ \begin{center}
+ {\colorA\Huge \bfseries #1}\par\nobreak
+ \end{center}
+ \vskip 5\p@
+ {\colorB\hrule}
+ \vskip 30\p@
+ }}
+\renewcommand{\setevenhead}[1]{\def\@evenhead{#1}}
+\renewcommand{\setoddhead}[1]{\def\@oddhead{#1}}
+\renewcommand{\setevenfoot}[1]{\def\@evenfoot{#1}}
+\renewcommand{\setoddfoot}[1]{\def\@oddfoot{#1}}
+\renewcommand{\oddheadtext}{{\colorA{\slshape\rightmark}\hfill\thepage}}
+\renewcommand{\setoddheadtext}[1]{\renewcommand{\oddheadtext}{#1}}
+\renewcommand{\evenheadtext}{\oddheadtext}
+\renewcommand{\setevenheadtext}[1]{\renewcommand{\evenheadtext}{#1}}
+\renewcommand{\evenfoottext}{}
+\renewcommand{\setevenfoottext}[1]{\renewcommand{\evenfoottext}{#1}}
+\renewcommand{\oddfoottext}{}
+\renewcommand{\setoddfoottext}[1]{\renewcommand{\oddfoottext}{#1}}
+\renewcommand{\setleftmark}[1]{\renewcommand{\leftmark}{#1}}
+\renewcommand{\setrightmark}[1]{\renewcommand{\rightmark}{#1}}
+\renewcommand{\makeheadrule}{{\colorB\hrule\@width\textwidth \@height 0.4pt \vskip-0.4pt}}
+\renewcommand{\makefootrule}{\makeheadrule}
+\if@twoside
+ \setevenheadtext{{\colorA\thepage\hfill\slshape\leftmark}}
+\fi
+\setevenhead{\vbox{\evenheadtext \vskip 5\p@ \makeheadrule}}
+\setoddhead{\vbox{\oddheadtext \vskip 5\p@ \makeheadrule}}
+\let\UCase\MakeUppercase
+\renewcommand{\MakeUppercase}{}
+\def\ps@plain{%
+ \def\@oddfoot{{\hfil\colorA\thepage\hfil}}
+ \def\@evenfoot{{\hfil\colorA\thepage\hfil}}
+ \let\@oddhead\@empty
+ \let\@evenhead\@empty
+}
+}
\NoHyper
-\renewcommand{\bibname}{کتاب‌نامه }
-\renewcommand{\chaptername}{فصل}
-\renewcommand{\partname}{بخش}
-%to make appendix numbering farsi
+\renewcommand \thepart {\@tartibi\c@part}
+%to make appendix numbering persian
\renewcommand\appendix{\par
\setcounter{chapter}{0}%
\setcounter{section}{0}%
@@ -464,7 +824,31 @@
\gdef\thechapter{\@harfi\c@chapter}
}%end appendix
}{}
+
+
\@ifclassloaded{book}{%
+\def\@makechapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedleft \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \huge\bfseries \@chapapp\space \thechapter
+ \par\nobreak
+ \vskip 20\p@
+ \fi
+ \fi
+ \interlinepenalty\@M
+ \Huge \bfseries #1\par\nobreak
+ \vskip 40\p@
+ }}
+\def\@makeschapterhead#1{%
+ \vspace*{50\p@}%
+ {\parindent \z@ \raggedleft
+ \normalfont
+ \interlinepenalty\@M
+ \Huge \bfseries #1\par\nobreak
+ \vskip 40\p@
+ }}
\renewenvironment{thebibliography}[1]
{\chapter*{\bibname}%
\@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
@@ -491,7 +875,7 @@
\renewcommand\mainmatter{%
\cleardoublepage
\@mainmattertrue
- \pagenumbering{farsi}}
+ \pagenumbering{persian}}
\renewcommand\backmatter{%
\if@openright
\cleardoublepage
@@ -503,40 +887,40 @@
\if@twoside
\def\ps@headings{%
\let\@oddfoot\@empty\let\@evenfoot\@empty
- \def\@evenhead{\rl\rightmark\hfil\rl\thepage}%
- \def\@oddhead{\rl\thepage\hfil\rl\leftmark}%
+ \def\@evenhead{\sl\RL{\rightmark}\hfil\thepage}%
+ \def\@oddhead{\sl\thepage\hfil\RL{\leftmark}}%
\let\@mkboth\markboth
\def\chaptermark##1{%
\markboth {\MakeUppercase{%
- \rl{\@chapapp\ \thechapter.\,\,}%
+ \RL{\@chapapp\ \thechapter.\,\,}%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
- \rl{##1}
+ \RL{##1}
\fi
\fi
}}{}}%
\def\ps@plain{\ps@empty
- \def\@oddfoot{\hfil\rl\thepage\hfil}%
+ \def\@oddfoot{\hfil\thepage\hfil}%
\let\@evenfoot\@oddfoot
}
\def\sectionmark##1{%
\markright {\MakeUppercase{%
- \rl{\thesection}\,
+ \RL{\thesection}\,
\ifnum \c@secnumdepth >\z@
- \rl{##1} \ %
+ \RL{##1} \ %
\fi
}}}}
\else
\def\ps@headings{%
\let\@oddfoot\@empty
- \def\@oddhead{\rl\thepage\hfil\rl\rightmark}%
+ \def\@oddhead{\sl\thepage\hfil\RL{\rightmark}}%
\let\@mkboth\markboth
\def\chaptermark##1{%
\markright {\MakeUppercase{%
- \rl{\@chapapp\ \thechapter. } %
+ \RL{\@chapapp\ \thechapter. } %
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
- \rl{##1}
+ \RL{##1}
\fi
\fi
}}}}
@@ -544,22 +928,22 @@
\fi
\pagestyle{headings}
-\renewcommand{\bibname}{کتاب‌نامه }
-\renewcommand{\chaptername}{فصل}
-\renewcommand{\partname}{بخش}
-%to make appendix numbering farsi
+
+\renewcommand \thepart {\@tartibi\c@part}
+%to make appendix numbering Persian
\renewcommand\appendix{\par
\setcounter{chapter}{0}%
\setcounter{section}{0}%
\gdef\@chapapp{\appendixname}%
\gdef\thechapter{\@harfi\c@chapter}
}%end appendix
+\def\@idxitem{\par\hangindent -40\p@}
}{}
+
+
\@ifclassloaded{refrep}{%
-\renewcommand{\bibname}{کتاب‌نامه }
-\renewcommand{\chaptername}{فصل}
-\renewcommand{\partname}{بخش}
-%to make appendix numbering farsi
+\renewcommand \thepart {\@tartibi\c@part}
+%to make appendix numbering Persian
\renewcommand\appendix{\par
\setcounter{chapter}{0}%
\setcounter{section}{0}%
@@ -569,72 +953,360 @@
}{}
-
-%We redefine arabic counter style
-\def\@@number#1{\ifmmode\else\beginL\fi{\farsifont #1}\ifmmode\else\endL\fi}
-\def\@@latin#1{\@@number{{\@fromrl#1}}}
-\def\@number{\protect\@@number}
-\def\@latin{\protect\@@latin}
-\let\@farsi=\@arabic
-\let\@@arabic=\@arabic
-\let\@@roman=\@roman
-\let\@@Roman=\@Roman
-\let\@@alph=\@alph
-\let\@@Alph=\@Alph
-\def\@arabic#1{\ifmmode\else\@number{\@@arabic#1}\fi}
-\def\@Roman#1{\@latin{\@@Roman#1}}
-\def\arabicnorl#1{\expandafter\@@arabic\csname c@#1\endcsname}
-\def\make@lr#1{\begingroup
- \toks@=\expandafter{#1}%
- \edef\x{\endgroup
- \def\noexpand#1{\noexpand\@number{\the\toks@}}}%
- \x}
-\def\@character#1{\ifcase#1\or الف\or ب\or پ\or ت\or ث\or ج\or چ\or ح\or خ\or د\or ذ\or ر\or ز\or س\or ش\or ص\or ض\or ع\or غ\or ف\or ق\or ک\or گ\or ل\or م\or ن\or ه\or و\or ی\fi}
-
-\def\@harfi#1{\farsifont\@character{\@@arabic#1}}
-
-\def\@numeric#1{\ifcase#1 \or یک\or دو\or سه\or چهار\or پنج\or شش\or هفت\or هشت\or نه\or ده\or یازده\or دوازده\or سیزده\or چهارده\or پانزده\or شانزده\or هفده\or هجده\or نوزده\or بیست\fi}
-\def\@adadi#1{\farsifont\@numeric{\@@arabic#1}}
-
-%The figure or table caption
-\newsavebox\@Arabitempboxa
-\long\def\@makecaption#1#2{%
- \vskip\abovecaptionskip
- \sbox\@Arabitempboxa{\beginR #1: #2\endR}%
- \ifdim \wd\@Arabitempboxa >\hsize
- \beginR #1: #2\endR\par
+\@ifclassloaded{beamer}{%
+\def\familydefault{\rmdefault}
+\raggedleft
+\def\LTR{\bgroup\par\raggedright\@rlfalse}
+\def\endLTR{\par\egroup}
+\def\RTL{\bgroup\par\raggedleft\@rltrue}
+\def\endRTL{\par\egroup}
+\def\roman{\bgroup\par\raggedright\@rlfalse\rmfamily}
+\def\endroman{\par\egroup}
+\def\persian{\bgroup\par\raggedleft\@rltrue\persianfont}
+\def\endpersian{\par\egroup}
+\long\def\beamer@@frametitle[#1]#2{%
+ \beamer@ifempty{#2}{}{%
+ \gdef\insertframetitle{\raggedleft\rightskip=2em{\RL{#2}\ifnum\beamer@autobreakcount>0\relax{}\space\usebeamertemplate*{frametitle continuation}\fi}}%
+ \gdef\beamer@frametitle{\RL{#2}}%
+ \gdef\beamer@shortframetitle{\RL{#1}}%
+}%
+}
+\def\@thm#1#2#3{%
+ \ifhmode\unskip\unskip\par\fi
+ \normalfont
+ \let\thmheadnl\relax
+ \let\thm@swap\@gobble
+ \thm@headpunct{.}% add period after heading
+ \thm@space@setup
+ #1% style overrides
+ \def\inserttheoremname{#3}
+ \def\inserttheorempunctuation{\the\thm@headpunct}
+ \def\@tempa{#2}%
+ \ifx\@empty\@tempa
+ \def\inserttheoremnumber{}
\else
- \global \@minipagefalse
- \hb@xt@\hsize{\hfil\box\@Arabitempboxa\hfil}%
+ \refstepcounter{#2}%
+ \expandafter\def\expandafter\inserttheoremnumber\expandafter{ \csname the#2\endcsname}
\fi
- \vskip\belowcaptionskip}
+ \beamer@begintheorem%
+\raggedleft\@rltrue
+}
+ \ifbeamer@countsect
+ \newtheorem{قضیه}{\raggedleft قضیه}[section]
+ \else
+ \newtheorem{قضیه}{\raggedleft قضیه}
+ \fi
+ \newtheorem{نتیجه}[theorem]{\raggedleft نتیجه}
+ \newtheorem{حقیقت}[theorem]{\raggedleft حقیقت}
+ \newtheorem{لما}[theorem]{\raggedleft لما}
+ \newtheorem{مسئله}[theorem]{\raggedleft مسئله}
+ \newtheorem{پاسخ}[theorem]{\raggedleft پاسخ}
+\theoremstyle{definition}
+ \newtheorem{تعریف}[theorem]{\raggedleft تعریف}
+ \newtheorem{تعریفها}[theorem]{\raggedleft تعریف‌ها}
+\theoremstyle{example}
+ \newtheorem{مثال}[theorem]{\raggedleft مثال}
+ \newtheorem{مثالها}[theorem]{\raggedleft مثال‌ها}
+\newenvironment<>{اثبات}[1][\raggedleft اثبات]{%
+ \par
+ \def\insertproofname{#1\@addpunct{}}%
+ \pushQED{\qed}
+ \usebeamertemplate{proof begin}\@rltrue#2}
+{\popQED\usebeamertemplate{proof end}}
+ \newenvironment<>{بلوک}[1]{%
+ \begin{actionenv}#2%
+ \def\insertblocktitle{\raggedleft#1}%
+ \par%
+ \usebeamertemplate{block begin}\raggedleft\@rltrue}
+ {\par%
+ \usebeamertemplate{block end}%
+ \end{actionenv}}
+ \newenvironment<>{بلوک‌هشدار}[1]{%
+ \begin{actionenv}#2%
+ \def\insertblocktitle{\raggedleft#1}%
+ \par%
+ \mode<presentation>{%\usebeamerfont{block}%
+ \setbeamercolor{local structure}{parent=alerted text}}%
+ \usebeamertemplate{block alerted begin}\raggedleft\@rltrue}
+ {\par%
+ \usebeamertemplate{block alerted end}%
+ \end{actionenv}}
+ \newenvironment<>{بلوک‌مثال}[1]{%
+ \begin{actionenv}#2%
+ \def\insertblocktitle{\raggedleft#1}%
+ \par%
+ \mode<presentation>{%\usebeamerfont{block}%
+ \setbeamercolor{local structure}{parent=example text}}%
+ \usebeamertemplate{block example begin}\raggedleft\@rltrue}
+ {\par%
+ \usebeamertemplate{block example end}%
+ \end{actionenv}}
+\def\beamer@enum@{%
+ \beamer@computepref\@itemdepth% sets \beameritemnestingprefix
+ \usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
+ \usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
+ \usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
+ \expandafter
+ \list
+ {\usebeamertemplate{\beamer@enumtempl}}
+ {\usecounter\@enumctr%
+ \def\makelabel##1{{\hss\llap{{%
+ \usebeamerfont*{enumerate \beameritemnestingprefix item}%
+ \usebeamercolor[fg]{enumerate \beameritemnestingprefix item}##1}}}}}%
+ \beamer@cramped%
+ \raggedleft\rightskip=2em%
+ \beamer@firstlineitemizeunskip%
+}
+\renewcommand{\itemize}[1][]{%
+ \beamer@ifempty{#1}{}{\def\beamer@defaultospec{#1}}%
+ \ifnum \@itemdepth >2\relax\@toodeep\else
+ \advance\@itemdepth\@ne
+ \beamer@computepref\@itemdepth% sets \beameritemnestingprefix
+ \usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
+ \usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
+ \usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
+ \list
+ {\usebeamertemplate{itemize \beameritemnestingprefix item}}
+ {\def\makelabel##1{%
+ {%
+ \hss\llap{{%
+ \usebeamerfont*{itemize \beameritemnestingprefix item}%
+ \usebeamercolor[fg]{itemize \beameritemnestingprefix item}##1}}%
+ }%
+ }%
+ }
+ \fi%
+ \beamer@cramped%
+ \raggedleft\rightskip=2em%
+ \beamer@firstlineitemizeunskip%
+}
+\def\@@description{%
+ \advance\beamer@descdefault by \labelsep%
+ \list
+ {}
+ {\labelwidth\beamer@descdefault\leftmargin\beamer@descdefault\let\makelabel\beamer@descriptionitem}%
+ \beamer@cramped%
+ \raggedleft\rightskip=6em
+ \beamer@firstlineitemizeunskip%
+}
+\AtBeginDocument{\@rlfalse}
+\renewenvironment{beamer@frameslide}{%
+ \ifbeamer@autobreak\else%
+ \ifx\beamer@againname\@empty%
+ {\let\@elt\beamer@restorecounter\beamer@overlaycounterresets}%
+ \else%
+ {\let\@elt\beamer@labelrestorecounter\beamer@overlaycounterresets}%
+ \fi%
+ \fi%
+ \global\c@beamerpauses=1\relax%
+ \expandafter\beamer@ifempty\expandafter{\beamer@framestartpage}{%
+ \refstepcounter{subsectionslide}%
+ \xdef\beamer@framestartpage{\the\c@page}% only first time
+ }{\clearpage\beamer@notesactions}% cleanup from previous slide
+ \hypersetup{pdfpagetransition=R}%
+ \hypersetup{pdfpageduration=}%
+ \xdef\beamer@frameendpage{\the\c@page}% every time
+ \beamer@setuplinks%
+ \beamer@displaybreak%
+ \global\setbox\beamer@zoombox=\box\voidb@x%
+ \def\beamer@zoomer{}%
+ \beamer@slidehaszoomfalse%
+ \gdef\insertframetitle{}%
+ \gdef\insertframesubtitle{}%
+ \gdef\beamer@frametitle{}%
+ \gdef\beamer@shortframetitle{}%
+ \gdef\beamer@framesubtitle{}%
+ \let\beamer@startcomment=\beamer@startcommentinframe%
+ % Start slide:
+ \beamer@framenotesbegin\@rltrue%
+ \global\setbox\beamer@framebox=\vbox\bgroup%
+ \beamer@inframetrue%
+ \let\frame=\framelatex% inside frames, use LaTeX's \frame command
+ \begin{beamer@framepauses}%
+ \ifbeamer@shrink%
+ \hsize=\beamer@shrinkfactorinv\hsize%
+ \textwidth=\beamer@shrinkfactorinv\textwidth%
+ \linewidth=\beamer@shrinkfactorinv\linewidth%
+ \fi%
+ % Insert labels if necessary:
+ \ifx\beamer@againname\@empty\else%
+ \nointerlineskip\vbox to0pt{\vss%
+ \label<\the\beamer@slideinframe>{\beamer@againname<\the\beamer@slideinframe>}%
+ \ifnum\beamer@slideinframe=1\relax%
+ \label<1>{\beamer@againname}%
+ \fi%
+ }\nointerlineskip%
+ \fi%
+ \ifx\beamer@framehypertargets\@empty\else%
+ \nointerlineskip\vbox to0pt{\vss%
+ \beamer@framehypertargets%
+ \global\let\beamer@framehypertargets\@empty%
+ }\nointerlineskip%
+ \fi%
+ \vskip-\parskip\vbox{}%
+ \beamer@initfirstlineunskip%
+ \ifbeamer@plainframe\nointerlineskip\fi%
+ \beamer@checkframetitle}%
+ {\end{beamer@framepauses}%
+ \egroup%
+ \ifx\beamer@frametitle\@empty%
+ \setbox\beamer@frametitlebox=\box\voidb@x%
+ \else%
+ \setbox\beamer@frametitlebox=\vbox{%
+ \vbox{}%
+ {\parskip0pt\usebeamertemplate***{frametitle}\vskip0.25em}%
+ }%
+ \fi%
+ \ifbeamer@plainframe%
+ \beamer@frametextheight=\paperheight%
+ \else%
+ \beamer@frametextheight=\textheight%
+ \fi%
+ \advance\beamer@frametextheight by-\ht\beamer@frametitlebox%
+ \advance\beamer@frametextheight by-\dp\beamer@frametitlebox%
+ \advance\beamer@frametextheight by-\beamer@frametopskip%
+ \ifbeamer@shrink%
+ \beamer@shrinkframebox%
+ \fi%
+ \ifx\beamer@zoomer\@empty
+ \setbox\beamer@framebox=\vbox{%
+ \nobreak\vbox{}\nobreak\par\nobreak\beamer@entrycode\nobreak%
+ \nointerlineskip\unvbox\beamer@frametitlebox%
+ \nobreak%
+ \ifbeamer@autobreak%
+ \vskip\beamer@frametopskipautobreak%
+ \else%
+ \vskip\beamer@frametopskip%
+ \fi%
+ \nobreak%
+ \nointerlineskip\box\beamer@zoombox\nointerlineskip%
+ \nobreak%
+ \ifbeamer@slidehaszoom\box\beamer@framebox\else\unvbox\beamer@framebox\fi%
+ % bottom skip is added in autobreakframebox
+ }%
+ \beamer@autobreakframebox%
+ \else%
+ \beamer@zoomer%
+ \fi%
+ \beamer@undolabels%
+ \beamer@framenotesend%
+ \box\beamer@framebox}
+\long\def\beamer@title[#1]#2{%
+ \def\inserttitle{\RL{#2}}%
+ \def\beamer@shorttitle{\RL{#1}}%
+ }
+\long\def\beamer@subtitle[#1]#2{%
+ \def\insertsubtitle{\RL{#2}}%
+ \def\beamer@shortsubtitle{\RL{#1}}%
+ }
+\long\def\beamer@date[#1]#2{%
+ \def\insertdate{\RL{#2}}%
+ \def\beamer@shortdate{\RL{#1}}%
+ }
+\long\def\beamer@author[#1]#2{%
+ \def\insertauthor{\def\inst{\beamer@insttitle}\def\and{\beamer@andtitle}\RL{#2}}%
+ \def\beamer@shortauthor{\RL{#1}}%
+ \ifbeamer@autopdfinfo%
+ \def\beamer@andstripped{}%
+ \beamer@stripands#2 \and\relax
+ {\let\inst=\@gobble\let\thanks=\@gobble\def\and{, }\hypersetup{pdfauthor={\beamer@andstripped}}}
+ \fi%
+}
+\long\def\beamer@institute[#1]#2{%
+ \def\beamer@temp{\RL{#2}}%
+ \ifx\beamer@temp\@empty
+ \def\insertinstitute{}
+ \else
+ \def\insertinstitute{\def\inst{\beamer@instinst}\def\and{\beamer@andinst}\RL{#2}}%
+ \fi
+ \def\beamer@shortinstitute{\RL{#1}}}
+\renewenvironment{thebibliography}[1]
+{%\leavevmode\unskip%
+ \list{\@biblabel{\@arabic\c@enumiv}}%
+ {\settowidth\labelwidth{\beamer@biblabeltemplate{\@biblabel{#1}}}%
+ \leftmargin\labelwidth
+ \advance\leftmargin\labelsep
+ \itemsep=0pt%
+ \partopsep=0pt%
+ \topsep=0pt%
+ \usecounter{enumiv}%
+ \let\p@enumiv\@empty
+ \renewcommand\theenumiv{\@arabic\c@enumiv}
+ \let\makelabel\beamer@biblabeltemplate}%
+ \sloppy\raggedleft
+ \clubpenalty10000
+ \@clubpenalty \clubpenalty
+ \widowpenalty10000%
+ \sfcode`\.\@m}
+ {\def\@noitemerr
+ {\@latex@warning{Empty `thebibliography' environment}}%
+ \ifhmode\unskip\fi\endlist}
+\long\def\beamer@@@section#1{\beamer@section[\RL{#1}]{#1}}
+\def\beamer@@@subsection#1{\beamer@subsection[\RL{#1}]{#1}}
+\def\beamer@@@subsubsection#1{\beamer@subsubsection[\RL{#1}]{#1}}
+\long\def\beamer@subsectionintoc#1#2#3#4#5#6{%
+ \ifnum\c@tocdepth>1%
+ \ifnum#5=\beamer@showpartnumber%
+ {
+ \beamer@saveanother%
+ \gdef\beamer@todo{}%
+ \beamer@slideinframe=#1\relax%
+ \expandafter\only\beamer@tocsections{\gdef\beamer@todo{%
+ \ifbeamer@pausesubsections\pause\fi%
+ \beamer@tempcount=#6%
+ \advance\beamer@tempcount by\beamer@sectionadjust%
+ \edef\inserttocsectionnumber{\the\beamer@tempcount}%
+ \def\inserttocsubsectionnumber{#2}%
+ \def\inserttocsubsection{\rightskip=1.5em\hyperlink{Navigation#4}{\RL{#3}\hfill}}%
+ \beamer@tocifnothide{\ifnum\c@section=#1\beamer@toc@oss\else\beamer@toc@ooss\fi}%
+ {%
+ \def\beamer@breakhere{\\}%
+ \beamer@tocact{\ifnum\c@section=#1\ifnum\c@subsection=#2\beamer@toc@css\else\beamer@toc@oss\fi\else\beamer@toc@ooss\fi}
+ {subsection in toc}%
+ }%
+ }}%
+ \beamer@restoreanother%
+ }
+ \beamer@todo%
+ \fi\fi%
+}
+\long\def\beamer@subsubsectionintoc#1#2#3#4#5#6#7{%
+ \ifnum\c@tocdepth>2%
+ \ifnum#1=\beamer@showpartnumber%
+ {
+ \beamer@saveanother%
+ \gdef\beamer@todo{}%
+ \beamer@slideinframe=#2\relax%
+ \expandafter\only\beamer@tocsections{\gdef\beamer@todo{%
+ \ifbeamer@pausesubsections\pause\fi%
+ \beamer@tempcount=#6%
+ \advance\beamer@tempcount by\beamer@sectionadjust%
+ \edef\inserttocsectionnumber{\the\beamer@tempcount}%
+ \def\inserttocsubsectionnumber{#3}%
+ \def\inserttocsubsubsectionnumber{#4}%
+ \def\inserttocsubsubsection{\rightskip=3em\hyperlink{Navigation#5}{\RL{#7}\hfill}}%
+ \beamer@tocifnothide{\ifnum\c@section=#2\beamer@toc@oss\else\beamer@toc@ooss\fi}%
+ {%
+ \def\beamer@breakhere{\\}%
+ \beamer@tocact{\ifnum\c@section=#2\ifnum\c@subsection=#3\beamer@toc@css\else\beamer@toc@oss\fi\else\beamer@toc@ooss\fi}
+ {subsubsection in toc}%
+ }%
+ }}%
+ \beamer@restoreanother%
+ }
+ \beamer@todo%
+ \fi\fi%
+}
+}{}
+
-%The correct the right footnorerule so it does not overlap the texts
-\def\r@fn{%
- \hbox to \columnwidth
- {\beginR \vbox{\kern -3\p@
- \hrule width .4\columnwidth \kern2.6\p@}\hfil\endR}}
-\def\footnoterule{\r@fn}
-%a command to put a footnote from left to right
-%while in a right to left context
-\providerobustcmd{\Footnote}[1]{%
-\bgroup% To make the scope of the change local
-\footnotemark%
-\renewcommand{\thefootnote}{\arabic{footnote}}%
-\unsetRL%
-\footnotetext{#1}%
-\egroup
-}
-%For Right-to-Left two column command, I guess taken from rlbabel
-\makeatletter
-\let\@old@outputdblcol\@outputdblcol
-\newcommand{\rl@outputdblcolumn}{%
+\def\rl@outputdblcolumn{%
\if@firstcolumn
\global \@firstcolumnfalse
\global \setbox\@leftcolumn \box\@outputbox
@@ -660,25 +1332,44 @@
\@startdblcolumn}%
\endgroup
\fi}
+
+\def\lr@outputdblcolumn{%
+ \if@firstcolumn
+ \global \@firstcolumnfalse
+ \global \setbox\@leftcolumn \box\@outputbox
+ \else
+ \global \@firstcolumntrue
+ \setbox\@outputbox \vbox {%
+ \hb@xt@\textwidth {%
+ \hb@xt@\columnwidth {%
+ \box\@leftcolumn \hss}%
+ \hfil
+ {\normalcolor\vrule \@width\columnseprule}%
+ \hfil
+ \hb@xt@\columnwidth {%
+ \box\@outputbox \hss}%
+ }%
+ }%
+ \@combinedblfloats
+ \@outputpage
+ \begingroup
+ \@dblfloatplacement
+ \@startdblcolumn
+ \@whilesw\if@fcolmade \fi
+ {\@outputpage
+ \@startdblcolumn}%
+ \endgroup
+ \fi
+}
\newcommand{\rldblcolumn}{\renewcommand{\@outputdblcol}{\rl@outputdblcolumn}}
-\newcommand{\lrdblcolumn}{\renewcommand{\@outputdblcol}{\@old@outputdblcol}}
+\newcommand{\lrdblcolumn}{\renewcommand{\@outputdblcol}{\lr@outputdblcolumn}}
%set the default direction of the twocolumn texts to Right-to-Left
\rldblcolumn
-% define the XePersian logo
-\def\reflect#1{{\setbox0=\hbox{#1}\rlap{\kern0.5\wd0
- \special{x:gsave}\special{x:scale -1 1}}\box0 \special{x:grestore}}}
-\def\XePersian{\leavevmode$\smash{\hbox{X\lower.5ex
- \hbox{\kern-.125em\reflect{E}}Persian}}$}
-
-\newenvironment{english}{\par\vspace{.5cm}\setLR\begin{rmfamily}}{\end{rmfamily}\par\vspace{.5cm}}
-\def\lr#1{\LR{\rmfamily{#1}}}
-\def\rl#1{\RL{\farsifont#1}}
-%To fix tabular problem in bidi. Taken from farsitex
\newif\if@tabsw
\global\@tabswfalse
\def\@tabular{\if@rl\global\@tabswtrue\fi
@@ -704,40 +1395,23 @@
\if@tabsw\hbox\bgroup\beginR\vbox\bgroup\fi
\@preamble}
-%taken from rlbabel.ldf
-\newif\if@rl
-\AtBeginDocument{% Here we set the main document direction
- \newif\if@rlmain%
- \if@rl% e.g: if the options to babel were [english,hebrew]
- \@rlmaintrue%
- \else% e.g: if the options to babel were [hebrew,english]
- \@rlmainfalse%
- \fi%
-}
-%To fix eqref problem taken from amsmath
-\let\@@text=\text
-\def\text#1{\@@text{\RL{#1}}}
-\def\tagform@#1{\maketag@@@{)\ignorespaces\text{#1}\unskip\@@italiccorr(}}
-\renewcommand{\eqref}[1]{(\ref{#1})}
-%To fix equation numbers. taken from amsmath
-\renewenvironment{equation}{%
-\par\unsetRL
- \incr@eqnum
- \mathdisplay@push
- \st@rredfalse \global\@eqnswtrue
- \mathdisplay{equation}%
-}{%
- \endmathdisplay{equation}%
- \mathdisplay@pop
- \ignorespacesafterend
-\par\setRL\noindent
-}
-%almost taken verbatim from polyglossia for making abjad numbering in enumerate environment
+
+
+
+
+
+
+
+
+
+
+
+
\providecommand*{\xpg@warning}[1]{%
\PackageWarning{XePersian}%
{#1}}
@@ -763,12 +1437,12 @@
}
\def\abjad@zero{}
\def\abj@num@i#1{%
- \ifcase#1\or ا\or ب\or ج\char"200D\or د%
- \or ه\or و\or ز\or ح\or ط\fi
+ \ifcase#1\or ا\or ب\or ج\char"200D\or د%
+ \or ه\char"200D\or و\or ز\or ح\or ط\fi
\ifnum#1=\z@\abjad@zero\fi}
\def\abj@num@ii#1{%
\ifcase#1\or ی\or ک\or ل\or م\or ن%
- \or س\or ع\or ف\or ص\fi
+ \or س\or ع\or ف\or ص\fi
\ifnum#1=\z@\fi\abj@num@i}
\def\abj@num@iii#1{%
\ifcase#1\or ق\or ر\or ش\or ت\or ث%
@@ -779,22 +1453,175 @@
\ifnum#1=\z@\fi\abj@num@iii}
}
-\def\farsi@numbers{%
\let\@latinalph\@alph%
\let\@latinAlph\@Alph%
\let\@alph\abjad%
\let\@Alph\abjad%
+
+
+
+\def\underline#1{%
+ \relax
+ \ifmmode\@@@underline{#1}%
+ \else
+\if@rl $\@@@underline{\hbox{\RL{#1}}}\m@th$\relax
+\else
+$\@@@underline{\hbox{#1}}\m@th$\relax\fi\fi}
+
+
+
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ % %
+ % footnote setup %
+ % %
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\ifx \CatEscape\undefined
+ \chardef\CatEscape=0
+ \chardef\CatOpen=1
+ \chardef\CatClose=2
+ \chardef\CatIgnore=9
+ \chardef\CatLetter=11
+ \chardef\CatOther=12
+ \chardef\CatActive=13 % is defined in Plain already
+
+ \chardef\CatUsCode=\catcode`\_
+\fi
+
+\catcode`\_=\CatLetter % top level macro file
+
+
+\def\r@fn{%
+ \hbox to \columnwidth
+ {\beginR \vbox{\kern -3\p@
+ \hrule width .4\columnwidth \kern2.6\p@}\hfil\endR}}
+\def\l@fn{%
+ \hrule width .4\columnwidth\kern 2.6\p@}
+
+
+\def\@makefnmark{\hbox{$^{\hbox{\scriptsize\@thefnmark}}\m@th$}}
+
+
+\def\leftfootnoterule{\global\def\footnoterule{\l@fn}}
+\def\rightfootnoterule{\global\def\footnoterule{\r@fn}}
+\leftfootnoterule
+
+%%% \beginprog
+\newread\old_foot_file
+\newwrite\foot_file
+\def\foot_file_name{\jobname.fot\relax}
+\def\init_footnote{%
+ \openin\old_foot_file\foot_file_name
+ \ifeof\old_foot_file \closein\old_foot_file
+ \else \closein\old_foot_file
+ \read_foot_file
+ \fi
+ \immediate\openout\foot_file\foot_file_name
+ \immediate\write\foot_file{\relax}%
+ \global\let\init_footnote\relax
+ }
+
+\newcount\foot_name_no % for generating footnote mark names
+
+
+
+
+
+\newcount\autofootnote
+\def\fnpp_next_footnote{%
+ \init_footnote
+ \global\advance\foot_name_no\@ne
+ \global\advance\c@footnote\@ne
+ \edef\do_write{%
+ \immediate\write\foot_file{%
+ \string\advance\autofootnote\@ne
+ \string\expandafter\xdef
+ \string\csname\space f@\number\foot_name_no \endcsname{%
+ \string\number\autofootnote
+ }%
+ }%
+ }%
+ \do_write
+ \global\autofootnote 0\csname f@\number\foot_name_no \endcsname \relax
+ }
+
+\def\read_foot_file{%
+ \begingroup
+ \catcode`\@\CatLetter \catcode`\^^M\CatIgnore
+ \input \foot_file_name
+ \endgroup
+ }
+
+\let\fnpp_orig_outputpage=\@outputpage
+\def\@outputpage{%
+ \ifx \init_footnote\relax
+ \immediate\write\foot_file{\autofootnote\z@}%
+ \fi
+ \fnpp_orig_outputpage
+ }
+
+\let\FnppOrigFootnote=\footnote % save original bindings
+\let\FnppOrigFootnotemark=\footnotemark
+
+\def\footnote{%
+ \@ifnextchar[% % ] (Emacs)
+ \@xfootnote
+ {\fnpp_next_footnote \ifnum\autofootnote=1\rightfootnoterule\fi \@xfootnote[\the\c@footnote] %
+}%
+ }
+\def\footnotemark{%
+ \@ifnextchar[% % ] (Emacs)
+ \@xfootnotemark
+ {\fnpp_next_footnote \ifnum\autofootnote=1\rightfootnoterule\fi \@xfootnotemark[\the\c@footnote]}%
+ }
+
+
+
+
+\def\footnotemarkLR{%
+ \@ifnextchar[% % ] (Emacs)
+ \@xfootnotemark
+ {\fnpp_next_footnote \ifnum\autofootnote=1\leftfootnoterule\fi\@xfootnotemark[\the\c@footnote]}%
+ }
+
+\newif\if@RomanFootNum
+\providerobustcmd{\Footnote}[1]{%
+\bgroup
+\footnotemarkLR%
+\renewcommand{\thefootnote}{\if@RomanFootNum\rmfamily{\@arabic\c@footnote}\else\@arabic\c@footnote\fi}%
+\@rl@footnotefalse\footnotetext{\rmfamily#1}%
+\egroup
}
+\@RomanFootNumfalse
+\def\PersianFootNum{\@RomanFootNumfalse}
+\def\RomanFootNum{\@RomanFootNumtrue}
+\DeclareOption{RomanFootNum}{\@RomanFootNumtrue}
+\ProcessOptions
-\AtBeginDocument{\farsi@numbers}
+\ifx \@minipagerestore\relax
+ \let\@minipagerestore\@empty
+\fi
+
+\g@addto@macro\@minipagerestore{%
+ \let\footnote\FnppOrigFootnote
+ }
+
+\let\fnpp_orig_maketitle=\maketitle
+\def\maketitle{%
+ \begingroup
+ \let\footnotemark\FnppOrigFootnotemark
+ \fnpp_orig_maketitle
+ \endgroup
+ }
+
+\catcode`\_=\CatUsCode
+
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ % %
+ % End of footnote setup %
+ % %
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\newcommand\twocolumnstableofcontents{%
- \begin{multicols}{2}[\section*{\contentsname}]%
- \small
- \@starttoc{toc}%
- \end{multicols}}
-\def\rcases#1{\left.\vcenter{\normalbaselines\m@th
- \ialign{$##\hfil$&\quad{##}\hfil\crcr#1\crcr}}\,\right\}}
\endinput