diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/latex-tipps-und-tricks/verscnt.sty')
-rw-r--r-- | Master/texmf-dist/doc/latex/latex-tipps-und-tricks/verscnt.sty | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/latex-tipps-und-tricks/verscnt.sty b/Master/texmf-dist/doc/latex/latex-tipps-und-tricks/verscnt.sty new file mode 100644 index 00000000000..fdedb1c3dd1 --- /dev/null +++ b/Master/texmf-dist/doc/latex/latex-tipps-und-tricks/verscnt.sty @@ -0,0 +1,38 @@ +% verscnt.sty +% \begin{versenumber}[Start] +% \item Vers <Start> ... +% \item Vers <Start>+1 ... +% \item Vers <Start>+2 ... +% \end{versenumber} +% Start kann entfallen, Zaehlung dann fortlaufend +\RequirePackage{calc} + +% entweder (Nummer) oder (Kapitel--Nummer) +\@ifundefined{chapter} + {\newcounter{verscnt} + \renewcommand{\theverscnt} + {(\arabic{verscnt})}} + {\newcounter{verscnt}[chapter] + \renewcommand{\theverscnt} + {(\thechapter--\arabic{verscnt})}} +\setcounter{verscnt}{0} + +% damit Zaehler nicht mit 0 initialisiert wird +\newcommand{\myusecounter}[1] + {\@nmbrlisttrue\def\@listctr{#1}} + +% Verse mit \item einleiten +% optional: Start-Versnummer-1 +\newenvironment{versenumber}[1][\value{verscnt}] + {\begin{list} + {\theverscnt} + {\myusecounter{verscnt} + \setcounter{verscnt}{#1} + \@ifundefined{chapter} + {\settowidth{\labelwidth}{(999)}} + {\settowidth{\labelwidth}{(99--999)}} + \setlength{\labelsep}{1ex} + \setlength{\itemindent}{\labelwidth+\labelsep} + } + } + {\end{list}} |