diff options
author | Karl Berry <karl@freefriends.org> | 2020-10-14 21:46:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-10-14 21:46:43 +0000 |
commit | 6750592bf6fcf9bb8430a8b30c52368e14b48e0f (patch) | |
tree | 93ef8da397eee725f3e91f9ba73cf5dc45d9ef00 /Master/texmf-dist/tex/latex/leaflet/leaflet.cls | |
parent | b13986f8177f2b46e18a7288e7bb7909d86d18a4 (diff) |
leaflet (14oct20)
git-svn-id: svn://tug.org/texlive/trunk@56666 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/leaflet/leaflet.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/leaflet/leaflet.cls | 239 |
1 files changed, 124 insertions, 115 deletions
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 |