From d1d17eb787a0c0122a9180855c1b73f0d9a87416 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Tue, 20 Jun 2017 22:18:03 +0000
Subject: poetry (20jun17)

git-svn-id: svn://tug.org/texlive/trunk@44655 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/poetry/poetry.sty | 369 ++++++++++++++++++++++++++
 1 file changed, 369 insertions(+)
 create mode 100644 Master/texmf-dist/tex/latex/poetry/poetry.sty

(limited to 'Master/texmf-dist/tex/latex/poetry/poetry.sty')

diff --git a/Master/texmf-dist/tex/latex/poetry/poetry.sty b/Master/texmf-dist/tex/latex/poetry/poetry.sty
new file mode 100644
index 00000000000..e0a0751a6e1
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/poetry/poetry.sty
@@ -0,0 +1,369 @@
+%%
+%% This is file `poetry.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% poetry.dtx  (with options: `package')
+%% This is a generated file.
+%% 
+%% This document is copyright 2014 by Donald P. Goodman, and is
+%% released publicly under the LaTeX Project Public License.  The
+%% distribution and modification of this work is constrained by the
+%% conditions of that license.  See
+%% http://www.latex-project.org/lppl.txt
+%% for the text of the license.  This document is released
+%% under version 1.3 of that license, and this work may be distributed
+%% or modified under the terms of that license or, at your option, any
+%% later version.
+%% 
+%% This work has the LPPL maintenance status 'maintained'.
+%% 
+%% The Current Maintainer of this work is Donald P. Goodman
+%% (dgoodmaniii@gmail.com).
+%% 
+%% This work consists of poetry.dtx, poetry.ins, and
+%% derived files poetry.sty and poetry.pdf.
+
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{poetry}[2017/06/19 v1.0 support for typesetting poetry]
+
+\ProvidesPackage{poetry}%
+\newcounter{poemline}%
+\newcount\poemlineno%
+\newcounter{verseline}%
+\newcount\vslineno%
+\newcounter{abspoemno}%
+\newcount\poem@abspoemno%
+\newcounter{poemno}%
+\newcount\poem@poemno%
+\newcounter{poemgroupno}\setcounter{poemgroupno}{0}%
+\newcount\poem@groupno\poem@groupno=0%
+\newcounter{poemlinenumsevery}\setcounter{poemlinenumsevery}{1}%
+\newcount\poem@linenumsevery\poem@linenumsevery=\value{poemlinenumsevery}%
+\newlength{\poemindent}\setlength{\poemindent}{0pt}%
+\newlength{\poemtopskip}{\setlength{\poemtopskip}{1em}%
+\newlength{\poembotskip}{\setlength{\poembotskip}{1em}%
+\newdimen\poem@topskip\newdimen\poem@botskip%
+\newdimen\poem@defleftskip\poem@defleftskip=\the\poemindent%
+\newdimen\poem@maxlinewd%
+\newlength{\poemmaxlinewd}\setlength{\poemmaxlinewd}{\textwidth}%
+\newdimen\poem@hinwd\poem@hinwd=1em%
+\newlength{\poemhinwd}\setlength{\poemhinwd}{1em}%
+\newif\ifpoemlinenums\poemlinenumstrue%
+\newif\ifpoemlinenumright\poemlinenumrightfalse%
+\newdimen\poem@linenumboxwd\poem@linenumboxwd=2em%
+\newlength{\poemlinenumboxwd}\setlength{\poemlinenumboxwd}{2em}%
+\newdimen\poem@linenumboxgap\poem@linenumboxgap=0pt%
+\newlength{\poemlinenumboxgap}\setlength{\poemlinenumboxgap}{0pt}%
+\def\poemlinenumstyle{}%
+\newdimen\poem@hangindent\poem@hangindent=1em%
+\newlength{\poemhangindent}\setlength{\poemhangindent}{1em}%
+\newcount\poem@indentevery\poem@indentevery=0%
+\newcounter{poemindentevery}\setcounter{poemindentevery}{0}%
+\newdimen\poem@verseskip\poem@verseskip=\baselineskip%
+\newlength{\poemverseskip}\setlength{\poemverseskip}{\baselineskip}%
+\newdimen\poem@buff%
+\newcount\poem@tmp%
+\def\poem@expandvsloop#1{\poem@xvsloop#1\relax}%
+\def\poem@xvsloop#1{%
+\ifx\relax#1\else%
+\poem@tmp=#1%
+\ifnum\poem@tmp=\the\vslineno%
+\hin%
+\fi%
+\expandafter\poem@xvsloop%
+\fi%
+}%
+\newcommand{\poem@ifbang}[1]{\@ifnextchar !{\@firstoftwo{#1}}}
+\newcommand{\poem@ifhyph}[1]{\@ifnextchar -{\@firstoftwo{#1}}}
+\newcommand{\poem@ifstar}[1]{\@ifnextchar *{\@firstoftwo{#1}}}
+\newcommand{\poem@ifques}[1]{\@ifnextchar ?{\@firstoftwo{#1}}}
+\newcount\poem@tmpa
+\def\modulo#1#2{%
+\poem@tmpa=#1%
+\divide\poem@tmpa by#2%
+\multiply\poem@tmpa by#2%
+\multiply\poem@tmpa by-1%
+\advance\poem@tmpa by#1\relax%
+}%
+\def\poemvsindentlines{}%
+\def\poemlnindentlines{}%
+\def\tlap#1{\vbox to0pt{\vss\hbox{#1}}}%
+\def\blap#1{\vbox to0pt{\hbox{#1}\vss}}%
+\def\placelineno{%
+\setcounter{verseline}{\the\vslineno}%
+\setcounter{poemline}{\the\poemlineno}%
+\poem@linenumsevery=\value{poemlinenumsevery}%
+\poem@linenumboxgap=\the\poemlinenumboxgap%
+\poem@linenumboxwd=\the\poemlinenumboxwd%
+\modulo{\the\poemlineno}{\the\poem@linenumsevery}%
+\ifpoemlinenums%
+\ifnum\poem@tmpa=0%
+\ifpoemlinenumright%
+\hskip0pt\tlap{%
+\rlap{%
+\hskip\poem@maxlinewd%
+\hskip\poem@linenumboxgap%
+\hbox to\poem@linenumboxwd{%
+\hfil%
+\poemlinenumstyle\thepoemline%
+}%
+}%
+}%
+\else%
+\hskip-\poem@linenumboxgap%
+\llap{%
+\tlap{%
+\hbox to\poem@linenumboxwd{%
+\poemlinenumstyle\thepoemline%
+\hfil%
+}\penalty10000%
+}%
+}\penalty10000%
+\fi%
+\else
+\hskip-\poem@linenumboxgap%
+\llap{\tlap{\hbox to\poem@linenumboxwd{\hfil}}}%
+\penalty10000%
+\fi%
+\else
+\hskip-\poem@linenumboxgap%
+\llap{\tlap{\hbox to\poem@linenumboxwd{\hfil}}}%
+\penalty10000%
+\fi%
+\par\vskip-\baselineskip%
+\poem@indentevery=\value{poemindentevery}%
+\ifnum\poem@indentevery=0%
+\else%
+\modulo{\the\poemlineno}{\the\poem@indentevery}%
+\ifnum\poem@tmpa=0%
+\hin%
+\fi%
+\fi%
+\expandafter\poem@expandvsloop\expandafter{\poemvsindentlines}%
+\def\@currentlabel{\thepoemline}%
+\phantomsection%
+}%
+\def\poem@endline{%
+\par%
+\advance\poemlineno by1%
+\advance\vslineno by1%
+\poem@defaultpars%
+\leftskip=\poem@defleftskip%
+\placelineno%
+}%
+\def\poem@endpart{%
+\par%
+\advance\poemlineno by1%
+\advance\vslineno by1%
+\poem@defaultpars%
+\leftskip=\poem@defleftskip%
+}%
+\def\poem@resume{%
+\placelineno%
+}%
+\def\*{%
+\poem@resume%
+}%
+\def\poem@endverse{%
+\par%
+\vslineno=1%
+\advance\poemlineno by1%
+\poem@verseskip=\the\poemverseskip%
+\vskip\poem@verseskip%
+\leftskip=\poem@defleftskip%
+\placelineno%
+}
+\def\poem@endversepart{%
+\par%
+\advance\poemlineno by1%
+\vslineno=1%
+\poem@defaultpars%
+\leftskip=\poem@defleftskip%
+}
+\def\poem@defaultpars{%
+\poem@hangindent=\the\poemhangindent%
+\everypar={%
+\parindent=0pt%
+\hangindent=\poem@hangindent%
+\hangafter=1%
+}%
+}%
+\def\hin{%
+\poem@hinwd=\the\poemhinwd%
+\advance\leftskip by\the\poem@hinwd%
+\penalty10000%
+}%
+\def\poemnew{%
+\advance\poem@poemno by1\stepcounter{poemno}%
+\advance\poem@abspoemno by1\stepcounter{abspoemno}%
+}%
+\def\poem{%
+\widowpenalty=0\clubpenalty=0%
+\def\\{%
+\poem@ifbang{\poem@endverse}{%
+\poem@ifhyph{\par\vskip\poem@botskip\relax}{%
+\poem@ifstar{\poem@endpart}{%
+\poem@ifques{\poem@endversepart}{\poem@endline}%
+}%
+}%
+}%
+}%
+\poem@defleftskip=\the\poemindent%
+\leftskip=\poem@defleftskip%
+\poem@maxlinewd=\the\poemmaxlinewd%
+\hsize=\the\poem@defleftskip%
+\advance\hsize by\the\poem@maxlinewd%
+\poemlineno=1%
+\vslineno=1%
+\poem@topskip=\the\poemtopskip%
+\poem@botskip=\the\poembotskip%
+\vskip\poem@topskip%
+\poem@defaultpars%
+\noindent%
+\poem@ifstar{}{\placelineno}%
+}%
+\def\endpoem{%
+}%
+\newdimen\poem@centlinewd
+\def\centerpoemon#1{%
+\settowidth{\poem@centlinewd}{#1}%
+\ifdim\poem@centlinewd>\linewidth\poem@defleftskip=0pt%
+\else
+\poem@buff=\linewidth%
+\advance\poem@buff by-\poem@centlinewd%
+\divide\poem@buff by2%
+\poem@defleftskip=\the\poem@buff%
+\poemindent=\the\poem@buff%
+\poem@maxlinewd=\the\poem@centlinewd%
+\setlength{\poemmaxlinewd}{\poem@maxlinewd}%
+\fi
+}%
+\def\centerpoemoff{%
+\poem@defleftskip=0pt\setlength{\poemindent}{0pt}%
+\poem@maxlinewd=\the\linewidth%
+\setlength{\poemmaxlinewd}{\linewidth}%
+}%
+\def\thepoemtitle{\poemblanktitle}%
+\def\thepoemauthor{\poemblankauthor}%
+\def\thepoemlicense{Public Domain}%
+\def\poemdefaultlicense{Public Domain}%
+\def\thepoempubdate{\today}%
+\def\poemblanktitle{Untitled}%
+\def\poemblankauthor{Anonymous}%
+\def\poemtitlestyle{\LARGE\bfseries}%
+\def\poemauthorstyle{\Large}%
+\def\poemtitleprehook{%
+\begin{center}%
+}%
+\def\poemtitleposthook{%
+\end{center}%
+}%
+\def\poemauthorprehook{%
+\begin{center}%
+}%
+\def\poemauthorposthook{%
+\end{center}%
+}%
+\def\titlepoem#1{%
+\advance\poem@poemno by1\stepcounter{poemno}%
+\advance\poem@abspoemno by1\stepcounter{abspoemno}%
+\def\thepoemtitle{#1}\def\thepoemauthor{\poemblankauthor}%
+\begingroup%
+\poemtitleprehook%
+\poemtitlestyle #1%
+\poemtitleposthook%
+\endgroup%
+}%
+\def\titleauthorpoem#1#2{%
+\advance\poem@poemno by1\stepcounter{poemno}%
+\advance\poem@abspoemno by1\stepcounter{abspoemno}%
+\def\thepoemtitle{#1}\def\thepoemauthor{#2}%
+\begingroup%
+\poemtitleprehook%
+\poemtitlestyle #1%
+\poemtitleposthook%
+\endgroup%
+\begingroup%
+\poemauthorprehook%
+\poemauthorstyle #2%
+\poemauthorposthook%
+\endgroup%
+}%
+\def\poemgroup{%
+\advance\poem@groupno by1%
+\stepcounter{poemgroupno}%
+\poem@poemno=0\setcounter{poemno}{0}%
+\def\thepoemgroupname{\poemgroupblankname}%
+}%
+\def\endpoemgroup{%
+}%
+\def\poemgrouptitleprehook{}%
+\def\poemgrouptitleposthook{}%
+\def\poemgroupotherprehook{}%
+\def\poemgroupotherposthook{}%
+\def\poemgrouptitlestyle{\Huge}%
+\def\poemgroupotherstyle{\LARGE}%
+\def\poemgroupblankname{Untitled Group}%
+\def\poemgroupname{\poemgroupblankname}%
+\def\poemgroupheading#1#2{%
+\def\thepoemgroupname{#1}%
+\begingroup%
+\poemgrouptitleprehook%
+\poemgrouptitlestyle #1%
+\poemgrouptitleposthook%
+\endgroup%
+\begingroup%
+\poemgroupotherprehook%
+\poemgroupotherstyle #2%
+\poemgroupotherposthook%
+\endgroup%
+}%
+\def\poemlopformat{%
+\@dottedtocline{1}{0em}{2.3em}%
+}%
+\def\l@poem{\poemlopformat}%
+\def\addtolop#1{%
+\addcontentsline{lop}{poem}{#1}%
+}%
+\def\addgrouptolop#1{%
+\addcontentsline{lop}{poemgroup}{#1}%
+}%
+\def\lopname{List of Poems}%
+\def\listofpoems{%
+\@starttoc{lop}%
+}%
+\def\poemgrouplopformat#1#2{%
+\ifnum \c@tocdepth >\m@ne
+\addpenalty{-\@highpenalty}%
+\vskip 1.0em \@plus\p@
+\setlength\@tempdima{1.5em}%
+\begingroup
+\parindent \z@ \rightskip \@pnumwidth
+\parfillskip -\@pnumwidth
+\leavevmode \bfseries
+\advance\leftskip\@tempdima
+\hskip -\leftskip
+#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
+\penalty\@highpenalty
+\endgroup
+\fi%
+}%
+\def\l@poemgroup{\poemgrouplopformat}%
+\RequirePackage{imakeidx}
+\makeindex[intoc,columns=1,name={\jobname-iofl},title={\poemioflname}]
+\def\poemioflname{Index of First Lines}%
+\def\poemfirstline#1{%
+\index[\jobname-iofl]{#1}%
+}%
+\def\iofl#1{%
+\index[\jobname-iofl]{#1}%
+#1%
+}%
+\def\printiofl{%
+\printindex[\jobname-iofl]%
+}%
+\endinput
+%%
+%% End of file `poetry.sty'.
-- 
cgit v1.2.3

