texlive[56718] Master/texmf-dist: scrlttr2copy (20oct20)

commits+karl at tug.org commits+karl at tug.org
Tue Oct 20 22:40:34 CEST 2020


Revision: 56718
          http://tug.org/svn/texlive?view=revision&revision=56718
Author:   karl
Date:     2020-10-20 22:40:34 +0200 (Tue, 20 Oct 2020)
Log Message:
-----------
scrlttr2copy (20oct20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.pdf
    trunk/Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.tex
    trunk/Master/texmf-dist/tex/latex/scrlttr2copy/copy.lco

Modified: trunk/Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.tex	2020-10-20 20:40:24 UTC (rev 56717)
+++ trunk/Master/texmf-dist/doc/latex/scrlttr2copy/letter-copy-test.tex	2020-10-20 20:40:34 UTC (rev 56718)
@@ -36,6 +36,8 @@
 
 \end{letter}
 
+\setkomavar{subject}{Ihr Schreiben vom 27.\,5.\,2015}
+
 \begin{letter}{%
 Ellen Bogen \\
 Dorfstraße 1\\

Modified: trunk/Master/texmf-dist/tex/latex/scrlttr2copy/copy.lco
===================================================================
--- trunk/Master/texmf-dist/tex/latex/scrlttr2copy/copy.lco	2020-10-20 20:40:24 UTC (rev 56717)
+++ trunk/Master/texmf-dist/tex/latex/scrlttr2copy/copy.lco	2020-10-20 20:40:34 UTC (rev 56718)
@@ -1,5 +1,5 @@
 
-%% Copyright (C) 2015
+%% Copyright (C) 2015-2020
 %% Rolf Niepraschk, Rolf.Niepraschk at gmx.de
 %%
 %% This work may be distributed and/or modified under the
@@ -12,37 +12,51 @@
 %%
 %% 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 at 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 at pages}
 
-\AtBeginLetter{\shipout at copy}
-\AtEndDocument{\shipout at copy}
+\AtBeginLetter{\shipout at copy}% Output the copy of the pages of the previous letter
+\AtEndDocument{\shipout at copy}% Output the copy of the pages of the last letter
 
 \newcommand*\shipout at copy{%
-  \if at twoside\ifodd\c at copy@pages
-    \@latex at info@no at line{Shipout an empty page}%
-    \AtBeginShipoutOriginalShipout\null
-  \fi\fi
-  \immediate\closeout\@mainaux
-  \immediate\openout\@mainaux\jobname.aux
-  \begingroup
-    \c at page=\z@
-    \loop\ifnum\c at page<\c at copy@pages
-      \advance\c at page\@ne
-      \@latex at info@no at line{Shipout copy of page \the\c at page}%
-      \setbox\AtBeginShipoutBox=\box\csname out at box\the\c at page\endcsname
-      \AtBeginShipoutUpperLeft{\LetterCopyMarker}%
-      \AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox
-    \repeat
-  \endgroup
-  \c at copy@pages=\z@
+  \ifnum\c at copy@pages>\z@% ignore the following in the first \AtBeginLetter     
+    \RemoveFromHook{shipout/before}[CP at save]
+    \if at twoside\ifodd\c at copy@pages
+      \@latex at info@no at line{Shipout an empty page}%
+      \shipout\null
+    \fi\fi
+    \immediate\closeout\@mainaux
+    \immediate\openout\@mainaux\jobname.aux
+    \begingroup
+      \c at page=\z@
+      \AddToHook{shipout/background}[CP at marker]{\LetterCopyMarker}%
+      \loop\ifnum\c at page<\c at copy@pages
+        \advance\c at page\@ne
+        \@latex at info@no at line{Shipout copy of page \the\c at page}%
+        \setbox\ShipoutBox=\box\csname out at box\the\c at page\endcsname
+        \shipout\box\ShipoutBox
+      \repeat
+      \RemoveFromHook{shipout/background}[CP at marker]
+    \endgroup
+    \c at copy@pages=\z@
+  \fi
+  % Saving all pages of the next letter 
+  \AddToHook{shipout/before}[CP at save]{\save at page@copies}
 }
 
-\AtBeginShipout{%
+\newcommand*\save at page@copies{%
   \@ifundefined{out at box\the\c at page}{%
     \@latex at info@no at line{Alloc savebox for page \the\c at page}%
     \expandafter\newsavebox\csname out at box\the\c at page\endcsname
@@ -49,8 +63,8 @@
   }{%
     \@latex at info@no at line{Savebox for page \the\c at page\space already exist}%
   }%
-  \@latex at info@no at line{Save page \the\c at page}%
-  \global\setbox\csname out at box\the\c at page\endcsname=\copy\AtBeginShipoutBox
+  \@latex at info@no at line{Save page \the\c at page\space to \string\out at box\the\c at page}%
+  \global\setbox\csname out at box\the\c at page\endcsname=\copy\ShipoutBox
   \global\c at copy@pages=\c at page
 }
 



More information about the tex-live-commits mailing list.