From c8e8fe4cb53b2b726916ac8c976c6f9f41b8f6ea Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 22 Jan 2019 22:19:50 +0000 Subject: reledmac (22jan19) git-svn-id: svn://tug.org/texlive/trunk@49792 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/reledmac/reledmac.dtx | 94 +++++++++++++++++++--- .../texmf-dist/source/latex/reledmac/reledpar.dtx | 62 +++++++++----- 2 files changed, 125 insertions(+), 31 deletions(-) (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx index 37ebef36ee7..5bab19f8b7d 100644 --- a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx +++ b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx @@ -520,8 +520,10 @@ % \changes{v2.28.1}{2018/12/22}{Fix bug with the alignment of the columns of two and three columns critical footnotes.} % \changes{v2.29.0}{2019/01/08}{Fix bug with \protect\cs{linenumannotation} and `nofamiliar` option.} % \changes{v2.29.0}{2019/01/08}{Really reset line number annotation at each line} -% \changes{v2.29.0}{2018/01/08}{Add \protect\option{noresetlinenumannotation}} -% \changes{v2.29.0}{2018/01/08}{Fix little bug with \protect\cs{msdata}} +% \changes{v2.29.0}{2019/01/08}{Add \protect\option{noresetlinenumannotation}} +% \changes{v2.29.0}{2019/01/08}{Fix little bug with \protect\cs{msdata}} +% \changes{v2.30.0}{2019/01/22}{Add \protect\cs{Xnoidenticallinenumannotation} and \protect\cs{Xendnoidenticallinenumannotation} hooks} +% \changes{v2.30.0}{2019/01/22}{Add separator between line number annotations in margin. Add \protect\cs{setlinenumannotationsep}} % Typeset scholarly editions with \LaTeX\thanks{This file (\dtxfilename) % has version number \fileversion, last revised \filedate.}} % @@ -1249,7 +1251,7 @@ % \DescribeMacro{\hidenumberingonleftpage} % \cs{hidenumberingonleftpage} is like \protect{hidenumbering}, but is applied only on left page. \cs{hidenumberingonrightpage} is applied on right page. % They can be useful if the position of the line number is depending of the position of the page, but the position of marginal note is fixed. -% \subsubsection{Adding annotations to line numbers}\label{annotation} +% \subsection{Adding annotations to line numbers}\label{annotation} % You may want to have two or more numbers associated with a line of text. % Consider, for example, the following cases: % \begin{itemize} @@ -1292,7 +1294,7 @@ % \item by \enquote{A-B} for the third lemma, as it starts while annotation A is still in effect and it finishes after annotation B has already taken effect; % \item by \enquote{B} for the fourth lemma. % \end{itemize} -% \paragraph{Modifying annotation associated with a specific note}\label{lineannot} +% \subsubsection{Modifying annotation associated with a specific note}\label{lineannot} % % The \cs{linenum} (\reff{linenum}) macro changes the line number passed to a note. % \DescribeMacro{\lineannot}The \cs{lineannot} macro does the same for the annotations. @@ -1304,7 +1306,7 @@ % \lineannot{a|b}% to change both % \lineannot{\empty|}% to delete the beginning annotation % \end{verbatim} -% \paragraph{Changing the position of the annotation}\label{annotationposition} +% \subsubsection{Changing the position of the annotation}\label{annotationposition} % By default, annotations are placed after line numbers in both margin and footnote. % % \DescribeMacro{\Xlinenumannotationposition} @@ -1319,7 +1321,7 @@ % \meta{s} for the series of endnotes to which it applies, where \meta{s} may once again be a comma-separated list of series. % \end{itemize} % In each of these three commands, \meta{v} can be \option{after} or \option{before} to indicate position with regards to the line number. -% \paragraph{Changing the macro in which annotations are wrapped}\label{wraplinenumannotation} +% \subsubsection{Changing the macro in which annotations are wrapped}\label{wraplinenumannotation} % By default, annotations are wrapped in the \cs{textsuperscript} macro. % You can modify this using one of the following: % \begin{itemize} @@ -1343,6 +1345,20 @@ % \Xwraplinenumannotationside{\@gobble} % \makeatother % \end{verbatim} +% \subsubsection{Not printing the second identical annotations} +% If you print only line number annotation, you may get in critical notes something like \verb+6-6+, +% because the starting and ending annotations are the same. +% \DescribeMacro{\Xnoidenticallinenumannotation} +% \DescribeMacro{\Xendnoidenticallinenumannotation} +% You can avoid that using \\ +% \cs{Xnoidenticallinenumannotation}\oarg{s}, for critical footnotes \\ +% or +% \cs{Xendnoidenticallinenumannotation}\oarg{s} +% \subsubsection{Separator between annotations} +% \DescribeMacro{\setlinenumannotationsep} +% If there an more than one annotation in the same line, there are separated by a comma. +% If you want to change the separator, you can use \\ +% \cs{setlinenumannotationsep}\marg{sep} % \subsection{Executing code at each line}\label{linehook} % \Macpackage provides an advanced feature for users. % \DescribeMacro{\dolinehook}\DescribeMacro{\doinsidelinehook} @@ -3362,6 +3378,7 @@ % \item \cs{Xtwolinesonlyinsamepage} % \item \cs{Xlinenumannotationposition} % \item \cs{Xwraplinenumannotation} +% \item \cs{Xnoidenticallinenumannotation} % \end{itemize} % % If you want to make settings specific to \cs{appref} or \cs{SEref}, just call them with an optional argument containing a comma-separated list of command names (for example \verb+appref,SEref+) or with a suffix equal to the command name (for example \verb+appref+). @@ -3382,6 +3399,7 @@ % \item\cs{Xendtwolinesonlyinsamepage} % \item\cs{Xendlinenumannotationposition} % \item\cs{Xendwraplinenumannotation} +% \item\cs{Xemdnoidenticallinenumannotation} % \end{itemize} % \paragraph{For one specific command} % @@ -4228,7 +4246,7 @@ % \begin{macrocode} %<*code> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{reledmac}[2019/01/08 v2.29.0 typesetting critical editions]% +\ProvidesPackage{reledmac}[2019/01/22 v2.30.0 typesetting critical editions]% % \end{macrocode} % % \subsection{Package options} @@ -6048,7 +6066,7 @@ % action codes and the settings they invoke; it does not require an % entry in the action-code list for every line. % \item \cs{annot@list} stores line number annotations for the start and the end lines of each \cs{edtext}, as \cs{line@list} does for line numbers. -% We don't store that in the same list as line numbers as \cs{printlines} already have height arguments, and a \TeX\ macro can take at most nine arguments. +% We don't store that in the same list as line numbers as \cs{Xprintlines} already have height arguments, and a \TeX\ macro can take at most nine arguments. % \end{itemize} % Here are the commands to create these lists: % @@ -9458,12 +9476,16 @@ % \end{macro} % \begin{macro}{\Xwraplinenumannotation@ref} % \begin{macro}{\Xwraplinenumannotation@side} -% The \cs{Xwraplinenumannotation@ref} macro is applied to crossrefs made to line annotations. The \cs{Xwraplinenumannotation@side} macro is applied to line annotation in sides. +% The \cs{Xwraplinenumannotation@ref} macro is applied to line annotations in crossref. The \cs{Xwraplinenumannotation@side} macro is applied to line annotation in sides. % They must be modified by users using \cs{Xwraplinenumannotation}. % By default, they call \cs{textsuperscript}. +% +% We also define toggle \verb+Xnoidenticallinenumannotation@ref+ and \verb+Xnoidenticallinenumannotation@ref+ % \begin{macrocode} \def\Xwraplinenumannotation@ref{\textsuperscript}% \def\Xwraplinenumannotation@side{\textsuperscript}% +\newtoggle{Xnoidenticallinenumannotation@ref}% +\newtoggle{Xnoidenticallinenumannotation@side}% % \end{macrocode} % \end{macro} % \end{macro} @@ -9481,9 +9503,17 @@ }% \newcommand{\store@annot@to@absline}[1]{% \ifledRcol% - \csgappto{annotR@\the\absline@numR @\the\section@numR}{#1}% + \ifcsdef{annotR@\the\absline@numR @\the\section@numR}{% + \csgappto{annotR@\the\absline@numR @\the\section@numR}{\@linenumannotationsep#1}% + }{% + \csgdef{annotR@\the\absline@numR @\the\section@numR}{#1}% + }% \else% - \csgappto{annot@\the\absline@num @\the\section@num}{#1}% + \ifcsdef{annot@\the\absline@num @\the\section@num}{% + \csgappto{annot@\the\absline@num @\the\section@num}{\@linenumannotationsep#1}% + }{% + \csgdef{annot@\the\absline@num @\the\section@num}{#1}% + }% \fi% }% % \end{macrocode} @@ -9516,6 +9546,15 @@ }% % \end{macrocode} % \end{macro} +% \begin{macro}{\setlinenumannotationsep} +% \begin{macro}{\@linenumannotationsep} +% The separator between the annotations and the way to redefine it. +% \begin{macrocode} +\newcommand{\setlinenumannotationsep}[1]{\gdef\@linenumannotationsep{#1}}% +\def\@linenumannotationsep{, }% +% \end{macrocode} +% \end{macro} +% \end{macro} % \section{Line number printing} % % \begin{macro}{\affixline@num} @@ -12006,6 +12045,18 @@ }% \fi% % \end{macrocode} +% If the \cs{Xnoidenticallinenumannotation} is set for this series, we check if the ending annotation is identical to the starting. +% If true, we don't print the ending annotation +% \begin{macrocode} + \iftoggle{Xnoidenticallinenumannotation@\@currentseries}{% + \ifx\annot@start\annot@end% + \let\@annot@end@print\relax% + \ifx\linenumrep\@gobble%Dont print the dash if we don't print the line number + \l@d@dashfalse% + \fi% + \fi% + }{}% +% \end{macrocode} % End of \protect\cs{setprintlines}. % \begin{macrocode} }% @@ -14015,6 +14066,18 @@ }% \fi% % \end{macrocode} +% If the \cs{Xendnoidenticallinenumannotation} is set for this series, we check if the ending annotation is identical to the starting. +% If true, we don't print the ending annotation +% \begin{macrocode} + \iftoggle{Xendnoidenticallinenumannotation@\@currentseries}{% + \ifx\annot@start\annot@end% + \let\@annot@end@print\relax% + \ifx\linenumrep\@gobble%Dont print the dash if we don't print the line number + \l@d@dashfalse% + \fi% + \fi% + }{}% +% \end{macrocode} % End of \protect\cs{setprintendlines}. % \begin{macrocode} }% @@ -14322,6 +14385,7 @@ \csgdef{Xwidth@#1}{\hsize}% \csgdef{Xwraplinenumannotation@#1}{\textsuperscript}% \csgdef{Xlinenumannotationposition@#1}{after}% + \newtoggle{Xnoidenticallinenumannotation@#1}% % \end{macrocode} % \subsubsection{Create inserts, needed to add notes in foot} % As regards inserts, see chapter 15 of \thetexbook\ by D. Knuth. @@ -14750,6 +14814,7 @@ \csgdef{Xendlinenumannotationposition@#1}{after}% \csgdef{Xendwraplinenumannotation@#1}{\textsuperscript}% + \newtoggle{Xendnoidenticallinenumannotation@#1}% \newtoggle{Xendpagenumberonlyfirst@#1}% \newtoggle{Xendpagenumberonlyfirstifsingle@#1}% @@ -15072,6 +15137,7 @@ \newhookcommand@series{Xlinerangeseparator}[appref,SEref] \newhookcommand@series{Xlinenumannotationposition}[side,appref,SEref]% \newhookcommand@series{Xwraplinenumannotation}[side,ref,appref,SEref]% +\newhooktoggle@series{Xnoidenticallinenumannotation}[side,ref,appref,SEref]% % \end{macrocode} % \subsubsection{Options for familiar notes} % Before generating the optional commands for familiar notes, we check the \protect\cs{nofamiliar} option. @@ -15179,6 +15245,7 @@ \newhookcommand@series{Xendlinenumannotationposition}[apprefwithpage,SErefwithpage]% \newhookcommand@series{Xendwraplinenumannotation}[apprefwithpage,SErefwithpage]% +\newhooktoggle@series{Xendnoidenticallinenumannotation}[apprefwithpage,SErefwithpage]% % \end{macrocode} % \subsection{Hooks for a particular footnote} % \begin{macro}{\newhooktoggle@specific} @@ -16294,6 +16361,8 @@ \def\Xwraplinenumannotation@appref{\textsuperscript}% \def\Xwraplinenumannotation@SEref{\textsuperscript}% +\newtoggle{Xnoidenticallinenumannotation@appref}% +\newtoggle{Xnoidenticallinenumannotation@SEref}% \def\Xendtwolines@apprefwithpage{}% \def\Xendtwolines@SErefwithpage{}% @@ -16338,6 +16407,9 @@ \def\Xendwraplinenumannotation@apprefwithpage{\textsuperscript}% \def\Xendwraplinenumannotation@SErefwithpage{\textsuperscript}% + +\newtoggle{Xendnoidenticallinenumannotation@apprefwithpage}% +\newtoggle{Xendnoidenticallinenumannotation@SErefwithpage}% % \end{macrocode} % Note that some of these hooks are declared but no user command can change their values. Such hooks are not pertinent for \verb+appref+ and \verb+apprefwithpage+ pseudo-series, but their values are nonetheless tested in some macros. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx index 951b1e45917..3fc339e156f 100644 --- a/Master/texmf-dist/source/latex/reledmac/reledpar.dtx +++ b/Master/texmf-dist/source/latex/reledmac/reledpar.dtx @@ -336,6 +336,7 @@ % \changes{v2.21.9}{2018/07/19}{Fix (little) bug when using \protect\package{calc} package.} % \changes{v2.22.0}{2018/09/13}{Compatibility with \protect\cs{doinsidethislinehook} macro.} % \changes{v2.22.1}{2019/01/08}{Really reset line number annotation at each line} +% \changes{v2.22.2}{2019/01/22}{Fix bug with \protect\cs{Xonlyside} and \protect\cs{onlysideX}} % ^^A PW added following as the definitions are at some unknown elsewhere % % \newcommand{\egstart}{% @@ -1384,7 +1385,7 @@ % \begin{macrocode} %<*code> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{reledpar}[2019/01/08 v2.22.1 reledmac extension for parallel texts]% +\ProvidesPackage{reledpar}[2019/01/22 v2.22.2 reledmac extension for parallel texts]% % \end{macrocode} % \subsection{Package's requirement} @@ -4836,8 +4837,10 @@ % \subsection{Footnotes output specific to \protect\cs{Pages}} % \begin{macro}{\print@Xnotes@forpages} +% \begin{macro}{\restore@Xnotes@settings} % \begin{macro}{\correct@Xfootins@box} % \begin{macro}{\print@notesX@forpages} +% \begin{macro}{\restore@notesX@settings} % \begin{macro}{\correct@footinsX@box} % \changes{v1.13.1}{2015/03/12}{Correct \protect\cs{correct@footinsX@box} and \protect\cs{correct@Xfootins@box}} % \changes{v1.13.1}{2015/03/12}{Call \protect\cs{correct@footinsX@box} and \protect\cs{correct@Xfootins@box} directly in \protect\cs{print@notesX@forpages} and \protect\cs{print@Xnotes@forpages}.} @@ -4894,19 +4897,10 @@ }% % \end{macrocode} % In case we are on a page where notes must NOT be printed. -% First restore expected rooms for notes on the next page. Also reset expected vertical size allowed to notes. +% We reset the settings of the notes for one side. % \begin{macrocode} {% - \global\count\csuse{#1footins}=\csuse{default@#1footins}% - \global\skip\csuse{#1footins}=\csuse{Xbeforenotes@#1}% - \bgroup% - \csuse{Xnotefontsize@#1}% - \global\dimen\csuse{#1footins}=\csuse{Xmaxhnotes@#1}% - \egroup% -% \end{macrocode} -% Then, save the current insert box to a temporary insert box. -% \begin{macrocode} - \global\setnamebox{#1footins@kept}=\box\namebox{#1footins}% + \restore@Xnotes@settings{#1}% }% % \end{macrocode} % End of \protect\cs{print@Xnotes@forpages}. @@ -4914,6 +4908,21 @@ }% }% % \end{macrocode} +% The macro which restore the note settings. +% \#1 = series +% \begin{macrocode} +\newcommand{\restore@Xnotes@settings}[1]{% + \unless\ifnocritical@ + \global\count\csuse{#1footins}=\csuse{default@#1footins}% + \global\skip\csuse{#1footins}=\csuse{Xbeforenotes@#1}% + \bgroup% + \csuse{Xnotefontsize@#1}% + \global\dimen\csuse{#1footins}=\csuse{Xmaxhnotes@#1}% + \egroup% + \global\setnamebox{#1footins@kept}=\box\namebox{#1footins}% + \fi +}% +% \end{macrocode} % And now, the same for familiar footnotes. % \begin{macrocode} \newcommand\print@notesX@forpages[1]{% @@ -4933,24 +4942,30 @@ \global\count\csuse{footins#1}=\z@% \global\skip\csuse{footins#1}=\z@% \global\dimen\csuse{footins#1}=\maxdimen% - }% {% - \global\count\csuse{footins#1}=\csuse{default@footins#1}% - \global\skip\csuse{footins#1}=\csuse{beforenotesX@#1}% - \bgroup% - \csuse{Xnotefontsize@#1}% - \global\dimen\csuse{footins#1}=\csuse{maxhnotesX@#1}% - \egroup% - \global\setnamebox{footins#1@kept}=\box\namebox{footins#1}% + \restore@notesX@settings{#1}% }% }% }% +\newcommand{\restore@notesX@settings}[1]{% + \unless\ifnofamiliar@ + \global\count\csuse{footins#1}=\csuse{default@footins#1}% + \global\skip\csuse{footins#1}=\csuse{beforenotesX@#1}% + \bgroup% + \csuse{Xnotefontsize@#1}% + \global\dimen\csuse{footins#1}=\csuse{maxhnotesX@#1}% + \egroup% + \global\setnamebox{footins#1@kept}=\box\namebox{footins#1}% + \fi +}% % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} +% \end{macro} +% \end{macro} % \begin{macro}{\insert@notes@for@onlyside} % \cs{insert@notes@for@onlyside} is everytime \cs{Pages} go to the next side. % It just reinsert the notes note printed on the previous side because of \protect{Xonlyside} or \cs{onlysideX} setting. @@ -4964,6 +4979,7 @@ \unvnamebox{##1footins@kept}% \egroup% \fi% + \restore@Xnotes@settings{##1}% \fi% \unless\ifnofamiliar@% \ifvoid\csuse{footins##1@kept}\else% @@ -4972,6 +4988,7 @@ \unvnamebox{footins##1@kept}% \egroup% \fi% + \restore@notesX@settings{##1}% \fi% }% \dolistloop{\@series}% @@ -6712,6 +6729,11 @@ \global\newnamebox{footins##1}% \fi % \end{macrocode} +% We must also restore the settings for the footnotes in case of using onlyside option. +% \begin{macrocode} + \restore@Xnotes@settings{##1}% + \restore@notesX@settings{##1}% +% \end{macrocode} % And now, add a \protect\cs{newpage} if there is no more footnote to print. % \begin{macrocode} \ifvoid\csuse{##1footins}% -- cgit v1.2.3