summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-10-22 20:51:06 +0000
committerKarl Berry <karl@freefriends.org>2020-10-22 20:51:06 +0000
commitda47113c029fe8407e6c7270d2a1763081240a67 (patch)
tree6759829c1bf2aca767a1bcc79147a66116084afc /Master
parent61fb10ef8524429784dd835fee2523a635ed8580 (diff)
scrlttr2copy (22oct20)
git-svn-id: svn://tug.org/texlive/trunk@56733 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/scrlttr2copy/README.md8
-rw-r--r--Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.pdfbin88554 -> 88546 bytes
-rw-r--r--Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.tex11
-rw-r--r--Master/texmf-dist/tex/latex/scrlttr2copy/copy.lco81
4 files changed, 53 insertions, 47 deletions
diff --git a/Master/texmf-dist/doc/latex/scrlttr2copy/README.md b/Master/texmf-dist/doc/latex/scrlttr2copy/README.md
index 77e30b6f8e7..cea1bb15a4d 100644
--- a/Master/texmf-dist/doc/latex/scrlttr2copy/README.md
+++ b/Master/texmf-dist/doc/latex/scrlttr2copy/README.md
@@ -1,5 +1,5 @@
# scrlttr2copy
-A letter class option file for automatically creation of copies.
+A letter class option file for automatically creation of page copies.
The file `copy.lco` provides the new class option »copy« for the KOMA-Script
letter class »scrlttr2«. If the option »copy« is given all pages of a specific
@@ -7,6 +7,10 @@ letter are duplicated with background text marking as copies.
For more details see the example document `letter-copy-test.tex`.
-[Rolf Niepraschk](mailto:Rolf.Niepraschk@gmx.de), 2016-02-13
+This work may be distributed and/or modified under the conditions of the LaTeX
+Project Public License, either version 1.3 of this license or (at your option)
+any later version.
+
+Rolf Niepraschk
diff --git a/Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.pdf b/Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.pdf
index aee604b509a..6a5f347143e 100644
--- a/Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.pdf
+++ b/Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.tex b/Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.tex
index 16697625272..6ff0819a9c9 100644
--- a/Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.tex
+++ b/Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.tex
@@ -1,4 +1,4 @@
-
+\listfiles
\documentclass[%
,copy
,ngerman
@@ -18,15 +18,18 @@
%\setkomavar*{copy}{Zweitschrift}
+% It is possible to redefine the \LetterCopyMarker macro to have a different
+% background for the copied pages.
+
\begin{document}
-\setkomavar{subject}{Ihr Schreiben vom 11.\,5.\,2015}
+\setkomavar{subject}{Ihr Schreiben vom 11.\,5.\,2015}
\begin{letter}{%
Ellen Bogen \\
Dorfstraße 1\\
12345 Musterhausen
-}
+}
\opening{Sehr geehrte Frau Bogen,}
@@ -50,6 +53,6 @@ Dorfstraße 1\\
\closing{Mit freundlichen Grüßen}
-\end{letter}
+\end{letter}
\end{document}
diff --git a/Master/texmf-dist/tex/latex/scrlttr2copy/copy.lco b/Master/texmf-dist/tex/latex/scrlttr2copy/copy.lco
index 260d3c6eb8d..989449a59c4 100644
--- a/Master/texmf-dist/tex/latex/scrlttr2copy/copy.lco
+++ b/Master/texmf-dist/tex/latex/scrlttr2copy/copy.lco
@@ -12,7 +12,7 @@
%%
%% This work has the LPPL maintenance status "author-maintained".
-\ProvidesFile{copy.lco}[2020/10/20 v0.2a copy letter-class-option (RN)]
+\ProvidesFile{copy.lco}[2020/10/22 v0.3a copy letter-class-option (RN)]
\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
\IfFormatAtLeastTF{2020/10/01}{}{%
\PackageError{copy.lco}{%
@@ -25,49 +25,20 @@
\RequirePackage{xcolor,graphicx}
-\newcounter{copy@pages}
-
-\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{%
- \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}
+\AtEndLetter{% Saving the number of total pages of each letter in a separate macro
+ \expandafter\xdef\csname CP@max@pages@\the\c@letter\endcsname{\the\c@page}%
}
-\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\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
+\newcommand*\save@page@copies{% Saving each output page in a separate box
+ \expandafter\newsavebox\csname page@box@\the\c@letter @\the\c@page\endcsname
+ \@latex@info@no@line{Save page \the\c@page\space of letter \the\c@letter
+ \space to \string\page@box@\the\c@letter @\the\c@page}%
+ \global\setbox\csname page@box@\the\c@letter @\the\c@page\endcsname=
+ \copy\ShipoutBox
}
+\AddToHook{shipout/before}[CP@save]{\save@page@copies}
+
\newcommand*\LetterCopyMarker{%
\put(0.5\paperwidth,-0.5\paperheight){%
\makebox(0,0)[c]{\resizebox{\textwidth}{!}{\rotatebox{45}{%
@@ -75,6 +46,34 @@
}%
}
+\AddToHook{enddocument/afteraux}[CP@shipout]{%
+ \RemoveFromHook{shipout/before}[CP@save]%
+ \if@twoside\ifodd\ReadonlyShipoutCounter
+ \@latex@info@no@line{Output an empty page}%
+ \shipout\null
+ \fi\fi
+ \AddToHook{shipout/background}[CP@marker]{\LetterCopyMarker}%
+ \@tempcnta=\z@
+ \loop% iterate over all letters
+ \advance\@tempcnta\@ne
+ {%
+ \c@page=\z@
+ \edef\@tempa{\@nameuse{CP@max@pages@\the\@tempcnta}}% total pages
+ \loop% iterate over all pages of this letter
+ \advance\c@page\@ne
+ \@latex@info@no@line{Output of the copy of page \the\c@page\space
+ of letter \the\@tempcnta}%
+ \setbox\ShipoutBox=\box\@nameuse{page@box@\the\@tempcnta @\the\c@page}%
+ \shipout\box\ShipoutBox
+ \ifnum \c@page < \@tempa
+ \repeat
+ }%
+ \ifnum \@tempcnta < \c@letter
+ \repeat
+ \RemoveFromHook{shipout/background}[CP@marker]
+ \RemoveFromHook{enddocument/afteraux}[CP@shipout]
+}
+
\newkomavar[\copyname]{copy}
\newcommand*\copyname{Copy}
@@ -82,7 +81,7 @@
english,newzealand,UKenglish,USenglish}\copyname{Copy}%
\defcaptionname{german,ngerman,austrian,naustrian,%
swissgerman,nswissgerman}\copyname{Kopie}
-\defcaptionname{acadian,canadien,francais,french}\copyname{Copie}
+\defcaptionname{acadian,francais,french}\copyname{Copie}
\defcaptionname{spanish,italian,portugese}\copyname{Copia}
\defcaptionname{polish}\copyname{Kopia}
\defcaptionname{russian}\copyname{Копия}