summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/poemscol
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-05-28 21:59:59 +0000
committerKarl Berry <karl@freefriends.org>2020-05-28 21:59:59 +0000
commit95adfddbd29a54564bdafff9e843bbf8618049e9 (patch)
treedcc8865dd1fe47dc4af232c6c7d1107cf04ca1c5 /Master/texmf-dist/tex/latex/poemscol
parent69700ca12b26ac22bebbdf65ddb4fbdb2621b6fc (diff)
poemscol (28may20)
git-svn-id: svn://tug.org/texlive/trunk@55323 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/poemscol')
-rw-r--r--Master/texmf-dist/tex/latex/poemscol/poemscol.sty251
1 files changed, 247 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/latex/poemscol/poemscol.sty b/Master/texmf-dist/tex/latex/poemscol/poemscol.sty
index 89b947b51e8..63730c3b4c0 100644
--- a/Master/texmf-dist/tex/latex/poemscol/poemscol.sty
+++ b/Master/texmf-dist/tex/latex/poemscol/poemscol.sty
@@ -1823,6 +1823,207 @@
\newcommand{\interjectiontitlemiddleline}[1]{
\sequencefirstsubsectionmiddleline{#1}
}
+\newlength{\JHtextwidth}
+\setlength{\JHtextwidth}{\textwidth}
+\newlength{\JHmarginparsep}
+\setlength{\JHmarginparsep}{0pt}
+\newlength{\JHmarginparvshift}
+\setlength{\JHmarginparvshift}{0pt}
+\newif{\ifJHmarkstoleft}
+\JHmarkstolefttrue
+\newif{\ifJHmarkstoright}
+\JHmarkstorightfalse
+\newif{\ifJHmarkstoouter}
+\JHmarkstoouterfalse
+\newif{\ifJHmarkstogutter}
+\JHmarkstogutterfalse
+\newif{\ifJHmarginparswitch}
+\JHmarginparswitchfalse
+\newif{\ifJHreversemarginpar}
+\JHreversemarginparfalse
+\newcommand{\JHmarksleft}{%
+\JHmarkstolefttrue%
+\JHmarkstorightfalse%
+\JHmarkstoouterfalse%
+\JHmarkstogutterfalse%
+\JHmarginparswitchfalse%
+\JHreversemarginparfalse%
+\reversemarginpar
+}
+\newcommand{\JHmarksright}{%
+\JHmarkstoleftfalse%
+\JHmarkstorighttrue%
+\JHmarkstoouterfalse%
+\JHmarkstogutterfalse%
+\JHmarginparswitchfalse%
+\JHreversemarginparfalse%
+\normalmarginpar
+}
+\JHmarksright
+\newcommand{\JHmarksouter}{%
+\JHmarkstoleftfalse%
+\JHmarkstorightfalse%
+\JHmarkstooutertrue%
+\JHmarkstogutterfalse%
+\JHmarginparswitchtrue%
+\JHreversemarginparfalse%
+\@mparswitchtrue
+}
+\newcommand{\JHmarksgutter}{%
+\JHmarkstoleftfalse%
+\JHmarkstorightfalse%
+\JHmarkstoouterfalse%
+\JHmarkstoguttertrue%
+\JHmarginparswitchtrue%
+\JHreversemarginpartrue%
+\@mparswitchtrue
+\reversemarginpar
+}
+\newcommand{\JHrightmarginpar}[1]{%
+\pmclbsphack\strut\vadjust{%
+\rlap{\kern-\parindent%
+\kern\JHtextwidth\kern\JHmarginparsep% at right
+\setbox0=\vtop to 0pt{% added
+\begin{minipage}[t]{\marginparwidth}% added
+#1%
+\end{minipage}%
+\vss}%
+\vtop to 0pt{\kern\JHmarginparvshift% default should be 0pt
+\kern-\dp\strutbox \kern-\ht0 \box0 \vss}}}\pmclesphack}%
+\newcommand{\JHleftmarginpar}[1]{%
+\pmclbsphack\strut\vadjust{% changed
+\rlap{\kern-\parindent%
+\kern -\JHmarginparsep \kern -\marginparwidth% at left
+\setbox0=\vtop to 0pt{
+\begin{minipage}[t]{\marginparwidth}% added
+#1%
+\end{minipage}%
+\vss}% changed
+\vtop to 0pt{\kern\JHmarginparvshift % default should be 0pt
+\kern-\dp\strutbox \kern-\ht0 \box0 \vss}}}\pmclesphack}% changed
+%%\marginpar{\scriptsize {\the\margrefmarker~p.~\pageref{margref\themargrefnumber}}}
+\newcommand{\JHoutermarginpar}{%
+\strictpagechecktrue%
+\checkoddpage%
+\ifoddpage%
+\JHswitchmarginpar{\scriptsize {\the\margrefmarker~p.~\pageref{margref\themargrefnumber}}}%
+\else% below is for even pages
+\JHswitchmarginpar{\scriptsize {\the\margrefmarker~p.~\pageref{margref\themargrefnumber}}}%
+\fi%
+}
+%%\marginpar{\scriptsize {\the\margrefmarker~p.~\pageref{margref\themargrefnumber}}}
+\newcommand{\JHguttermarginpar}{%
+\strictpagechecktrue
+\checkoddpage%
+\ifoddpage%
+\JHswitchmarginpar{\scriptsize {\the\margrefmarker~p.~\pageref{margref\themargrefnumber}}}%
+\else% below is for even pages
+\JHswitchmarginpar{\scriptsize {\the\margrefmarker~p.~\pageref{margref\themargrefnumber}}}%
+\fi%
+}
+\newcommand{\JHswitchmarginpar}{\@dblarg{\@JHswitchmarginpar}}
+\long\def\@JHswitchmarginpar[#1]#2{\@bsphack\strut\vadjust{% added
+\checkoddpage
+ \ifJHmarginparswitch
+ \ifJHreversemarginpar
+ \ifoddpage
+ \oddpagefalse
+ \else
+ \oddpagetrue
+ \fi
+ \fi
+ \else
+ \oddpagetrue
+ \ifJHreversemarginpar
+ \oddpagefalse
+ \fi
+ \fi
+ \rlap{\kern-\parindent
+ \if@twocolumn
+ \if@firstcolumn % put at left
+ \kern -\JHmarginparsep \kern -\marginparwidth % at left
+ \else % put at right
+ \kern \columnwidth \kern \JHmarginparsep % at right
+ \fi
+ \else
+ \ifoddpage % put at right
+ \kern \textwidth \kern \JHmarginparsep % at right
+ \else % put at left
+ \kern -\JHmarginparsep \kern -\marginparwidth % at left
+ \fi
+ \fi
+ \setbox0=\vtop to 0pt{% added
+ \begin{minipage}[t]{\marginparwidth}% added
+ \ifoddpage #2\else #1\fi%
+ \end{minipage}%
+\vss}% added
+ \vtop to 0pt{\kern\JHmarginparvshift % default should be 0pt
+ \kern-\dp\strutbox \kern-\ht0 \box0 \vss}}}\@esphack}% added
+\newcommand{\JHrighttitlemarginpar}[1]{%
+\pmclbsphack\strut\vadjust{%
+\rlap{\kern-\parindent%
+\kern\JHtextwidth\kern\JHmarginparsep% at right
+\kern-.5\JHtextwidth\kern\marginparsepmin
+\setbox0=\vtop to 0pt{% added
+\begin{minipage}[t]{\marginparwidth}% added
+#1%
+\end{minipage}%
+\vss}%
+\vtop to 0pt{\kern\JHmarginparvshift% default should be 0pt
+\kern-\dp\strutbox \kern-\ht0 \box0 \vss}}}\pmclesphack}%
+\newcommand{\JHlefttitlemarginpar}[1]{%
+\pmclbsphack\strut\vadjust{% changed
+\rlap{\kern-\parindent%
+\kern -\JHmarginparsep \kern -\marginparwidth% at left
+\kern-.5\JHtextwidth\kern\marginparsepmin
+\setbox0=\vtop to 0pt{
+\begin{minipage}[t]{\marginparwidth}% added
+#1%
+\end{minipage}%
+\vss}% changed
+\vtop to 0pt{\kern\JHmarginparvshift % default should be 0pt
+\kern-\dp\strutbox \kern-\ht0 \box0 \vss}}}\pmclesphack}% changed
+\newcommand{\JHswitchtitlemarginpar}{\@dblarg{\@JHswitchtitlemarginpar}}
+\long\def\@JHswitchtitlemarginpar[#1]#2{\@bsphack\strut\vadjust{% added
+\checkoddpage
+ \ifJHmarginparswitch
+ \ifJHreversemarginpar
+ \ifoddpage
+ \oddpagefalse
+ \else
+ \oddpagetrue
+ \fi
+ \fi
+ \else
+ \oddpagetrue
+ \ifJHreversemarginpar
+ \oddpagefalse
+ \fi
+ \fi
+ \rlap{\kern-\parindent
+ \if@twocolumn
+ \if@firstcolumn % put at left
+ \kern -\JHmarginparsep \kern -\marginparwidth % at left
+ \kern-.5\JHtextwidth\kern\marginparsepmin
+ \else % put at right
+ \kern \columnwidth \kern \JHmarginparsep % at right
+ \fi
+ \else
+ \ifoddpage % put at right
+ \kern \textwidth \kern \JHmarginparsep % at right
+ \kern-.5\JHtextwidth\kern\marginparsepmin
+ \else % put at left
+ \kern -\JHmarginparsep \kern -\marginparwidth % at left
+ \kern-.5\JHtextwidth\kern\marginparsepmin
+ \fi
+ \fi
+ \setbox0=\vtop to 0pt{% added
+ \begin{minipage}[t]{\marginparwidth}% added
+ \ifoddpage #2\else #1\fi%
+ \end{minipage}%
+\vss}% added
+ \vtop to 0pt{\kern\JHmarginparvshift % default should be 0pt
+ \kern-\dp\strutbox \kern-\ht0 \box0 \vss}}}\@esphack}% added
\newcommand{\set@margp@emtitle}[7]{\setlength{\titleentryoverrun}{#6}%
{#2}%
{#3 \begin{titleentryenvironment}%
@@ -1848,6 +2049,7 @@
\t@xtnotesinfo{#1}%
\sources{\label{#2}}%
}
+\@mparswitchfalse % so the title marker won't switch sides on alternate pages
\newcommand{\JHpoemtitle}[2]{%
\set@margp@emtitle{#1}{\poemtitlepenalty}{\poemtitlefont}%
{\sequencetitleindent}{\nobreak\par\nobreak\afterpoemtitleskip\nobreak}{\z@}%
@@ -1867,7 +2069,20 @@
\sources{\label{#2}}%
}
\newcommand{\JHlabel}[1]{%
-\marginpar{{\scriptsize{\the\margrefmarker~p.~\pageref{#1}}}}}
+\ifJHmarkstoright\JHrighttitlemarginpar
+{{\scriptsize{\the\margrefmarker~p.~\pageref{#1}}}}
+\fi
+\ifJHmarkstoleft
+\JHlefttitlemarginpar{{\scriptsize{\the\margrefmarker~p.~\pageref{#1}}}}
+\fi
+\ifJHmarkstoouter
+\JHswitchtitlemarginpar{{\scriptsize{\the\margrefmarker~p.~\pageref{#1}}}}
+\fi
+\ifJHmarkstogutter
+\JHswitchtitlemarginpar{{\scriptsize{\the\margrefmarker~p.~\pageref{#1}}}}
+\fi
+}
+
\newcommand{\JHsequencetitle}[2]{%
\set@margp@emtitle{#1}{\sequencetitlepenalty}{\sequencetitlefont}%
{\sequencetitleindent}{\nobreak\par\nobreak\aftersequencetitleskip\nobreak}{\z@}%
@@ -1943,12 +2158,30 @@
\newtoks{\margrefmarker}
\margrefmarker={\dag}
\newcommand{\setmargrefmarker}[1]{\margrefmarker={#1}}
+\providecommand{\settitlemargrefmarker}[1]{\titlemargrefmarker={#1}}
+\newtoks{\titlemargrefmarker}
+\titlemargrefmarker={\dag}
\newcommand{\makemargreflabel}{\string\label\string{margref\themargrefnumber\string}}
\newif{\ifmargrefstomargin}
-\margrefstomarginfalse
-\newcommand{\setmargref}
-{\marginpar{\ifmargrefstomargin\hspace*{.5\leftmargin}\fi\scriptsize {\the\margrefmarker~p.~\pageref{margref\themargrefnumber}}}
+\margrefstomargintrue
+\newcommand{\setmargref}{\nolinebreak\begin{marginenvironment}%
+\nolinebreak%
+\ifJHmarkstoright%
+ \JHrightmarginpar{\scriptsize {\the\margrefmarker~p.~\pageref{margref\themargrefnumber}}}%
+\fi%
+\ifJHmarkstoleft%
+ \JHleftmarginpar{\scriptsize {\the\margrefmarker~p.~\pageref{margref\themargrefnumber}}}%
+ \fi%
+ \ifJHmarkstoouter%
+ \JHoutermarginpar%
+ \fi%
+ \ifJHmarkstogutter%
+ \JHguttermarginpar%
+ \fi%
+ \end{marginenvironment}%
+ \nolinebreak%
}
+
\newcommand{\margreftextnote}{%
\iftextnoteson\addtocounter{margrefnumber}{1}%
\immediate\write\textnotes{\makemargreflabel}%
@@ -2045,6 +2278,16 @@
\else\setlength{\dateindent}{\leftmargin}%
\fi%
\bigskip\begin{raggedleft}\hspace{\dateindent}#1\end{raggedleft}\bigskip}%
+\newlength{\poemattributionindent}%
+\setlength{\poemattributionindent}{\leftmargin}%
+\newcommand{\variablepoemattributionindent}{%
+\setlength{\poemattributionindent}{\linewidth}%
+\addtolength{\poemattributionindent}{-\versewidth}%
+\addtolength{\poemattributionindent}{-.5\poemattributionindent}}%
+\newcommand{\poemattribution}[1]{\iflastpoemcentered\variablepoemattributionindent%
+\else\setlength{\poemattributionindent}{\leftmargin}%
+\fi%
+\bigskip\begin{raggedleft}\hspace{\poemattributionindent}#1\end{raggedleft}\bigskip}%
\def\strip#1>{}
\newcommand{\literaltextnote}[1]{\iftextnotesatend
\begingroup