summaryrefslogtreecommitdiff
path: root/info/examples/ltt/poem.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /info/examples/ltt/poem.sty
Initial commit
Diffstat (limited to 'info/examples/ltt/poem.sty')
-rw-r--r--info/examples/ltt/poem.sty39
1 files changed, 39 insertions, 0 deletions
diff --git a/info/examples/ltt/poem.sty b/info/examples/ltt/poem.sty
new file mode 100644
index 0000000000..8561826471
--- /dev/null
+++ b/info/examples/ltt/poem.sty
@@ -0,0 +1,39 @@
+% poem.sty
+% Gedichte mit Verzeichniseintrag
+\RequirePackage{ifthen}
+
+% Der Zaehler.
+\newcounter{poemcnt}
+\renewcommand{\thepoemcnt}{\Roman{poemcnt}}
+
+% Formatiert die Eintraege im Verzeichnis.
+\newcommand{\l@poem}[2]
+ {{\renewcommand{\numberline}[1]
+ {\makebox[1cm][l]{##1}}
+ \itshape #1\dotfill#2}\\}
+
+% Erzeugt die Eintraege im Verzeichnis und druckt
+% den Gedichtkopf in einem bestimmen Format.
+\newenvironment{poem}[1]
+ {\refstepcounter{poemcnt}
+ \addcontentsline{lop}{poem}
+ {\protect\numberline{\thepoemcnt} #1}
+ \begin{verse}
+ \flushleft{\itshape\thepoemcnt{} #1}
+ }
+ {\end{verse}}
+
+% Erzeugt das Verzeichnis.
+\newcommand{\lopname}{Die Gedichte}
+\newcommand{\tableofpoems}
+ {\setboolean{@restonecol}{false}
+ \ifthenelse{\boolean{@twocolumn}}
+ {\setboolean{@restonecol}{true}\onecolumn}
+ {}
+ \chapter*{\lopname\@mkboth{\lopname}{\lopname}}
+ {\setlength{\parindent}{0pt}
+ \@starttoc{lop}}
+ \ifthenelse{\boolean{@restonecol}}
+ {\twocolumn}
+ {}
+ }