diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/reledmac/reledmac.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/reledmac/reledmac.dtx | 70 |
1 files changed, 61 insertions, 9 deletions
diff --git a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx index c831474cc9c..ba5f27a5f23 100644 --- a/Master/texmf-dist/source/latex/reledmac/reledmac.dtx +++ b/Master/texmf-dist/source/latex/reledmac/reledmac.dtx @@ -514,6 +514,7 @@ % \changes{v2.26.10}{2018/05/05}{Add error message when insertion a \protect\cs{pstart} or \protect\cs{pend} inside \protect\cs{edtext} arguments} % \changes{v2.26.11}{2018/05/21}{Allow to use \protect\cs{edtext} inside \protect\cs{sameword}} % \changes{v2.26.12}{2018/07/19}{Precise minimal version of xparse package required.} +% \changes{v2.27.0}{2018/09/13}{Add \protect\cs{doinsidethislinehook}.} % Typeset scholarly editions with \LaTeX\thanks{This file (\dtxfilename) % has version number \fileversion, last revised \filedate.}} % @@ -748,7 +749,7 @@ % \url{https://www.zotero.org/groups/209265/critical_editions_typeset_with_edmac_ledmac_eledmac_and_reledmac/}. % Please add your own edition made with (r)(e)ledmac. % -% If you write book or article about (r)(e)ledmac, please add it on the collaborative bibliography on \url{https://www.zotero.org/groups/1024519/}. +% If you write a book or an article about (r)(e)ledmac, please add it on the collaborative bibliography on \url{https://www.zotero.org/groups/1024519/}. % \section{How the package works --- the problem of the number of \LaTeX\ runs}\label{howto} % The \macpackage package is a three-pass package like \LaTeX\ itself. % Although your textual apparatus and line @@ -1250,6 +1251,29 @@ % The file \href{examples/2-line_numbers_in_header.tex}{examples/2-line\_numbers\_in\_header.tex} provides % an example for printing the first and last line numbers of a page in the header. % +% \section{Execution code at a specific line} +% Sometime, you want to execute a code at a precise point in the flow of your text. +% For example, if the current header of the page corresponds to the position inside the text, you may want to use \cs{markboth} (or similar) command. +% The main problem is that you need to execute \cs{markboth} when \macpackage\ typesets the text, and not when it reads it, because that could create damage with vertical spacing. +% +% \DescribeMacro{\doinsidethislinehook} +% The \cs{doinsidethislinehook}\marg{code} macro allows \meta{code} to be executed when the text is typeset. The \meta{code} will be executed in the line equivalent to the position of \cs{doinsidethislinehook} in the flow of the text. +% +% For example, with the following code: +% \begin{verbatim} +% \beginnumbering +% \pstart +% … +% 1.\doinsidelinehook{\markboth{1}{1}} a +% \pend +% \end{verbatim} +% \verb+\markboth{1}{1}+ will be executed at the line the \verb+1.+ will be typeset. +% The \meta{code} of \cs{doinsidethislinehook} will be executed only at the second run of \LaTeX. +% +% See the file +% \href{examples/2-subdivision-number-in-header.tex}{examples/2-subdivision-number-in-header.tex} for an example. +% Especially, the use of this command with \LaTeX\ counters is quite complex, but the example show you how to deal with this problem. +% % \section{Apparatus commands} % % \subsection{Terminology} @@ -1356,9 +1380,9 @@ % \DescribeMacro{\Cfootnote} % \DescribeMacro{\Dfootnote} % \DescribeMacro{\Efootnote} -% Five separate series of the footnotes are maintained; each macro +% Five separate series of footnotes are maintained; each macro % takes one argument like \protect\cs{Afootnote}\marg{text}. -% When all of the six +% When all of the five % are used, the \texttt{A} notes appear in a layer just below the main % text, followed by the rest in turn, down to the \texttt{E} notes at % the bottom. @@ -1373,8 +1397,8 @@ % \label{fulllines}The available options are: % \begin{itemize} % \item \verb|fulllines| to disable \protect\cs{Xtwolines} and \protect\cs{Xmorethantwolines} features for this note (cf. \reff{Xtwolines}). -% \item \verb|nonum| disables line numbering for this note. A horizontal blank space is added instead. You can use \cs{Xinplaceoflemmaseparator} to set it (\reff{Xinplaceoflemmaseparator}). -% \item \verb|nosep| to disable the lemma separator for this note. +% \item \verb|nonum| disables line numbering for this note. A horizontal blank space is added instead. You can use \cs{Xinplaceofnunber} to set it (\reff{Xinplaceofnumber}). +% \item \verb|nosep| to disable the lemma separator for this note. A horizontal blank space is added instead. You can use \cs{Xinplaceoflemmaseparator} to set it (\reff{Xinplaceoflemmaseparator}). % \item \verb|linerangesep=|\meta{c} to change to \meta{c} the separator between start line and end line for this particular note. % \end{itemize} % @@ -2274,7 +2298,7 @@ % \cs{Xendbeforesymlinenum} and \cs{Xendaftersymlinenum} are the equivalents of \cs{Xbeforesymlinenum} and \cs{Xaftersymlinenum} for the endnotes. % % \subsubsection{Space in place of number} -% \DescribeMacro{\Xinplaceofnumber} +% \DescribeMacro{\Xinplaceofnumber}\label{Xinplaceofnumber} % If no number or symbolic line number is printed, you can add a space, with \cs{Xinplaceofnumber}\oarg{s}\marg{l}. The default value is 1~em. % % \DescribeMacro{\Xendinplaceofnumber} \cs{Xendinplaceofnumber}\oarg{s}\marg{l} is the same, for critical endnotes. @@ -2907,7 +2931,6 @@ % \item \DescribeMacro{\AtEveryStopStanza} Use \cs{AtEveryStopStanza} to automatically add content after the end of stanzas (not in the same paragraph). % % Note that a \cs{noindent} will be inserted before the argument, and, consequently, a \cs{parskip}. You can use the starred version of \protect\cs{AtEveryStopStanza} to avoid this \cs{noindent}. -% \item \DescribeMacro{\AtStartEveryStanza} Use \cs{AtStartEveryStanza} to automatically add content at the end of stanza (in the same paragraph). % \end{itemize} % % @@ -4192,7 +4215,7 @@ % \begin{macrocode} %<*code> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{reledmac}[2018/07/19 v2.26.12 typesetting critical editions]% +\ProvidesPackage{reledmac}[2018/09/13 v2.27.0 typesetting critical editions]% % \end{macrocode} % % \subsection{Package options} @@ -8905,9 +8928,11 @@ % \begin{macrocode} \hb@xt@ \linewidth{% % \end{macrocode} -% User hook. +% User hooks. % \begin{macrocode} \do@insidelinehook% + \csuse{insidethis@\the\absline@num @\the\section@num}% + \global\csundef{insidethis@\the\absline@num @\the\section@num}% % \end{macrocode} % Left line number % \begin{macrocode} @@ -9045,6 +9070,33 @@ % \end{macrocode} % \end{macro} % \end{macro} +% \begin{macro}{\doinsidethislinehook} +% \begin{macro}{\@insidethisline} +% The \cs{doinsidethislinehook} can be called directly in the main flood of a text. +% It will define a hook executed at a specific line, determined by the position of the command in the flood of the text. +% \begin{macrocode} +\newcommand{\doinsidethislinehook}[1]{% + \leavevmode%In case it begins with a \pstart, ensure the \@insidethisline is written after \@nl + \ifledRcol% + \write\linenum@outR{\string\@insidethisline[\unexpanded{#1}]}% + \else% + \write\linenum@out{\string\@insidethisline[\unexpanded{#1}]}% + \fi% +}% +% \end{macrocode} +% The auxiliary files command just store the information to be executed +% when typesseting the specific line. +% \begin{macrocode} +\newcommand{\@insidethisline}[1]{% + \ifledRcol% + \csgappto{insidethisR@\the\absline@numR @\the\section@numR}{#1}% + \else% + \csgappto{insidethis@\the\absline@num @\the\section@num}{#1}% + \fi% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} % \subsubsection{Sidenotes and marginal line number initialization} % \begin{macro}{\l@demptyd@ta} % \begin{macro}{\l@dld@ta} |