From 0904e30ef59894e483d50ac5a550070517845b60 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 17 Jun 2015 22:41:46 +0000 Subject: poemscol (17jun15) git-svn-id: svn://tug.org/texlive/trunk@37588 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/poemscol/poemscol.sty | 244 +++++++++++++++++++++- 1 file changed, 233 insertions(+), 11 deletions(-) (limited to 'Master/texmf-dist/tex/latex/poemscol') diff --git a/Master/texmf-dist/tex/latex/poemscol/poemscol.sty b/Master/texmf-dist/tex/latex/poemscol/poemscol.sty index 0686ae5934f..825ae7c4c68 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} - [2013/08/20 v2.64 poemscol file] + [2015/6/18 v2.7 poemscol file] @@ -142,12 +142,14 @@ \advance\leftmargin\runoverindentvalue} \item[]} {\endlist} +\newif\ifinquotedverse \newenvironment{quotedverse}{% + \inquotedversetrue \let\\=\@centercr% \list{}{\itemsep\z@ \itemindent -\runoverindentvalue\listparindent \itemindent \rightmargin 0sp\leftmargin 0sp\advance\leftmargin \runoverindentvalue}\item[]} - {\endlist} + {\endlist\inquotedversefalse} \newcounter{verselinenumber} \newcounter{printlineindex} @@ -264,7 +266,7 @@ \fancypagestyle{volumefirststyle}{% \fancyhf{} -\fancyfoot[C]{\hfil{\small \botmark}} +\fancyfoot[C]{\hfil{\small \botmark}\hfil} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} } @@ -1765,8 +1767,9 @@ literal#1\endcsname{\begin{multicols}{2}\fi\setlength{\parindent}{-10pt}}% \relax\else \modulolinenumbers[\value{prosemodulo}]% if lineno is called \fi +\newif\ifinprosesection \newenvironment{prosesection} -{\resetlinenumber\begin{linenumbers}% +{\inprosesectiontrue\resetlinenumber\begin{linenumbers}% \renewcommand{\linenumberfont}{\scriptsize}% \ifnumbersright\rightlinenumbers*\setlength{\linenumbersep}{-\marginparsep}% \else\ifnumbersswitch\rightlinenumbers*\setlength{\linenumbersep}{-\marginparsep}% @@ -1776,7 +1779,7 @@ literal#1\endcsname{\begin{multicols}{2}\fi\setlength{\parindent}{-10pt}}% \noemendyettrue% \noexplainyettrue% } -{\end{linenumbers}} +{\end{linenumbers}\inprosesectionfalse} \newenvironment{prosesectionnoreset} {\begin{linenumbers}% \renewcommand{\linenumberfont}{\scriptsize} @@ -1858,7 +1861,7 @@ r@#2\endcsname{}{}\@nil \string{\string\mark\string{\string\thenotepageholdernote\string}\string}% \string{\string\mark\string{\string\thenotepageholdertitle\string}\string}\string\unskip \string\unskip\string\relax\ \proseciterange :\string~\string\nolinebreak}% -\newcommand{\proselinelabel}[1]{\unskip\linelabel{#1}} +\newcommand{\proselinelabel}[1]{\ifhmode\unskip\fi\linelabel{#1}} \newcommand{\prosetextnote}[3][0]{% \iftextnoteson% \unskip\proselinelabel{#2}% @@ -2309,7 +2312,6 @@ r@#2\endcsname{}{}\@nil {\ifexplanon% \immediate\write\explanations{\string\noindent\string\kern-#1}% \fi} - \newcommand{\stanzaatbottom}[1]{\global\edef\stanzaatbottomvalue{#1}} \stanzaatbottom{*} \newcommand{\nostanzaatbottom}[1]{\global\edef\nostanzaatbottomvalue{#1}} @@ -2317,11 +2319,19 @@ r@#2\endcsname{}{}\@nil \def\cleartorecto{\clearpage\if@twoside \ifodd\c@page\else \hbox{}\thispagestyle{empty}% \newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi} - \def\cleartoverso{\clearpage\if@twoside \ifodd\c@page\hbox{}\thispagestyle{empty}% \newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi} - +\makeatletter +\def\ifenv#1{% + \def\reserved@a{#1}% + \ifx\reserved@a\@currenvir + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +\makeatother \newdimen\pmclsavsk \newcount\pmclsavsf \def\pmclbsphack{% @@ -2385,6 +2395,22 @@ r@#2\endcsname{}{}\@nil \rectopoemstillopenfalse \newif\ifversopoemstillopen \versopoemstillopenfalse +\newif\ifrectoprosesectionpending +\rectoprosesectionpendingfalse +\newif\ifversoprosesectionpending +\versoprosesectionpendingfalse +\newif\ifrectoprosesectionstillopen +\rectoprosesectionstillopenfalse +\newif\ifversoprosesectionstillopen +\versoprosesectionstillopenfalse +\newif\ifrectoquotedversepending +\rectoquotedversependingfalse +\newif\ifversoquotedversepending +\versoquotedversependingfalse +\newif\ifrectoquotedversestillopen +\rectoquotedversestillopenfalse +\newif\ifversoquotedversestillopen +\versoquotedversestillopenfalse \newif\ifrectoemendationspending \rectoemendationspendingfalse \newif\ifversoemendationspending @@ -2456,6 +2482,122 @@ r@#2\endcsname{}{}\@nil \nolinebreak } } +\newenvironment{parallelverse}{\startparalleltexts} +{\finishparalleltexts} +\newtoks{\versotitleholder} +\newtoks{\rectotitleholder} +\newcommand{\makeversotitleholder}[1]{% +\versotitleholder={#1}% +} +\newcommand{\makerectotitleholder}[1]{% +\rectotitleholder={#1}% +} +\makeatletter +\newcommand{\versopoemtitle}[1]{% +\versoset@p@emtitle{#1}{\poemtitlepenalty}{\poemtitlefont}% +{\relax}{\nobreak\par\nobreak\afterpoemtitleskip\nobreak}{\z@}% +\c@ntentsinfo{#1}{\contentsindentone}{\contentspoemtitlefont}% +{\contentsindenttwoamount}% +} +\newcommand{\versoset@p@emtitle}[6]{\setlength{\titleentryoverrun}{#6}% +{#2}% +{#3 \begin{titleentryenvironment}% +{\ifcentertitleson\begin{center}#4 #1\end{center}\else #4 #1\fi}% +\end{titleentryenvironment}}% +{#5}% +\m@kep@emlabel +\versom@ken@teholder{#1}% +\setlength{\titleentryoverrun}{\z@}} +\newcommand{\versom@ken@teholder}[1]{% +\ifsinglelinetitle +\versotitleholder={#1}% +\global\edef\@compoundlabelscratch{poem\thepoemnumber}% +\else\iftitlefirstline + \versotitleholder={#1}% + \global\edef\@compoundlabelscratch{poem\thepoemnumber}% + \else\iftitlemiddleline + \titlesofar=\versotitleholder + \titleincrement={~#1}% + \global\edef\titleconcat{\the\titlesofar \the\titleincrement}% + \versotitleholder=\expandafter{\titleconcat}% + \global\edef\@compoundlabelscratch{poem\thepoemnumber}% + \else + \titlesofar=\versotitleholder + \titleincrement={~#1}% + \global\edef\titleconcat{\the\titlesofar \the\titleincrement}% + \versotitleholder=\expandafter{\titleconcat}% + \global\edef\@compoundlabelscratch{poem\thepoemnumber}% + \fi + \fi + \fi +} +\newcommand{\versotitletoothernotes}{\string\par +\ifputpagenumberinnotes% +\string\argpageref\string{\@compoundlabelscratch\string}% +\string\setcounterfrompageref\string{notepageholdertitle\string}% +\string{\@compoundlabelscratch\string}% +\fi% +\string\textbf\string{\ \the\versotitleholder\string} +}% +\newcommand{\versopoemtitlenocontents}[1]{% +\versoset@p@emtitle{#1}{\poemtitlepenalty}{\poemtitlefont}% +{\relax}{\nobreak\par\nobreak\afterpoemtitleskip\nobreak}{\z@}% +} +\newcommand{\versotitleinnotescheck}{\ifparalleltexts\let\titletoothernotes=\versotitletoothernotes\fi} +\makeatother +\makeatletter +\newcommand{\rectopoemtitle}[1]{% +\rectoset@p@emtitle{#1}{\poemtitlepenalty}{\poemtitlefont}% +{\relax}{\nobreak\par\nobreak\afterpoemtitleskip\nobreak}{\z@}% +\c@ntentsinfo{#1}{\contentsindentone}{\contentspoemtitlefont}% +{\contentsindenttwoamount}% +} +\newcommand{\rectoset@p@emtitle}[6]{\setlength{\titleentryoverrun}{#6}% +{#2}% +{#3 \begin{titleentryenvironment}% +{\ifcentertitleson\begin{center}#4 #1\end{center}\else #4 #1\fi}% +\end{titleentryenvironment}}% +{#5}% +\m@kep@emlabel +\rectom@ken@teholder{#1}% +\setlength{\titleentryoverrun}{\z@}} +\newcommand{\rectom@ken@teholder}[1]{% +\ifsinglelinetitle +\rectotitleholder={#1}% +\global\edef\@compoundlabelscratch{poem\thepoemnumber}% +\else\iftitlefirstline + \rectotitleholder={#1}% + \global\edef\@compoundlabelscratch{poem\thepoemnumber}% + \else\iftitlemiddleline + \titlesofar=\rectotitleholder + \titleincrement={~#1}% + \global\edef\titleconcat{\the\titlesofar \the\titleincrement}% + \rectotitleholder=\expandafter{\titleconcat}% + \global\edef\@compoundlabelscratch{poem\thepoemnumber}% + \else + \titlesofar=\rectotitleholder + \titleincrement={~#1}% + \global\edef\titleconcat{\the\titlesofar \the\titleincrement}% + \rectotitleholder=\expandafter{\titleconcat}% + \global\edef\@compoundlabelscratch{poem\thepoemnumber}% + \fi + \fi + \fi +} +\newcommand{\rectotitletoothernotes}{\string\par +\ifputpagenumberinnotes% +\string\argpageref\string{\@compoundlabelscratch\string}% +\string\setcounterfrompageref\string{notepageholdertitle\string}% +\string{\@compoundlabelscratch\string}% +\fi% +\string\textbf\string{\ \the\rectotitleholder\string} +}% +\newcommand{\rectopoemtitlenocontents}[1]{% +\rectoset@p@emtitle{#1}{\poemtitlepenalty}{\poemtitlefont}% +{\relax}{\nobreak\par\nobreak\afterpoemtitleskip\nobreak}{\z@}% +} +\newcommand{\rectotitleinnotescheck}{\ifparalleltexts\let\titletoothernotes=\rectotitletoothernotes\fi} +\makeatother \newcommand{\saveversoline}{\setcounter{versolinecounter}% {\value{verselinenumber}}% \setcounter{versoindexscratch}{\value{printlineindex}}} @@ -2503,7 +2645,8 @@ r@#2\endcsname{}{}\@nil \noexplainyetfalse \global\versoexplanationspendingfalse \fi -\versotrue\restoreversoline} +\rectofalse\versotrue\restoreversoline +\let\titletoothernotes=\versotitletoothernotes} \newcommand{\finishversopage}{ \saveversoline\versofalse\ \ifinpoem @@ -2556,7 +2699,8 @@ r@#2\endcsname{}{}\@nil \noexplainyetfalse \global\rectoexplanationspendingfalse \fi -\rectotrue\restorerectoline} +\versofalse\rectotrue\restorerectoline +\let\titletoothernotes=\rectotitletoothernotes} \newcommand{\finishrectopage}{\saverectoline\rectofalse \ifinpoem \global\rectopoempendingtrue @@ -2581,6 +2725,84 @@ r@#2\endcsname{}{}\@nil \noexplainyetfalse \fi } +\newcommand{\finishparalleltexts}{ +\ifinstanza +\end{stanza} +\fi +\ifinpoem +\end{poem} +\fi +\ifinprosesection +\end{prosesection} +\fi +\ifinquotedverse +\end{quotedverse} +\fi +\rectofalse\versofalse\paralleltextsfalse +} +\newif\ifversopassagestillopen +\versopassagestillopenfalse +\newif\ifrectopassagestillopen +\rectopassagestillopenfalse +\newif\ifinpara +\inparafalse +\newif\ifrectoparapending +\rectoparapendingfalse +\newif\ifrectoparaopen +\rectoparaopenfalse +\newif\ifversoparapending +\versoparapendingfalse +\newif\ifversoparaopen +\versoparaopenfalse +\newcounter{prosepage} +\setcounter{prosepage}{1} +\newcommand{\makeprosepagelabel}{\proselinelabel{prosepageno\theprosepage}} +\newcounter{versoproselinecounter} +\newcommand{\saveversoproseline}{% +\refstepcounter{prosepage}% +\makeprosepagelabel +\setcounterfromref{versoproselinecounter}{prosepageno\theprosepage} +} +\newcommand{\restoreversoproseline}{\setcounter{linenumber}{\value{versoproselinecounter}}}% +\newcounter{rectoproselinecounter} +\newcommand{\saverectoproseline}{% +\refstepcounter{prosepage}% +\makeprosepagelabel +\setcounterfromref{rectoproselinecounter}{prosepageno\theprosepage} +} +\newcommand{\restorerectoproseline}{\setcounter{linenumber}% + {\value{rectoproselinecounter}}}% +\newcommand{\parastart}{\inparatrue} +\newcommand{\paraend}{\inparafalse} +\newcommand{\startparalleltextsprose}{% +\leavevmode +\cleartoverso +\paralleltextstrue +\inparafalse +} +\newcommand{\finishparalleltextsprose}{% +\paralleltextsfalse} +\newenvironment{parallelprose}{\startparalleltextprose} {\finishparalleltextsprose} +\newcommand{\startversoprosepage}{% +\let\titletoothernotes=\versotitletoothernotes +\restoreversoproseline% +\ifversoparapending{\inparatrue}\else{\inparafalse}\fi% +\ifinpara{\noindent}\else{\relax}\fi% +} +\newcommand{\finishversoprosepage}{% +\ifinpara{\versoparapendingtrue}\else{\versoparapendingfalse}\fi% +\saveversoproseline% +} +\newcommand{\startrectoprosepage}{% +\let\titletoothernotes=\rectotitletoothernotes +\restorerectoproseline% +\ifrectoparapending{\inparatrue}\else{\inparafalse}\fi% +\ifinpara{\noindent}\else{\relax}\fi% +} +\newcommand{\finishrectoprosepage}{% +\ifinpara{\rectoparapendingtrue}\else{\rectoparapendingfalse}\fi% +\saverectoproseline +} \newcommand{\finish}{ \small\bf \hyphenchar\font=45 -- cgit v1.2.3