From 1aa9f96a824274478f102d5a8fdc0c41b6f7092a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 27 Aug 2012 22:08:16 +0000 Subject: poemscol (27aug12) git-svn-id: svn://tug.org/texlive/trunk@27535 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/poemscol/poemscol.pdf | Bin 547680 -> 548645 bytes .../texmf-dist/source/latex/poemscol/poemscol.dtx | 151 +++++++++++++-------- Master/texmf-dist/tex/latex/poemscol/poemscol.sty | 73 +++++----- 3 files changed, 135 insertions(+), 89 deletions(-) diff --git a/Master/texmf-dist/doc/latex/poemscol/poemscol.pdf b/Master/texmf-dist/doc/latex/poemscol/poemscol.pdf index 7324e4d0b61..093cd2842af 100644 Binary files a/Master/texmf-dist/doc/latex/poemscol/poemscol.pdf and b/Master/texmf-dist/doc/latex/poemscol/poemscol.pdf differ diff --git a/Master/texmf-dist/source/latex/poemscol/poemscol.dtx b/Master/texmf-dist/source/latex/poemscol/poemscol.dtx index aa09d058cf7..ca5a2ce3a55 100644 --- a/Master/texmf-dist/source/latex/poemscol/poemscol.dtx +++ b/Master/texmf-dist/source/latex/poemscol/poemscol.dtx @@ -1,4 +1,5 @@ % \iffalse meta-comment +% !TEX TS-program = dtxmk % % Copyright (C) 2005 by John Burt % -------------------------------------------------- @@ -18,7 +19,7 @@ % \iffalse %\NeedsTeXFormat{LaTeX2e}[1997/12/01] %\ProvidesPackage{poemscol} -% [2011/08/30 v2.54 poemscol file] +% [2012/08/30 v2.6 poemscol file] % %<*driver> \documentclass{ltxdoc} @@ -32,7 +33,7 @@ % % \fi % -% \CheckSum{5986} +% \CheckSum{6058} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -196,11 +197,10 @@ % \changes{v2.53}{2007/07/14}{Changed the name of an internal token % register to avoid a conflict with babel} % \changes{v2.531}{2011/08/16}{Fixed a typo in example code.} -% \changes{v2.54}{2011/08/16}{Fixed a (recently introduced!) bug that caused marginal line -% numbers to align to the wrong line. Added a command to let the user -% choose the first line number appear in the margin, so that the -% marginal line number will always be a round number.} % \GetFileInfo{poemscol.sty} +% \changes{v2.6}{2012/08/31}{Added an optional argument to the poem +% environment to center the text block of the poem on the longest +% line. Added a switch to enable titles to be centered on the page.} % % \DoNotIndex{\newcommand,\newenvironment,\def,\edef,\else,\renewcommand,\makeatletter,\makeatother} % \DoNotIndex{\abovedisplayskip,\belowdisplayskip,\abovedisplayshortskip,\belowdisplayshortskip} @@ -235,13 +235,13 @@ % \textsc, \unskip} % \setcounter{IndexColumns}{2} % \MakeShortVerb{|} -% \def\fileversion{2.54} -% \def\filedate{30 August 2011} -% \def\docdate{30 August 2011} +% \def\fileversion{2.6} +% \def\filedate{23 August 2012} +% \def\docdate{23 August 2012} % \title{Typesetting Poetry Collections with \textsf{poemscol}\thanks{This document % corresponds to \textsf{poemscol}~\fileversion, dated \filedate.}} % \author{John Burt \\ \texttt{burt@brandeis.edu}} -% \date{August 30, 2011} +% \date{August 23, 2012} % \maketitle % \begin{abstract} % \textsf{poemscol} provides macros for \LaTeX\ for setting @@ -549,6 +549,20 @@ % indentation used for run over lines, in order to make the difference % between the indented run over portion of a long line, on one hand, % and an explicitly indented second line, more obvious in the output. +% +% The |poem| environment takes an optional argument. If your poem has +% short lines, and you wish to center it on the page, rather than set +% it against the left margin of the normal |poem| environment, you can +% give the width of the line you want to use to center the poem as the +% argument. Alternatively, the length |\versewidth| can be used as the +% argument. You can set the length of |\versewidth| to the proper +% amount using |\settowidth| as follows: +% \DescribeMacro{\versewidth} +% |\settowidth{\versewidth}{Text of line to use for centering}|. +% \DescribeMacro{\centertitles} +% If you center the poem on a sample +% line, you probably also want to center the title of the poem too, +% which you can do by issuing |\centertitles|. % % \textsf{poemscol} turns off automatic hyphenation in poetry % environments. The idea here is that every hyphen in the printed poem is @@ -823,15 +837,6 @@ % |\label| from \LaTeX.) |\pageref{text of label}| will set the page % number of the page on which the label appears. % -% \DescribeMacro{\setmargnumbegin}\label{setmargnumbegin} -% You may wish not only to set the line number of the first line of the -% poem, but to set the line number at which the first number will -% appear in the margin. You might, for instance, if your poem begins at -% line 137, not want marginal line numbers at lines 142, 147, 152 and -% so on, but at lines 140, 145, 150 and so on. |\setmargnumbegin{}| -% enables you to set the line number at which the first number will -% appear in the margin. -% % \section{Making a table of contents} % \DescribeMacro{\makepoemcontents} % I found the normal \LaTeX\ macros for making tables of contents @@ -2919,21 +2924,37 @@ \runoverindent{6em} % pmclverse (runover indented more than it is in the normal verse % environment) -\newenvironment{pmclverse}{% -\let\\=\@centercr% -\list{}{\itemsep\z@ \itemindent -\runoverindentvalue\listparindent \itemindent - \rightmargin 1sp\leftmargin 1sp\advance\leftmargin - \runoverindentvalue}\item[]} +% \newenvironment{pmclverse}{% +% \let\\=\@centercr% +% \list{}{\itemsep\z@ \itemindent -\runoverindentvalue\listparindent \itemindent +% \rightmargin 1sp\leftmargin 1sp\advance\leftmargin +% \runoverindentvalue}\item[]} +% {\endlist} +\newenvironment{pmclverse}[1][\linewidth]{% +\let\\=\@centercr% +\list{}{\itemsep\z@ +\itemindent -\runoverindentvalue +\listparindent \itemindent + \ifdim #1 < \linewidth + \rightmargin \z@ + \setlength{\leftmargin}{\linewidth}% + \addtolength{\leftmargin}{-#1}% + \addtolength{\leftmargin}{-0.5\leftmargin}% + \else + \rightmargin \leftmargin + \fi +\advance\leftmargin\runoverindentvalue} +\item[]} {\endlist} % rfoverse (flushes runover to right) (Just a placeholder now.) -\newif\ifrfv -\rfvfalse -\newcommand{\rightflushrunoververse}{\global\rfvtrue} -\newcommand{\indentrunoververse}{\global\rfvfalse} -\newenvironment{rfoverse}{\begin{pmclverse}}{\end{pmclverse}} -% verse environment with a switch -\renewenvironment{verse}{\ifrfv\begin{rfoverse}\else\begin{pmclverse}\fi} -{\ifrfv\end{rfoverse}\else\end{pmclverse}\fi} +% \newif\ifrfv +% \rfvfalse +% \newcommand{\rightflushrunoververse}{\global\rfvtrue} +% \newcommand{\indentrunoververse}{\global\rfvfalse} +% \newenvironment{rfoverse}{\begin{pmclverse}}{\end{pmclverse}} +% % verse environment with a switch +% \renewenvironment{verse}{\ifrfv\begin{rfoverse}\else\begin{pmclverse}\fi} +% {\ifrfv\end{rfoverse}\else\end{pmclverse}\fi} % \end{macrocode} % \subsection{~Miscellaneous internal counters} @@ -3240,17 +3261,30 @@ % anywhere else. % \begin{macro}{poem} % \begin{macrocode} -\newenvironment{poem}{\raggedright% +% \newenvironment{poem}{\raggedright% +% \language=255%no hyphenation in verse +% \noemendyettrue% +% \noexplainyettrue% +% \setcounter{verselinenumber}{0}\setcounter{printlineindex}{0}% +% \nobreak\begin{verse}% +% \inpoemtrue\nobreak\mark{\relax}% +% }{\end{verse}% +% \inpoemfalse\mark{\relax}% +% \goodbreak\afterpoemskip%\bigskip +% } +\newlength{\versewidth} +\newenvironment{poem}[1][\linewidth] +{\raggedright% \language=255%no hyphenation in verse \noemendyettrue% \noexplainyettrue% \setcounter{verselinenumber}{0}\setcounter{printlineindex}{0}% - \nobreak\begin{verse}% + \nobreak\begin{pmclverse}[#1]% \inpoemtrue\nobreak\mark{\relax}% - }{\end{verse}% + }{\end{pmclverse}% \inpoemfalse\mark{\relax}% \goodbreak\afterpoemskip%\bigskip - } + } % \end{macrocode} % \end{macro} % \begin{macro}{rightflushverse} @@ -3523,11 +3557,12 @@ % \marginpar{\textrm{\scriptsize\theverselinenumber}\hfil}% % \fi% % \fi - \ifnumbersswitch\pmclsidepar{\textrm{\scriptsize\theverselinenumber}}% + \ifnumbersswitch\pmclsidepar{\hfil\textrm{\scriptsize\theverselinenumber}}% \else% - \ifnumbersright\pmclrightsidepar{\textrm{\scriptsize\theverselinenumber}}% + \ifnumbersright\pmclrightsidepar{\hfil\textrm{\scriptsize\theverselinenumber}}% \else% - \pmclleftsidepar{\textrm{\scriptsize\theverselinenumber}}% + \pmclleftsidepar +{\textrm{\scriptsize\theverselinenumber}\hfil}% \fi% \fi% % \marn{\hfil\textrm{\theverselinenumber}} @@ -3542,13 +3577,8 @@ % \end{macro} % \begin{macro}{\verseline} % \begin{macrocode} - \newif\ifspeciallinelock \speciallinelockfalse -\newcounter{margnumbegin} -\setcounter{margnumbegin}{0} -\newcommand{\setmargnumbegin}[1]{\setcounter{margnumbegin}{#1}% -\addtocounter{margnumbegin}{-1}} \newcommand{\verseline}{\ifspeciallinelock% \relax\else% \nolinebreak\incrementverselinenumber% @@ -3559,13 +3589,12 @@ \newcommand{\incrementverselinenumber}{% \nolinebreak\addtocounter{verselinenumber}{1}% \addtocounter{printlineindex}{1}% -\ifnum\theverselinenumber>\themargnumbegin \ifnum\theprintlineindex>\thelineindexrepeat% \ifverselinenumbers\nobreak% \putverselinenumber\nobreak% \fi\nobreak% \setcounter{printlineindex}{0}% - \fi\fi% + \fi% } \newcommand{\setverselinemodulo}[1]{% \setcounter{lineindexrepeat}{#1}% @@ -4083,15 +4112,27 @@ \fi \fi } - +\newif\ifcentertitleson +\newcommand{\centertitles}{\centertitlesontrue} +\makeatletter \newcommand{\set@p@emtitle}[6]{\setlength{\titleentryoverrun}{#6}% {#2}% -{#3 \begin{titleentryenvironment}{#4 #1}\end{titleentryenvironment}}% +{#3 \begin{titleentryenvironment}% +{\ifcentertitleson\begin{center}#4 #1\end{center}\else #4 #1\fi}% +\end{titleentryenvironment}}% {#5}% \m@kep@emlabel \m@ken@teholder{#1}% \setlength{\titleentryoverrun}{\z@}} +% \newcommand{\set@p@emtitle}[6]{\setlength{\titleentryoverrun}{#6}% +% {#2}% +% {#3 \begin{titleentryenvironment}{#4 #1}\end{titleentryenvironment}}% +% {#5}% +% \m@kep@emlabel +% \m@ken@teholder{#1}% +% \setlength{\titleentryoverrun}{\z@}} + \newcommand{\setcontentsleaders}[1]{% \def\contentsleaders{#1\nobreak% }} @@ -5323,13 +5364,13 @@ % the notes section when the first note is called for a poem) % thanks to Heiko Oberdiek \makeatletter -\appendtomacro{\poem}{\global\expandafter\csname no#1yettrue\endcsname} +\appendtomacro{\endpoem}{\global\expandafter\csname no#1yettrue\endcsname} \makeatother \makeatletter -\appendtomacro{\prosesection}{\global\expandafter\csname no#1yettrue\endcsname} +\appendtomacro{\endprosesection}{\global\expandafter\csname no#1yettrue\endcsname} \makeatother \makeatletter -\appendtomacro{\pmsection}{\global\expandafter\csname no#1yettrue\endcsname} +\appendtomacro{\endpmsection}{\global\expandafter\csname no#1yettrue\endcsname} \makeatother % 9. command for closing the output file @@ -6276,7 +6317,7 @@ r@#2\endcsname{}{}\@nil \noemendyettrue \noexplainyettrue \setcounter{verselinenumber}{0}\setcounter{printlineindex}{0} - \nobreak\begin{verse} + \nobreak\begin{pmclverse} \inpoemtrue\nobreak\mark{\relax}} % must end poem if parallel text. Don't worry, % begin recto page and begin verso page will @@ -6284,14 +6325,14 @@ r@#2\endcsname{}{}\@nil % if it was finish recto page or finish verso page % that closed the poem rather than your own declaration. {\ifversopoemstillopen - \end{verse} + \end{pmclverse} \inpoemfalse\mark{\relax} \else \ifrectopoemstillopen - \end{verse} + \end{pmclverse} \inpoemfalse\mark{\relax} \else -\end{verse} +\end{pmclverse} \inpoemfalse\mark{\relax} \goodbreak\afterpoemskip%\bigskip \fi\fi } diff --git a/Master/texmf-dist/tex/latex/poemscol/poemscol.sty b/Master/texmf-dist/tex/latex/poemscol/poemscol.sty index 1e2c6d6d511..8e14ff22cb5 100644 --- a/Master/texmf-dist/tex/latex/poemscol/poemscol.sty +++ b/Master/texmf-dist/tex/latex/poemscol/poemscol.sty @@ -22,7 +22,7 @@ %% in the same archive or directory.) \NeedsTeXFormat{LaTeX2e}[1997/12/01] \ProvidesPackage{poemscol} - [2011/08/30 v2.54 poemscol file] + [2012/08/30 v2.6 poemscol file] @@ -121,19 +121,22 @@ \newcommand{\runoverindent}[1]{\global\edef\runoverindentvalue{#1} } \runoverindent{6em} -\newenvironment{pmclverse}{% +\newenvironment{pmclverse}[1][\linewidth]{% \let\\=\@centercr% -\list{}{\itemsep\z@ \itemindent -\runoverindentvalue\listparindent \itemindent - \rightmargin 1sp\leftmargin 1sp\advance\leftmargin - \runoverindentvalue}\item[]} +\list{}{\itemsep\z@ +\itemindent -\runoverindentvalue +\listparindent \itemindent + \ifdim #1 < \linewidth + \rightmargin \z@ + \setlength{\leftmargin}{\linewidth}% + \addtolength{\leftmargin}{-#1}% + \addtolength{\leftmargin}{-0.5\leftmargin}% + \else + \rightmargin \leftmargin + \fi +\advance\leftmargin\runoverindentvalue} +\item[]} {\endlist} -\newif\ifrfv -\rfvfalse -\newcommand{\rightflushrunoververse}{\global\rfvtrue} -\newcommand{\indentrunoververse}{\global\rfvfalse} -\newenvironment{rfoverse}{\begin{pmclverse}}{\end{pmclverse}} -\renewenvironment{verse}{\ifrfv\begin{rfoverse}\else\begin{pmclverse}\fi} -{\ifrfv\end{rfoverse}\else\end{pmclverse}\fi} \newcounter{verselinenumber} \newcounter{printlineindex} @@ -317,14 +320,16 @@ \itemsep\z@ \itemindent -\titleentryoverrun\listparindent \itemindent \rightmargin 1sp\leftmargin 1sp\advance\leftmargin \titleentryoverrun}\item[]}{\endlist} -\newenvironment{poem}{\raggedright% +\newlength{\versewidth} +\newenvironment{poem}[1][\linewidth] +{\raggedright% \language=255%no hyphenation in verse \noemendyettrue% \noexplainyettrue% \setcounter{verselinenumber}{0}\setcounter{printlineindex}{0}% - \nobreak\begin{verse}% + \nobreak\begin{pmclverse}[#1]% \inpoemtrue\nobreak\mark{\relax}% - }{\end{verse}% + }{\end{pmclverse}% \inpoemfalse\mark{\relax}% \goodbreak\afterpoemskip%\bigskip } @@ -455,24 +460,20 @@ \numbersgutterfalse} \newcommand{\putverselinenumber}{\nolinebreak\begin{marginenvironment}% \nolinebreak% - \ifnumbersswitch\pmclsidepar{\textrm{\scriptsize\theverselinenumber}}% + \ifnumbersswitch\pmclsidepar{\hfil\textrm{\scriptsize\theverselinenumber}}% \else% - \ifnumbersright\pmclrightsidepar{\textrm{\scriptsize\theverselinenumber}}% + \ifnumbersright\pmclrightsidepar{\hfil\textrm{\scriptsize\theverselinenumber}}% \else% - \pmclleftsidepar{\textrm{\scriptsize\theverselinenumber}}% + \pmclleftsidepar +{\textrm{\scriptsize\theverselinenumber}\hfil}% \fi% \fi% \nolinebreak% \end{marginenvironment}% \nolinebreak% } - \newif\ifspeciallinelock \speciallinelockfalse -\newcounter{margnumbegin} -\setcounter{margnumbegin}{0} -\newcommand{\setmargnumbegin}[1]{\setcounter{margnumbegin}{#1}% -\addtocounter{margnumbegin}{-1}} \newcommand{\verseline}{\ifspeciallinelock% \relax\else% \nolinebreak\incrementverselinenumber% @@ -483,13 +484,12 @@ \newcommand{\incrementverselinenumber}{% \nolinebreak\addtocounter{verselinenumber}{1}% \addtocounter{printlineindex}{1}% -\ifnum\theverselinenumber>\themargnumbegin \ifnum\theprintlineindex>\thelineindexrepeat% \ifverselinenumbers\nobreak% \putverselinenumber\nobreak% \fi\nobreak% \setcounter{printlineindex}{0}% - \fi\fi% + \fi% } \newcommand{\setverselinemodulo}[1]{% \setcounter{lineindexrepeat}{#1}% @@ -798,15 +798,20 @@ \fi \fi } - +\newif\ifcentertitleson +\newcommand{\centertitles}{\centertitlesontrue} +\makeatletter \newcommand{\set@p@emtitle}[6]{\setlength{\titleentryoverrun}{#6}% {#2}% -{#3 \begin{titleentryenvironment}{#4 #1}\end{titleentryenvironment}}% +{#3 \begin{titleentryenvironment}% +{\ifcentertitleson\begin{center}#4 #1\end{center}\else #4 #1\fi}% +\end{titleentryenvironment}}% {#5}% \m@kep@emlabel \m@ken@teholder{#1}% \setlength{\titleentryoverrun}{\z@}} + \newcommand{\setcontentsleaders}[1]{% \def\contentsleaders{#1\nobreak% }} @@ -1614,13 +1619,13 @@ \pmresetlemmacounters\unskip% } \makeatletter -\appendtomacro{\poem}{\global\expandafter\csname no#1yettrue\endcsname} +\appendtomacro{\endpoem}{\global\expandafter\csname no#1yettrue\endcsname} \makeatother \makeatletter -\appendtomacro{\prosesection}{\global\expandafter\csname no#1yettrue\endcsname} +\appendtomacro{\endprosesection}{\global\expandafter\csname no#1yettrue\endcsname} \makeatother \makeatletter -\appendtomacro{\pmsection}{\global\expandafter\csname no#1yettrue\endcsname} +\appendtomacro{\endpmsection}{\global\expandafter\csname no#1yettrue\endcsname} \makeatother \expandafter\newcommand\csname put#1s\endcsname{ @@ -2266,7 +2271,7 @@ r@#2\endcsname{}{}\@nil \noemendyettrue \noexplainyettrue \setcounter{verselinenumber}{0}\setcounter{printlineindex}{0} - \nobreak\begin{verse} + \nobreak\begin{pmclverse} \inpoemtrue\nobreak\mark{\relax}} % must end poem if parallel text. Don't worry, % begin recto page and begin verso page will @@ -2274,14 +2279,14 @@ r@#2\endcsname{}{}\@nil % if it was finish recto page or finish verso page % that closed the poem rather than your own declaration. {\ifversopoemstillopen - \end{verse} + \end{pmclverse} \inpoemfalse\mark{\relax} \else \ifrectopoemstillopen - \end{verse} + \end{pmclverse} \inpoemfalse\mark{\relax} \else -\end{verse} +\end{pmclverse} \inpoemfalse\mark{\relax} \goodbreak\afterpoemskip%\bigskip \fi\fi } -- cgit v1.2.3