From 6750592bf6fcf9bb8430a8b30c52368e14b48e0f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 14 Oct 2020 21:46:43 +0000 Subject: leaflet (14oct20) git-svn-id: svn://tug.org/texlive/trunk@56666 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/leaflet/README.md | 5 - .../doc/latex/leaflet/leaflet-manual.pdf | Bin 93938 -> 92279 bytes .../doc/latex/leaflet/leaflet-manual.tex | 21 +- Master/texmf-dist/doc/latex/leaflet/leaflet.pdf | Bin 240797 -> 246694 bytes Master/texmf-dist/source/latex/leaflet/leaflet.dtx | 354 ++++++++++----------- Master/texmf-dist/tex/latex/leaflet/leaflet.cls | 239 +++++++------- 6 files changed, 305 insertions(+), 314 deletions(-) diff --git a/Master/texmf-dist/doc/latex/leaflet/README.md b/Master/texmf-dist/doc/latex/leaflet/README.md index bc86a827578..f69c75208ca 100644 --- a/Master/texmf-dist/doc/latex/leaflet/README.md +++ b/Master/texmf-dist/doc/latex/leaflet/README.md @@ -11,13 +11,8 @@ Recommended TDS locations: leaflet.cls: tex/latex/leaflet leaflet.pdf,leaflet-manual.pdf: doc/latex/leaflet ``` -For general installation advice, see -http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages For bug reports use [this address](https://github.com/rolfn/leaflet/issues). The leaflet document class is also on CTAN:[macros/latex/contrib/leaflet](http://mirrors.ctan.org/macros/latex/contrib/leaflet) - - - diff --git a/Master/texmf-dist/doc/latex/leaflet/leaflet-manual.pdf b/Master/texmf-dist/doc/latex/leaflet/leaflet-manual.pdf index 01c189db39d..07cf61a3f2c 100644 Binary files a/Master/texmf-dist/doc/latex/leaflet/leaflet-manual.pdf and b/Master/texmf-dist/doc/latex/leaflet/leaflet-manual.pdf differ diff --git a/Master/texmf-dist/doc/latex/leaflet/leaflet-manual.tex b/Master/texmf-dist/doc/latex/leaflet/leaflet-manual.tex index 522a4cdf7f3..a7bfda1184e 100644 --- a/Master/texmf-dist/doc/latex/leaflet/leaflet-manual.tex +++ b/Master/texmf-dist/doc/latex/leaflet/leaflet-manual.tex @@ -21,9 +21,9 @@ %% This work has the LPPL maintenance status "author-maintained". %% \def\filename{leaflet-manual.tex} -\def\fileversion{v1.1b} % change this when leaflet-manual changed, too. -\def\filedate{2017/03/17} -\def\docdate {2015/12/27} % change this when leaflet-manual changed, too. +\def\fileversion{v2.0b} % change this when leaflet-manual changed, too. +\def\filedate{2020/10/14} +\def\docdate {2020/10/14} % change this when leaflet-manual changed, too. \listfiles \errorcontextlines=99 \documentclass[ @@ -68,8 +68,7 @@ \MakeShortVerb{\|} \usepackage{url} \usepackage{graphicx} -\usepackage[dvipsnames,usenames]{color} -\definecolor{LIGHTGRAY}{gray}{.9} +\usepackage[svgnames]{xcolor} %%%%\renewcommand{\descfont}{\normalfont} \newcommand\Lpack[1]{\textsf{#1}} @@ -90,13 +89,13 @@ \CutLine{6}% Dotted line with scissors \AddToBackground{5}{% Background of a small page - \put(0,0){\textcolor{Cerulean}{\rule{\paperwidth}{\paperheight}}}} + \put(0,0){\textcolor{LightSkyBlue}{\rule{\paperwidth}{\paperheight}}}} \AddToBackground*{2}{% Background of a large page - \put(\LenToUnit{.5\paperwidth},\LenToUnit{.5\paperheight}){% + \put(.5\paperwidth,.5\paperheight){% \makebox(0,0)[c]{% \resizebox{.9\paperwidth}{!}{\rotatebox{35.26}{% - \textsf{\textbf{\textcolor{LIGHTGRAY}{BACKGROUND}}}}}}}} + \textsf{\textbf{\textcolor{LightGray}{BACKGROUND}}}}}}}} \begin{document} @@ -137,9 +136,6 @@ document is created in PostScript or PDF format, using \end{itemize} (Some other drivers supported by standard \LaTeX{} work as well.) -The non-standard macro package \Lpack{everyshi} \cite{cit:everyshi} is -used by the \Lclass{leaflet} class. - \section{Features} Basically the \Lclass{leaflet} class provides the same features as the @@ -326,9 +322,6 @@ this document class. \bibitem{cit:latex-man} \textsc{L.\,Lamport}: \LaTeX. A Document Preparation System. \textit{User's Guide And Reference Manual.} Second Edition. 1994. -\bibitem{cit:everyshi} - \textsc{M.\,Schr\"oder}: The \Lpack{everyshi} package. 2001. - CTAN: \url{macros/latex/contrib/ms/everyshi.dtx} \end{thebibliography} \loggingall diff --git a/Master/texmf-dist/doc/latex/leaflet/leaflet.pdf b/Master/texmf-dist/doc/latex/leaflet/leaflet.pdf index ee6687ad8c5..7f2ae799141 100644 Binary files a/Master/texmf-dist/doc/latex/leaflet/leaflet.pdf and b/Master/texmf-dist/doc/latex/leaflet/leaflet.pdf differ diff --git a/Master/texmf-dist/source/latex/leaflet/leaflet.dtx b/Master/texmf-dist/source/latex/leaflet/leaflet.dtx index da7360318c2..1acc4424c7a 100644 --- a/Master/texmf-dist/source/latex/leaflet/leaflet.dtx +++ b/Master/texmf-dist/source/latex/leaflet/leaflet.dtx @@ -20,16 +20,16 @@ % \fi % % \iffalse -%\NeedsTeXFormat{LaTeX2e}[1999/12/01] +%\NeedsTeXFormat{LaTeX2e}[2020-10-01] %\ProvidesClass{leaflet} -% [2015/12/27 v1.1a LaTeX document class (JS,WaS,RN,HjG)] +% [2020/10/14 v2.0b LaTeX document class (JS,WaS,RN,HjG)] % %<*driver|manual> %\def\filename{leaflet.dtx} %\def\filename{leaflet-manual.tex} -\def\fileversion{v1.1b} % change this when leaflet-manual changed, too. -\def\filedate{2017/03/17} -\def\docdate {2015/12/27} % change this when leaflet-manual changed, too. +\def\fileversion{v2.0b} % change this when leaflet-manual changed, too. +\def\filedate{2020/10/14} +\def\docdate {2020/10/14} % change this when leaflet-manual changed, too. % %<*driver> \listfiles @@ -52,7 +52,7 @@ % % \fi % -% \CheckSum{1303} +% \CheckSum{1272} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -144,16 +144,29 @@ %<*class> % \end{macrocode} % +% \subsection{Test whether the LaTeX format is new enough} +% We use the 'shipout/before' hook. +% \begin{macrocode} +\@ifundefined{DiscardShipoutBox}{% + \ClassError{leaflet}{% + LaTeX version equal to or newer \MessageBreak + than '2020-10-01' is required% + }{% + Renew your TeX installation.% + }% +}{} +% \end{macrocode} % \subsection{Saving some internal macros\dots} % % \begin{macrocode} -\let\LL@shipout\shipout \let\LL@outputpage\@outputpage -\let\LL@begindvi\@begindvi \let\LL@@end\@@end +\let\LL@begindvi\@begindvi % \end{macrocode} % \subsection{Option processing} % % \changes{v1.0b}{2004/08/12}{New option -% \texttt{nospecialtricks} for testing purposes. (RN)} +% \texttt{nospecialtricks} for testing purposes. (RN)} +% \changes{v2.0a}{2020/10/13}{The macro \cmd{\LenToUnit} is no longer +% required. (RN)} % \begin{macrocode} \@ifundefined{iflandscape}{\newif\iflandscape}{}% \@ifundefined{iftumble}{\newif\iftumble}{}% @@ -213,10 +226,10 @@ \DeclareOption{foldmark}{% \def\LL@foldmark{% \begingroup - \linethickness{\LenToUnit{\foldmarkrule}}% + \linethickness{\foldmarkrule}% \@tempdima=\dimexpr\paperheight-\LL@tmargin - \put(0,\LenToUnit{\@tempdima}){% - \line(0,-1){\LenToUnit{\foldmarklength}}}% + \put(0,\@tempdima){% + \line(0,-1){\foldmarklength}}% \endgroup}% } % \end{macrocode} @@ -284,13 +297,12 @@ % \begin{macro}{\write} % \begin{macro}{\openout} % \begin{macro}{\closeout} -% Im Folgenden definieren wir die \TeX{} primitives \cmd{\immediate}, -% \cmd{\write}, \cmd{\openout} und \cmd{\closeout} um. Alle nicht -% ``immediate'' ausgef\"uhrten Anweisungen werden dem Makro -% \cmd{\@@@pending@outs} (Kommaliste) hinzugef\"ugt. So k\"onnen speziell die -% \cmd{\write}-Anweisungen unabh\"angig von \TeX's \cmd{\shipout} -% zu einem g\"unstigen Zeitpunkt ausgef\"uhrt werden. For V\TeX\ we -% must keep in mind that \cmd{\immediate}\cmd{\special} exist. +% In the following we redefine the \TeX{} primitives \cmd{\immediate}, +% \cmd{\write}, \cmd{\openout}, and \cmd{\closeout}. All of them not +% ``immediate'' executed statements are added to the macro +% \cmd{\@@@pending@outs} (comma list). So especially the \cmd{\write} +% statements independent of \TeX's \cmd{\shipout} run at a convenient time. For +% V\TeX\ we must keep in mind that \cmd{\immediate}\cmd{\special} exist. % \changes{v1.0b}{2004/08/12}{\cmd{\special} must be processed similar % to e.\,g. \cmd{\write} (V\TeX). (RN)} % \begin{macrocode} @@ -426,20 +438,20 @@ % ready. It works only for output commands in the main text which moved to % the next page but not for floating output commands. % \begin{macrocode} - \newcommand*\@@@exec@outs{% - \begingroup +\newcommand*\@@@exec@outs{% + \begingroup % \end{macrocode} % Pending io's $=\cmd{\@tempcntb} = \mbox{TOTAL-OUTS}\,-\,\mbox{LAST-EXEC}$ % \begin{macrocode} - \@tempcntb\c@@@total@outs\advance\@tempcntb-\c@@@last@exec% - \edef\reserved@a{\botmarks\@@@out@mark}% - \ifx\reserved@a\@empty\@tempcnta\z@\else\@tempcnta\reserved@a\fi% - \LL@debug@info{PENDING-OUTS:\the\@tempcntb\space\space - TOTAL-OUTS:\the\c@@@total@outs\space\space - LAST-EXEC:\the\c@@@last@exec\space\space - TOPMARK:\topmarks\@@@out@mark\space\space - FIRSTMARK:\firstmarks\@@@out@mark\space\space - BOTMARK:\botmarks\@@@out@mark}% + \@tempcntb\c@@@total@outs\advance\@tempcntb-\c@@@last@exec% + \edef\reserved@a{\botmarks\@@@out@mark}% + \ifx\reserved@a\@empty\@tempcnta\z@\else\@tempcnta\reserved@a\fi% + \LL@debug@info{PENDING-OUTS:\the\@tempcntb\space\space + TOTAL-OUTS:\the\c@@@total@outs\space\space + LAST-EXEC:\the\c@@@last@exec\space\space + TOPMARK:\topmarks\@@@out@mark\space\space + FIRSTMARK:\firstmarks\@@@out@mark\space\space + BOTMARK:\botmarks\@@@out@mark}% % \end{macrocode} % Last valid pending entry $ = \cmd{\@tempcntb} = % \mbox{PENDING-OUTS}\,-\,\mbox{TOTAL-OUTS}\,+\,\mbox{BOTMARK} $ @@ -447,33 +459,33 @@ % Number of invalid (moved) out's $ = \cmd{\@tempcnta} = % \mbox{TOTAL-OUTS}\,-\,\mbox{BOTMARK} $ % \begin{macrocode} - \advance\@tempcnta-\c@@@total@outs \advance\@tempcntb\@tempcnta - \@tempcnta-\@tempcnta% - \ifnum\@tempcnta>\z@ - \LL@debug@info{% - >>> resave \the\@tempcnta\space output command(s). - Too early to execute! <<<}% - \fi - \@tempcnta\z@ \def\reserved@b{}% - \@for\reserved@a :=\@@@pending@outs\do{% - \ifx\reserved@a\@empty\else - \ifnum\@tempcnta<\@tempcntb% - \reserved@a% execute output's related to the current page box. - \global\advance\c@@@last@exec\@ne - \LL@debug@info{>>> execute output command number - \the\c@@@last@exec\space<<<}% - \else + \advance\@tempcnta-\c@@@total@outs \advance\@tempcntb\@tempcnta + \@tempcnta-\@tempcnta% + \ifnum\@tempcnta>\z@ + \LL@debug@info{% + >>> resave \the\@tempcnta\space output command(s). + Too early to execute! <<<}% + \fi + \@tempcnta\z@ \def\reserved@b{}% + \@for\reserved@a :=\@@@pending@outs\do{% + \ifx\reserved@a\@empty\else + \ifnum\@tempcnta<\@tempcntb% + \reserved@a% execute output's related to the current page box. + \global\advance\c@@@last@exec\@ne + \LL@debug@info{>>> execute output command number + \the\c@@@last@exec\space<<<}% + \else % \end{macrocode} % Other output's must be resaved and still pending. % \begin{macrocode} - \expandafter\g@addto@macro\expandafter\reserved@b\expandafter{% - \reserved@a,}% - \fi - \advance\@tempcnta\@ne% - \fi}% - \expandafter\@temptokena\expandafter{\reserved@b}% - \xdef\@@@pending@outs{\the\@temptokena}% - \endgroup}% + \expandafter\g@addto@macro\expandafter\reserved@b\expandafter{% + \reserved@a,}% + \fi + \advance\@tempcnta\@ne% + \fi}% + \expandafter\@temptokena\expandafter{\reserved@b}% + \xdef\@@@pending@outs{\the\@temptokena}% + \endgroup}% % \end{macrocode} % \end{macro} % \begin{macrocode} @@ -498,13 +510,6 @@ \if@nobreak\ifvmode\nobreak\fi\fi}% % \end{macrocode} % \end{macro} -% \begin{macro}{\shipout} -% We make \LaTeX's \cmd{\shipout} inefficacious (no more shipout at -% all). -% \begin{macrocode} - \def\shipout{\deadcycles\z@\setbox\@tempboxa=} -% \end{macrocode} -% \end{macro} % \begin{macro}{\@begindvi} % Delay \cmd{\@begindvi} to be executed until the real page output. % \begin{macrocode} @@ -519,7 +524,7 @@ % package `calc'.(RN)} % \begin{macrocode} \LoadClass{article} -\RequirePackage{everyshi,graphicx} +\RequirePackage{graphicx} % \end{macrocode} % \begin{macro}{\LL@pagesize@specials} % Now the graphics driver is known. @@ -540,27 +545,27 @@ \if@tempswa \ClassInfo{leaflet}{Generating code for dvips}% \def\LL@pagesize@specials#1#2{% - \@tempdima=#1\@tempdimb=#2% + \@tempdima=#1\@tempdimb=#2 % \AtBeginDvi{\special{papersize=\the\@tempdima,\the\@tempdimb}}}% \fi \def\reserved@a{pdftex}% \ifx\filename@base\reserved@a \ClassInfo{leaflet}{Generating code for pdfTeX}% \def\LL@pagesize@specials#1#2{% - \@tempdima=#1\@tempdimb=#2% + \@tempdima=#1\@tempdimb=#2 % \pdfpagewidth\@tempdima\pdfpageheight\@tempdimb}% \fi \def\reserved@a{luatex}% \ifx\filename@base\reserved@a \ClassInfo{leaflet}{Generating code for LuaTeX}% - \ifx\pdfvariable\@undefined + \ifx\pdfpagewidth\@undefined \def\LL@pagesize@specials#1#2{% - \@tempdima=#1\@tempdimb=#2% - \pdfpagewidth\@tempdima\pdfpageheight\@tempdimb}% + \@tempdima=#1\@tempdimb=#2 % + \pagewidth\@tempdima\pageheight\@tempdimb}% \else \def\LL@pagesize@specials#1#2{% - \@tempdima=#1\@tempdimb=#2% - \pagewidth\@tempdima\pageheight\@tempdimb}% + \@tempdima=#1\@tempdimb=#2 % + \pdfpagewidth\@tempdima\pdfpageheight\@tempdimb}% \fi \fi \def\reserved@a{xetex}% @@ -814,16 +819,6 @@ % \end{macrocode} % \end{macro} % \end{macro} -% \begin{macro}{\LenToUnit} -% \changes{v1.0a}{2004/08/08}{New macro \cmd{\LenToUnit}. (RN)} -% \changes{v1.1a}{2015/12/27}{\cmd{\providecommand} instead of -% \cmd{\newcommand}. (RN)} -% \cmd{\LenToUnit}\marg{dimension} can be used in a -% |picture| environment instead of multiples of \cmd{\unitlength}. -% \begin{macrocode} -\providecommand\LenToUnit[1]{#1\@gobble} -% \end{macrocode} -% \end{macro} % \begin{macro}{\CutLine} % \begin{macro}{\CutLine*} % \begin{macro}{\Scissors} @@ -840,13 +835,13 @@ \if@tempswa \AddToBackground{#1}{% \put(0,0){% - \rotatebox{90}{\makebox(\LenToUnit{\paperheight},0){% + \rotatebox{90}{\makebox(\paperheight,0){% \normalsize \dotfill}}}}% \else \AddToBackground{#1}{% \put(0,0){% - \rotatebox{90}{\makebox(\LenToUnit{\paperheight},0){% + \rotatebox{90}{\makebox(\paperheight,0){% \normalsize \dotfill\Scissors\dotfill\dotfill\Scissors\dotfill}}}}% \fi @@ -876,7 +871,7 @@ % \end{macro} % We use our own page saving macro instead of real \LaTeX\ output. % \begin{macrocode} -\AtBeginDocument{\EveryShipout{\LL@savePage}} +\AtBeginDocument{\AddToHook{shipout/before}{\LL@processPage}} % \end{macrocode} % \begin{macro}{LL@page} % A counter for the small pages (absolute counting). @@ -885,14 +880,19 @@ \newcommand\LL@tempa{} % \end{macrocode} % \end{macro} -% \begin{macro}{\LL@savePage} +% \begin{macro}{\LL@processPage} % With ``combine'' option the six small pages will be saved in box registers % (\cmd{\LL@boxI}\dots \cmd{\LL@boxVI}). -% The box255 with the page content must be a bit moved to get a -% ``normal-sized'' box. +% The \cmd{\ShipoutBox} with the page content must be a bit moved to get a +% ``normal-sized'' box. In ``nocombine'' mode only put the background picture. % \changes{v1.1a}{2015/12/27}{Additions for new option `foldcorr'. (RN)} +% \changes{v2.0a}{2020/10/13}{Do not call \cmd{\@@@exec@outs} temporarily. (RN)} +% \changes{v2.0a}{2020/10/13}{Using \LaTeX's new 'shipout/before' hook. (RN)} +% \changes{v2.0b}{2020/10/14}{Renamed \cmd{\LL@savePage} to +% \cmd{\LL@processPage}. (RN)} % \begin{macrocode} -\newcommand*\LL@savePage{% +\newcommand*\LL@processPage{% + \ifLL@combine\DiscardShipoutBox\fi \ifnum\c@LL@page<7\relax \LL@tempdima=\paperwidth \ifLL@combine @@ -908,18 +908,19 @@ \if@tempswa\LL@tempdima=0.9797979798\paperwidth \else\LL@tempdima=1.0101010101\paperwidth \fi \fi - \@@@exec@outs + %%%\@@@exec@outs \expandafter\newsavebox\csname LL@box\Roman{LL@page}\endcsname% - \setbox\@cclv=\vbox{\vskip1in\unvbox\@cclv}% - \setbox\@cclv=\vbox{\moveright1in\box\@cclv}% - \setbox\@cclv=\hb@xt@\paperwidth{\box\@cclv\hss}% - \iffoldcorr\setbox\@cclv=\hb@xt@\LL@tempdima{\hss\box\@cclv\hss}\fi + \setbox\ShipoutBox=\vbox{\vskip1in\unvbox\ShipoutBox}% + \setbox\ShipoutBox=\vbox{\moveright1in\box\ShipoutBox}% + \setbox\ShipoutBox=\hb@xt@\paperwidth{\box\ShipoutBox\hss}% + \iffoldcorr + \setbox\ShipoutBox=\hb@xt@\LL@tempdima{\hss\box\ShipoutBox\hss}\fi % \end{macrocode} % Add a background picture to a single small page (`combine'). % \begin{macrocode} - \setbox\@cclv=\vb@xt@\paperheight{% + \setbox\ShipoutBox=\vb@xt@\paperheight{% \vbox{% - \pictur@(0,0)(0,\LenToUnit{\paperheight})% + \pictur@(0,0)(0,\paperheight)% \begingroup \set@typeset@protect \paperwidth=\LL@tempdima @@ -927,26 +928,26 @@ \endgroup \endpicture }% - \nointerlineskip\box\@cclv\vss + \nointerlineskip\box\ShipoutBox\vss }% \global\expandafter\setbox - \csname LL@box\Roman{LL@page}\endcsname=\box\@cclv + \csname LL@box\Roman{LL@page}\endcsname=\box\ShipoutBox \typeout{\@spaces[\the\c@LL@page] ==> [\Roman{LL@page}]}% \else % \end{macrocode} % Add a background picture to a single small page (`nocombine'). % \begin{macrocode} - \setbox\@cclv\vbox{% + \setbox\ShipoutBox\vbox{% \vbox{\@tempdima=1in\relax \@tempdimb=\paperheight\advance\@tempdimb-\@tempdima - \pictur@(0,0)(\LenToUnit{\@tempdima},\LenToUnit{\@tempdimb})% + \pictur@(0,0)(\@tempdima,\@tempdimb)% \begingroup \set@typeset@protect \@nameuse{LL@smallPic\Roman{LL@page}}% \endgroup \endpicture }% - \nointerlineskip\box\@cclv + \nointerlineskip\box\ShipoutBox }% \fi \fi @@ -967,53 +968,58 @@ % \end{macrocode} % \end{macro} % -% \subsubsection{Generating missing small pages} -% -% NOTE TO OURSELVES: +% \noindent NOTE TO OURSELVES: % All the following must be done if the document code is already -% processed. -% \begin{macrocode} -\ifLL@combine -% \end{macrocode} -% \begin{macro}{\@@end} -% \begin{macrocode} - \def\@@end{% - \clearpage\pagestyle{empty}% +% processed. +% +% \changes{v2.0b}{2020/10/14}{Using hooks instead of redefinition +% of \cmd{\@@end}. (RN)} +% \begin{macro}{\LL@add@empty@pages} +% Generating missing small pages +% \begin{macrocode} +\newcommand*\LL@add@empty@pages{% + \clearpage\pagestyle{empty}% + \loop\ifnum\c@LL@page<7\relax + \ClassInfo{leaflet}{Generating empty page \the\c@page}% + \null\newpage + \repeat +} % \end{macrocode} -% Restore the original \cmd{\@outputpage} command (removing any related -% background pictures). +% \end{macro} +% \begin{macro}{\LL@shipout@combined@pages} % \begin{macrocode} - \let\@outputpage\LL@outputpage +\newcommand*\LL@shipout@combined@pages{% % \end{macrocode} -% Suppresses all everyshi's clients (removing other kinds of -% background pictures) but our page saving macro is still needed for +% +% \subsubsection{Reassembling the small pages} +% +% Suppresses all shipout hook's clients (removing other kinds of +% background pictures). Our page saving macro is still needed for % the next step and must be set again. +% \changes{v2.0b}{2020/10/14}{Suppress other background images. (RN)} % \begin{macrocode} - \def\@EveryShipout@Hook{}% - \def\@EveryShipout@AtNextHook{}% - \EveryShipout{\LL@savePage}% + \RemoveFromHook{shipout/foreground}[*] + \RemoveFromHook{shipout/background}[*] + \RemoveFromHook{shipout/firstpage}[*] + \RemoveFromHook{shipout/lastpage}[*] + \RemoveFromHook{shipout/before}[*] + \AddToHook{shipout/before}{\LL@processPage} % \end{macrocode} % Create empty pages if necessary. % \begin{macrocode} - \loop\ifnum\c@LL@page<7\relax - \ClassInfo{leaflet}{Generating empty page \the\c@page}% - \null\newpage - \repeat + \LL@add@empty@pages % \end{macrocode} -% -% \subsubsection{Reassembling the small pages} -% -% Here begins the real output using \LaTeX's original \cmd{\shipout}. -% The \textsf{everyshi} package isn't active any more. -% The begin dvi hook is reactivated. -% \begin{macrocode} - \let\shipout\LL@shipout \let\@begindvi\LL@begindvi - \paperwidth=3\paperwidth - \iflandscape - \LL@pagesize@specials{\paperwidth}{\paperheight}% - \else - \LL@pagesize@specials{\paperheight}{\paperwidth}% - \fi +% Here begins the real output. LaTeX's \cmd{\shipout} will no more suppressed. +% The begin dvi hook is reactivated. Final removing content from the hook. +% \begin{macrocode} + \RemoveFromHook{shipout/before}[*] + \let\@begindvi\LL@begindvi + \paperwidth=3\paperwidth + \iflandscape + \LL@pagesize@specials{\paperwidth}{\paperheight}% + \else + \LL@pagesize@specials{\paperheight}{\paperwidth}% + \fi % \end{macrocode} % \begin{macro}{\LL@shipoutPage} % \changes{v1.0c}{2004/08/13}{Fix \cmd{\protect}-ion problems. (RN/HjG)} @@ -1024,22 +1030,22 @@ % Helper macros for page output: reassemble the small pages. % % \begin{macrocode} - \newcommand*\LL@shipoutPage[1]{% + \newcommand*\LL@shipoutPage[1]{% % \set@display@protect - \let \protect \noexpand - \shipout\vb@xt@\paperheight{% - \set@typeset@protect - \vskip-1in% - \@begindvi\hb@xt@\paperwidth{\hskip-1in##1\hss}\vss}}% - \newcommand*\LL@preparePages[3]{% - \typeout{[\@Roman{##1}\space\@Roman{##2}\space\@Roman{##3}] ==>}% + \let \protect \noexpand + \shipout\vb@xt@\paperheight{% + \set@typeset@protect + \vskip-1in% + \@begindvi\hb@xt@\paperwidth{\hskip-1in##1\hss}\vss}}% + \newcommand*\LL@preparePages[3]{% + \typeout{[\@Roman{##1}\space\@Roman{##2}\space\@Roman{##3}] ==>}% % \end{macrocode} % Add a background picture to a large page. % \begin{macrocode} - \pictur@(0,0)\@nameuse{LL@largePic\Roman{page}}\endpicture% - \LL@preparePage{##1}\LL@preparePage{##2}\LL@preparePage{##3}}% - \newcommand*\LL@preparePage[1]{% - \expandafter\box\csname LL@box\@Roman{##1}\endcsname}% + \pictur@(0,0)\@nameuse{LL@largePic\Roman{page}}\endpicture% + \LL@preparePage{##1}\LL@preparePage{##2}\LL@preparePage{##3}}% + \newcommand*\LL@preparePage[1]{% + \expandafter\box\csname LL@box\@Roman{##1}\endcsname}% % \end{macrocode} % \end{macro} % \end{macro} @@ -1049,35 +1055,31 @@ % order, to allow the typesetting of a 4 page leaflet and a detachable 2 page % form, for summaries, fill-in forms, applications, questionnaires, etc. % \begin{macrocode} - \LL@selectOutput - \iftwopart - {\setcounter{page}{1}% - \LL@shipoutPage{\LL@rotate@I{\LL@preparePages{6}{4}{1}}}}% - {\setcounter{page}{2}% - \LL@shipoutPage{\LL@rotate@II{\LL@preparePages{2}{3}{5}}}}% - \else - {\setcounter{page}{1}% - \LL@shipoutPage{\LL@rotate@I{\LL@preparePages{5}{6}{1}}}}% - {\setcounter{page}{2}% - \LL@shipoutPage{\LL@rotate@II{\LL@preparePages{2}{3}{4}}}}% - \fi - \LL@@end - }% + \LL@selectOutput + \iftwopart + {\setcounter{page}{1}% + \LL@shipoutPage{\LL@rotate@I{\LL@preparePages{6}{4}{1}}}}% + {\setcounter{page}{2}% + \LL@shipoutPage{\LL@rotate@II{\LL@preparePages{2}{3}{5}}}}% + \else + {\setcounter{page}{1}% + \LL@shipoutPage{\LL@rotate@I{\LL@preparePages{5}{6}{1}}}}% + {\setcounter{page}{2}% + \LL@shipoutPage{\LL@rotate@II{\LL@preparePages{2}{3}{4}}}}% + \fi +}% % \end{macrocode} -% End of the redefinition of \cmd{\@@end}. % \end{macro} -% \begin{macrocode} +% \begin{macrocode} +\ifLL@combine + \AddToHook{enddocument/end}{\LL@shipout@combined@pages} \else % \end{macrocode} % Create empty pages if necessary and then call the normal \LaTeX\ end. % \begin{macrocode} \LL@pagesize@specials{\paperwidth}{\paperheight}% \AtEndDocument{% - \clearpage\pagestyle{empty}% - \loop\ifnum\c@LL@page<7\relax - \ClassInfo{leaflet}{Generating empty page \the\c@page}% - \null\newpage - \repeat + \LL@add@empty@pages } \fi % @@ -1138,8 +1140,7 @@ \MakeShortVerb{\|} \usepackage{url} \usepackage{graphicx} -\usepackage[dvipsnames,usenames]{color} -\definecolor{LIGHTGRAY}{gray}{.9} +\usepackage[svgnames]{xcolor} %%%%\renewcommand{\descfont}{\normalfont} \newcommand\Lpack[1]{\textsf{#1}} @@ -1160,13 +1161,13 @@ \CutLine{6}% Dotted line with scissors \AddToBackground{5}{% Background of a small page - \put(0,0){\textcolor{Cerulean}{\rule{\paperwidth}{\paperheight}}}} + \put(0,0){\textcolor{LightSkyBlue}{\rule{\paperwidth}{\paperheight}}}} \AddToBackground*{2}{% Background of a large page - \put(\LenToUnit{.5\paperwidth},\LenToUnit{.5\paperheight}){% + \put(.5\paperwidth,.5\paperheight){% \makebox(0,0)[c]{% \resizebox{.9\paperwidth}{!}{\rotatebox{35.26}{% - \textsf{\textbf{\textcolor{LIGHTGRAY}{BACKGROUND}}}}}}}} + \textsf{\textbf{\textcolor{LightGray}{BACKGROUND}}}}}}}} \begin{document} @@ -1208,10 +1209,6 @@ document is created in PostScript or PDF format, using \end{itemize} (Some other drivers supported by standard \LaTeX{} work as well.) -The non-standard macro package \Lpack{everyshi} \cite{cit:everyshi} is -used by the \Lclass{leaflet} class. - - \section{Features} Basically the \Lclass{leaflet} class provides the same features as the @@ -1401,9 +1398,6 @@ this document class. \bibitem{cit:latex-man} \textsc{L.\,Lamport}: \LaTeX. A Document Preparation System. \textit{User's Guide And Reference Manual.} Second Edition. 1994. -\bibitem{cit:everyshi} - \textsc{M.\,Schr\"oder}: The \Lpack{everyshi} package. 2001. - CTAN: \url{macros/latex/contrib/ms/everyshi.dtx} \end{thebibliography} \loggingall diff --git a/Master/texmf-dist/tex/latex/leaflet/leaflet.cls b/Master/texmf-dist/tex/latex/leaflet/leaflet.cls index b1561488ee4..38eb4fcb81d 100644 --- a/Master/texmf-dist/tex/latex/leaflet/leaflet.cls +++ b/Master/texmf-dist/tex/latex/leaflet/leaflet.cls @@ -20,11 +20,18 @@ %% %% This work has the LPPL maintenance status "author-maintained". %% -\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\NeedsTeXFormat{LaTeX2e}[2020-10-01] \ProvidesClass{leaflet} - [2015/12/27 v1.1a LaTeX document class (JS,WaS,RN,HjG)] -\let\LL@shipout\shipout \let\LL@outputpage\@outputpage -\let\LL@begindvi\@begindvi \let\LL@@end\@@end + [2020/10/14 v2.0b LaTeX document class (JS,WaS,RN,HjG)] +\@ifundefined{DiscardShipoutBox}{% + \ClassError{leaflet}{% + LaTeX version equal to or newer \MessageBreak + than '2020-10-01' is required% + }{% + Renew your TeX installation.% + }% +}{} +\let\LL@begindvi\@begindvi \@ifundefined{iflandscape}{\newif\iflandscape}{}% \@ifundefined{iftumble}{\newif\iftumble}{}% \@ifundefined{iftwopart}{\newif\iftwopart}{}% @@ -65,10 +72,10 @@ \DeclareOption{foldmark}{% \def\LL@foldmark{% \begingroup - \linethickness{\LenToUnit{\foldmarkrule}}% + \linethickness{\foldmarkrule}% \@tempdima=\dimexpr\paperheight-\LL@tmargin - \put(0,\LenToUnit{\@tempdima}){% - \line(0,-1){\LenToUnit{\foldmarklength}}}% + \put(0,\@tempdima){% + \line(0,-1){\foldmarklength}}% \endgroup}% } \DeclareOption{nofoldmark}{\def\LL@foldmark{}}% @@ -181,41 +188,41 @@ \global\advance\c@@@total@outs\@ne% \marks\@@@out@mark{\the\c@@@total@outs}% \g@addto@macro\@@@pending@outs{\@@@immediate\@@@closeout\number#1,}}% - \newcommand*\@@@exec@outs{% - \begingroup - \@tempcntb\c@@@total@outs\advance\@tempcntb-\c@@@last@exec% - \edef\reserved@a{\botmarks\@@@out@mark}% - \ifx\reserved@a\@empty\@tempcnta\z@\else\@tempcnta\reserved@a\fi% - \LL@debug@info{PENDING-OUTS:\the\@tempcntb\space\space - TOTAL-OUTS:\the\c@@@total@outs\space\space - LAST-EXEC:\the\c@@@last@exec\space\space - TOPMARK:\topmarks\@@@out@mark\space\space - FIRSTMARK:\firstmarks\@@@out@mark\space\space - BOTMARK:\botmarks\@@@out@mark}% - \advance\@tempcnta-\c@@@total@outs \advance\@tempcntb\@tempcnta - \@tempcnta-\@tempcnta% - \ifnum\@tempcnta>\z@ - \LL@debug@info{% - >>> resave \the\@tempcnta\space output command(s). - Too early to execute! <<<}% +\newcommand*\@@@exec@outs{% + \begingroup + \@tempcntb\c@@@total@outs\advance\@tempcntb-\c@@@last@exec% + \edef\reserved@a{\botmarks\@@@out@mark}% + \ifx\reserved@a\@empty\@tempcnta\z@\else\@tempcnta\reserved@a\fi% + \LL@debug@info{PENDING-OUTS:\the\@tempcntb\space\space + TOTAL-OUTS:\the\c@@@total@outs\space\space + LAST-EXEC:\the\c@@@last@exec\space\space + TOPMARK:\topmarks\@@@out@mark\space\space + FIRSTMARK:\firstmarks\@@@out@mark\space\space + BOTMARK:\botmarks\@@@out@mark}% + \advance\@tempcnta-\c@@@total@outs \advance\@tempcntb\@tempcnta + \@tempcnta-\@tempcnta% + \ifnum\@tempcnta>\z@ + \LL@debug@info{% + >>> resave \the\@tempcnta\space output command(s). + Too early to execute! <<<}% + \fi + \@tempcnta\z@ \def\reserved@b{}% + \@for\reserved@a :=\@@@pending@outs\do{% + \ifx\reserved@a\@empty\else + \ifnum\@tempcnta<\@tempcntb% + \reserved@a% execute output's related to the current page box. + \global\advance\c@@@last@exec\@ne + \LL@debug@info{>>> execute output command number + \the\c@@@last@exec\space<<<}% + \else + \expandafter\g@addto@macro\expandafter\reserved@b\expandafter{% + \reserved@a,}% \fi - \@tempcnta\z@ \def\reserved@b{}% - \@for\reserved@a :=\@@@pending@outs\do{% - \ifx\reserved@a\@empty\else - \ifnum\@tempcnta<\@tempcntb% - \reserved@a% execute output's related to the current page box. - \global\advance\c@@@last@exec\@ne - \LL@debug@info{>>> execute output command number - \the\c@@@last@exec\space<<<}% - \else - \expandafter\g@addto@macro\expandafter\reserved@b\expandafter{% - \reserved@a,}% - \fi - \advance\@tempcnta\@ne% - \fi}% - \expandafter\@temptokena\expandafter{\reserved@b}% - \xdef\@@@pending@outs{\the\@temptokena}% - \endgroup}% + \advance\@tempcnta\@ne% + \fi}% + \expandafter\@temptokena\expandafter{\reserved@b}% + \xdef\@@@pending@outs{\the\@temptokena}% + \endgroup}% \fi% end of eTeX test. \long\def\protected@write#1#2#3{% \begingroup @@ -226,11 +233,10 @@ \reserved@a% \endgroup \if@nobreak\ifvmode\nobreak\fi\fi}% - \def\shipout{\deadcycles\z@\setbox\@tempboxa=} \let\@begindvi\@empty \fi% end of \ifLL@combine \LoadClass{article} -\RequirePackage{everyshi,graphicx} +\RequirePackage{graphicx} \newcommand*\LL@pagesize@specials[2]{} \@ifundefined{Gin@driver}{}{% \ifx\Gin@driver\@empty\else% @@ -242,27 +248,27 @@ \if@tempswa \ClassInfo{leaflet}{Generating code for dvips}% \def\LL@pagesize@specials#1#2{% - \@tempdima=#1\@tempdimb=#2% + \@tempdima=#1\@tempdimb=#2 % \AtBeginDvi{\special{papersize=\the\@tempdima,\the\@tempdimb}}}% \fi \def\reserved@a{pdftex}% \ifx\filename@base\reserved@a \ClassInfo{leaflet}{Generating code for pdfTeX}% \def\LL@pagesize@specials#1#2{% - \@tempdima=#1\@tempdimb=#2% + \@tempdima=#1\@tempdimb=#2 % \pdfpagewidth\@tempdima\pdfpageheight\@tempdimb}% \fi \def\reserved@a{luatex}% \ifx\filename@base\reserved@a \ClassInfo{leaflet}{Generating code for LuaTeX}% - \ifx\pdfvariable\@undefined + \ifx\pdfpagewidth\@undefined \def\LL@pagesize@specials#1#2{% - \@tempdima=#1\@tempdimb=#2% - \pdfpagewidth\@tempdima\pdfpageheight\@tempdimb}% + \@tempdima=#1\@tempdimb=#2 % + \pagewidth\@tempdima\pageheight\@tempdimb}% \else \def\LL@pagesize@specials#1#2{% - \@tempdima=#1\@tempdimb=#2% - \pagewidth\@tempdima\pageheight\@tempdimb}% + \@tempdima=#1\@tempdimb=#2 % + \pdfpagewidth\@tempdima\pdfpageheight\@tempdimb}% \fi \fi \def\reserved@a{xetex}% @@ -411,7 +417,6 @@ \if@tempswa\def\@tempa{LL@largePic}\else\def\@tempa{LL@smallPic}\fi \expandafter\providecommand\csname\@tempa\@Roman{#1}\endcsname{}% \expandafter\g@addto@macro\csname\@tempa\@Roman{#1}\endcsname{#2}} -\providecommand\LenToUnit[1]{#1\@gobble} \newcommand*\CutLine{% \@ifstar{\@tempswatrue\LL@CutLine}{\@tempswafalse\LL@CutLine}} \@onlypreamble\CutLine @@ -421,13 +426,13 @@ \if@tempswa \AddToBackground{#1}{% \put(0,0){% - \rotatebox{90}{\makebox(\LenToUnit{\paperheight},0){% + \rotatebox{90}{\makebox(\paperheight,0){% \normalsize \dotfill}}}}% \else \AddToBackground{#1}{% \put(0,0){% - \rotatebox{90}{\makebox(\LenToUnit{\paperheight},0){% + \rotatebox{90}{\makebox(\paperheight,0){% \normalsize \dotfill\Scissors\dotfill\dotfill\Scissors\dotfill}}}}% \fi @@ -438,10 +443,11 @@ {\newcommand*\Scissors{}} \AddToBackground{3}{\LL@foldmark} \providecommand*\vb@xt@{\vbox to} -\AtBeginDocument{\EveryShipout{\LL@savePage}} +\AtBeginDocument{\AddToHook{shipout/before}{\LL@processPage}} \newcounter{LL@page}\setcounter{LL@page}{1} \newcommand\LL@tempa{} -\newcommand*\LL@savePage{% +\newcommand*\LL@processPage{% + \ifLL@combine\DiscardShipoutBox\fi \ifnum\c@LL@page<7\relax \LL@tempdima=\paperwidth \ifLL@combine @@ -457,15 +463,16 @@ \if@tempswa\LL@tempdima=0.9797979798\paperwidth \else\LL@tempdima=1.0101010101\paperwidth \fi \fi - \@@@exec@outs + %%%\@@@exec@outs \expandafter\newsavebox\csname LL@box\Roman{LL@page}\endcsname% - \setbox\@cclv=\vbox{\vskip1in\unvbox\@cclv}% - \setbox\@cclv=\vbox{\moveright1in\box\@cclv}% - \setbox\@cclv=\hb@xt@\paperwidth{\box\@cclv\hss}% - \iffoldcorr\setbox\@cclv=\hb@xt@\LL@tempdima{\hss\box\@cclv\hss}\fi - \setbox\@cclv=\vb@xt@\paperheight{% + \setbox\ShipoutBox=\vbox{\vskip1in\unvbox\ShipoutBox}% + \setbox\ShipoutBox=\vbox{\moveright1in\box\ShipoutBox}% + \setbox\ShipoutBox=\hb@xt@\paperwidth{\box\ShipoutBox\hss}% + \iffoldcorr + \setbox\ShipoutBox=\hb@xt@\LL@tempdima{\hss\box\ShipoutBox\hss}\fi + \setbox\ShipoutBox=\vb@xt@\paperheight{% \vbox{% - \pictur@(0,0)(0,\LenToUnit{\paperheight})% + \pictur@(0,0)(0,\paperheight)% \begingroup \set@typeset@protect \paperwidth=\LL@tempdima @@ -473,23 +480,23 @@ \endgroup \endpicture }% - \nointerlineskip\box\@cclv\vss + \nointerlineskip\box\ShipoutBox\vss }% \global\expandafter\setbox - \csname LL@box\Roman{LL@page}\endcsname=\box\@cclv + \csname LL@box\Roman{LL@page}\endcsname=\box\ShipoutBox \typeout{\@spaces[\the\c@LL@page] ==> [\Roman{LL@page}]}% \else - \setbox\@cclv\vbox{% + \setbox\ShipoutBox\vbox{% \vbox{\@tempdima=1in\relax \@tempdimb=\paperheight\advance\@tempdimb-\@tempdima - \pictur@(0,0)(\LenToUnit{\@tempdima},\LenToUnit{\@tempdimb})% + \pictur@(0,0)(\@tempdima,\@tempdimb)% \begingroup \set@typeset@protect \@nameuse{LL@smallPic\Roman{LL@page}}% \endgroup \endpicture }% - \nointerlineskip\box\@cclv + \nointerlineskip\box\ShipoutBox }% \fi \fi @@ -503,58 +510,60 @@ \endgroup \fi \stepcounter{LL@page}} +\newcommand*\LL@add@empty@pages{% + \clearpage\pagestyle{empty}% + \loop\ifnum\c@LL@page<7\relax + \ClassInfo{leaflet}{Generating empty page \the\c@page}% + \null\newpage + \repeat +} +\newcommand*\LL@shipout@combined@pages{% + \RemoveFromHook{shipout/foreground}[*] + \RemoveFromHook{shipout/background}[*] + \RemoveFromHook{shipout/firstpage}[*] + \RemoveFromHook{shipout/lastpage}[*] + \RemoveFromHook{shipout/before}[*] + \AddToHook{shipout/before}{\LL@processPage} + \LL@add@empty@pages + \RemoveFromHook{shipout/before}[*] + \let\@begindvi\LL@begindvi + \paperwidth=3\paperwidth + \iflandscape + \LL@pagesize@specials{\paperwidth}{\paperheight}% + \else + \LL@pagesize@specials{\paperheight}{\paperwidth}% + \fi + \newcommand*\LL@shipoutPage[1]{% + \let \protect \noexpand + \shipout\vb@xt@\paperheight{% + \set@typeset@protect + \vskip-1in% + \@begindvi\hb@xt@\paperwidth{\hskip-1in##1\hss}\vss}}% + \newcommand*\LL@preparePages[3]{% + \typeout{[\@Roman{##1}\space\@Roman{##2}\space\@Roman{##3}] ==>}% + \pictur@(0,0)\@nameuse{LL@largePic\Roman{page}}\endpicture% + \LL@preparePage{##1}\LL@preparePage{##2}\LL@preparePage{##3}}% + \newcommand*\LL@preparePage[1]{% + \expandafter\box\csname LL@box\@Roman{##1}\endcsname}% + \LL@selectOutput + \iftwopart + {\setcounter{page}{1}% + \LL@shipoutPage{\LL@rotate@I{\LL@preparePages{6}{4}{1}}}}% + {\setcounter{page}{2}% + \LL@shipoutPage{\LL@rotate@II{\LL@preparePages{2}{3}{5}}}}% + \else + {\setcounter{page}{1}% + \LL@shipoutPage{\LL@rotate@I{\LL@preparePages{5}{6}{1}}}}% + {\setcounter{page}{2}% + \LL@shipoutPage{\LL@rotate@II{\LL@preparePages{2}{3}{4}}}}% + \fi +}% \ifLL@combine - \def\@@end{% - \clearpage\pagestyle{empty}% - \let\@outputpage\LL@outputpage - \def\@EveryShipout@Hook{}% - \def\@EveryShipout@AtNextHook{}% - \EveryShipout{\LL@savePage}% - \loop\ifnum\c@LL@page<7\relax - \ClassInfo{leaflet}{Generating empty page \the\c@page}% - \null\newpage - \repeat - \let\shipout\LL@shipout \let\@begindvi\LL@begindvi - \paperwidth=3\paperwidth - \iflandscape - \LL@pagesize@specials{\paperwidth}{\paperheight}% - \else - \LL@pagesize@specials{\paperheight}{\paperwidth}% - \fi - \newcommand*\LL@shipoutPage[1]{% - \let \protect \noexpand - \shipout\vb@xt@\paperheight{% - \set@typeset@protect - \vskip-1in% - \@begindvi\hb@xt@\paperwidth{\hskip-1in##1\hss}\vss}}% - \newcommand*\LL@preparePages[3]{% - \typeout{[\@Roman{##1}\space\@Roman{##2}\space\@Roman{##3}] ==>}% - \pictur@(0,0)\@nameuse{LL@largePic\Roman{page}}\endpicture% - \LL@preparePage{##1}\LL@preparePage{##2}\LL@preparePage{##3}}% - \newcommand*\LL@preparePage[1]{% - \expandafter\box\csname LL@box\@Roman{##1}\endcsname}% - \LL@selectOutput - \iftwopart - {\setcounter{page}{1}% - \LL@shipoutPage{\LL@rotate@I{\LL@preparePages{6}{4}{1}}}}% - {\setcounter{page}{2}% - \LL@shipoutPage{\LL@rotate@II{\LL@preparePages{2}{3}{5}}}}% - \else - {\setcounter{page}{1}% - \LL@shipoutPage{\LL@rotate@I{\LL@preparePages{5}{6}{1}}}}% - {\setcounter{page}{2}% - \LL@shipoutPage{\LL@rotate@II{\LL@preparePages{2}{3}{4}}}}% - \fi - \LL@@end - }% + \AddToHook{enddocument/end}{\LL@shipout@combined@pages} \else \LL@pagesize@specials{\paperwidth}{\paperheight}% \AtEndDocument{% - \clearpage\pagestyle{empty}% - \loop\ifnum\c@LL@page<7\relax - \ClassInfo{leaflet}{Generating empty page \the\c@page}% - \null\newpage - \repeat + \LL@add@empty@pages } \fi \endinput -- cgit v1.2.3