summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-09-28 00:38:09 +0000
committerKarl Berry <karl@freefriends.org>2008-09-28 00:38:09 +0000
commit481994839d45d4e497b7dde0c7619bfc88d6c6af (patch)
tree7e7035fec516300d9d4d30ae4c95da6bd665534a /Master/texmf-dist/tex/xelatex
parentf278b35cd0f364590612f947a7950e591a26e8a5 (diff)
xepersian update (27sep08)
git-svn-id: svn://tug.org/texlive/trunk@10758 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex')
-rw-r--r--Master/texmf-dist/tex/xelatex/xepersian/persianpoem.sty5
-rw-r--r--Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty383
-rw-r--r--Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty178
3 files changed, 502 insertions, 64 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xepersian/persianpoem.sty b/Master/texmf-dist/tex/xelatex/xepersian/persianpoem.sty
index 8aed77da7b5..43de9c1be5c 100644
--- a/Master/texmf-dist/tex/xelatex/xepersian/persianpoem.sty
+++ b/Master/texmf-dist/tex/xelatex/xepersian/persianpoem.sty
@@ -1,5 +1,3 @@
-%%
-%% This is file `poem.sty',
%% Copyright(C) 2002, 2004 Behdad Esfahbod <behdad@farsitex.org>
%%
%% It may be distributed and/or modified under the
@@ -215,6 +213,5 @@
\endinput
-%%
-%% End of file `poem.sty'.
+
diff --git a/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty
new file mode 100644
index 00000000000..9317c8dccc5
--- /dev/null
+++ b/Master/texmf-dist/tex/xelatex/xepersian/xepersian-mathsdigitspec.sty
@@ -0,0 +1,383 @@
+\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}
+\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{%
+ #1=#2\relax
+ \um@Loop #4%
+ \advance#1\@ne
+ \ifnum#1>#3\relax
+ \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={%
+ {Size=\tf@size-},%
+ {Size=\sf@size-\tf@size,%
+ Font=\um@ScriptFont,%
+ \um@ScriptFeatures},%
+ {Size=-\sf@size,%
+ 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
+ \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
+}
+\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
+ #2
+ \fi}}
+\um@zf@feature{ScriptStyle}{%
+ \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}}}
+\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
+\mathchardef\ziffer@DotOri="013A
+{\ZifferAn
+ \catcode`\.=\active\gdef.{\begingroup\obeyspaces\futurelet\n\ziffer@dcheck}}
+\def\ziffer@dcheck{\ziffer@check\ZifferLeer\ziffer@DotOri}
+\def\ziffer@check#1#2{%
+ \ifx\n1\endgroup#1\else
+ \ifx\n2\endgroup#1\else
+ \ifx\n3\endgroup#1\else
+ \ifx\n4\endgroup#1\else
+ \ifx\n5\endgroup#1\else
+ \ifx\n6\endgroup#1\else
+ \ifx\n7\endgroup#1\else
+ \ifx\n8\endgroup#1\else
+ \ifx\n9\endgroup#1\else
+ \ifx\n0\endgroup#1\else
+ \endgroup#2%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi}
+\mathcode`.="8000\relax
+\def\ZifferLeer{\ifx\momayez\undefied .\else \momayez\fi}
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty b/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
index f3651751538..1c608d4bc46 100644
--- a/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
+++ b/Master/texmf-dist/tex/xelatex/xepersian/xepersian.sty
@@ -1,20 +1,27 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{xepersian}[2008/09/17 v0.161111111
- Typesetting Persian with XeTeX]
+\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
+
\RequirePackage{graphicx}
\RequirePackage{amssymb}
\RequirePackage{amsmath}
\RequirePackage{amsthm}
-\RequirePackage{fontspec}
+\RequirePackage[quiet]{fontspec}
\RequirePackage{bidi}
\RequirePackage{xltxtra}
\RequirePackage{xunicode}
\RequirePackage{etoolbox}
-\RequirePackage{persianpoem,fmultico}
-\AtBeginDocument{\ifdefined\farsifont\relax\else%
-\PackageWarning{XePersian}{\string\farsifont\ is not defined! XePersian will try to load ``XB Zar''}%
-\newfontfamily\farsifont[Script=Arabic,Scale=1.2,Mapping=parsidigits]{XB Zar}\fi
-}%
+\RequirePackage{xepersian-mathsdigitspec}
+
\def\ps@plain{\ps@empty
\def\@oddfoot{\hfil\farsifont\thepage\hfil}%
@@ -22,39 +29,7 @@
\let\@oddhead\@empty\let\@evenhead\@empty
}
-%to make the digits in math formula persian
-\def\setparsimathsdigitsfont#1{
-\font\tenrgm="#1" at 12pt
-\font\sevrgm="#1" at 10pt
-\font\fivrgm="#1" at 7pt
-\newfam\fardig
-\textfont\fardig=\tenrgm
-\scriptfont\fardig=\sevrgm
-\scriptscriptfont\fardig=\fivrgm
- \XeTeXmathcode`0="7 \fardig "06F0%
- \XeTeXmathcode`1="7 \fardig "06F1%
- \XeTeXmathcode`2="7 \fardig "06F2%
- \XeTeXmathcode`3="7 \fardig "06F3%
- \XeTeXmathcode`4="7 \fardig "06F4%
- \XeTeXmathcode`5="7 \fardig "06F5%
- \XeTeXmathcode`6="7 \fardig "06F6%
- \XeTeXmathcode`7="7 \fardig "06F7%
- \XeTeXmathcode`8="7 \fardig "06F8%
- \XeTeXmathcode`9="7 \fardig "06F9%
- \XeTeXmathcode`.="7 \fardig "066B%decimal point
-
- \XeTeXmathcode`٫="7 \fardig "066B%decimal point
- \XeTeXmathcode`۰="7 \fardig "06F0%
- \XeTeXmathcode`۱="7 \fardig "06F1%
- \XeTeXmathcode`۲="7 \fardig "06F2%
- \XeTeXmathcode`۳="7 \fardig "06F3%
- \XeTeXmathcode`۴="7 \fardig "06F4%
- \XeTeXmathcode`۵="7 \fardig "06F5%
- \XeTeXmathcode`۶="7 \fardig "06F6%
- \XeTeXmathcode`۷="7 \fardig "06F7%
- \XeTeXmathcode`۸="7 \fardig "06F8%
- \XeTeXmathcode`۹="7 \fardig "06F9%
-}
+
\AtBeginDocument{\setRL\farsifont\addfontfeature{Mapping=parsidigits}}
@@ -285,7 +260,24 @@
\def\@oddfoot{\hfil\rl\thepage\hfil}%
\let\@evenfoot\@oddfoot
}
-
+\renewenvironment{thebibliography}[1]
+ {\section*{\refname}%
+ \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
+ \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
@@ -333,8 +325,23 @@
\gdef\thesection{\@harfi\c@section}}
}{}
\@ifclassloaded{amsart}{%
-\def\l@section{\@tocline{1}{0pt}{.5pc}{2.7pc}{}}
-\def\l@subsection{\@tocline{2}{0pt}{.5pc}{2.7pc}{}}
+\let\oldleftskip=\leftskip
+\let\leftskip=\rightskip
+\let\rightskip=\oldleftskip
+\renewenvironment{thebibliography}[1]{%
+ \@bibtitlestyle
+ \normalfont\bibliofont\labelsep .5em\relax
+ \renewcommand\theenumiv{\arabic{enumiv}}\let\p@enumiv\@empty
+ \list{\@biblabel{\theenumiv}}{\settowidth\labelwidth{\@biblabel{#1}}%
+ \leftmargin\labelwidth \advance\leftmargin\labelsep
+ \rightmargin\labelwidth \advance\rightmargin\labelsep
+ \usecounter{enumiv}}%
+ \sloppy \clubpenalty\@M \widowpenalty\clubpenalty
+ \sfcode`\.=\@m
+}{%
+ \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
+ \endlist
+}
\renewcommand{\datename}{\rl{تاریخ:}}
\renewcommand{\refname}{مراجع}
\renewcommand{\abstractname}{چکیده}
@@ -344,7 +351,25 @@
\gdef\thesection{\@harfi\c@section}}
}{}
\@ifclassloaded{report}{%
-
+\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
@@ -397,9 +422,25 @@
}%end appendix
}{}
\@ifclassloaded{amsbook}{%
-\def\l@section{\@tocline{1}{0pt}{.5pc}{2.7pc}{}}
+\renewenvironment{thebibliography}[1]{%
+ \@bibtitlestyle
+ \normalfont\bibliofont\labelsep .5em\relax
+ \renewcommand\theenumiv{\arabic{enumiv}}\let\p@enumiv\@empty
+ \list{\@biblabel{\theenumiv}}{\settowidth\labelwidth{\@biblabel{#1}}%
+ \rightmargin\labelwidth \advance\rightmargin\labelsep
+ \leftmargin\labelwidth \advance\leftmargin\labelsep
+ \usecounter{enumiv}}%
+ \sloppy \clubpenalty\@M \widowpenalty\clubpenalty
+ \sfcode`\.=\@m
+}{%
+ \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{\bibname}{کتاب‌نامه }
\renewcommand{\chaptername}{فصل}
\renewcommand{\partname}{بخش}
%to make appendix numbering farsi
@@ -412,7 +453,7 @@
}{}
\@ifclassloaded{bookest}{%
\NoHyper
-\renewcommand{\bibname}{کتاب‌نامه}
+\renewcommand{\bibname}{کتاب‌نامه }
\renewcommand{\chaptername}{فصل}
\renewcommand{\partname}{بخش}
%to make appendix numbering farsi
@@ -424,6 +465,25 @@
}%end appendix
}{}
\@ifclassloaded{book}{%
+\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}
\renewcommand\frontmatter{%
\cleardoublepage
\@mainmatterfalse
@@ -484,7 +544,7 @@
\fi
\pagestyle{headings}
-\renewcommand{\bibname}{کتاب‌نامه}
+\renewcommand{\bibname}{کتاب‌نامه }
\renewcommand{\chaptername}{فصل}
\renewcommand{\partname}{بخش}
%to make appendix numbering farsi
@@ -496,7 +556,7 @@
}%end appendix
}{}
\@ifclassloaded{refrep}{%
-\renewcommand{\bibname}{کتاب‌نامه}
+\renewcommand{\bibname}{کتاب‌نامه }
\renewcommand{\chaptername}{فصل}
\renewcommand{\partname}{بخش}
%to make appendix numbering farsi
@@ -511,7 +571,7 @@
%We redefine arabic counter style
-\def\@@number#1{\ifmmode\else\beginL\fi{#1}\ifmmode\else\endL\fi}
+\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}
@@ -560,7 +620,7 @@
%a command to put a footnote from left to right
%while in a right to left context
-\newcommand{\Footnote}[1]{%
+\providerobustcmd{\Footnote}[1]{%
\bgroup% To make the scope of the change local
\footnotemark%
\renewcommand{\thefootnote}{\arabic{footnote}}%
@@ -663,20 +723,18 @@
\renewcommand{\eqref}[1]{(\ref{#1})}
%To fix equation numbers. taken from amsmath
-{\renewenvironment{equation}{%
- \unsetRL
+\renewenvironment{equation}{%
+\par\unsetRL
\incr@eqnum
\mathdisplay@push
\st@rredfalse \global\@eqnswtrue
\mathdisplay{equation}%
-\setRL
}{%
-\unsetRL
\endmathdisplay{equation}%
\mathdisplay@pop
\ignorespacesafterend
-\setRL
-}}
+\par\setRL\noindent
+}
%almost taken verbatim from polyglossia for making abjad numbering in enumerate environment
@@ -737,6 +795,6 @@
\small
\@starttoc{toc}%
\end{multicols}}
-
-
+\def\rcases#1{\left.\vcenter{\normalbaselines\m@th
+ \ialign{$##\hfil$&\quad{##}\hfil\crcr#1\crcr}}\,\right\}}
\endinput