summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/memoir
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-09-14 00:46:20 +0000
committerKarl Berry <karl@freefriends.org>2009-09-14 00:46:20 +0000
commit912ba7898315ab887463006c081d888c528f4c2b (patch)
tree4ac388ea0339657367b3c75be65f518016ac7850 /Master/texmf-dist/tex/latex/memoir
parent1c467aabf1a2f6e96c1cb2ef4d54e30696dbe10d (diff)
memoir 1.61803398 (13sep09)
git-svn-id: svn://tug.org/texlive/trunk@15274 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/memoir')
-rw-r--r--Master/texmf-dist/tex/latex/memoir/memoir.cls318
1 files changed, 198 insertions, 120 deletions
diff --git a/Master/texmf-dist/tex/latex/memoir/memoir.cls b/Master/texmf-dist/tex/latex/memoir/memoir.cls
index 02e644788d0..ca734ba8f57 100644
--- a/Master/texmf-dist/tex/latex/memoir/memoir.cls
+++ b/Master/texmf-dist/tex/latex/memoir/memoir.cls
@@ -26,7 +26,7 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{memoir}%
- [2009/07/24 v1.6180339h configurable book, report, article document class]
+ [2009/09/10 v1.61803398 configurable book, report, article document class]
\newcommand*{\@ptsize}{}
\newcommand*{\@memptsize}{}
\newlength{\onelineskip}
@@ -426,6 +426,13 @@
%%\@memfakeusepackage{patchcmd}
+\newcommand*{\memRTLleftskip}{\leftskip}
+\newcommand*{\memRTLrightskip}{\rightskip}
+\newcommand*{\memRTLvleftskip}{\leftskip}
+\newcommand*{\memRTLvrightskip}{\rightskip}
+\newcommand*{\memRTLraggedright}{\raggedright}
+\newcommand*{\memRTLraggedleft}{\raggedleft}
+
\newlength{\stockheight}
\newlength{\stockwidth}
\newlength{\trimtop}
@@ -645,6 +652,7 @@
\DeclareOption{extrafontsizes}{\extrafontsizestrue}
\newif\ifmem@noetex
+ \mem@noetexfalse
\DeclareOption{noetex}{\mem@noetextrue}
\ExecuteOptions{final,letterpaper,10pt,onecolumn,openright,twoside,
@@ -1263,20 +1271,26 @@
\newcommand*{\fixpdflayout}{%
\pdfpageheight=\the\stockheight
\pdfpagewidth=\the\stockwidth
+ \ifxetex\else
\ifdim\pdfvorigin=0pt\pdfvorigin=1in\fi
- \ifdim\pdfhorigin=0pt\pdfhorigin=1in\fi}
+ \ifdim\pdfhorigin=0pt\pdfhorigin=1in\fi
+ \fi}
\newcommand*{\fixdvipslayout}{%
\AtBeginDvi{\special{papersize=\the\stockwidth,\the\stockheight}}}
\AtBeginDocument{%
- \ifpdf
- \ifnum\pdfoutput<\@ne
- \fixdvipslayout
+ \ifxetex
+ \fixpdflayout
+ \else
+ \ifpdf
+ \ifnum\pdfoutput<\@ne
+ \fixdvipslayout
+ \else
+ \fixpdflayout
+ \fi
\else
- \fixpdflayout
+ \fixdvipslayout
\fi
- \else
- \fixdvipslayout
\fi}
\newcommand{\typeoutstandardlayout}{%
@@ -1588,6 +1602,10 @@
\makeevenfoot{plain}{}{\thepage}{}
\makeoddfoot{plain}{}{\thepage}{}
+\makepagestyle{simple}
+ \makeevenhead{simple}{\thepage}{}{}
+ \makeoddhead{simple}{}{}{\thepage}
+
\newcommand*{\nouppercaseheads}{\let\memUChead\relax}
\newcommand*{\uppercaseheads}{\let\memUChead\MakeUppercase}
\uppercaseheads
@@ -2114,8 +2132,12 @@
\newcommand{\makethanksmark}{%
\leavevmode%
\parindent 1em\noindent
- \leftskip\thanksmarksep\relax
- \advance\leftskip\thanksmarkwidth \null\nobreak\hskip-\leftskip\relax
+%%% \leftskip\thanksmarksep\relax
+ \memRTLleftskip\thanksmark\relax
+%%% \advance\leftskip\thanksmarkwidth
+ \advance\memRTLleftskip\thanksmarkwidth
+%%% \null\nobreak\hskip-\leftskip\relax
+ \null\nobreak\hskip-\memRTLleftskip\relax
\makethanksmarkhook\relax
\thanksfootmark}
@@ -2425,7 +2447,7 @@
\newcommand*{\bookblankpage}{\m@mnobooknewpagefalse}
\newcommand*{\nobookblankpage}{\m@mnobooknewpagetrue}
-\def\@endbook{\afterbookskip
+\newcommand*{\bookpageend}{\afterbookskip
\ifm@mnobooknewpage
\else
\if@twoside
@@ -2439,6 +2461,7 @@
\if@tempswa
\twocolumn
\fi}
+\def\@endbook{\bookpageend}
\aliaspagestyle{book}{empty}
\aliaspagestyle{afterbook}{empty}
@@ -2515,7 +2538,7 @@
\newcommand*{\partblankpage}{\m@mnopartnewpagefalse}
\newcommand*{\nopartblankpage}{\m@mnopartnewpagetrue}
-\def\@endpart{\afterpartskip
+\newcommand*{\partpageend}{\afterpartskip
\ifm@mnopartnewpage
\else
\if@twoside
@@ -2529,6 +2552,7 @@
\if@tempswa
\twocolumn
\fi}
+\def\@endpart{\partpageend}
\aliaspagestyle{afterpart}{empty}
@@ -2617,7 +2641,8 @@
\def\@makechapterhead#1{%
\chapterheadstart% \vspace*{50\p@}%
- {\parindent \z@ \raggedright \normalfont
+ {%\parindent \z@ \raggedright \normalfont
+ \parindent \z@ \memRTLraggedright \normalfont
\ifm@m@And
\printchaptername \chapternamenum \printchapternum
\afterchapternum % \par\nobreak \vskip 20\p@
@@ -2687,7 +2712,8 @@
\def\@makeschapterhead#1{%
\chapterheadstart
- {\parindent \z@ \raggedright \normalfont
+ {%\parindent \z@ \raggedright \normalfont
+ \parindent \z@ \memRTLraggedright \normalfont
\printchapternonum
\interlinepenalty\@M
\printchaptertitle{#1}%
@@ -2748,8 +2774,11 @@
\newcommand*{\reparticle}{%
\chapterstyle{reparticle}
- \setsecheadstyle{\normalfont\large\bfseries\raggedright}
- \setsubsecheadstyle{\normalfont\bfseries\raggedright}}
+%%% \setsecheadstyle{\normalfont\large\bfseries\raggedright}
+ \setsecheadstyle{\normalfont\large\bfseries\memRTLraggedright}%
+%%% \setsubsecheadstyle{\normalfont\bfseries\raggedright}
+ \setsubsecheadstyle{\normalfont\bfseries\memRTLraggedright}%
+}
\makechapterstyle{hangnum}{%
\chapterstyle{default}
@@ -2808,7 +2837,8 @@
\renewcommand*{\printchapternum}{}
\renewcommand*{\afterchapternum}{}
\renewcommand*{\printchaptertitle}[1]{%
- \raggedright\Large\scshape\MakeLowercase{##1}}
+%%% \raggedright\Large\scshape\MakeLowercase{##1}}
+ \memRTLraggedright\Large\scshape\MakeLowercase{##1}}
\renewcommand*{\afterchaptertitle}{%
\vskip\onelineskip \hrule\vskip\onelineskip}}
@@ -2981,7 +3011,8 @@
\setlength{\midchapskip}{\textwidth}% \rightblock
\addtolength{\midchapskip}{-\beforechapskip}
\renewcommand*{\chapterheadstart}{\vspace*{2\baselineskip}}
- \renewcommand*{\chaptitlefont}{\huge\rmfamily\raggedright}
+%%% \renewcommand*{\chaptitlefont}{\huge\rmfamily\raggedright}
+ \renewcommand*{\chaptitlefont}{\huge\rmfamily\memRTLraggedright}
\renewcommand*{\chapnumfont}{\chaptitlefont}
\renewcommand*{\printchaptername}{}
\renewcommand*{\chapternamenum}{}
@@ -3108,7 +3139,8 @@
\renewcommand*{\chapnumfont}{\normalfont\huge\bfseries}%
\renewcommand*{\printchapternum}{\chapnumfont \thechapter\quad}%
\renewcommand*{\afterchapternum}{}%
- \renewcommand*{\chaptitlefont}{\chapnumfont\raggedright}}
+%%% \renewcommand*{\chaptitlefont}{\chapnumfont\raggedright}}
+ \renewcommand*{\chaptitlefont}{\chapnumfont\memRTLraggedright}}
\makechapterstyle{wilsondob}{%
\setlength{\beforechapskip}{2\onelineskip}%
@@ -3230,7 +3262,8 @@
\setaftersecskip{2.3ex \@plus .2ex}
\newcommand{\secheadstyle}{}
\newcommand{\setsecheadstyle}[1]{\renewcommand{\secheadstyle}{#1}}
- \setsecheadstyle{\Large\bfseries\raggedright}
+%%% \setsecheadstyle{\Large\bfseries\raggedright}
+ \setsecheadstyle{\Large\bfseries\memRTLraggedright}
\newcommand{\subsection}{%
\subsechook%
@@ -3252,7 +3285,8 @@
\setaftersubsecskip{1.5ex \@plus .2ex}
\newcommand{\subsecheadstyle}{}
\newcommand{\setsubsecheadstyle}[1]{\renewcommand{\subsecheadstyle}{#1}}
- \setsubsecheadstyle{\large\bfseries\raggedright}
+%%% \setsubsecheadstyle{\large\bfseries\raggedright}
+ \setsubsecheadstyle{\large\bfseries\memRTLraggedright}
\newcommand{\subsubsection}{%
\subsubsechook%
@@ -3278,7 +3312,8 @@
\newcommand{\subsubsecheadstyle}{}
\newcommand{\setsubsubsecheadstyle}[1]{%
\renewcommand{\subsubsecheadstyle}{#1}}
- \setsubsubsecheadstyle{\normalsize\bfseries\raggedright}
+%%% \setsubsubsecheadstyle{\normalsize\bfseries\raggedright}
+ \setsubsubsecheadstyle{\normalsize\bfseries\memRTLraggedright}
\newcommand{\paragraph}{%
\parahook%
@@ -3480,17 +3515,20 @@
\setsecindent{\z@}%
\setbeforesecskip{-3.5ex \@plus -1ex \@minus -.2ex}%
\setaftersecskip{2.3ex \@plus .2ex}%
- \setsecheadstyle{\Large\bfseries\raggedright}%
+%%% \setsecheadstyle{\Large\bfseries\raggedright}%
+ \setsecheadstyle{\Large\bfseries\memRTLraggedright}%
\setsubsechook{}%
\setsubsecindent{\z@}%
\setbeforesubsecskip{-3.25ex \@plus -1ex \@minus -.2ex}%
\setaftersubsecskip{1.5ex \@plus .2ex}%
- \setsubsecheadstyle{\large\bfseries\raggedright}%
+%%% \setsubsecheadstyle{\large\bfseries\raggedright}%
+ \setsubsecheadstyle{\large\bfseries\memRTLraggedright}%
\setsubsubsechook{}%
\setsubsubsecindent{\z@}%
\setbeforesubsubsecskip{-3.25ex \@plus -1ex \@minus -.2ex}%
\setaftersubsubsecskip{1.5ex \@plus .2ex}%
- \setsubsubsecheadstyle{\normalsize\bfseries\raggedright}%
+%%% \setsubsubsecheadstyle{\normalsize\bfseries\raggedright}%
+ \setsubsubsecheadstyle{\normalsize\bfseries\memRTLraggedright}%
\setparahook{}%
\setparaindent{\z@}%
\setbeforeparaskip{3.25ex \@plus 1ex \@minus .2ex}%
@@ -3520,15 +3558,18 @@
\setbeforesecskip{-1.333\onelineskip
\@plus -0.5\onelineskip \@minus -.5\onelineskip}%
\setaftersecskip{0.667\onelineskip \@plus 0.1\onelineskip}%
- \setsecheadstyle{\normalfont\scshape\raggedright}%
+%%% \setsecheadstyle{\normalfont\scshape\raggedright}%
+ \setsecheadstyle{\normalfont\scshape\memRTLraggedright}%
\setbeforesubsecskip{-0.667\onelineskip
\@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
\setaftersubsecskip{0.333\onelineskip \@plus 0.1\onelineskip}%
- \setsubsecheadstyle{\normalfont\bfseries\raggedright}%
+%%% \setsubsecheadstyle{\normalfont\bfseries\raggedright}%
+ \setsubsecheadstyle{\normalfont\bfseries\memRTLraggedright}%
\setbeforesubsubsecskip{-0.667\onelineskip
\@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
\setaftersubsubsecskip{0.333\onelineskip \@plus 0.1\onelineskip}%
- \setsubsubsecheadstyle{\normalfont\normalsize\itshape\raggedright}%
+%%% \setsubsubsecheadstyle{\normalfont\normalsize\itshape\raggedright}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\itshape\memRTLraggedright}%
\setbeforeparaskip{1.0\onelineskip
\@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
\setafterparaskip{-1em}%
@@ -3544,11 +3585,13 @@
\setbeforesecskip{-1\onelineskip
\@plus -0.5\onelineskip \@minus -.5\onelineskip}%
\setaftersecskip{1\onelineskip \@plus 0.1\onelineskip}%
- \setsecheadstyle{\normalfont\raggedright\scshape\MakeLowercase}%
+%%% \setsecheadstyle{\normalfont\raggedright\scshape\MakeLowercase}%
+ \setsecheadstyle{\normalfont\memRTLraggedright\scshape\MakeLowercase}%
\setbeforesubsecskip{-1.0\onelineskip
\@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
\setaftersubsecskip{1.0\onelineskip \@plus 0.1\onelineskip}%
- \setsubsecheadstyle{\sethangfrom{\noindent ####1}\normalfont\itshape\raggedright}%
+%%% \setsubsecheadstyle{\sethangfrom{\noindent ####1}\normalfont\itshape\raggedright}%
+ \setsubsecheadstyle{\sethangfrom{\noindent ####1}\normalfont\itshape\memRTLraggedright}%
\setbeforesubsubsecskip{1.0\onelineskip
\@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
\setaftersubsubsecskip{-1em}%
@@ -3618,13 +3661,16 @@
\chapterstyle{komalike}
\setbeforesecskip{-3.5ex \@plus -1ex \@minus -.2ex}%
\setaftersecskip{2.3ex \@plus .2ex}%
- \setsecheadstyle{\normalfont\Large\sffamily\bfseries\raggedright}%
+%%% \setsecheadstyle{\normalfont\Large\sffamily\bfseries\raggedright}%
+ \setsecheadstyle{\normalfont\Large\sffamily\bfseries\memRTLraggedright}%
\setbeforesubsecskip{-3.25ex \@plus -1ex \@minus -.2ex}%
\setaftersubsecskip{1.5ex \@plus .2ex}%
- \setsubsecheadstyle{\normalfont\large\sffamily\bfseries\raggedright}%
+%%% \setsubsecheadstyle{\normalfont\large\sffamily\bfseries\raggedright}%
+ \setsubsecheadstyle{\normalfont\large\sffamily\bfseries\memRTLraggedright}%
\setbeforesubsubsecskip{-3.25ex \@plus -1ex \@minus -.2ex}%
\setaftersubsubsecskip{1.5ex \@plus .2ex}%
- \setsubsubsecheadstyle{\normalfont\normalsize\sffamily\bfseries\raggedright}%
+%%% \setsubsubsecheadstyle{\normalfont\normalsize\sffamily\bfseries\raggedright}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\sffamily\bfseries\memRTLraggedright}%
\setbeforeparaskip{3.25ex \@plus 1ex \@minus .2ex}%
\setafterparaskip{-1em}%
\setparaheadstyle{\normalfont\normalsize\sffamily\bfseries}%
@@ -3663,15 +3709,18 @@
\setbeforesecskip{-2\onelineskip
\@plus -0.5\onelineskip \@minus -.5\onelineskip}%
\setaftersecskip{1\onelineskip \@plus 0.1\onelineskip}%
- \setsecheadstyle{\normalfont\raggedright\MakeUppercase}%
+%%% \setsecheadstyle{\normalfont\raggedright\MakeUppercase}%
+ \setsecheadstyle{\normalfont\memRTLraggedright\MakeUppercase}%
\setbeforesubsecskip{-1.2\onelineskip
\@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
\setaftersubsecskip{0.8\onelineskip \@plus 0.1\onelineskip}%
- \setsubsecheadstyle{\normalfont\Large\itshape\raggedright}%
+%%% \setsubsecheadstyle{\normalfont\Large\itshape\raggedright}%
+ \setsubsecheadstyle{\normalfont\Large\itshape\memRTLraggedright}%
\setbeforesubsubsecskip{-0.667\onelineskip
\@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
\setaftersubsubsecskip{0.333\onelineskip \@plus 0.1\onelineskip}%
- \setsubsubsecheadstyle{\normalfont\normalsize\bfseries\raggedright}%
+%%% \setsubsubsecheadstyle{\normalfont\normalsize\bfseries\raggedright}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\bfseries\memRTLraggedright}%
\setbeforeparaskip{1.0\onelineskip
\@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
\setafterparaskip{-1em}%
@@ -3687,15 +3736,18 @@
\setbeforesecskip{-1.333\onelineskip
\@plus -0.5\onelineskip \@minus -.5\onelineskip}%
\setaftersecskip{0.667\onelineskip \@plus 0.1\onelineskip}%
- \setsecheadstyle{\normalfont\raggedright\MakeUppercase}%
+%%% \setsecheadstyle{\normalfont\raggedright\MakeUppercase}%
+ \setsecheadstyle{\normalfont\memRTLraggedright\MakeUppercase}%
\setbeforesubsecskip{-0.667\onelineskip
\@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
\setaftersubsecskip{0.333\onelineskip \@plus 0.1\onelineskip}%
- \setsubsecheadstyle{\normalfont\Large\itshape\raggedright}%
+%%% \setsubsecheadstyle{\normalfont\Large\itshape\raggedright}%
+ \setsubsecheadstyle{\normalfont\Large\itshape\memRTLraggedright}%
\setbeforesubsubsecskip{-0.667\onelineskip
\@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
\setaftersubsubsecskip{0.333\onelineskip \@plus 0.1\onelineskip}%
- \setsubsubsecheadstyle{\normalfont\normalsize\raggedright\scshape\MakeLowercase}%
+%%% \setsubsubsecheadstyle{\normalfont\normalsize\raggedright\scshape\MakeLowercase}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\memRTLraggedright\scshape\MakeLowercase}%
\setbeforeparaskip{1.0\onelineskip
\@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
\setafterparaskip{-1em}%
@@ -3889,8 +3941,10 @@
\vadjust{}{\parfillskip\z@\memorigpar}}
\newcommand*{\centerlastline}{%
- \leftskip\@flushglue
- \rightskip=\z@ plus -1fil
+%%% \leftskip\@flushglue
+ \memRTLleftskip\@flushglue
+%%% \rightskip=\z@ plus -1fil
+ \memRTLrightskip=\z@ plus -1fil
\parfillskip=\z@ plus 2fil}
\newcommand*{\leftcenterright}{%;
@@ -3910,20 +3964,27 @@
\newdimen\ragrparindent
\setlength{\ragrparindent}{\parindent}
\newcommand{\raggedyright}[1][2em]{%
- \let\\\@centercr\@rightskip \z@ \@plus #1\relax \rightskip\@rightskip
- \leftskip\z@skip
+ \let\\\@centercr\@rightskip \z@ \@plus #1\relax
+%%% \rightskip\@rightskip
+ \memRTLrightskip\@rightskip
+%%% \leftskip\z@skip
+ \memRTLleftskip\z@skip
\parindent\ragrparindent}
\newcommand*{\justlastraggedleft}{%
- \leftskip\@flushglue
- \rightskip-\leftskip
+%%% \leftskip\@flushglue
+ \memRTLleftskip\@flushglue
+%%% \rightskip-\leftskip
+ \memRTLrightskip-\memRTLleftskip
\parfillskip\leftskip
\parindent \z@}
\newcommand*{\raggedrightthenleft}{%
\parindent \z@
- \leftskip \z@ \@plus 1fill
- \rightskip\@flushglue
+%%% \leftskip \z@ \@plus 1fill
+ \memRTLleftskip \z@ \@plus 1fill
+%%% \rightskip\@flushglue
+ \memRTLrightskip\@flushglue
\parfillskip \z@
\everypar{\hskip \z@ \@plus -1fill}}
@@ -4441,7 +4502,8 @@
\setlength{\stanzaskip}{\onelineskip}
\newcommand{\flagverse}[1]{%
- \hskip-\vleftskip\llap{#1}\hskip\vleftskip\ignorespaces}
+%%% \hskip-\vleftskip\llap{#1}\hskip\vleftskip\ignorespaces}
+ \hskip-\memRTLvleftskip\llap{#1}\hskip\memRTLvleftskip\ignorespaces}
\newlength{\versewidth}
\newlength{\vgap} \setlength{\vgap}{1.5em}
@@ -4466,10 +4528,12 @@
\verselinenumbersright
\newcommand*{\@vslnumright}{%
- \hfill\rlap{\kern\vrightskip\kern\rightmargin%
+ \hfill\rlap{%\kern\vrightskip\kern\rightmargin%
+ \kern\memRTLvrightskip\kern\rightmargin%
\vlvnumfont\getthelinenumber{poemline}{memfvsline}}}
\newcommand*{\@vslnumleft}{%
- \hfill\rlap{\kern-\textwidth\kern-\vrightskip%
+ \hfill\rlap{%\kern-\textwidth\kern-\vrightskip%
+ \kern-\textwidth\kern-\memRTLvrightskip%
\vlvnumfont\getthelinenumber{poemline}{memfvsline}}}
\newcommand{\@vscentercr}{%
\ifhmode \unskip\else \@nolnerr\fi
@@ -7031,26 +7095,19 @@
\@ifundefined{c@#2depth}{\newcounter{#2depth}}{}
\setcounter{#2depth}{1}
\@namedef{#2mark}{\markboth{#3}{#3}}
- \@namedef{#1}{\@ifstar{\@nameuse{@star#2}}{\@nameuse{@plain#2}}}
- \@namedef{@star#2}{%
+ \@namedef{#1}{\@ifstar{\@nameuse{mem@#1}{01}}{\@nameuse{mem@#1}{00}}}
+ \@namedef{mem@#1}##1{%
\ensureonecol
\par
\begingroup
-%%% \parindent\z@ \parskip\cftparskip
\@nameuse{@#2maketitle}
-\parskip\cftparskip
- \@starttoc{#2}%
- \endgroup
- \restorefromonecol}
- \@namedef{@plain#2}{%
- \ensureonecol
- \par
- \begingroup
-%%% \parindent\z@ \parskip\cftparskip
- \@nameuse{@#2maketitle}
- \phantomsection
- \addcontentsline{toc}{chapter}{#3}
-\parskip\cftparskip
+ \if##1
+ \ifmem@em@starred@listof\else
+ \phantomsection
+ \addcontentsline{toc}{chapter}{#3}
+ \fi
+ \fi
+ \parskip\cftparskip
\@starttoc{#2}%
\endgroup
\restorefromonecol}
@@ -7072,6 +7129,8 @@
\@namedef{print#2title}##1{\printchaptertitle{##1}}
} % end \newlistof
+\newif\ifmem@em@starred@listof
+\newcommand\KeepFromToc{\mem@em@starred@listoftrue}
\renewcommand{\@starttoc}[1]{%
\begingroup\makeatletter
\@input{\jobname.#1}%
@@ -7113,9 +7172,12 @@
\@namedef{l@#2}##1##2{%
\ifnum \@nameuse{c@#3depth} > #4\relax
\vskip \@nameuse{cftbefore#2skip}
- {\leftskip \@nameuse{cft#2indent}\relax
- \rightskip \@tocrmarg
- \parfillskip -\rightskip
+ {%\leftskip \@nameuse{cft#2indent}\relax
+ \memRTLleftskip \@nameuse{cft#2indent}\relax
+%%% \rightskip \@tocrmarg
+ \memRTLrightskip \@tocrmarg
+%%% \parfillskip -\rightskip
+ \parfillskip -\memRTLrightskip
\parindent \@nameuse{cft#2indent}\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
@@ -7125,11 +7187,12 @@
\expandafter\let\expandafter\@cftasnum\csname cft#2aftersnum\endcsname
\expandafter\let\expandafter\@cftasnumb\csname cft#2aftersnumb\endcsname
\expandafter\let\expandafter\@cftn@me\csname cft#2name\endcsname
- \advance\leftskip\@tempdima \null\nobreak\hskip -\leftskip
+%%% \advance\leftskip\@tempdima \null\nobreak\hskip -\leftskip
+ \advance\memRTLleftskip\@tempdima \null\nobreak\hskip -\memRTLleftskip
{\@nameuse{cft#2font}##1}\nobreak
\@nameuse{cft#2fillnum}{##2}}
\fi
- } % end of \l@#2
+ }% end of \l@#2
\expandafter\newlength\csname cftbefore#2skip\endcsname
\setlength{\@nameuse{cftbefore#2skip}}{\z@ \@plus .2\p@}
@@ -7181,13 +7244,14 @@
\addvspace{\cftbeforebookskip}}
\newcommand*{\l@book}[2]{%
\ifnum\c@tocdepth >-3\relax
-%% \addpenalty{-\@highpenalty}%
\cftbookbreak
-%% \addvspace{\cftbeforebookskip}%
\begingroup
- {\leftskip \cftbookindent\relax
- \rightskip \@tocrmarg
- \parfillskip -\rightskip
+ {%\leftskip \cftbookindent\relax
+ \memRTLleftskip \cftbookindent\relax
+%%% \rightskip \@tocrmarg
+ \memRTLrightskip \@tocrmarg
+%%% \parfillskip -\rightskip
+ \parfillskip -\memRTLrightskip
\parindent \cftbookindent\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
@@ -7196,7 +7260,8 @@
\let\@cftbsnum \cftbookpresnum
\let\@cftasnum \cftbookaftersnum
\let\@cftasnumb \cftbookaftersnumb
- \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
+%%% \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
+ \advance\memRTLleftskip \@tempdima \null\nobreak\hskip -\memRTLleftskip
{\cftbookfont #1}%
\cftbookfillnum{#2}}
\nobreak
@@ -7237,13 +7302,14 @@
\addvspace{\cftbeforepartskip}}
\newcommand*{\l@part}[2]{%
\ifnum \c@tocdepth >-2\relax
-%%% \addpenalty{-\@highpenalty}%
-%%% \addvspace{\cftbeforepartskip}%
\cftpartbreak
\begingroup
- {\leftskip \cftpartindent\relax
- \rightskip \@tocrmarg
- \parfillskip -\rightskip
+ {%\leftskip \cftpartindent\relax
+ \memRTLleftskip \cftpartindent\relax
+%%% \rightskip \@tocrmarg
+ \memRTLrightskip \@tocrmarg
+%%% \parfillskip -\rightskip
+ \parfillskip -\memRTLrightskip
\parindent \cftpartindent\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
@@ -7252,7 +7318,8 @@
\let\@cftbsnum \cftpartpresnum
\let\@cftasnum \cftpartaftersnum
\let\@cftasnumb \cftpartaftersnumb
- \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
+%%% \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
+ \advance\memRTLleftskip \@tempdima \null\nobreak\hskip -\memRTLleftskip
{\cftpartfont #1}%
\cftpartfillnum{#2}}
\nobreak
@@ -7295,9 +7362,12 @@
\ifnum \c@tocdepth >\m@ne
\cftchapterbreak
\vskip \cftbeforechapterskip
- {\leftskip \cftchapterindent\relax
- \rightskip \@tocrmarg
- \parfillskip -\rightskip
+ {%\leftskip \cftchapterindent\relax
+ \memRTLleftskip \cftchapterindent\relax
+%%% \rightskip \@tocrmarg
+ \memRTLrightskip \@tocrmarg
+%%% \parfillskip -\rightskip
+ \parfillskip -\memRTLrightskip
\parindent \cftchapterindent\relax
\@afterindenttrue
\interlinepenalty\@M
@@ -7308,7 +7378,8 @@
\def\@chapapp@head{#3}%
\settowidth{\@tempdima}{\cftchapterfont\@chapapp@head}%
\addtolength{\@tempdima}{\cftchapternumwidth}%
- \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
+%%% \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
+ \advance\memRTLleftskip \@tempdima \null\nobreak\hskip -\memRTLleftskip
{\cftchapterfont #1}\nobreak
\cftchapterfillnum{#2}}
\fi}
@@ -7402,9 +7473,12 @@
\newcommand{\chapterprecistoc}[1]{%
\addtocontents{toc}{\precistoctext{#1}}}
\DeclareRobustCommand{\precistoctext}[1]{%
- {\nopagebreak\leftskip \cftchapterindent\relax
- \advance\leftskip \cftchapternumwidth\relax
- \rightskip \@tocrmarg\relax
+ {%\nopagebreak\leftskip \cftchapterindent\relax
+ \nopagebreak\memRTLleftskip \cftchapterindent\relax
+%%% \advance\leftskip \cftchapternumwidth\relax
+ \advance\memRTLleftskip \cftchapternumwidth\relax
+%%% \rightskip \@tocrmarg\relax
+ \memRTLrightskip \@tocrmarg\relax
\precistocfont #1\par}}
\newcommand{\cftlocalchange}[3]{%
\addtocontents{#1}{\protect\setpnumwidth{#2} \protect\setrmarg{#3}}}
@@ -7420,58 +7494,59 @@
\addtocontents{#1}{\protect\cftinsert\protect{#2\protect}}}
\newcommand*{\@setclcnt}[2]{%
- \@tempswafalse
+ \def\@setclcntok{0}% = false
\nametest{#1}{none}%
\ifsamename
\setcounter{#2}{-10}%
- \@tempswatrue
+ \def\@setclcntok{1}% = true
\fi
\nametest{#1}{book}%
\ifsamename
\setcounter{#2}{-2}%
- \@tempswatrue
+ \def\@setclcntok{1}%
\fi
\nametest{#1}{part}%
\ifsamename
\setcounter{#2}{-1}%
- \@tempswatrue
+ \def\@setclcntok{1}%
\fi
\nametest{#1}{chapter}%
\ifsamename
\setcounter{#2}{0}%
- \@tempswatrue
+ \def\@setclcntok{1}%
\fi
\nametest{#1}{section}%
\ifsamename
\setcounter{#2}{1}%
- \@tempswatrue
+ \def\@setclcntok{1}%
\fi
\nametest{#1}{subsection}%
\ifsamename
\setcounter{#2}{2}%
- \@tempswatrue
+ \def\@setclcntok{1}%
\fi
\nametest{#1}{subsubsection}%
\ifsamename
\setcounter{#2}{3}%
- \@tempswatrue
+ \def\@setclcntok{1}%
\fi
\nametest{#1}{paragraph}%
\ifsamename
\setcounter{#2}{4}%
- \@tempswatrue
+ \def\@setclcntok{1}%
\fi
\nametest{#1}{subparagraph}%
\ifsamename
\setcounter{#2}{5}%
- \@tempswatrue
+ \def\@setclcntok{1}%
\fi
\nametest{#1}{all}%
\ifsamename
\setcounter{#2}{50}%
- \@tempswatrue
+ \def\@setclcntok{1}%
\fi
- \if@tempswa\else
+%% \if@tempswa\else
+ \ifnum \@setclcntok = 0\relax
\@memerror{%
Unknown document division name (#1)
}{%
@@ -7482,58 +7557,58 @@
\fi}
\newcommand*{\settocdepth}[1]{%
- \@tempswafalse
+ \def\@chtodok{0}% false
\nametest{#1}{none}%
\ifsamename
\addtocontents{toc}{\changetocdepth{-10}}%
- \@tempswatrue
+ \def\@chtodok{1}% true
\fi
\nametest{#1}{book}%
\ifsamename
\addtocontents{toc}{\changetocdepth{-2}}%
- \@tempswatrue
+ \def\@chtodok{1}%
\fi
\nametest{#1}{part}%
\ifsamename
\addtocontents{toc}{\changetocdepth{-1}}%
- \@tempswatrue
+ \def\@chtocdok{1}%
\fi
\nametest{#1}{chapter}%
\ifsamename
\addtocontents{toc}{\changetocdepth{0}}%
- \@tempswatrue
+ \def\@chtocdok{1}%
\fi
\nametest{#1}{section}%
\ifsamename
\addtocontents{toc}{\changetocdepth{1}}%
- \@tempswatrue
+ \def\@chtocdok{1}%
\fi
\nametest{#1}{subsection}%
\ifsamename
\addtocontents{toc}{\changetocdepth{2}}%
- \@tempswatrue
+ \def\@chtocdok{1}%
\fi
\nametest{#1}{subsubsection}%
\ifsamename
\addtocontents{toc}{\changetocdepth{3}}%
- \@tempswatrue
+ \def\@chtocdok{1}%
\fi
\nametest{#1}{paragraph}%
\ifsamename
\addtocontents{toc}{\changetocdepth{4}}%
- \@tempswatrue
+ \def\@chtocdok{1}%
\fi
\nametest{#1}{subparagraph}%
\ifsamename
\addtocontents{toc}{\changetocdepth{5}}%
- \@tempswatrue
+ \def\@chtocdok{1}%
\fi
\nametest{#1}{all}%
\ifsamename
\addtocontents{toc}{\changetocdepth{50}}%
- \@tempswatrue
+ \def\@chtocdok{1}%
\fi
- \if@tempswa
+ \ifnum\@chtocdok=1\relax
\@ifundefined{toclevel@#1}{%
\@memwarn{Unknown toclevel for #1}%
}{%
@@ -8175,7 +8250,8 @@
{\normalsize\normalfont}% sidebarfont
{\textheight}% sidebarheight
-\newcommand{\sidebarform}{\rightskip=\z@ \@plus 2em}
+\newcommand{\sidebarform}{%\rightskip=\z@ \@plus 2em}
+ \memRTLrightskip=\z@ \@plus 2em}
\newif\ifsidebaroneside
\if@twoside\sidebaronesidefalse\else\sidebaronesidetrue\fi
@@ -9676,14 +9752,14 @@
\def\verbatim@font{\m@mverbfont
\hyphenchar\font\m@ne
- \let\do\do@noligs
- \verbatim@nolig@list}
+ \@noligs}
\def\@verbatim{\the\every@verbatim
\trivlist \item \relax
\if@minipage\else\vskip\parskip\fi
\@beginparpenalty \predisplaypenalty
- \leftskip\@totalleftmargin\rightskip\z@
+%%% \leftskip\@totalleftmargin\rightskip\z@
+ \memRTLleftskip\@totalleftmargin\memRTLrightskip\z@
\parindent\z@\parfillskip\@flushglue\parskip\z@
\@@par
\def\par{%
@@ -9858,8 +9934,10 @@
\newcommand*{\raggedwrap}{%
\@rightskip\@flushglue
- \rightskip\@rightskip
- \leftskip\@totalleftmargin
+%%% \rightskip\@rightskip
+ \memRTLrightskip\@rightskip
+%%% \leftskip\@totalleftmargin
+ \memRTLleftskip\@totalleftmargin
\parindent\ragrparindent}
\newcommand*{\wrappingon}{%
\def\@xobeysp{~\discretionary{\verbatimbreakchar}%