summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/scrlttr2copy
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-10-21 03:02:35 +0000
committerNorbert Preining <norbert@preining.info>2020-10-21 03:02:35 +0000
commitd800950bfaacab9c6c4bf4d44206d60016b2f04d (patch)
treea47704a85d1a29b69fcede9454aa32ed2c7b5902 /macros/latex/contrib/scrlttr2copy
parent6c4fb500d344400c932c5792f94aee3e34cbe6a7 (diff)
CTAN sync 202010210302
Diffstat (limited to 'macros/latex/contrib/scrlttr2copy')
-rw-r--r--macros/latex/contrib/scrlttr2copy/copy.lco66
-rw-r--r--macros/latex/contrib/scrlttr2copy/letter-copy-test.pdfbin88407 -> 88554 bytes
-rw-r--r--macros/latex/contrib/scrlttr2copy/letter-copy-test.tex2
3 files changed, 42 insertions, 26 deletions
diff --git a/macros/latex/contrib/scrlttr2copy/copy.lco b/macros/latex/contrib/scrlttr2copy/copy.lco
index e3213a9f24..260d3c6eb8 100644
--- a/macros/latex/contrib/scrlttr2copy/copy.lco
+++ b/macros/latex/contrib/scrlttr2copy/copy.lco
@@ -1,5 +1,5 @@
-%% Copyright (C) 2015
+%% Copyright (C) 2015-2020
%% Rolf Niepraschk, Rolf.Niepraschk@gmx.de
%%
%% This work may be distributed and/or modified under the
@@ -12,45 +12,59 @@
%%
%% This work has the LPPL maintenance status "author-maintained".
-\ProvidesFile{copy.lco}[2015/05/31 v0.1d copy letter-class-option (RN)]
+\ProvidesFile{copy.lco}[2020/10/20 v0.2a copy letter-class-option (RN)]
+\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
+\IfFormatAtLeastTF{2020/10/01}{}{%
+ \PackageError{copy.lco}{%
+ LaTeX version equal to or newer \MessageBreak
+ than '2020/10/01' is required%
+ }{%
+ Renew your TeX installation.%
+ }%
+}
-\RequirePackage{atbegshi,picture,xcolor,graphicx}
-\RequirePackage{etex}
+\RequirePackage{xcolor,graphicx}
\newcounter{copy@pages}
-\AtBeginLetter{\shipout@copy}
-\AtEndDocument{\shipout@copy}
+\AtBeginLetter{\shipout@copy}% Output the copy of the pages of the previous letter
+\AtEndDocument{\shipout@copy}% Output the copy of the pages of the last letter
\newcommand*\shipout@copy{%
- \if@twoside\ifodd\c@copy@pages
- \@latex@info@no@line{Shipout an empty page}%
- \AtBeginShipoutOriginalShipout\null
- \fi\fi
- \immediate\closeout\@mainaux
- \immediate\openout\@mainaux\jobname.aux
- \begingroup
- \c@page=\z@
- \loop\ifnum\c@page<\c@copy@pages
- \advance\c@page\@ne
- \@latex@info@no@line{Shipout copy of page \the\c@page}%
- \setbox\AtBeginShipoutBox=\box\csname out@box\the\c@page\endcsname
- \AtBeginShipoutUpperLeft{\LetterCopyMarker}%
- \AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox
- \repeat
- \endgroup
- \c@copy@pages=\z@
+ \ifnum\c@copy@pages>\z@% ignore the following in the first \AtBeginLetter
+ \RemoveFromHook{shipout/before}[CP@save]
+ \if@twoside\ifodd\c@copy@pages
+ \@latex@info@no@line{Shipout an empty page}%
+ \shipout\null
+ \fi\fi
+ \immediate\closeout\@mainaux
+ \immediate\openout\@mainaux\jobname.aux
+ \begingroup
+ \c@page=\z@
+ \AddToHook{shipout/background}[CP@marker]{\LetterCopyMarker}%
+ \loop\ifnum\c@page<\c@copy@pages
+ \advance\c@page\@ne
+ \@latex@info@no@line{Shipout copy of page \the\c@page}%
+ \setbox\ShipoutBox=\box\csname out@box\the\c@page\endcsname
+ \shipout\box\ShipoutBox
+ \repeat
+ \RemoveFromHook{shipout/background}[CP@marker]
+ \endgroup
+ \c@copy@pages=\z@
+ \fi
+ % Saving all pages of the next letter
+ \AddToHook{shipout/before}[CP@save]{\save@page@copies}
}
-\AtBeginShipout{%
+\newcommand*\save@page@copies{%
\@ifundefined{out@box\the\c@page}{%
\@latex@info@no@line{Alloc savebox for page \the\c@page}%
\expandafter\newsavebox\csname out@box\the\c@page\endcsname
}{%
\@latex@info@no@line{Savebox for page \the\c@page\space already exist}%
}%
- \@latex@info@no@line{Save page \the\c@page}%
- \global\setbox\csname out@box\the\c@page\endcsname=\copy\AtBeginShipoutBox
+ \@latex@info@no@line{Save page \the\c@page\space to \string\out@box\the\c@page}%
+ \global\setbox\csname out@box\the\c@page\endcsname=\copy\ShipoutBox
\global\c@copy@pages=\c@page
}
diff --git a/macros/latex/contrib/scrlttr2copy/letter-copy-test.pdf b/macros/latex/contrib/scrlttr2copy/letter-copy-test.pdf
index 49e0a9b90a..aee604b509 100644
--- a/macros/latex/contrib/scrlttr2copy/letter-copy-test.pdf
+++ b/macros/latex/contrib/scrlttr2copy/letter-copy-test.pdf
Binary files differ
diff --git a/macros/latex/contrib/scrlttr2copy/letter-copy-test.tex b/macros/latex/contrib/scrlttr2copy/letter-copy-test.tex
index 5c265efa8b..1669762527 100644
--- a/macros/latex/contrib/scrlttr2copy/letter-copy-test.tex
+++ b/macros/latex/contrib/scrlttr2copy/letter-copy-test.tex
@@ -36,6 +36,8 @@ Dorfstraße 1\\
\end{letter}
+\setkomavar{subject}{Ihr Schreiben vom 27.\,5.\,2015}
+
\begin{letter}{%
Ellen Bogen \\
Dorfstraße 1\\