texlive[50921] Master/texmf-dist: poetry (1may19)

commits+karl at tug.org commits+karl at tug.org
Thu May 2 00:51:20 CEST 2019


Revision: 50921
          http://tug.org/svn/texlive?view=revision&revision=50921
Author:   karl
Date:     2019-05-02 00:51:20 +0200 (Thu, 02 May 2019)
Log Message:
-----------
poetry (1may19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/poetry/CHANGES
    trunk/Master/texmf-dist/doc/latex/poetry/README
    trunk/Master/texmf-dist/doc/latex/poetry/poetry.pdf
    trunk/Master/texmf-dist/source/latex/poetry/poetry.dtx
    trunk/Master/texmf-dist/source/latex/poetry/poetry.ins
    trunk/Master/texmf-dist/tex/latex/poetry/poetry.sty

Modified: trunk/Master/texmf-dist/doc/latex/poetry/CHANGES
===================================================================
--- trunk/Master/texmf-dist/doc/latex/poetry/CHANGES	2019-05-01 22:50:55 UTC (rev 50920)
+++ trunk/Master/texmf-dist/doc/latex/poetry/CHANGES	2019-05-01 22:51:20 UTC (rev 50921)
@@ -1,3 +1,6 @@
+2 May 1203 (2 May 2019):  Added ability to arbitrarily label
+both the left and right sides of the line.  Version 2.0.
+
 X Sept 1202 (10 Sept 2018):  Removed *requirement* for
 hyperref by inserting a fake definition for \phantomsection,
 which is the only hyperref command used.

Modified: trunk/Master/texmf-dist/doc/latex/poetry/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/poetry/README	2019-05-01 22:50:55 UTC (rev 50920)
+++ trunk/Master/texmf-dist/doc/latex/poetry/README	2019-05-01 22:51:20 UTC (rev 50921)
@@ -1,6 +1,6 @@
 +AMDG
 
-This document is copyright 2018 by Donald P. Goodman, and is
+This document is copyright 2019 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

Modified: trunk/Master/texmf-dist/doc/latex/poetry/poetry.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/poetry/poetry.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/poetry/poetry.dtx	2019-05-01 22:50:55 UTC (rev 50920)
+++ trunk/Master/texmf-dist/source/latex/poetry/poetry.dtx	2019-05-01 22:51:20 UTC (rev 50921)
@@ -1,7 +1,7 @@
 % \iffalse
 % +AMDG
 %
-% This document is copyright 2018 by Donald P. Goodman, and is
+% This document is copyright 2019 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
@@ -22,7 +22,7 @@
 
 % \iffalse
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-%<package>\ProvidesPackage{poetry}[2018/09/10 v1.1 support for typesetting poetry]
+%<package>\ProvidesPackage{poetry}[2019/05/02 v2.0 support for typesetting poetry]
 %<*driver>
 \documentclass{ltxdoc}
 
@@ -77,7 +77,7 @@
 %</driver>
 % \fi
 %
-% \title{The |poetry| Package, v1.1}
+% \title{The |poetry| Package, v2.0}
 % \author{Donald P.\ Goodman III}
 % \date{\today}
 %
@@ -262,7 +262,7 @@
 % that governs how far the poem will be indented from the
 % left margin.  Reset it as usual with \LaTeX's |\setlength|
 % command; e.g., |\setlength{\poemindent}{1.5in}| to indent
-% the entire poem 1.5in from the left line.  By default,
+% the entire poem 1.5in from the left margin.  By default,
 % |\poemindent| is |0pt|, meaning that verses are flush with
 % the left margin.  This also means that line numbers, if
 % they are on the left, will hang into the left margin.
@@ -549,6 +549,7 @@
 % The port is near, the bells I hear, the people all exulting, \\
 % While follow eyes the steady keel, the vessel grim and daring; \\-
 % \end{poem}
+% \setcounter{poemlinenumsevery}{0}
 %
 % This can, of course, be set to any value, though typically
 % 1--4 are reasonable ones.  A sufficiently high number will
@@ -557,17 +558,61 @@
 % last line number was.  But I'm certainly not going to make
 % it impossible.
 %
-% Line numbers can be placed on either the right or the
-% left.  By default, they are placed on the left; to place
-% them on the right, use
+% Often, though, you won't want to print line numbers every
+% arbitrary number of lines throughout the poem, but on
+% certain lines by verse.  E.g., perhaps you want to number
+% lines 2, 3, and 5 of a poem, but not 1, 4, and 6.  To
+% accomplish this, use the \DescribeMacro{\poemnumlines}|\poemnumlines|
+% macro.  If empty, it has no effect, and by default it is
+% empty.  However, if you put in a list of numbers,
+% then the lines of each stanza corresponding to that list
+% of numbers will be numbered accordingly.  So, for example,
+% to number 2, 3, and 5 only:
+%
+% \begin{verbatim}
+% \def\poemnumlines{235}
+% \begin{poem}
+% Once upon a midnight dreary, while I pondered, weak and weary,\\
+% Over many a quaint and curious volume of forgotten lore---\\
+% While I nodded, nearly napping, suddenly there came a tapping,\\
+% As of someone gently rapping, rapping at my chamber door.\\
+% ``'Tis some visitor,'' I muttered, ``tapping at my chamber door---\\
+% Only this and nothing more.''\\-
+% \end{poem}
+% \def\poemnumlines{}
+% \end{verbatim}
+%
+% Yields the following:
+% \def\poemnumlines{235}
+% \begin{poem}
+% Once upon a midnight dreary, while I pondered, weak and weary,\\
+% Over many a quaint and curious volume of forgotten lore---\\
+% While I nodded, nearly napping, suddenly there came a tapping,\\
+% As of someone gently rapping, rapping at my chamber door.\\
+% ``'Tis some visitor,'' I muttered, ``tapping at my chamber door---\\
+% Only this and nothing more.''\\-
+% \end{poem}
+% \def\poemnumlines{}
+%
+% This pattern will repeat for each verse until you set
+% |\poemnumline| to something else.
+%
+% Finally, line numbers can be placed on either the right or the
+% left.  |poetry| v2.0 introduces significantly more
+% flexibility into this mechanic; however, to preserve
+% backward compatibility, the old commands are still
+% recognized.  To place line numbers on the right, use
 % \DescribeMacro{\poemlinenumrighttrue}|\poemlinenumrighttrue|;
 % to put them back on the left, use the corresponding
 % command
 % \DescribeMacro{\poemlinenumrightfalse}|\poemlinenumrightfalse|.
+% Note that these commands merely set the right-hand line
+% number spot to equal the poem line counter; this will make
+% sense to you later.
 %
 % \begin{verbatim}
+% \poemlinenumrighttrue
 % \setcounter{poemlinenumsevery}{1}
-% \poemlinenumrighttrue
 % \begin{poem}
 % O captain! my captain!  The fearful trip is done; \\
 % \poemlinenumrightfalse
@@ -580,8 +625,8 @@
 % Which gives us this (notice that right-side line numbers
 % are placed after |\poemmaxlinewd|):
 %
+% \poemlinenumrighttrue
 % \setcounter{poemlinenumsevery}{1}
-% \poemlinenumrighttrue
 % \begin{poem}
 % O captain! my captain!  The fearful trip is done; \\
 % \poemlinenumrightfalse
@@ -600,6 +645,112 @@
 % line.  Please keep that in mind when you're planning your
 % formats.
 %
+% As of v2.0, |poetry| allows numbering to appearing on both
+% the right \emph{and} left side of the poem.  This is a
+% much more flexible mechanism than before, and should be
+% used in preference to the old |\poemlinenumsrighttrue|
+% mechanism in any new work.
+%
+% Any of the line numbering variables beginning with |\poem|
+% have corresponding versions beginning with |\poemrt|.  You
+% can then set the variables arbitrarily for the left and
+% right sides, which will not effect one another.
+% E.g., perhaps you want to show total line numbers on the
+% left, and verse line numbers on the right, both on every
+% two lines:
+%
+% \begin{quote}
+% |\renewcommand{\thepoemline}{\arabic{poemline}}|\\
+% |\setcounter{poemlinenumsevery}{2}|\\
+% |\setcounter{poemrtlinenumsevery}{2}|\\
+% |\renewcommand{\thepoemrtline}{\arabic{verseline}}|\\
+% \end{quote}
+%
+% \renewcommand{\thepoemline}{\arabic{poemline}}
+% \setcounter{poemlinenumsevery}{2}
+% \setcounter{poemrtlinenumsevery}{2}
+% \renewcommand{\thepoemrtline}{\arabic{verseline}}
+% \centerpoemon{Whose woods these are I think I know.}
+% \begin{poem}
+% Whose woods these are I think I know. \\
+% His house is in the village though; \\
+% He will not see me stopping here \\
+% To watch his woods fill up with snow. \\!
+%
+% My little horse must think it queer \\
+% To stop without a farmhouse near \\
+% Between the woods and frozen lake \\
+% The darkest evening of the year. \\-
+% \end{poem}
+% \setcounter{poemlinenumsevery}{0}
+% \setcounter{poemrtlinenumsevery}{0}
+%
+% This is useful for those volumes that wish to list a
+% stanza number as well as a line numbers, one on each side.
+% |poetry| offers the stanza number as the counter
+% \DescribeMacro{stanzacount}|stanzacount|.  For example, to
+% put the line count on the right, with a stanza count on the
+% first line of each stanza on the left:
+%
+% \begin{quote}
+% |\def\poemnumlines{1}|\\
+% |\renewcommand{\thepoemline}{\arabic{stanzacount}}|\\
+% |\setcounter{poemrtlinenumsevery}{1}|\\
+% |\renewcommand{\thepoemrtline}{\arabic{poemline}}|\\
+% \end{quote}
+%
+% \def\poemnumlines{1}
+% \renewcommand{\thepoemline}{\arabic{stanzacount}}
+% \setcounter{poemrtlinenumsevery}{1}
+% \renewcommand{\thepoemrtline}{\arabic{poemline}}
+% \centerpoemon{Whose woods these are I think I know.}
+% \begin{poem}
+% Whose woods these are I think I know. \\
+% His house is in the village though; \\
+% He will not see me stopping here \\
+% To watch his woods fill up with snow. \\!
+%
+% My little horse must think it queer \\
+% To stop without a farmhouse near \\
+% Between the woods and frozen lake \\
+% The darkest evening of the year. \\-
+% \end{poem}
+%
+% We can occasionally do some truly interesting things this
+% way.  For example, to have odd-numbered lines marked on
+% the left and even on the right:
+%
+% \begin{quote}
+% |\renewcommand{\thepoemline}{\arabic{poemline}}|\\
+% |\renewcommand{\thepoemrtline}{\arabic{poemline}}|\\
+% |\def\poemnumlines{13}|\\
+% |\def\poemrtnumlines{24}|\\
+% \end{quote}
+%
+% \setcounter{poemlinenumsevery}{99}
+% \setcounter{poemrtlinenumsevery}{99}
+% \renewcommand{\thepoemline}{\arabic{poemline}}
+% \renewcommand{\thepoemrtline}{\arabic{poemline}}
+% \def\poemnumlines{13}
+% \def\poemrtnumlines{24}
+% \centerpoemon{Whose woods these are I think I know.}
+% \begin{poem}
+% Whose woods these are I think I know. \\
+% His house is in the village though; \\
+% He will not see me stopping here \\
+% To watch his woods fill up with snow. \\!
+%
+% My little horse must think it queer \\
+% To stop without a farmhouse near \\
+% Between the woods and frozen lake \\
+% The darkest evening of the year. \\!
+%
+% He gives his harness bells a shake \\
+% To ask if there is some mistake. \\
+% The only other sound's the sweep \\
+% Of easy wind and downy flake. \\-
+% \end{poem}
+%
 % \subsubsection{Styling Line Numbers}
 % \label{subsub:stylelineno}
 %
@@ -642,7 +793,7 @@
 % \poemlinenumrighttrue
 % \begin{poem}
 % And gentlemen in England now abed \\
-% \setlength{\poemlinenumboxwd}{1em}
+% \setlength{\poemrtlinenumboxwd}{1em}
 % shall think themselves accurs'd they were not here, \\
 % and hold their manhoods cheap whilst any speaks \\
 % that fought with us, upon St.~Crispin's day. \\-
@@ -655,11 +806,16 @@
 % but a different way when you use them elsehwere, you can
 % use \DescribeMacro{\poemlinenumstyle}|\poemlinenumstyle|
 % to change their appearance.  For example, the following
-% uses |\def\poemlinenumstyle{\footnotesize\color{green}}|:
+% uses |\def\poemlinenumstyle{\footnotesize\color{green}}|
+% and |\def\poemrtlinenumstyle{\LARGE\color{red}}|:
 %
 % \centerpoemon{Thou see'st the world, Volumnius, how it goes; }
-% \poemlinenumrightfalse
+% \renewcommand{\thepoemline}{\arabic{poemline}}
+% \renewcommand{\thepoemrtline}{\arabic{poemline}}
+% \def\poemnumlines{13}
+% \def\poemrtnumlines{24}
 % \def\poemlinenumstyle{\footnotesize\color{green}}
+% \def\poemrtlinenumstyle{\LARGE\color{red}}
 % \begin{poem}
 % Thou see'st the world, Volumnius, how it goes; \\
 % our enemies have beat us to the pit. \\
@@ -667,8 +823,12 @@
 % than tarry till they push us. \\-
 % \end{poem}
 %
-% By default, |\poemlinenumstyle| does nothing.
+% The right line style is an insane choice; but it does
+% demonstrate how things work.  By default, both
+% |\poemlinenumstyle| and |\poemrtlinenumstyle| do nothing.
 % \def\poemlinenumstyle{}
+% \def\poemrtlinenumstyle{}
+% \def\poemrtnumlines{}
 %
 % Labels can be placed on any line of poetry, and refer back
 % to that line.  Make references with the usual \LaTeX\
@@ -678,6 +838,7 @@
 % |hyperref|, these will correctly turn into hyperlinks, as
 % well.
 %
+%
 % \section{Document Structure}
 % \label{sect:structure}
 %
@@ -1154,10 +1315,16 @@
 %
 %    \begin{macrocode}
 \ProvidesPackage{poetry}%
+\RequirePackage{modulus}%
 \newcounter{poemline}%
 \newcount\poemlineno%
+\newcounter{poemrtline}%
+\newcount\poemrtlineno%
+\renewcommand\thepoemrtline{}%
 \newcounter{verseline}%
 \newcount\vslineno%
+\newcounter{stanzacount}%
+\newcount\stanzano%
 \newcounter{abspoemno}%
 \newcount\poem at abspoemno%
 \newcounter{poemno}%
@@ -1166,6 +1333,8 @@
 \newcount\poem at groupno\poem at groupno=0%
 \newcounter{poemlinenumsevery}\setcounter{poemlinenumsevery}{1}%
 \newcount\poem at linenumsevery\poem at linenumsevery=\value{poemlinenumsevery}%
+\newcounter{poemrtlinenumsevery}\setcounter{poemrtlinenumsevery}{1}%
+\newcount\poem at rt@linenumsevery\poem at rt@linenumsevery=\value{poemrtlinenumsevery}%
 \newlength{\poemindent}\setlength{\poemindent}{0pt}%
 \newlength{\poemtopskip}{\setlength{\poemtopskip}{1em}%
 \newlength{\poembotskip}{\setlength{\poembotskip}{1em}%
@@ -1173,15 +1342,34 @@
 \newdimen\poem at defleftskip\poem at defleftskip=\the\poemindent%
 \newdimen\poem at maxlinewd%
 \newlength{\poemmaxlinewd}\setlength{\poemmaxlinewd}{\textwidth}%
+\newdimen\poem at rt@maxlinewd%
+\newlength{\poemrtmaxlinewd}\setlength{\poemrtmaxlinewd}{\textwidth}%
 \newdimen\poem at hinwd\poem at hinwd=1em%
 \newlength{\poemhinwd}\setlength{\poemhinwd}{1em}%
 \newif\ifpoemlinenums\poemlinenumstrue%
-\newif\ifpoemlinenumright\poemlinenumrightfalse%
+\newif\ifpoemrtlinenums\poemrtlinenumstrue%
+\def\poemlinenumright{%
+	\renewcommand{\thepoemrtline}{\arabic{poemline}}%
+	\renewcommand{\thepoemline}{}%
+}%
+\def\poemlinenumrighttrue{%
+	\renewcommand{\thepoemrtline}{\arabic{poemline}}%
+	\renewcommand{\thepoemline}{}%
+}%
+\def\poemlinenumrightfalse{%
+	\renewcommand{\thepoemline}{\arabic{poemline}}%
+	\renewcommand{\thepoemrtline}{}%
+}%
 \newdimen\poem at linenumboxwd\poem at linenumboxwd=2em%
 \newlength{\poemlinenumboxwd}\setlength{\poemlinenumboxwd}{2em}%
+\newdimen\poem at rt@linenumboxwd\poem at rt@linenumboxwd=2em%
+\newlength{\poemrtlinenumboxwd}\setlength{\poemrtlinenumboxwd}{2em}%
 \newdimen\poem at linenumboxgap\poem at linenumboxgap=0pt%
 \newlength{\poemlinenumboxgap}\setlength{\poemlinenumboxgap}{0pt}%
+\newdimen\poem at rt@linenumboxgap\poem at rt@linenumboxgap=0pt%
+\newlength{\poemrtlinenumboxgap}\setlength{\poemrtlinenumboxgap}{0pt}%
 \def\poemlinenumstyle{}%
+\def\poemrtlinenumstyle{}%
 \newdimen\poem at hangindent\poem at hangindent=1em%
 \newlength{\poemhangindent}\setlength{\poemhangindent}{1em}%
 \newcount\poem at indentevery\poem at indentevery=0%
@@ -1190,17 +1378,17 @@
 \newlength{\poemverseskip}\setlength{\poemverseskip}{\baselineskip}%
 \newdimen\poem at buff%
 \newcount\poem at tmp%
-% from David Carlisle's answer on tex.stackexchange.com,
+% From David Carlisle's answer on tex.stackexchange.com,
 % question 57598; allows us to loop through a string in a
 % command.  We will use this for the verse indentation
 % counter, as well as for the generic line indentatin
-% counter, both in |\placelineno|.
+% counter and the right indentation counter, both in |\placelineno|.
+\def\loopcommand{\hin}%
 \def\poem at expandvsloop#1{\poem at xvsloop#1\relax}%
 \def\poem at xvsloop#1{%
 	\ifx\relax#1\else%
-		\poem at tmp=#1%
-		\ifnum\poem at tmp=\the\vslineno%
-			\hin%
+		\ifnum#1=\the\vslineno%
+			\loopcommand\relax%
 		\fi%
 		\expandafter\poem at xvsloop%
 	\fi%
@@ -1210,73 +1398,76 @@
 \newcommand{\poem at ifhyph}[1]{\@ifnextchar -{\@firstoftwo{#1}}}
 \newcommand{\poem at ifstar}[1]{\@ifnextchar *{\@firstoftwo{#1}}}
 \newcommand{\poem at ifques}[1]{\@ifnextchar ?{\@firstoftwo{#1}}}
-% get modulus
-\newcount\poem at tmpa
-\def\modulo#1#2{%
-	\poem at tmpa=#1%
-	\divide\poem at tmpa by#2%
-	\multiply\poem at tmpa by#2%
-	\multiply\poem at tmpa by-1%
-	\advance\poem at tmpa by#1\relax%
-}%
 \def\poemvsindentlines{}%
-\def\poemlnindentlines{}%
+\def\poemnumlines{}%
+\def\poemrtnumlines{}%
 \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}%
+	\setcounter{stanzacount}{\the\stanzano}%
+	\setcounter{poemrtline}{\the\poemrtlineno}%
 	\poem at linenumsevery=\value{poemlinenumsevery}%
+	\poem at rt@linenumsevery=\value{poemrtlinenumsevery}%
+	\poem at indentevery=\value{poemindentevery}%
 	\poem at linenumboxgap=\the\poemlinenumboxgap%
 	\poem at linenumboxwd=\the\poemlinenumboxwd%
-	\modulo{\the\poemlineno}{\the\poem at linenumsevery}%
+	\poem at rt@linenumboxgap=\the\poemrtlinenumboxgap%
+	\poem at rt@linenumboxwd=\the\poemrtlinenumboxwd%
 	\ifpoemlinenums%
-		\ifnum\poem at tmpa=0%
-			\ifpoemlinenumright%
-				\hskip0pt\tlap{%
-					\rlap{%
-						\hskip\poem at maxlinewd%
-						\hskip\poem at linenumboxgap%
-						\hbox to\poem at linenumboxwd{%
-							\hfil%
-							\poemlinenumstyle\thepoemline%
-						}%
-					}%
-				}%
-			\else%
-				\hskip-\poem at linenumboxgap%
-				\llap{%
-					\tlap{%
-						\hbox to\poem at linenumboxwd{%
-							\poemlinenumstyle\thepoemline%
-							\hfil%
-						}\penalty10000%
-					}%
-				}\penalty10000%
-			\fi%
-		\else
-			\hskip-\poem at linenumboxgap%
-			\llap{\tlap{\hbox to\poem at linenumboxwd{\hfil}}}%
-			\penalty10000%
+		\def\loopcommand{\poem at putlineno}%
+		\expandafter\poem at expandvsloop\expandafter{\poemnumlines}%
+		\def\loopcommand{\poem at rt@putlineno}%
+		\expandafter\poem at expandvsloop\expandafter{\poemrtnumlines}%
+		\ifnum\poem at linenumsevery=0\relax\else%
+			\modulo{\the\vslineno}{\the\poem at linenumsevery}%
+			\ifnum\remainder=0\poem at putlineno\fi%
 		\fi%
-	\else
-		\hskip-\poem at linenumboxgap%
-		\llap{\tlap{\hbox to\poem at linenumboxwd{\hfil}}}%
-		\penalty10000%
-	\fi%
-	\par\vskip-\baselineskip%
-	\poem at indentevery=\value{poemindentevery}%
-	\ifnum\poem at indentevery=0%
-	\else%
-		\modulo{\the\poemlineno}{\the\poem at indentevery}%
-		\ifnum\poem at tmpa=0%
-			\hin%
+		\ifnum\poem at rt@linenumsevery=0\relax\else%
+			\modulo{\the\vslineno}{\the\poem at rt@linenumsevery}%
+			\ifnum\remainder=0\poem at rt@putlineno\fi%
 		\fi%
 	\fi%
+	\ifnum\poem at indentevery=0\relax\else%
+		\modulo{\the\vslineno}{\the\poem at indentevery}%
+		\ifnum\remainder=0\hin\fi%
+	\fi%
+	\def\loopcommand{\hin}%
 	\expandafter\poem at expandvsloop\expandafter{\poemvsindentlines}%
 	\def\@currentlabel{\thepoemline}%
 	\phantomsection%
 }%
+\def\poem at putlineno{%
+	\hskip-\poem at linenumboxgap%
+	\llap{%
+		\tlap{%
+			\hbox to\poem at linenumboxwd{%
+				\poemlinenumstyle\thepoemline%
+				\hfil%
+			}\penalty10000%
+		}%
+	}%
+	\ifnum\poemlineno=1\relax\else%
+		\ifnum\vslineno=1%
+			\vskip-\baselineskip%
+		\fi%
+	\fi%
+	\penalty10000%
+}%
+\def\poem at rt@putlineno{%
+	\hskip0pt\tlap{%
+		\rlap{%
+			\hskip\poem at maxlinewd%
+			\hskip\poem at rt@linenumboxgap%
+			\hbox to\poem at rt@linenumboxwd{%
+				\hfil%
+				\poemrtlinenumstyle\thepoemrtline%
+			}%
+		}%
+	}%
+	\vskip-\baselineskip%
+}%
 \def\poem at endline{%
 	\par%
 	\advance\poemlineno by1%
@@ -1302,6 +1493,7 @@
 	\par%
 	\vslineno=1%
 	\advance\poemlineno by1%
+	\advance\stanzano by1%
 	\poem at verseskip=\the\poemverseskip%
 	\vskip\poem at verseskip%
 	\leftskip=\poem at defleftskip%
@@ -1349,6 +1541,7 @@
 	\advance\hsize by\the\poem at maxlinewd%
 	\poemlineno=1%
 	\vslineno=1%
+	\stanzano=1%
 	\poem at topskip=\the\poemtopskip%
 	\poem at botskip=\the\poembotskip%
 	\vskip\poem at topskip%

Modified: trunk/Master/texmf-dist/source/latex/poetry/poetry.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/poetry/poetry.ins	2019-05-01 22:50:55 UTC (rev 50920)
+++ trunk/Master/texmf-dist/source/latex/poetry/poetry.ins	2019-05-01 22:51:20 UTC (rev 50921)
@@ -3,7 +3,7 @@
 % Apostle, and the Immaculate Heart of Mary, for their
 % prayers, and to the Sacred Heart of Jesus, for His mercy.
 %
-% This document is copyright 2018 by Donald P. Goodman, and is
+% This document is copyright 2019 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
@@ -32,7 +32,7 @@
 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
+under version 1.3c of that license, and this work may be distributed
 or modified under the terms of that license or, at your option, any
 later version.
 

Modified: trunk/Master/texmf-dist/tex/latex/poetry/poetry.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/poetry/poetry.sty	2019-05-01 22:50:55 UTC (rev 50920)
+++ trunk/Master/texmf-dist/tex/latex/poetry/poetry.sty	2019-05-01 22:51:20 UTC (rev 50921)
@@ -13,7 +13,7 @@
 %% 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
+%% under version 1.3c of that license, and this work may be distributed
 %% or modified under the terms of that license or, at your option, any
 %% later version.
 %% 
@@ -26,13 +26,19 @@
 %% derived files poetry.sty and poetry.pdf.
 
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{poetry}[2018/09/10 v1.1 support for typesetting poetry]
+\ProvidesPackage{poetry}[2019/05/02 v2.0 support for typesetting poetry]
 
 \ProvidesPackage{poetry}%
+\RequirePackage{modulus}%
 \newcounter{poemline}%
 \newcount\poemlineno%
+\newcounter{poemrtline}%
+\newcount\poemrtlineno%
+\renewcommand\thepoemrtline{}%
 \newcounter{verseline}%
 \newcount\vslineno%
+\newcounter{stanzacount}%
+\newcount\stanzano%
 \newcounter{abspoemno}%
 \newcount\poem at abspoemno%
 \newcounter{poemno}%
@@ -41,6 +47,8 @@
 \newcount\poem at groupno\poem at groupno=0%
 \newcounter{poemlinenumsevery}\setcounter{poemlinenumsevery}{1}%
 \newcount\poem at linenumsevery\poem at linenumsevery=\value{poemlinenumsevery}%
+\newcounter{poemrtlinenumsevery}\setcounter{poemrtlinenumsevery}{1}%
+\newcount\poem at rt@linenumsevery\poem at rt@linenumsevery=\value{poemrtlinenumsevery}%
 \newlength{\poemindent}\setlength{\poemindent}{0pt}%
 \newlength{\poemtopskip}{\setlength{\poemtopskip}{1em}%
 \newlength{\poembotskip}{\setlength{\poembotskip}{1em}%
@@ -48,15 +56,34 @@
 \newdimen\poem at defleftskip\poem at defleftskip=\the\poemindent%
 \newdimen\poem at maxlinewd%
 \newlength{\poemmaxlinewd}\setlength{\poemmaxlinewd}{\textwidth}%
+\newdimen\poem at rt@maxlinewd%
+\newlength{\poemrtmaxlinewd}\setlength{\poemrtmaxlinewd}{\textwidth}%
 \newdimen\poem at hinwd\poem at hinwd=1em%
 \newlength{\poemhinwd}\setlength{\poemhinwd}{1em}%
 \newif\ifpoemlinenums\poemlinenumstrue%
-\newif\ifpoemlinenumright\poemlinenumrightfalse%
+\newif\ifpoemrtlinenums\poemrtlinenumstrue%
+\def\poemlinenumright{%
+\renewcommand{\thepoemrtline}{\arabic{poemline}}%
+\renewcommand{\thepoemline}{}%
+}%
+\def\poemlinenumrighttrue{%
+\renewcommand{\thepoemrtline}{\arabic{poemline}}%
+\renewcommand{\thepoemline}{}%
+}%
+\def\poemlinenumrightfalse{%
+\renewcommand{\thepoemline}{\arabic{poemline}}%
+\renewcommand{\thepoemrtline}{}%
+}%
 \newdimen\poem at linenumboxwd\poem at linenumboxwd=2em%
 \newlength{\poemlinenumboxwd}\setlength{\poemlinenumboxwd}{2em}%
+\newdimen\poem at rt@linenumboxwd\poem at rt@linenumboxwd=2em%
+\newlength{\poemrtlinenumboxwd}\setlength{\poemrtlinenumboxwd}{2em}%
 \newdimen\poem at linenumboxgap\poem at linenumboxgap=0pt%
 \newlength{\poemlinenumboxgap}\setlength{\poemlinenumboxgap}{0pt}%
+\newdimen\poem at rt@linenumboxgap\poem at rt@linenumboxgap=0pt%
+\newlength{\poemrtlinenumboxgap}\setlength{\poemrtlinenumboxgap}{0pt}%
 \def\poemlinenumstyle{}%
+\def\poemrtlinenumstyle{}%
 \newdimen\poem at hangindent\poem at hangindent=1em%
 \newlength{\poemhangindent}\setlength{\poemhangindent}{1em}%
 \newcount\poem at indentevery\poem at indentevery=0%
@@ -65,12 +92,12 @@
 \newlength{\poemverseskip}\setlength{\poemverseskip}{\baselineskip}%
 \newdimen\poem at buff%
 \newcount\poem at tmp%
+\def\loopcommand{\hin}%
 \def\poem at expandvsloop#1{\poem at xvsloop#1\relax}%
 \def\poem at xvsloop#1{%
 \ifx\relax#1\else%
-\poem at tmp=#1%
-\ifnum\poem at tmp=\the\vslineno%
-\hin%
+\ifnum#1=\the\vslineno%
+\loopcommand\relax%
 \fi%
 \expandafter\poem at xvsloop%
 \fi%
@@ -79,39 +106,47 @@
 \newcommand{\poem at ifhyph}[1]{\@ifnextchar -{\@firstoftwo{#1}}}
 \newcommand{\poem at ifstar}[1]{\@ifnextchar *{\@firstoftwo{#1}}}
 \newcommand{\poem at ifques}[1]{\@ifnextchar ?{\@firstoftwo{#1}}}
-\newcount\poem at tmpa
-\def\modulo#1#2{%
-\poem at tmpa=#1%
-\divide\poem at tmpa by#2%
-\multiply\poem at tmpa by#2%
-\multiply\poem at tmpa by-1%
-\advance\poem at tmpa by#1\relax%
-}%
 \def\poemvsindentlines{}%
-\def\poemlnindentlines{}%
+\def\poemnumlines{}%
+\def\poemrtnumlines{}%
 \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}%
+\setcounter{stanzacount}{\the\stanzano}%
+\setcounter{poemrtline}{\the\poemrtlineno}%
 \poem at linenumsevery=\value{poemlinenumsevery}%
+\poem at rt@linenumsevery=\value{poemrtlinenumsevery}%
+\poem at indentevery=\value{poemindentevery}%
 \poem at linenumboxgap=\the\poemlinenumboxgap%
 \poem at linenumboxwd=\the\poemlinenumboxwd%
-\modulo{\the\poemlineno}{\the\poem at linenumsevery}%
+\poem at rt@linenumboxgap=\the\poemrtlinenumboxgap%
+\poem at rt@linenumboxwd=\the\poemrtlinenumboxwd%
 \ifpoemlinenums%
-\ifnum\poem at tmpa=0%
-\ifpoemlinenumright%
-\hskip0pt\tlap{%
-\rlap{%
-\hskip\poem at maxlinewd%
-\hskip\poem at linenumboxgap%
-\hbox to\poem at linenumboxwd{%
-\hfil%
-\poemlinenumstyle\thepoemline%
+\def\loopcommand{\poem at putlineno}%
+\expandafter\poem at expandvsloop\expandafter{\poemnumlines}%
+\def\loopcommand{\poem at rt@putlineno}%
+\expandafter\poem at expandvsloop\expandafter{\poemrtnumlines}%
+\ifnum\poem at linenumsevery=0\relax\else%
+\modulo{\the\vslineno}{\the\poem at linenumsevery}%
+\ifnum\remainder=0\poem at putlineno\fi%
+\fi%
+\ifnum\poem at rt@linenumsevery=0\relax\else%
+\modulo{\the\vslineno}{\the\poem at rt@linenumsevery}%
+\ifnum\remainder=0\poem at rt@putlineno\fi%
+\fi%
+\fi%
+\ifnum\poem at indentevery=0\relax\else%
+\modulo{\the\vslineno}{\the\poem at indentevery}%
+\ifnum\remainder=0\hin\fi%
+\fi%
+\def\loopcommand{\hin}%
+\expandafter\poem at expandvsloop\expandafter{\poemvsindentlines}%
+\def\@currentlabel{\thepoemline}%
+\phantomsection%
 }%
-}%
-}%
-\else%
+\def\poem at putlineno{%
 \hskip-\poem at linenumboxgap%
 \llap{%
 \tlap{%
@@ -120,31 +155,27 @@
 \hfil%
 }\penalty10000%
 }%
-}\penalty10000%
+}%
+\ifnum\poemlineno=1\relax\else%
+\ifnum\vslineno=1%
+\vskip-\baselineskip%
 \fi%
-\else
-\hskip-\poem at linenumboxgap%
-\llap{\tlap{\hbox to\poem at linenumboxwd{\hfil}}}%
-\penalty10000%
 \fi%
-\else
-\hskip-\poem at linenumboxgap%
-\llap{\tlap{\hbox to\poem at linenumboxwd{\hfil}}}%
 \penalty10000%
-\fi%
-\par\vskip-\baselineskip%
-\poem at indentevery=\value{poemindentevery}%
-\ifnum\poem at indentevery=0%
-\else%
-\modulo{\the\poemlineno}{\the\poem at indentevery}%
-\ifnum\poem at tmpa=0%
-\hin%
-\fi%
-\fi%
-\expandafter\poem at expandvsloop\expandafter{\poemvsindentlines}%
-\def\@currentlabel{\thepoemline}%
-\phantomsection%
 }%
+\def\poem at rt@putlineno{%
+\hskip0pt\tlap{%
+\rlap{%
+\hskip\poem at maxlinewd%
+\hskip\poem at rt@linenumboxgap%
+\hbox to\poem at rt@linenumboxwd{%
+\hfil%
+\poemrtlinenumstyle\thepoemrtline%
+}%
+}%
+}%
+\vskip-\baselineskip%
+}%
 \def\poem at endline{%
 \par%
 \advance\poemlineno by1%
@@ -170,6 +201,7 @@
 \par%
 \vslineno=1%
 \advance\poemlineno by1%
+\advance\stanzano by1%
 \poem at verseskip=\the\poemverseskip%
 \vskip\poem at verseskip%
 \leftskip=\poem at defleftskip%
@@ -217,6 +249,7 @@
 \advance\hsize by\the\poem at maxlinewd%
 \poemlineno=1%
 \vslineno=1%
+\stanzano=1%
 \poem at topskip=\the\poemtopskip%
 \poem at botskip=\the\poembotskip%
 \vskip\poem at topskip%



More information about the tex-live-commits mailing list