diff options
author | Karl Berry <karl@freefriends.org> | 2020-09-10 21:21:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-09-10 21:21:03 +0000 |
commit | 67e9f00d61bf2bd2cb28a7843ab5733112cea855 (patch) | |
tree | 155862b1135aa708549ef0ad02b2fd57f6dfaf0c /Master/texmf-dist/tex/latex/memoir | |
parent | a1a059cb41146cfca1bb356bff185d946800c274 (diff) |
memoir (10sep20)
git-svn-id: svn://tug.org/texlive/trunk@56313 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/memoir')
-rw-r--r-- | Master/texmf-dist/tex/latex/memoir/memoir.cls | 273 |
1 files changed, 153 insertions, 120 deletions
diff --git a/Master/texmf-dist/tex/latex/memoir/memoir.cls b/Master/texmf-dist/tex/latex/memoir/memoir.cls index 65017bee089..208f026fc1a 100644 --- a/Master/texmf-dist/tex/latex/memoir/memoir.cls +++ b/Master/texmf-dist/tex/latex/memoir/memoir.cls @@ -28,8 +28,8 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesClass{memoir}% - [2020/06/02 v3.7l configurable book, report, article document class] -\newcommand\memversion{v3.7l, 2020/06/02} + [2020/09/10 v3.7m configurable book, report, article document class] +\newcommand\memversion{v3.7m, 2020/09/10} \newcommand*{\@ptsize}{} \newcommand*{\@memptsize}{} \newlength{\onelineskip} @@ -56,6 +56,8 @@ \newcommand*{\@memerror}{\ClassError{memoir}} \newcommand*{\@memwarn}{\ClassWarning{memoir}} +\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} + \newif\ifsamename \newcommand{\nametest}[2]{% \samenamefalse% @@ -135,59 +137,86 @@ \@namelet{ver@#1.\@pkgextension}\relax} \@onlypreamble\DisemulatePackage -\ifcsname InputIfFileExists \endcsname% looking for an explicit space - % here aka the robust version - \DeclareRobustCommand \InputIfFileExists[2]{% - \IfFileExists{#1}% - {% - \expandafter\@swaptwoargs\expandafter - {\@filef@und\m@matendf{#1}\killm@matf{#1}}{% - #2\@addtofilelist{#1}\m@matbeginf{#1}\@@input% +\IfFormatAtLeastTF{2020/10/01}{ + \newcommand\AtBeginFile[2]{\AddToHook{file/before/#1}{#2}} + \newcommand\AtEndFile[2]{\AddToHook{file/after/#1}{#2}} + + \newcommand\AtBeginPackage[2]{\AddToHook{package/before/#1}{#2}} + \newcommand\AtEndPackage[2]{\AddToHook{package/after/#1}{#2}} + \newcommand{\RequireAtEndPackage}[2]{% + \@ifpackageloaded{#1}{#2}{\AtEndPackage{#1}{#2}}} + + \newcommand\AtBeginClass[2]{\AddToHook{class/before/#1}{#2}} + \newcommand\AtEndClass[2]{\AddToHook{class/after/#1}{#2}} + \newcommand{\RequireAtEndClass}[2]{% + \@ifclassloaded{#1}{#2}{\AtEndClass{#1}{#2}}} + +}{% back to the code for older formats + \ifcsname InputIfFileExists \endcsname% looking for an explicit space + % here aka the robust version + \DeclareRobustCommand \InputIfFileExists[2]{% + \IfFileExists{#1}% + {% + \expandafter\@swaptwoargs\expandafter + {\@filef@und\m@matendf{#1}\killm@matf{#1}}{% + #2\@addtofilelist{#1}\m@matbeginf{#1}\@@input% + }% }% - }% - } -\else - % Old definition -\renewcommand{\InputIfFileExists}[2]{% - \IfFileExists{#1}% - {#2\@addtofilelist{#1}\m@matbeginf{#1}% - \@@input \@filef@und - \m@matendf{#1}% - \killm@matf{#1}}} -\fi + } + \else + % Old definition + \renewcommand{\InputIfFileExists}[2]{% + \IfFileExists{#1}% + {#2\@addtofilelist{#1}\m@matbeginf{#1}% + \@@input \@filef@und + \m@matendf{#1}% + \killm@matf{#1}}} + \fi -\newcommand{\m@matbeginf}[1]{\@ifundefined{#1-m@mfb}{}% - {\@nameuse{#1-m@mfb}}} -\newcommand{\m@matendf}[1]{\@ifundefined{#1-m@mfe}{}% - {\@nameuse{#1-m@mfe}}} - -\newcommand*{\killm@matf}[1]{% - \@namelet{#1-m@mfb}\relax - \@namelet{#1-m@mfe}\relax} - -\newcommand{\AtBeginFile}[2]{\@ifundefined{#1-m@mfb}% - {\@namedef{#1-m@mfb}{#2}}% - {\expandafter\addtodef\csname #1-m@mfb\endcsname{}{#2}}} -\newcommand{\AtEndFile}[2]{\@ifundefined{#1-m@mfe}% - {\@namedef{#1-m@mfe}{#2}}% - {\expandafter\addtodef\csname #1-m@mfe\endcsname{}{#2}}} - -\newcommand{\AtBeginPackage}[2]{% - \AtBeginFile{#1.\@pkgextension}{#2}} -\newcommand{\AtEndPackage}[2]{% - \AtEndFile{#1.\@pkgextension}{#2}} -\newcommand{\RequireAtEndPackage}[2]{% - \@ifpackageloaded{#1}{#2}% - {\AtEndFile{#1.\@pkgextension}{#2}}} - -\newcommand{\AtBeginClass}[2]{% - \AtBeginFile{#1.\@clsextension}{#2}} -\newcommand{\AtEndClass}[2]{% - \AtEndFile{#1.\@clsextension}{#2}} -\newcommand{\RequireAtEndClass}[2]{% - \@ifclassloaded{#1}{#2}% - {\AtEndFile{#1.\@clsextension}{#2}}} + \newcommand{\m@matbeginf}[1]{\@ifundefined{#1-m@mfb}{}% + {\@nameuse{#1-m@mfb}}} + \newcommand{\m@matendf}[1]{\@ifundefined{#1-m@mfe}{}% + {\@nameuse{#1-m@mfe}}} + %% \ifetex + \newcommand*{\killm@matf}[1]{% + \ifnum 6=\currentgrouptype + \ifvmode + \expandafter\expandafter\expandafter\@firstoftwo + \expandafter\expandafter\expandafter\noalign + \fi + \fi + \@firstofone + {\@namelet{#1-m@mfb}\relax + \@namelet{#1-m@mfe}\relax + }% + } + %% \fi + + \newcommand{\AtBeginFile}[2]{\@ifundefined{#1-m@mfb}% + {\@namedef{#1-m@mfb}{#2}}% + {\expandafter\addtodef\csname #1-m@mfb\endcsname{}{#2}}} + \newcommand{\AtEndFile}[2]{\@ifundefined{#1-m@mfe}% + {\@namedef{#1-m@mfe}{#2}}% + {\expandafter\addtodef\csname #1-m@mfe\endcsname{}{#2}}} + + \newcommand{\AtBeginPackage}[2]{% + \AtBeginFile{#1.\@pkgextension}{#2}} + \newcommand{\AtEndPackage}[2]{% + \AtEndFile{#1.\@pkgextension}{#2}} + \newcommand{\RequireAtEndPackage}[2]{% + \@ifpackageloaded{#1}{#2}% + {\AtEndFile{#1.\@pkgextension}{#2}}} + + \newcommand{\AtBeginClass}[2]{% + \AtBeginFile{#1.\@clsextension}{#2}} + \newcommand{\AtEndClass}[2]{% + \AtEndFile{#1.\@clsextension}{#2}} + \newcommand{\RequireAtEndClass}[2]{% + \@ifclassloaded{#1}{#2}% + {\AtEndFile{#1.\@clsextension}{#2}}} + +} % end of els part of format check \newcommand{\phantomsection}{} \renewcommand*{\nofiles}{% @@ -6111,21 +6140,6 @@ %%\@memfakeusepackage{booktabs} -\ifetex - \renewcommand*{\killm@matf}[1]{% - \ifnum 6=\currentgrouptype - \ifvmode - \expandafter\expandafter\expandafter\@firstoftwo - \expandafter\expandafter\expandafter\noalign - \fi - \fi - \@firstofone - {\@namelet{#1-m@mfb}\relax - \@namelet{#1-m@mfe}\relax - }% - } -\fi - \newskip\ctableftskip \ctableftskip=\fill \newskip\ctabrightskip \ctabrightskip=\fill @@ -10874,16 +10888,25 @@ \let\tmarkbm\relax} \newcommand*\trimmarkscolor{} +\newcommand\mem@trimmarks@initial@vskip{\vskip-1in} +\newcommand\mem@trimmarks@initial@hskip{\hskip-1in} \newcommand*{\trimmarks}{% - \vbox to \z@{\vskip-1in \vskip\trimtop % top of logical page - \hb@xt@\z@{\hskip-1in + \vbox to \z@{% + \mem@trimmarks@initial@vskip% + \vskip\trimtop % top of logical page + \hb@xt@\z@{% + \mem@trimmarks@initial@hskip% \ifodd\c@page - \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth + \hskip\stockwidth + \hskip-\trimedge + \hskip-\paperwidth \else \if@twoside \hskip\trimedge % left of logical page \else - \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth + \hskip\stockwidth + \hskip-\trimedge + \hskip-\paperwidth \fi \fi \vbox to \paperheight{% @@ -10893,8 +10916,8 @@ \hb@xt@\paperwidth{\trimmarkscolor\tmarkml\hfil\tmarkmr}% \vfil \hb@xt@\paperwidth{\trimmarkscolor\tmarkbl\hfil\tmarkbm\hfil\tmarkbr}}% - \hss}% - \vss}} + \hss}% + \vss}} \newcommand*{\registrationColour}[1]{#1} \newcommand*{\quarkmarks}{% @@ -10952,51 +10975,60 @@ \put(-24,-24){\line(0,1){48}} \put(-24,0){\oval(12,12)} \end{picture}}} -\renewcommand*{\trimmarks}{% -%% \special{papersize=\the\stockwidth,\the\stockheight} - {% - \vbox to \z@{\vskip-1in \vskip\trimtop % top of logical page - \hb@xt@\z@{\hskip-1in - \ifodd\c@page - \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth - \else - \if@twoside - \hskip\trimedge % left of logical page - \else - \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth - \fi - \fi - \vbox to \paperheight{% - \let\protect\relax % <- v1.4 addition - \hb@xt@\paperwidth{\trimmarkscolor\tmarktl\hfil\tmarktm\hfil\tmarktr}% - \vfil - \hb@xt@\paperwidth{\trimmarkscolor\tmarkml\hfil\tmarkmr}% - \vfil - \hb@xt@\paperwidth{\trimmarkscolor\tmarkbl\hfil\tmarkbm\hfil\tmarkbr}}% - \hss}% - \vss}}% -}} +%% \renewcommand*{\trimmarks}{% +%% %% \special{papersize=\the\stockwidth,\the\stockheight} +%% {% +%% \vbox to \z@{\vskip-1in \vskip\trimtop % top of logical page +%% \hb@xt@\z@{\hskip-1in +%% \ifodd\c@page +%% \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth +%% \else +%% \if@twoside +%% \hskip\trimedge % left of logical page +%% \else +%% \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth +%% \fi +%% \fi +%% \vbox to \paperheight{% +%% \let\protect\relax % <- v1.4 addition +%% \hb@xt@\paperwidth{\trimmarkscolor\tmarktl\hfil\tmarktm\hfil\tmarktr}% +%% \vfil +%% \hb@xt@\paperwidth{\trimmarkscolor\tmarkml\hfil\tmarkmr}% +%% \vfil +%% \hb@xt@\paperwidth{\trimmarkscolor\tmarkbl\hfil\tmarkbm\hfil\tmarkbr}}% +%% \hss}% +%% \vss}}% +%% } +} -\let\mem@oldshipout\shipout -\newcommand*{\mem@shipi}{% - \ifvoid\@cclv\expandafter\aftergroup\fi\mem@shipii} -\newcommand*\mem@shipii{% - \ifvoid\@cclv - \mem@oldshipout\box\@cclv - \else - \ifshowtrims - \mem@oldshipout\vbox{% - \trimmarks - \nointerlineskip - \box\@cclv - }% - \else +\IfFormatAtLeastTF{2020/10/01}{ + \renewcommand\mem@trimmarks@initial@vskip{} + \renewcommand\mem@trimmarks@initial@hskip{} + \ifshowtrims + \AddToHook{shipout/background}[./trimmarks]{\ifshowtrims\put(0,0){\trimmarks}\fi} + \fi +}{ + \let\mem@oldshipout\shipout + \newcommand*{\mem@shipi}{% + \ifvoid\@cclv\expandafter\aftergroup\fi\mem@shipii} + \newcommand*\mem@shipii{% + \ifvoid\@cclv \mem@oldshipout\box\@cclv - \fi - \fi} -\ifshowtrims - \renewcommand*{\shipout}{\afterassignment\mem@shipi\setbox\@cclv=} -\fi + \else + \ifshowtrims + \mem@oldshipout\vbox{% + \trimmarks + \nointerlineskip + \box\@cclv + }% + \else + \mem@oldshipout\box\@cclv + \fi + \fi} + \ifshowtrims + \renewcommand*{\shipout}{\afterassignment\mem@shipi\setbox\@cclv=} + \fi +} % end format check, else part \newtoks\every@verbatim \every@verbatim={} @@ -13146,11 +13178,12 @@ %%% revert changes to captioning macros if the caption package is used. \AtBeginPackage{caption}{ - \ClassWarningNoLine{memoir}{% + %\ClassWarningNoLine{memoir}{% + \ClassInfo{memoir}{% For the caption package to function properly with memoir, - we will now reset\string\caption\space and friends to - kernel defaults and then let the caption package take over. - Remember: all caption configuration now goves via the caption + we will now reset \string\caption\space and friends to + kernel defaults and then let the^^Jcaption package take over. + Remember: all caption configuration now goes via the caption package interface, not the interface from the memoir class. } |