From 228e343fd20c797e2c9ef3f01851664c4f1466c1 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 3 Aug 2019 21:57:48 +0000 Subject: poemscol (3aug19) git-svn-id: svn://tug.org/texlive/trunk@51811 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/poemscol/poemscol.dtx | 186 +++++++++++++++++---- .../texmf-dist/source/latex/poemscol/poemscol.ins | 6 +- 2 files changed, 153 insertions(+), 39 deletions(-) (limited to 'Master/texmf-dist/source/latex') diff --git a/Master/texmf-dist/source/latex/poemscol/poemscol.dtx b/Master/texmf-dist/source/latex/poemscol/poemscol.dtx index 09f5a51ed4d..5dab41358be 100644 --- a/Master/texmf-dist/source/latex/poemscol/poemscol.dtx +++ b/Master/texmf-dist/source/latex/poemscol/poemscol.dtx @@ -1,25 +1,23 @@ % \iffalse meta-comment % !TEX TS-program = dtxmk % -% Copyright (C) 2017 by John Burt +% Copyright (C) 2002-2019 by John Burt % -------------------------------------------------- % % This file may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 +% conditions of the LaTeX Project Public License, either version 1.3c % of this license or (at your option) any later version. % The latest version of this license is in: % % http://www.latex-project.org/lppl.txt % -% and version 1.2 or later is part of all distributions of LaTeX -% version 1999/12/01 or later. % % \fi % % \iffalse %\NeedsTeXFormat{LaTeX2e}[1997/12/01] %\ProvidesPackage{poemscol} -% [2018/01/11 v2.98 poemscol file] +% [2019/08/03 v3 poemscol file] % %<*driver> \documentclass{ltxdoc} @@ -33,7 +31,7 @@ % % \fi % -% \CheckSum{8465} +% \CheckSum{8569} % % \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 @@ -233,6 +231,9 @@ % \changes{v2.97}{2018/01/05}{Correction to JHepigraphs. Epigraphenvironment for % headnotes with more than one stanza or paragraph. Corrections to manual.} % \changes{v2.98}{2018/01/11}{Corrections to manual.} +% \changes{v2.99}{2019/08/02}{Hierarchy of indented stanzas} +% \changes{v3}{2019/08/03}{With centered verse you can align the title, epigraphs, +% attibutions, and so on with the left margin of the verse block.} % \DoNotIndex{\newcommand,\newenvironment,\def,\edef,\else,\renewcommand,\makeatletter,\makeatother} % \DoNotIndex{\abovedisplayskip,\belowdisplayskip,\abovedisplayshortskip,\belowdisplayshortskip} % \DoNotIndex{\newcommand, \section, \subsection, \subsubsection, @@ -265,15 +266,15 @@ % \textsc, \unskip} % \setcounter{IndexColumns}{2} % \MakeShortVerb{|} -% \def\fileversion{2.98} -% \def\filedate{11 January 2018} -% \def\docdate{11 January 2018} +% \def\fileversion{3} +% \def\filedate{3 August 2019} +% \def\docdate{3 August 2019} % \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{11 January 2018} +% \date{3 August 2019} % \maketitle % \begin{abstract} \textsf{poemscol} provides commands for \LaTeX\ for % setting collections of poetry. It is especially suited for setting @@ -429,7 +430,7 @@ % the poem on the page may be ambiguous, the editor's intentions about % the logical structure of the poem will be preserved in the \LaTeX\ % source. Should you wish later to produce an electronic edition of -% your work, either using XML or the SGML markup approved by the Text +% your work, perhaps using the XML markup approved by the Text % Encoding Initiative, transforming your texts from \LaTeX\ to XML % would largely (although not entirely) be a matter of performing a % series of global search-and-replaces, and could conceivably be done @@ -662,6 +663,29 @@ % environment, so |\centertitles| just moves them towards the center. To adjust the placement % of epigraphs and similar things, see section \ref{centerepigraphs}, page \pageref{centerepigraphs}. % +%\begin{sloppypar} +% \DescribeMacro{\leftaligntitles} Rather than centering the title over +% a centered block of verse, one might prefer to align the title with +% the left margin of the verse block. To do this, issue +% |\leftaligntitlestrue| to set the boolean |\ifleftaligntitles|. +% +% % \DescribeMacro{\leftalignepigraphs}You +% may also wish to align epigraphs, dedications, attributions, or +% headnotes with the left margin of the verse block (even if you +% center the titles). To do this, issue |\leftalignepigraphstrue| to +% set the boolean |\ifleftalignepigraphs|. Remember that for this to +% work, you will need to use the |\settowidth| command. Issue +% |\settowidth{\versewidth}{Text to be used for centering.}| just +% before you issue the |\poemtitle| or |\epigraph| command. +% |\leftalignepigraphstrue| will also align attributions, +% dedications, and other pre-texts of poems. (It will not affect the +% dedications and attributions on volume title pages, which are set +% using the |\volumededication|, |\volumeepigraph|, and +% |\volumeattribution| commands.) For how to use |\settowidth| to center the +% verse block or to align titles, epigraphs, and so forth with the left margin of the +% verse block, see section \ref{centeringtextblock}, page \pageref{centeringtextblock}. +% \end{sloppypar} +% % \begin{sloppypar} % \DescribeMacro{\poemtitlefont} % |\poemtitlefont| globally sets the font size (and @@ -683,7 +707,7 @@ % to do globally, not at the level of classes of title, anyway. %\end{sloppypar} % -% \DescribeMacro{\contentspoemtitlefont} +% \DescribeMacro{\contentspoemtitlefont} % |\contentspoemtitlefont| globally sets the font size (and leading) % for poem titles in the table of contents. There are similar commands for each of the % other kinds of titles in the table of contents. They can be changed just as the font @@ -759,21 +783,30 @@ % environment does. (I found that the standard stanza breaks did not % leap out on the page as stanza breaks.) % The verse environment for \textsf{poemscol} is |pmclverse|, defined -% below on page \pageref{versedefine}. +% below on page \pageref{versedefine}. You don't have to place poems explicitly in +% the |pmclverse| environment. The |poem| environment automatically opens (and closes) +% |pmclverse|. % % \subsubsection{Customizing the poem environment} % \DescribeMacro{\versewidth} -% The |poem| environment takes an optional argument. If your poem has +% The |poem| environment uses an optional argument to center the verse block on a +% line of a given width. 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: +% give the width of the line you want to use to center the poem as the optional +% argument. To center a verse block 20 ems wide, for instance, issue +% |\begin{poem}[20em]|. +% % \label{centeringtextblock} -% |\settowidth{\versewidth}{Text of line to use for centering}|. To use |\versewidth| -% to center the poem on a sample line, enter the |poem| environment this way: -% |\begin{poem}[\versewidth]|. Notice that the optional argument is in square braces, +% Rather than specifying the length explicitly, you can use the length +% |\versewidth| as the optional +% argument to |\begin{poem}|. You can set the length of |\versewidth| to the proper +% amount using |\settowidth| as follows: +% \begin{center} |\settowidth{\versewidth}{Text of line to use for centering}|. \end{center} +% Once you have set |\versewidth| +% to center the poem on a sample line, you use it to center the |poem| environment this way: +% \begin{center} |\begin{poem}[\versewidth]|.\end{center} +% Notice that the optional argument is in square braces, % not in curly braces. % % \DescribeMacro{\linenumberscenteredwithverse} @@ -785,7 +818,7 @@ % false. For centered verse, the distance between the line numbers and the % verse can be set by setting the length of |\marginparsepmin| (not % |\marginparsep|). The default -% value of |\marginparsepmin| is 2em. +% value of |\marginparsepmin| is 2 em. % % \begin{sloppy} % \DescribeMacro{\centertitles} @@ -951,6 +984,7 @@ % % \subsection{~Special line markup} % \subsubsection{Line breaks, runover, and broken lines} +% \begin{sloppypar} % \DescribeMacro{\verseindent} The |\verseindent| command is to be % used for formally indented lines. It should not be used to indent % the run over portion of long lines (which \textsf{poemscol} handles @@ -958,8 +992,26 @@ % than the run over portion of long ``bent'' lines are indented, so % that the two cases can be visually distinguished. By default, the % length of |\verseindent| is 2 em. To change it, say to 3 em, issue -% |\renewcommand{\verseindent}{\hspace{3em}}| -% +% |\renewcommand{\verseindent}{\hspace{3em}}|. +% Alternatively, you can change the length |\verseindentamount| by +% issuing |\setlength{\verseindentamount}{3em}|.\end{sloppypar}\goodbreak +% +% \begin{sloppypar} +% \DescribeMacro{indentedverse} You might want to indent whole stanzas, +% or perhaps extended passages of verse, relative to the rest of the poem (you might +% for instance, want to indent refrains systematically). This would be tedious to +% do using |\verseindent|. Put stretches of +% verse you wish to indent in the |indentedverse| environment. Whatever is +% in this environment will be indented. The indentation will be of the length +% |\indentedstanzaamount|, which is by default set to |\verseindentamount|, +% which by default is 2 em. You can change |\indentedstanzaamount| to 3em, by issuing +% |\setlength{\indentedstanzaamount}{3em}|. You can set a hierarchy of intended stanzas +% or passages by issuing an optional argument to |\begin{indentedverse}|. So, for instance, +% |\begin{indentedverse}[2]| will indent that environment by two |\indentedstanzaamount|s +% (4 em), and |\begin{indentedverse}[3]| will indent that environment by three +% |\indentedstanzaamount|s, or 6 em. Note that if you use the optional argument, you + % must enclose it in square brackets, not curly ones.\end{sloppypar} +% % \DescribeMacro{\linebend} \textsf{poemscol} automatically runs over % long lines, indenting the run over portion on the next physical % line. If you are unhappy with where \textsf{poemscol} has run over @@ -2152,6 +2204,24 @@ % poetry, use |\volumededication|, |\volumeepigraph|, and % |\volumeattribution|. These commands are unaffected by |\centertitles|. % +% \begin{sloppypar} +% \DescribeMacro{\leftaligntitles} Rather than centering the title over +% a centered block of verse, one might prefer to align the title with +% the left margin of the verse block. To do this, issue +% |\leftaligntitlestrue| to set the boolean |\ifleftaligntitles|. You +% may also wish to align epigraphs, dedications, attributions, or +% headnotes with the left margin of the verse block (even if you +% center the titles). To do this, issue |\leftalignepigraphstrue| to +% set the boolean |\ifleftalignepigraphs|. Remember that for this to +% work, you will need to use the |\settowidth| command. Issue +% |\settowidth{\versewidth}{Text to be used for centering.}| just +% before you issue the |\poemtitle| command. +% |\leftalignepigraphstrue| will also align attributions, +% dedications, and other pre-texts of poems. (It will not affect the +% dedications and attributions on volume title pages, which are set +% using the |\volumededication|, |\volumeepigraph|, and +% |\volumeattribution| commands.\end{sloppypar} +% % \subsection{~Appending publication date} % \DescribeMacro{\poemdate} You can append the date of the poem % with |\poemdate|. Issue |\poemdate| just after |\end{poem}|. You can @@ -2370,7 +2440,7 @@ % this way: |\JHpoemtitle{Los desvelados}{EP_LosDesvelados_AC}|. Up to % version 2.49 of \textsf{poemscol} you had to be sure to define the % label in the notes sections by issuing -% |\sources{\label{EP_LosDesvelados_AC}}|. This is no longer +% |\literaltextnote{\label{EP_LosDesvelados_AC}}|. This is no longer % necessary, and |\JHpoemtitle| defines both the |\label| and the % |\pageref|. Instructions are given in section \ref{JHpoemtitle}, % p.~\pageref{JHpoemtitle} for how to construct similar commands for @@ -3885,7 +3955,29 @@ % \end{macrocode} % For explicitly declared indented lines: % \begin{macrocode} -\newcommand{\verseindent}{\hspace{2em}} +\newlength{\verseindentamount} +\setlength{\verseindentamount}{2em} +\newcommand{\verseindent}{\hspace{\verseindentamount}} +\newlength{\indentedstanzaamount} +\setlength{\indentedstanzaamount}{\verseindentamount} +\newlength{\variablestanzaamount} +\setlength{\variablestanzaamount}{\indentedstanzaamount} +\newcount\loopcounter +\newcommand{\adjustst@nzaindent}[1]{\loopcounter=#1 +\loop + \addtolength{\variablestanzaamount}{\indentedstanzaamount} + \advance \loopcounter -1 +\ifnum \loopcounter>0 +\repeat} +\newif\ifinindentedverse +\newenvironment{indentedverse}[1][]{% +\inindentedversetrue +\ifthenelse{\equal{#1}{}}{\relax}{\adjustst@nzaindent{#1}} +\let\\=\@centercr% +\list{}{\itemsep\z@ \itemindent -\runoverindentvalue\listparindent \itemindent +\rightmargin 0sp\leftmargin 0sp\advance\leftmargin +\variablestanzaamount}\item[]} +{\endlist\inindentedversefalse\setlength{\variablestanzaamount}{\indentedstanzaamount}} % \end{macrocode} % For multicolumn notes: % \begin{macrocode} @@ -4441,9 +4533,15 @@ \let\\=\@centercr% \list{}{\topsep\z@% \partopsep\z@% -\itemsep\z@ \itemindent -\titleentryoverrun\listparindent \itemindent - \rightmargin 1sp\leftmargin 1sp\advance\leftmargin - \titleentryoverrun}\item[]}{\endlist} +\itemsep\z@ \itemindent -\titleentryoverrun% +\listparindent \itemindent % +\ifleftaligntitles +\left@ligntitleblock +\rightmargin 1sp\leftmargin \lefttitlemargin% +\else +\rightmargin 1sp\leftmargin 1sp% +\fi +\advance\leftmargin \titleentryoverrun}\item[]}{\endlist} % \end{macrocode} % \end{macro} % The poem environment. The little trick about setting the language @@ -4460,6 +4558,7 @@ % \begin{macro}{poem} % \begin{macrocode} \newlength{\versewidth} +\setlength{\versewidth}{\linewidth}% default length for \versewidth \newenvironment{poem}[1][\linewidth] {\raggedright% \language=255%no hyphenation in verse @@ -5374,7 +5473,6 @@ % textual notes. |\@poemtitletotextnotes{}| sends the title. % \begin{macrocode} - \newcommand{\m@kep@emlabel}{\ifsinglelinetitle% \addtocounter{poemnumber}{1}% \makepoemlabel{poem\thepoemnumber}% @@ -5458,6 +5556,16 @@ % \relax \fi\fi } +\newlength{\lefttitlemargin} +\newcommand{\leftaligntitlespace}{\hspace{\lefttitlemargin}} +\newif\ifleftaligntitles % title flush with left margin of centered poem +\leftaligntitlesfalse % default value +\newcommand{\left@ligntitleblock}{\rightmargin \z@%% + \setlength{\lefttitlemargin}{\linewidth}% + \addtolength{\lefttitlemargin}{-\versewidth}% + \addtolength{\lefttitlemargin}{-0.5\lefttitlemargin} +} +% \newcommand{\poemtitle}[1]{% \set@p@emtitle{#1}{\poemtitlepenalty}{\poemtitlefont}% {\relax}{\nobreak\par\nobreak\afterpoemtitleskip\nobreak}{\z@}% @@ -6533,7 +6641,7 @@ % Arseneau for suggesting how to do this. % \begin{macrocode} \newcommand{\tsentry}[1]{\iftextnoteson\ifincludetypescripts{\@ifnextchar,{\unskip}{% -Ê\@ifnextchar;{\unskip}{}% +Ê\@ifnextchar;{\unskip}{}% }#1}\fi\fi\unskip} % \end{macrocode} % \end{macro} @@ -6884,7 +6992,7 @@ literal#1\endcsname{\begin{multicols}{2}\fi\setlength{\parindent}{-10pt}}% % Fairbairns version % \begin{macrocode} % \newcommand*\ifrefundefined[1] {% -% Ê Ê\expandafter\ifx\csname r@#1\endcsname\relax +% Ê Ê\expandafter\ifx\csname r@#1\endcsname\relax % } % Oberdiek version \makeatletter @@ -9557,14 +9665,22 @@ wherever such spaces are lost in pagination. \newlength{\epigraphquoterightmargin} \setlength{\epigraphquoteleftmargin}{1.5em} \setlength{\epigraphquoterightmargin}{1.5em} -\newenvironment{epigraphquote}{\list{}{\rightmargin\epigraphquoterightmargin% - \leftmargin\epigraphquoteleftmargin% +\newif\ifleftalignepigraphs +\leftalignepigraphsfalse +\makeatletter +\newenvironment{epigraphquote}{\list{}{% +\ifleftalignepigraphs\left@ligntitleblock% +\rightmargin 1sp\leftmargin \lefttitlemargin% +\else +\rightmargin\epigraphquoterightmargin% +\leftmargin\epigraphquoteleftmargin% +\fi \topsep 0pt% \partopsep 0pt% \listparindent 0pt% }% \item\relax} - {\endlist} + {\endlist}\makeatother \newenvironment{volumetitlepagequote}{\list{}{\rightmargin \voladditionalamount% \leftmargin \voladditionalamount% \topsep 0pt% diff --git a/Master/texmf-dist/source/latex/poemscol/poemscol.ins b/Master/texmf-dist/source/latex/poemscol/poemscol.ins index 0628d333e1b..55a4659e8d3 100644 --- a/Master/texmf-dist/source/latex/poemscol/poemscol.ins +++ b/Master/texmf-dist/source/latex/poemscol/poemscol.ins @@ -1,15 +1,13 @@ %% -%% Copyright (C) 2013 by John Burt +%% Copyright (C) 2002-2019 by John Burt %% %% This file may be distributed and/or modified under the conditions -%% of the LateX Project Public License, either verison 1.2 of this +%% of the LateX Project Public License, either version 1.3c of this %% license or (at your option) any later version. The latest version of %% this license is in %% %% http://www.latex-project.org/lppl.txt %% -%% and version 1.2 or later is part of all distributions of LaTeX -%% version 1999/12/01 or later. %% \input docstrip.tex -- cgit v1.2.3