diff options
author | Karl Berry <karl@freefriends.org> | 2009-09-14 00:46:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-09-14 00:46:20 +0000 |
commit | 912ba7898315ab887463006c081d888c528f4c2b (patch) | |
tree | 4ac388ea0339657367b3c75be65f518016ac7850 /Master/texmf-dist/source/latex | |
parent | 1c467aabf1a2f6e96c1cb2ef4d54e30696dbe10d (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/source/latex')
-rw-r--r-- | Master/texmf-dist/source/latex/memoir/memoir.dtx | 500 |
1 files changed, 356 insertions, 144 deletions
diff --git a/Master/texmf-dist/source/latex/memoir/memoir.dtx b/Master/texmf-dist/source/latex/memoir/memoir.dtx index e6cbd7d3265..99b323981d9 100644 --- a/Master/texmf-dist/source/latex/memoir/memoir.dtx +++ b/Master/texmf-dist/source/latex/memoir/memoir.dtx @@ -18,7 +18,7 @@ % This work consists of the files listed in the README file. % % \fi -% \CheckSum{28141} +% \CheckSum{28432} % % \changes{v0.1}{2001/05/20}{First public alpha release} % \changes{v0.2}{2001/06/03}{First beta release} @@ -78,10 +78,13 @@ % and added 2 col Toc} % \changes{v1.6180339f}{2009/04/25}{Extended description lists} % \changes{v1.6180339f}{2009/07/12}{Added three \cs{memlet...} macros} -% \changes{v1.6180339g}{2009/07/13}{Fixed a bug regading extra enties +% \changes{v1.6180339g}{2009/07/13}{Fixed a bug regading extre enties % in the page note list} -% \changes{v1.6180339g}{2009/07/21}{fixed mempatch typos} -% \changes{v1.6180339h}{2009/07/24}{fixed typo in memoir.dtx} +% \changes{v1.61803398}{2009/07/17}{Added bidi (RTL) support} +% \changes{v1.61803398}{2009/07/27}{Fixed bug in \cs{@setclcnt}, added simple pagestyle} +% \changes{v1.61803398}{2009/08/08}{changed the code that defined the +% main function out of \cs{newlistof}} +% \changes{v1.61803398}{2009/09/10}{fixed bug with upquote} % % \def\dtxfile{memoir.dtx} % @@ -113,8 +116,8 @@ % \def\fileversion{v1.6180339d} \def\filedate{2009/02/04} % \def\fileversion{v1.6180339e} \def\filedate{2009/02/06} % \def\fileversion{v1.6180339f} \def\filedate{2009/07/12} -% \def\fileversion{v1.6180339g} \def\filedate{2009/07/21} -% \def\fileversion{v1.6180339h} \def\filedate{2009/07/24} +% \def\fileversion{v1.6180339g} \def\filedate{2009/07/13} +% \def\fileversion{v1.61803398} \def\filedate{2009/09/10} % \title{The LaTeX \Lpack{memoir} class for configurable book % typesetting: Source code\thanks{This % file (\texttt{\dtxfile}) has version number \fileversion, last revised @@ -298,7 +301,9 @@ % \DoNotIndex{\fbox} % \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef} % \DoNotIndex{\global,\halign,\hbox,\hfil,\hfill,\hrule} -% \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi} +% \DoNotIndex{\hsize,\hskip,\hspace,\hss} +% ^^A \DoNotIndex{\if@tempswa,\fi} +% \DoNotIndex{\ifcase,\or,\fi} % \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi} % \DoNotIndex{\input} % \DoNotIndex{\jobname,\kern,\leavevmode,\let} @@ -336,7 +341,7 @@ % Announce the name, option files and version for LaTeX2e files: % \begin{macrocode} %<class>\ProvidesClass{memoir}% -%<class> [2009/07/24 v1.6180339h configurable book, report, article document class] +%<class> [2009/09/10 v1.61803398 configurable book, report, article document class] %<9pt>\ProvidesFile{mem9.clo}% %<9pt> [2008/01/30 v0.4 memoir class 9pt size option] %<10pt>\ProvidesFile{mem10.clo}% @@ -1525,6 +1530,51 @@ % \end{macrocode} % +% \changes{v1.61803398}{2009/07/18}{Added support for bidi} +% \subsection{Support for the bidi package (RTL typesetting)} +% +% The \Lpack{bidi} package (system) enables bidirectional typesetting. +% As part of +% being able to accomplish this it often needs to exchange, for example, +% \cs{leftskip} and \cs{rightskip} depending on whether it is setting +% left-to-right (LTR) or right-to-left (RTL). In the case of \Lpack{memoir} +% the initial \Lpack{bidi} system implementation used a \Lpack{bidimemoir} +% class developed by Vafa Khalighi. Now, with Vafa's help, the necessary +% changes have been incorporated in \Lpack{memoir}; the \Lpack{bidimemoir} +% class is no longer needed. +% +% \begin{macro}{\memRTLleftskip} +% \begin{macro}{\memRTLrightskip} +% \begin{macro}{\memRTLvleftskip} +% \begin{macro}{\memRTLvrightskip} +% \begin{macro}{\memRTLraggedright} +% \begin{macro}{\memRTLraggedleft} +% These are the hooks required to support the \Lpack{bidi} package. +% \begin{macrocode} +\newcommand*{\memRTLleftskip}{\leftskip} +\newcommand*{\memRTLrightskip}{\rightskip} +\newcommand*{\memRTLvleftskip}{\leftskip} +\newcommand*{\memRTLvrightskip}{\rightskip} +\newcommand*{\memRTLraggedright}{\raggedright} +\newcommand*{\memRTLraggedleft}{\raggedleft} + +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% It is expected that the \Lpack{bidi} package will redefine these as: +% \begin{verbatim} +% \renewcommand*{\memRTLleftskip}{\if@RTL\rightskip\else\leftskip\fi} +% \renewcommand*{\memRTLrightskip}{\if@RTL\leftskip\else\rightskip\fi} +% \renewcommand*{\memRTLvleftskip}{\if@RTL\vrightskip\else\vleftskip\fi} +% \renewcommand*{\memRTLvrightskip}{\if@RTL\vleftskip\else\vrightskip\fi} +% \renewcommand*{\memRTLraggedright}{\if@RTL\raggedleft\else\raggedright\fi} +% \renewcommand*{\memRTLraggedleft}{\if@RTL\raggedright\else\raggedleft\fi} +% \end{verbatim} % % \section{Declaration of Options} \label{sec:opt} % @@ -2216,15 +2266,17 @@ % is what the LaTeX-project have recommended for several years now), % so we add a dead mans switch to disable the loading. % \begin{macro}{\ifmem@noetex} +% \begin{macro}{\mem@noetextrue} +% \begin{macro}{\mem@noetexfalse} % \begin{macrocode} \newif\ifmem@noetex + \mem@noetexfalse \DeclareOption{noetex}{\mem@noetextrue} % \end{macrocode} % \end{macro} -% -% -% +% \end{macro} +% \end{macro} % % % \section{Executing Options} \label{sec:xopt} @@ -4779,24 +4831,33 @@ % as \cs{fixpdflayout} does for \file{pdf} output. % \changes{v1.4}{2003/11/22}{Added \cs{fixpdflayout} (from patch v1.6)} % \changes{v1.4}{2003/12/01}{Added \cs{fixdvipslayout} } +% \changes{v1.61803398}{2009/08/17}{on ctt dynamotwain suggested a +% change to \cs{fixpdflayout} and the following \cs{AtBeginDocument} +% such that the \cs{special} is not outputtet when running xelatex} % \begin{macrocode} \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} % \end{macrocode} @@ -5721,6 +5782,18 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\ps@simple} +% The \pstyle{simple} page style simply puts the page number in the header +% at the outer margin. +% \changes{v1.61803398}{2009/07/26}{PW: Added the `simple' pagestyle} +% \begin{macrocode} +\makepagestyle{simple} + \makeevenhead{simple}{\thepage}{}{} + \makeoddhead{simple}{}{}{\thepage} + +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\nouppercaseheads} % \begin{macro}{\uppercaseheads} % \begin{macro}{\memUChead} @@ -6910,12 +6983,17 @@ % and typesets the mark. The code is a simplified version of that % for typesetting ToC entries. % \changes{v1.2}{2002/08/10}{Minor changes to \cs{makethanksmark}} +% \changes{v1.61803398}{2009/07/17}{Added bidi support to \cs{makethanksmark}} % \begin{macrocode} \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} @@ -7829,6 +7907,7 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\bookpageend} % \begin{macro}{\@endbook} % This finishes off both \cs{@book} and \cs{@sbook}. % Following a \cs{nobookblankpage} nothing is done, otherwise @@ -7836,8 +7915,9 @@ % and an extra blank page is created if both \Lopt{twoside} and % \Lopt{openright} are in effect. % At the end, if necessary, two column mode is switched back on. +% \changes{v1.61803398}{2009/07/26}{PW: Added \cs{bookpageend} as cover for \cs{@endbook}} % \begin{macrocode} -\def\@endbook{\afterbookskip +\newcommand*{\bookpageend}{\afterbookskip \ifm@mnobooknewpage \else \if@twoside @@ -7851,9 +7931,11 @@ \if@tempswa \twocolumn \fi} +\def\@endbook{\bookpageend} % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}{\ps@book} % \begin{macro}{\ps@afterbook} @@ -8045,6 +8127,7 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\partpageend} % \begin{macro}{\@endpart} % This finishes off both \cs{@part} and \cs{@spart}. % Following a \cs{nopartblankpage} nothing is done, otherwise @@ -8057,8 +8140,9 @@ % % At the end, if necessary, two column mode is switched back on. % \changes{v1.61803}{2008/01/30}{Used the afterpart pagestyle in \cs{@endpart}} +% \changes{v1.61803398}{2009/07/26}{PW: Added \cs{partpageend} as cover for \cs{@endpart}} % \begin{macrocode} -\def\@endpart{\afterpartskip +\newcommand*{\partpageend}{\afterpartskip \ifm@mnopartnewpage \else \if@twoside @@ -8072,9 +8156,11 @@ \if@tempswa \twocolumn \fi} +\def\@endpart{\partpageend} % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}{\ps@afterpart} % Pagestyle for the (blank) page after a part page. @@ -8280,10 +8366,12 @@ % set \cs{raggedright}. % \changes{v1.3}{2002/10/10}{Added \cs{printchapternonum} to % \cs{@makechapterhead}} +% \changes{v1.61803398}{2009/07/17}{Added bidi support to \cs{@makechapterhead}} % \begin{macrocode} \def\@makechapterhead#1{% \chapterheadstart% \vspace*{50\p@}% - {\parindent \z@ \raggedright \normalfont + {%\parindent \z@ \raggedright \normalfont + \parindent \z@ \memRTLraggedright \normalfont % \end{macrocode} % If there is a number, typeset it, otherwise call \cs{printchapternonum}. % \begin{macrocode} @@ -8444,10 +8532,12 @@ % This \emph{really} typesets a \cs{chapter*}, and is similar to \cs{@makechapterhead}. % \changes{v1.3}{2002/10/10}{Added \cs{printchapternonum} to % \cs{@makeschapterhead}} +% \changes{v1.61803398}{2009/07/17}{Added bidi support to \cs{@makeschapterhead}} % \begin{macrocode} \def\@makeschapterhead#1{% \chapterheadstart - {\parindent \z@ \raggedright \normalfont + {%\parindent \z@ \raggedright \normalfont + \parindent \z@ \memRTLraggedright \normalfont \printchapternonum \interlinepenalty\@M \printchaptertitle{#1}% @@ -8569,11 +8659,15 @@ % \verb?\ifartopt \reparticle \fi? \\ % The \cs{chapter} commands must still be used, though. % \changes{v1.61803}{2008/01/30}{Added \cs{reparticle} (mempatch v4.3)} +% \changes{v1.61803398}{2009/07/17}{Added bidi support to \cs{reparticle}} % \begin{macrocode} \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}% +} % \end{macrocode} % \end{macro} @@ -8664,6 +8758,7 @@ % % \begin{macro}{\chs@bringhurst} % My bringhurst style. +% \changes{v1.61803398}{2009/07/17}{Added bidi support to bringhurst chapterstyle} % \begin{macrocode} \makechapterstyle{bringhurst}{% \chapterstyle{default} @@ -8673,7 +8768,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}} @@ -8928,6 +9024,7 @@ % \begin{macro}{\chs@southall} % Style provided by Thomas Dye. I have modified the original to eliminate % the use of new lengths. +% \changes{v1.61803398}{2009/07/17}{Added bidi support to southall chapterstyle} % \begin{macrocode} %% Thomas Dye's southall chapter style \makechapterstyle{southall}{% @@ -8937,7 +9034,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}{} @@ -9118,6 +9216,7 @@ % % \begin{macro}{\chs@tandh} % A chapterstyle based on Thames \& Hudson \textit{Typography}. +% \changes{v1.61803398}{2009/07/17}{Added bidi support to tandh chapterstyle} % \begin{macrocode} \makechapterstyle{tandh}{% \setlength{\beforechapskip}{1\onelineskip}% @@ -9128,7 +9227,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}} % \end{macrocode} % \end{macro} @@ -9416,6 +9516,7 @@ % except that the heading will be \cs{raggedright}, thus preventing % hyphenation. The % \cs{set...} commands are for the user to change the values. +% \changes{v1.61803398}{@009/07/17}{Added bidi support to default secheadstyle} % \begin{macrocode} \newlength{\secindent} \newcommand{\setsecindent}[1]{\setlength{\secindent}{#1}} @@ -9428,7 +9529,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} % \end{macrocode} % \end{macro} @@ -9476,6 +9578,7 @@ % \begin{macro}{\setaftersubsecskip} % \begin{macro}{\setsubsecheadstyle} % The macros for controlling \cs{subsection} headings. +% \changes{v1.61803398}{2009/07/17}{Added bidi support to default subsec headstyle} % \begin{macrocode} \newlength{\subsecindent} \newcommand{\setsubsecindent}[1]{\setlength{\subsecindent}{#1}} @@ -9488,7 +9591,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} % \end{macrocode} % \end{macro} @@ -9537,6 +9641,7 @@ % \begin{macro}{\setaftersubsubsecskip} % \begin{macro}{\setsubsubsecheadstyle} % The macros for controlling \cs{subsubsection} headings. +% \changes{v1.61803398}{2009/07/17}{Added bidi support to default subsubsec headstyle} % \begin{macrocode} \newlength{\subsubsecindent} \newcommand{\setsubsubsecindent}[1]{% @@ -9553,7 +9658,8 @@ \newcommand{\subsubsecheadstyle}{} \newcommand{\setsubsubsecheadstyle}[1]{% \renewcommand{\subsubsecheadstyle}{#1}} - \setsubsubsecheadstyle{\normalsize\bfseries\raggedright} +%%% \setsubsubsecheadstyle{\normalsize\bfseries\raggedright} + \setsubsubsecheadstyle{\normalsize\bfseries\memRTLraggedright} % \end{macrocode} % \end{macro} @@ -10046,31 +10152,37 @@ \@chs@def@ult% default chapterstyle % \end{macrocode} % Default \cs{section} style +% \changes{v1.61803398}{2009/07/17}{Added bidi support to default sec headstyle} % \begin{macrocode} % section \setsechook{} \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}% % \end{macrocode} -% Default \cs{section} style +% Default \cs{subsection} style +% \changes{v1.61803398}{2009/07/17}{Added bidi support to default subsec headstyle} % \begin{macrocode} % subsection \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}% % \end{macrocode} -% Default \cs{section} style +% Default \cs{subsubsection} style +% \changes{v1.61803398}{2009/07/17}{Added bidi support to default subsubsec headstyle} % \begin{macrocode} % subsubsection \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}% % \end{macrocode} % Default \cs{paragraph} style % \begin{macrocode} @@ -10113,6 +10225,7 @@ % \begin{macro}{\hds@memman} % Head styles used in the \textit{The Memoir Class} user guide. In this, % as the later ones, only changes from the defaults need specifying. +% \changes{v1.61803398}{2009/07/17}{Added bidi support to the memman headstyles} % \begin{macrocode} \makeheadstyles{memman}{% % book changes @@ -10131,17 +10244,20 @@ \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}% % subsection \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}% % subsubsection \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}% % paragraph \setbeforeparaskip{1.0\onelineskip \@plus 0.5\onelineskip \@minus 0.2\onelineskip}% @@ -10159,6 +10275,7 @@ % % \begin{macro}{\hds@bringhurst} % Head styles based on Bringhurst's book +% \changes{v1.61803398}{2009/07/17}{Added bidi support to bringhurst headstyles} % \begin{macrocode} \makeheadstyles{bringhurst}{% % chapter @@ -10167,12 +10284,14 @@ \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}% % subsection \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}% % subsubsection \setbeforesubsubsecskip{1.0\onelineskip \@plus 0.5\onelineskip \@minus 0.2\onelineskip}% @@ -10266,6 +10385,7 @@ % % \begin{macro}{\hds@komalike} % Head styles based on KOMA script classes (\texttt{scrbook.cls}). +% \changes{v1.61803398}{2009/07/17}{Added bidi support to komalike headstyles} % \begin{macrocode} \makeheadstyles{komalike}{% % part @@ -10277,15 +10397,18 @@ % section \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}% % subsection \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}% % subsubsection \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}% % paragraph \setbeforeparaskip{3.25ex \@plus 1ex \@minus .2ex}% \setafterparaskip{-1em}% @@ -10339,6 +10462,7 @@ % % \begin{macro}{\hds@tandh} % Head styles based on Thames \& Hudson \textit{Typography}. +% \changes{v1.61803398}{2009/07/17}{Added bidi support to tandh headstyles} % \begin{macrocode} \makeheadstyles{tandh}{% % chapter @@ -10347,17 +10471,20 @@ \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}% % subsection \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}% % subsubsection \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}% % paragraph \setbeforeparaskip{1.0\onelineskip \@plus 0.5\onelineskip \@minus 0.2\onelineskip}% @@ -10375,6 +10502,7 @@ % % \begin{macro}{\hds@wilsondob} % Head styles based on Adrian Wilson's \textit{The Design of Books}. +% \changes{v1.61803398}{2009/07/17}{Added bidi support to wilsondob headstyles} % \begin{macrocode} \makeheadstyles{wilsondob}{% % chapter @@ -10383,17 +10511,20 @@ \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}% % subsection \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}% % subsubsection \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}% % paragraph \setbeforeparaskip{1.0\onelineskip \@plus 0.5\onelineskip \@minus 0.2\onelineskip}% @@ -10869,10 +11000,13 @@ % \begin{macro}{\centerlastline} % This declaration specifies normal paragraphs except that the last line of % each is centered. +% \changes{v1.61803398}{2009/07/17}{Added bidi support to \cs{centerlastline}} % \begin{macrocode} \newcommand*{\centerlastline}{% - \leftskip\@flushglue - \rightskip=\z@ plus -1fil +%%% \leftskip\@flushglue + \memRTLleftskip\@flushglue +%%% \rightskip=\z@ plus -1fil + \memRTLrightskip=\z@ plus -1fil \parfillskip=\z@ plus 2fil} % \end{macrocode} @@ -10935,12 +11069,16 @@ % \begin{macro}{\raggedyright} % \cs{raggedyright}\oarg{plus} provides controllable ragged right paragraphs. % \changes{v1.4}{2003/12/10}{Added \cs{raggedyright}} +% \changes{v1.61803398}{2009/07/17}{Added bidi support to \cs{raggedyright}} % \begin{macrocode} \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} % \end{macrocode} @@ -10951,10 +11089,13 @@ % This declaration specifies paragraphs where the lines are justified, % except for the last which is raggedleft (flushright).. % \changes{v1.6180339c}{2009/01/09}{Added \cs{justlastraggedleft} paragraph} +% \changes{v1.61803398}{2009/07/17}{Added bidi support to \cs{justlastraggedleft}} % \begin{macrocode} \newcommand*{\justlastraggedleft}{% - \leftskip\@flushglue - \rightskip-\leftskip +%%% \leftskip\@flushglue + \memRTLleftskip\@flushglue +%%% \rightskip-\leftskip + \memRTLrightskip-\memRTLleftskip \parfillskip\leftskip \parindent \z@} @@ -10968,11 +11109,14 @@ % this alters \cs{everpar}, which may need to be reset afterwards to % \verb?\everypar{}?. % \changes{v1.6180339c}{2009/01/09}{Added \cs{raggedrightthenleft} paragraph} +% \changes{v1.61803398}{2009/07/17}{Added bidi support to \cs{raggedrightthenleft}} % \begin{macrocode} \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}} @@ -12490,9 +12634,11 @@ % \begin{macro}{\flagverse} % \cs{flagverse}\marg{flag} inserts \meta{flag} at the left (of a line). % \changes{v1.1}{2002/03/24}{Added \cs{flagverse}} +% \changes{v1.61803398}{2009/07/17}{Added bidi suport to \cs{flagverse}} % \begin{macrocode} \newcommand{\flagverse}[1]{% - \hskip-\vleftskip\llap{#1}\hskip\vleftskip\ignorespaces} +%%% \hskip-\vleftskip\llap{#1}\hskip\vleftskip\ignorespaces} + \hskip-\memRTLvleftskip\llap{#1}\hskip\memRTLvleftskip\ignorespaces} % \end{macrocode} % \end{macro} @@ -12604,12 +12750,16 @@ % \begin{macro}{\@vslnumright} % \begin{macro}{\@vslnumleft} % Internal code for right/left line numbers. +% \changes{v1.61803398}{2009/07/17}{Added bidi support to \cs{@vslnumright} +% and \cs{@vslnumleft}} % \begin{macrocode} \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}}} % \end{macrocode} % \end{macro} @@ -20462,45 +20612,40 @@ % \begin{macro}{\X} % Typeset the listing title and entries, % with both a normal and starred version. +% \changes{v1.61803398}{2009/08/08}{changed such that it only use one +% internal macro} +% \changes{v1.61803398}{2009/08/09}{chose a better name for the +% internal macro} % \begin{macrocode} - \@namedef{#1}{\@ifstar{\@nameuse{@star#2}}{\@nameuse{@plain#2}}} + \@namedef{#1}{\@ifstar{\@nameuse{mem@#1}{01}}{\@nameuse{mem@#1}{00}}} % \end{macrocode} % \end{macro} % -% \begin{macro}{\@starZ} -% The starred listof version -% \changes{v1.6180339c}{2009/01/20}{Missing \cs{parskip} change} +% \begin{macro}{\mem@X} +% \changes{v1.61803398}{2009/08/08}{introduced \cs{mem@X} to replace +% \cs{@starZ} and \cs{@plainZ}} +% In earlier version of the class, we used two macros \cs{@starZ} +% and \cs{@plainZ}, to reduce code we now only use one, the argument +% of it takes care of differentiating between the stuff that are +% different. % \begin{macrocode} - \@namedef{@star#2}{% + \@namedef{mem@#1}##1{% \ensureonecol \par \begingroup -%%% \parindent\z@ \parskip\cftparskip \@nameuse{@#2maketitle} -\parskip\cftparskip - \@starttoc{#2}% - \endgroup - \restorefromonecol} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@plainZ} -% The unstarred listof version -% \changes{v1.61803}{2008/01/30}{Slight change to \cs{@plainZ} (mempatch v4.6)} -% \begin{macrocode} - \@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} % \end{macrocode} +% % \end{macro} % % \begin{macro}{\@Zmaketitle} @@ -20563,6 +20708,33 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\ifmem@em@starred@listof} +% \begin{macro}{\KeepFromToc} +% The class handles the created `new lists' a little different than +% other classes. We automatically add it to the main table of +% contents. This us usually what one wants. If not, one can always +% use the starred version. But in some cases other packages will use +% \cs{tableofcontents} to typeset their own `list of\dots', in which +% case it becomes a little hard to add a star. Therefore we add a +% switch that can be used to emulate the starred list of. After the +% macro \cs{KeepFromToc} the memoir created (non-starred) `list of' +% will behave as their starred counterpart. +% \changes{v1.61803398}{2009/08/08}{LM: added \cs{KeepFromToc}} +% \begin{macrocode} +\newif\ifmem@em@starred@listof +\newcommand\KeepFromToc{\mem@em@starred@listoftrue} +% \end{macrocode} +% Tip: use \cs{KeepFromToc} as an environment, i.e. +% \begin{verbatim} +% \begin{KeepFromToc} +% \listoffigures +% \end{KeepFromToc} +% \end{verbatim} +% to locally remove a list from the TOC. +% \end{macro} +% \end{macro} +% +% % \begin{macro}{\@starttoc} % A list of macro calls \cs{@starttoc} to read the appropriate file. I have % changed the kernel definition to allow a file to be read multiple times @@ -20749,6 +20921,7 @@ % level of the entry in the List of. % \changes{v1.61803}{2008/01/30}{Added \cs{cftXname} to \cs{newlistentry} % (mempatch v4.5)} +% \changes{v1.61803398}{2009/07/17}{Added bidi support to \cs{newlistentry}} % \begin{macrocode} \newcommand{\newlistentry}[4][\@empty]{% % \end{macrocode} @@ -20795,16 +20968,19 @@ % Start a group to keep paragraphing changes local. Set the \cs{leftskip} % to the entry's indentation. % \begin{macrocode} - {\leftskip \@nameuse{cft#2indent}\relax + {%\leftskip \@nameuse{cft#2indent}\relax + \memRTLleftskip \@nameuse{cft#2indent}\relax % \end{macrocode} % Set the \cs{rightskip} to \cs{@tocrmarg} to leave room for the page number. % \begin{macrocode} - \rightskip \@tocrmarg +%%% \rightskip \@tocrmarg + \memRTLrightskip \@tocrmarg % \end{macrocode} % Ensure that the last line of an entry will be filled. Setting \cs{parfillskip} % to a negative value prevents `overfull box' messages. % \begin{macrocode} - \parfillskip -\rightskip +%%% \parfillskip -\rightskip + \parfillskip -\memRTLrightskip % \end{macrocode} % Set the paragraph's indentation to the entry's indentation. % \begin{macrocode} @@ -20834,9 +21010,10 @@ % the current indent, and that any subsequent lines will be further % indented. % \begin{macrocode} - \advance\leftskip\@tempdima \null\nobreak\hskip -\leftskip +%%% \advance\leftskip\@tempdima \null\nobreak\hskip -\leftskip + \advance\memRTLleftskip\@tempdima \null\nobreak\hskip -\memRTLleftskip % \end{macrocode} -% Print the (number and) title, prohibiting any breqaking. +% Print the (number and) title, prohibiting any breaking. % \begin{macrocode} {\@nameuse{cft#2font}##1}\nobreak % \end{macrocode} @@ -20844,7 +21021,7 @@ % \begin{macrocode} \@nameuse{cft#2fillnum}{##2}} \fi - } % end of \l@#2 + }% end of \l@#2 % \end{macrocode} % \end{macro} @@ -20983,18 +21160,20 @@ % \changes{v1.6180339}{2008/07/23}{Deleted \cs{space} from \cs{booknumberline} % and \cs{partnumberline} % (per Lars Henrik Gam Madsen mempatch v5.1)} +% \changes{v1.61803398}{2009/07/18}{Added bidi support to \cs{l@book}} % \begin{macrocode} \newcommand*{\cftbookbreak}{\addpenalty{-\@highpenalty}% \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 @@ -21003,7 +21182,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 @@ -21090,18 +21270,20 @@ % Can't use \cs{newlistentry} for \cs{l@part} because of the initial penalty % and the final \cs{nobreak} code. % \changes{v1.61803}{2008/01/30}{Added \cs{cftpartbreak}} +% \changes{v1.61803398}{2009/07/18}{Added bidi support to \cs{l@part}} % \begin{macrocode} \newcommand*{\cftpartbreak}{\addpenalty{-\@highpenalty}% \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 @@ -21110,7 +21292,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 @@ -21219,14 +21402,18 @@ % \begin{macro}{\l@chapapp} % Generic chapter/appendix ToC entry typesetting. % \changes{v1.618}{2005/09/03}{Added \cs{l@chapapp}, courtesy Danie Els (mempatch v3.12)} +% \changes{v1.61803398}{2009/07/18}{ADded bidi support to \cs{l@chapapp}} % \begin{macrocode} \newcommand*{\l@chapapp}[3]{% \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 @@ -21237,7 +21424,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} @@ -21552,6 +21740,7 @@ % file. The \meta{text} will be typeset within the same margins as the % the title text of a \cs{chapter} heading, using the \cs{precistocfont} font. % \changes{v1.3}{2002/11/14}{Added \cs{precistoctext}} +% \changes{v1.61803398}{2009/07/18}{Added bidi support to \cs{precistoctext}} % \begin{macrocode} \newcommand{\chapterprecistoc}[1]{% \addtocontents{toc}{\precistoctext{#1}}} @@ -21562,12 +21751,15 @@ % \changes{v1.6180339c}{2009/01/20}{Added a \cs{nopagebreak}, though % this only disencourage a page break} % \begin{macrocode} - {\nopagebreak\leftskip \cftchapterindent\relax - \advance\leftskip \cftchapternumwidth\relax + {%\nopagebreak\leftskip \cftchapterindent\relax + \nopagebreak\memRTLleftskip \cftchapterindent\relax +%%% \advance\leftskip \cftchapternumwidth\relax + \advance\memRTLleftskip \cftchapternumwidth\relax % \end{macrocode} % Set the right hand margin to \cs{@tocrmarg}. % \begin{macrocode} - \rightskip \@tocrmarg\relax +%%% \rightskip \@tocrmarg\relax + \memRTLrightskip \@tocrmarg\relax % \end{macrocode} % Typeset \meta{text} using an italic font, then ensure that the paragraph % is finished (to use the local skips). Finally close the group and we @@ -21669,60 +21861,63 @@ % to the level of \meta{sec}. % \changes{v1.61803}{2008/01/30}{Added book to \cs{@setclcnt} and friends % (mempatch v4.4)} +% \changes{v1.61803398}{2009/07/29}{PW: Replaced \cs{if@tempswa} with +% \cs{@setclcntok} in \cs{@setclcnt} to avoid bad clashes with other uses} % \begin{macrocode} \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) }{% @@ -21741,60 +21936,63 @@ % \meta{sec}. % \changes{v1.3}{2002/11/14}{Changed \cs{settocdepth} to use \cs{changetocdepth}} % \changes{v1.61803}{2008/01/30}{Added book to ToC depth setting (mempatch v4.4)}. +% \changes{v1.61803398}{2009/07/29}{PW: Replaced \cs{if@tempswa} with +% \cs{@chtocdok} in \cs{settocdepth} to avoid bad clashes with other uses} % \begin{macrocode} \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 +% \if@tempswa + \ifnum\@chtocdok=1\relax % \end{macrocode} % The next bit is from Heiko Oberdiek (CTT {\itshape Re: Memoir, \verb?\settocdepth? % and pdflatex \verb?=>? problem with PDF bookmarks}, 2006/07/21) as @@ -23533,8 +23731,10 @@ % for raggedleft \renewcommand{\sidebarform}{\raggedleft} % \end{verbatim} % \changes{v1.4}{2003/11/22}{Added \cs{sidebarform} (from patch v1.5)} +% \changes{v1.61803398}{2009/07/18}{Added bidi support to \cs{sidebarform}} % \begin{macrocode} -\newcommand{\sidebarform}{\rightskip=\z@ \@plus 2em} +\newcommand{\sidebarform}{%\rightskip=\z@ \@plus 2em} + \memRTLrightskip=\z@ \@plus 2em} % \end{macrocode} % \end{macro} @@ -27052,20 +27252,25 @@ % \let\do\do@noligs % \verbatim@nolig@list} % \end{verbatim} +% Actually the kernel defines the macro \verb+\@noligs+ which just +% runs the last two lines of the \verb+\verbatim@font+ above. As other +% package may add stuff to \verb+\@noligs+, we will use that instead. % \end{macro} % % \begin{macro}{\setverbatimfont} % \begin{macro}{\m@mverbfont} % \begin{macro}{\verbatim@font} % User level handle for changing the font used for verbatim text. +% \changes{v1.61803398}{2009/09/10}{Changed the last two lines of +% \cs{verbatim@font} into using \cs{@noligs} instead. This fixes +% problem with upquote.} % \begin{macrocode} \newcommand{\setverbatimfont}[1]{\def\m@mverbfont{#1}} \setverbatimfont{\normalfont\ttfamily} \def\verbatim@font{\m@mverbfont \hyphenchar\font\m@ne - \let\do\do@noligs - \verbatim@nolig@list} + \@noligs} % \end{macrocode} % \end{macro} @@ -27081,6 +27286,7 @@ % \cs{item} command inserted. % Each line of the \texttt{verbatim} or \texttt{verbatim*} % environment will be treated as a separate paragraph. +% \changes{v1.61803398}{2009/07/18}{Added bidi support to \cs{@verbatim}} % \begin{macrocode} \def\@verbatim{\the\every@verbatim \trivlist \item \relax @@ -27100,7 +27306,8 @@ % extra space between lines. % \begin{macrocode} \@beginparpenalty \predisplaypenalty - \leftskip\@totalleftmargin\rightskip\z@ +%%% \leftskip\@totalleftmargin\rightskip\z@ + \memRTLleftskip\@totalleftmargin\memRTLrightskip\z@ \parindent\z@\parfillskip\@flushglue\parskip\z@ % \end{macrocode} % There's one point to make here: @@ -28027,11 +28234,14 @@ % to have fixed the problem with the original code which used % \cs{raggedright}. % \changes{v1.61803}{2008/01/30}{Added \cs{raggedwrap} (mempatch v4.4)} +% \changes{v1.61803398}{2009/07/18}{Added bidi support to \cs{raggedwrap}} % \begin{macrocode} \newcommand*{\raggedwrap}{% \@rightskip\@flushglue - \rightskip\@rightskip - \leftskip\@totalleftmargin +%%% \rightskip\@rightskip + \memRTLrightskip\@rightskip +%%% \leftskip\@totalleftmargin + \memRTLleftskip\@totalleftmargin \parindent\ragrparindent} \newcommand*{\wrappingon}{% \def\@xobeysp{~\discretionary{\verbatimbreakchar}% @@ -32208,9 +32418,11 @@ % \changes{v1.3}{2002/11/14}{Added input of mempatch.sty} % \changes{v1.6180339c}{2008/12/26}{Added the two missing arguments when inputting % mempatch.sty (courtesy of Wilhelm Muller)} +% \changes{v1.61803398}{2009/07/27}{PW: changed call to mempatch, which I think +% restores Lars' v1.6180339h change} % \begin{macrocode} \IfFileExists{mempatch.sty}{% - \RequirePackage{mempatch}}{} + \RequirePackage{mempatch}}{} % \end{macrocode} % |