From 6e16f035a8c484f015e4f50e460436239ca8aef1 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Fri, 4 Jan 2019 21:51:01 +0000
Subject: schwalbe-chess (4jan19)

git-svn-id: svn://tug.org/texlive/trunk@49602 c570f23f-e606-0410-a88d-b1316a301751
---
 .../tex/latex/schwalbe-chess/schwalbe.cls          | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)

(limited to 'Master/texmf-dist/tex/latex/schwalbe-chess/schwalbe.cls')

diff --git a/Master/texmf-dist/tex/latex/schwalbe-chess/schwalbe.cls b/Master/texmf-dist/tex/latex/schwalbe-chess/schwalbe.cls
index d7b2c8b9d15..4efe1923a29 100644
--- a/Master/texmf-dist/tex/latex/schwalbe-chess/schwalbe.cls
+++ b/Master/texmf-dist/tex/latex/schwalbe-chess/schwalbe.cls
@@ -331,6 +331,7 @@
    \stepcounter{@inhalt}%
    \inhalt@label\relax%
    \let\Abteilung=\sw@lsg@abteilung%
+   \let\Loeser=\cpd@save@Loeser%
    % Eintrag im Inhaltsverzeichnis
     \bgroup%
       \def\@tempb{\Loesungen}%
@@ -352,6 +353,35 @@
    \catcode`/=12%
     \endgroup%
 }
+\newwrite\@cpdfile@loeserkuerzel
+\AtBeginDocument{\immediate\openout\@cpdfile@loeserkuerzel=\jobname.ll}
+\AtEndDocument{\immediate\closeout\@cpdfile@loeserkuerzel}
+
+\newcommand{\x@cpd@saveloeser}[2]{%
+   \immediate\write\@cpdfile@loeserkuerzel{\unexpanded{#1:#2}}
+}
+\newcommand{\y@cpd@saveloeser}[2]{%
+   \x@cpd@saveloeser{#1}{#2}%
+   {#2}%
+}
+\newcommand{\cpd@save@Loeser}{%
+   \@ifstar{\y@cpd@saveloeser}{\x@cpd@saveloeser}%
+}
+
+\newboolean{@cpd@first@loeser}
+
+\newcommand{\cpd@display@loeser}[2]{%
+    \ifthenelse{\boolean{@cpd@first@loeser}}{\setboolean{@cpd@first@loeser}{false}}{, }%
+    #2 (#1)%
+}
+
+\newcommand{\ListeLoeserKuerzel}{%
+    \bgroup%
+    \setboolean{@cpd@first@loeser}{true}%
+    \let\Loeser=\cpd@display@loeser%
+    \InputIfFileExists{\jobname.llx}{}{}%
+    \egroup%
+}
 \newenvironment{Loeserliste}[1]{%
    \ttitel@skip%
    \centerline{\Large\bfseries L\"oserliste #1}%
-- 
cgit v1.2.3

