From dc8841d1ea72ec8b0e9f95c48f6121e2fc113971 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 9 Feb 2015 22:42:20 +0000 Subject: eledmac (9feb15) git-svn-id: svn://tug.org/texlive/trunk@36243 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/eledmac/eledmac.dtx | 161 +++++++++++---------- 1 file changed, 82 insertions(+), 79 deletions(-) (limited to 'Master/texmf-dist/source/latex/eledmac') diff --git a/Master/texmf-dist/source/latex/eledmac/eledmac.dtx b/Master/texmf-dist/source/latex/eledmac/eledmac.dtx index 718f89ee2db..ebadbcdd15a 100644 --- a/Master/texmf-dist/source/latex/eledmac/eledmac.dtx +++ b/Master/texmf-dist/source/latex/eledmac/eledmac.dtx @@ -51,7 +51,7 @@ % % \fi % -% \CheckSum{10648} +% \CheckSum{10613} % % \makeatletter % \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters @@ -2905,7 +2905,7 @@ % \begin{macrocode} %<*code> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{eledmac}[2015/02/05 v1.16.1 LaTeX port of EDMAC]% +\ProvidesPackage{eledmac}[2015/02/09 v1.17.0 LaTeX port of EDMAC]% % \end{macrocode} % % Generally, these are the modifications to the original. @@ -3091,6 +3091,12 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\led@err@edtextoutsidepstart} +% \begin{macrocode} +\newcommand*{\led@err@edtextoutsidepstart}{% + \eledmac@error{\string\edtext\space outside numbered paragraph (\pstart…\pend)}{\@ehc}}% +% \end{macrocode} +% \end{macro} % \begin{macro}{\led@mess@NotesChanged} % \begin{macrocode} \newcommand*{\led@mess@NotesChanged}{% @@ -5084,6 +5090,7 @@ % \end{macrocode} % \end{macro} % \begin{macro}{\if@noneed@Footnote} +% \cs{if@noneed@Footnote} is a boolean to check if we have to print a error message when a \cs{edtext} is called without any footnotes. % \begin{macro}{\flag@start} % \begin{macro}{\flag@end} % \changes{v1.12.3}{2014/08/15}{\cs{flag@start} and \cs{flag@end} are now defined only one time for eledmac and eledpar} @@ -5095,7 +5102,7 @@ % setting the value of \cs{insert@count} appropriately; it % actually gets done by the various footnote macros. % \begin{macrocode} -\newif\if@noneed@Footnote%Bool to check if we have to print a error message +\newif\if@noneed@Footnote% \newcommand*{\flag@start}{% \ifledRcol% @@ -5339,8 +5346,8 @@ % to store and recall this kind of information if they need it. % % -% \subsection{{\tt \protect\bslash edtext} and {\tt \protect\bslash critext} -% themselves} +% \subsection{{\tt \protect\bslash edtext} (and {\tt \protect\bslash critext}) +% itself} % % The various note-generating macros might want to request that % commands be executed not at once, but in close connection with the @@ -5360,7 +5367,7 @@ % \cs{end@lemmas} by using \cs{xleft@appenditem}. % (Anything that needs to be done at % the \emph{start} of the lemma may be handled using \cs{aftergroup}, since -% the commands specified within \cs{critext}'s second argument are +% the commands specified within \cs{edtext}'s second argument are % executed within a group that ends just before the lemma is added to % the main text.) % @@ -5370,7 +5377,7 @@ % no use is currently made of \cs{end@lemmas} or of the \cs{aftergroup} % trick. The general % approach would be to define a macro to be used within the second -% argument of \cs{critext} that would add the appropriate command to +% argument of \cs{edtext} that would add the appropriate command to % \cs{end@lemmas}. % % Commands that are added to this list should always take care @@ -5383,10 +5390,10 @@ % % \begin{macro}{\dummy@text} % We now need to define a number of macros that allow us to weed out -% nested instances of \cs{critext}, and other problematic macros, from +% nested instances of \cs{edtext}, and other problematic macros, from % our lemma. This is similar to what we did in reading the line-list % file using \cs{dummy@ref} and various redefinitions---and that's -% because nested \cs{critext} macros create nested \cs{@ref} entries +% because nested \cs{edtext} macros create nested \cs{@ref} entries % in the line-list file. % % Here's a macro that takes the same arguments as @@ -5447,7 +5454,7 @@ % We also need to eliminate all \Eledmac{} macros like \cs{edlabel} and % \cs{setline} that write things to auxiliary files: that writing % should be done only once. And we make -% \cs{critext} itself, if it appears within its own +% \cs{edtext} itself, if it appears within its own % argument, do nothing but copy its first argument. % % Finally, we execute \cs{morenoexpands}. The version of @@ -5458,11 +5465,11 @@ % standard \Eledmac{} code. If you define your own % \cs{morenoexpands}, you must be very careful about spaces: if the % macro adds any spaces to the text when it runs, extra space -% will appear in the main text when \cs{critext} is used. +% will appear in the main text when \cs{edtext} is used. % % (A related problem, not addressed by these two macros, % is that of characters whose category code is changed by any -% the macros used in the arguments to \cs{critext}. Since the +% the macros used in the arguments to \cs{edtext}. Since the % category codes are set when the arguments are scanned, macros % that depend on changing them will not work. We have most often % encountered this with characters that are made `active' within @@ -5519,49 +5526,64 @@ % text, it seems more appropriate to pay attention to spaces than to % skip them. % -% When executed, \cs{critext} first ensures that we're in -% horizontal mode. +% \changes{v1.17.0}{2015/02/09}{The historical \cs{critext} now just refers to \cs{edtext} (code refactoring).} +% Since v.1.17.0, \cs{critext} only refers to \cs{edtext}. % \begin{macrocode} -\long\def\critext#1#2/{\leavevmode - \@edtext@true% +\long\def\critext#1#2/{\edtext{#1}{#2}}% % \end{macrocode} +% \end{macro} % +% \begin{macro}{\edtext} +% \changes{v0.4}{2004/02/29}{Added \cs{showlemma} to \cs{edtext} (and \cs{critext})} +% \changes{v1.4}{2012/11/16}{Compatibility of \cs{edtext} (and \cs{critext}) with the right-to-left direction (with Polyglossia).} +% \changes{v1.17.0}{2015/02/09}{Error message when calling \cs{edtext} outside of a numbered paragraph.} +% When executed, \cs{edtext} first ensures that we're in +% horizontal mode. +% \begin{macrocode} +\newcommand{\edtext}[2]{\leavevmode% +% \end{macrocode} +% Then, check if we are in a numbered paragraph (\cs{pstart}…\cs{pend}).. +% \begin{macrocode} + \ifnumberedpar@% +% \end{macrocode} +% We switch the \cs{@edtext@} flag, +% to let know to other commands that we are in a \cs{edtext}. +% \begin{macrocode} + \@edtext@true% +% \end{macrocode} % \begin{macro}{\@tag} % Our normal lemma is just argument \verb"#1"; but that argument could have -% further invocations of \cs{critext} within it. We get a copy of the -% lemma without any \cs{critext} macros within it by temporarily redefining -% \cs{critext} to just copy its first argument and ignore the other, +% further invocations of \cs{edtext} within it. We get a copy of the +% lemma without any \cs{edtext} macros within it by temporarily redefining +% \cs{edtext} to just copy its first argument and ignore the other, % and then expand \verb"#1" into \cs{@tag}, our lemma. % % This is done within a group that starts here, in order to get the -% original \cs{critext} restored; within this group we've also turned +% original \cs{edtext} restored; within this group we've also turned % off the expansion of those control sequences commonly found within text % that can cause trouble for us. % \begin{macrocode} - \begingroup - \global\renewcommand{\@tag}{\no@expands #1}%% + \begingroup% + \global\renewcommand{\@tag}{\no@expands #1}% % \end{macrocode} % \end{macro} -% % \begin{macro}{\l@d@nums} % \phantomsection\label{nums} % Prepare more data for the benefit of note-generating macros: the line % references and font specifier for this lemma go to \cs{l@d@nums}. % \begin{macrocode} - \set@line + \set@line% % \end{macrocode} % \end{macro} -% % \cs{insert@count} will be altered by the note-generating macros: % it counts the number of deferred footnotes or other insertions -% generated by this instance of \cs{critext}. +% generated by this instance of \cs{edtext}. % If we are in a right column (eledpar), we use \cs{insert@countR} % instead of \cs{insert@count}. % \begin{macrocode} - \ifledRcol \global\insert@countR \z@% - \else \global\insert@count \z@ \fi% + \ifledRcol \global\insert@countR \z@% + \else \global\insert@count \z@ \fi% % \end{macrocode} -% % Now process the note-generating macros in argument \verb"#2" % (i.e., \cs{Afootnote}, \cs{lemma}, etc.). \cs{ignorespaces} is here to % skip over any spaces that might appear at the start of \verb"#2"; @@ -5570,9 +5592,8 @@ % \cs{ignorespaces} as well, to skip any spaces between macros when % several are used in series. % \begin{macrocode} - \ignorespaces #2\relax + \ignorespaces #2\relax% % \end{macrocode} -% % Finally, we're ready to admit the first argument into the current % paragraph. % @@ -5583,12 +5604,12 @@ % within the expansion of \verb"#2" above, or in \cs{aftergroup} % commands within that expansion. % \begin{macrocode} - \@ifundefined{xpg@main@language}{%if not polyglossia - \flag@start}% - {\if@RTL\flag@end\else\flag@start\fi% With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic). - } - \endgroup - \showlemma{#1}% + \@ifundefined{xpg@main@language}{%if not polyglossia + \flag@start}% + {\if@RTL\flag@end\else\flag@start\fi% With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic). + }% + \endgroup% + \showlemma{#1}% % \end{macrocode} % % Finally, we add any insertions that are @@ -5598,51 +5619,33 @@ % not above. % % \begin{macrocode} - \ifx\end@lemmas\empty \else - \gl@p\end@lemmas\to\x@lemma - \x@lemma - \global\let\x@lemma=\relax - \fi - \@ifundefined{xpg@main@language}{%if not polyglossia - \flag@end}% - {\if@RTL\flag@start\else\flag@end\fi% With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic). - } - \@edtext@false% - \global\@lemmacommand@false% - } + \ifx\end@lemmas\empty \else% + \gl@p\end@lemmas\to\x@lemma% + \x@lemma% + \global\let\x@lemma=\relax% + \fi% + \@ifundefined{xpg@main@language}{%if not polyglossia + \flag@end}% + {\if@RTL\flag@start\else\flag@end\fi% With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic). + }% % \end{macrocode} -% \end{macro} -% -% \changes{v0.4}{2004/02/29}{Added \cs{showlemma} to \cs{edtext} (and \cs{critext})} -% \changes{v1.4}{2012/11/16}{Compatibility of \cs{edtext} (and \cs{critext}) with the right-to-left direction (with Polyglossia).} -% \begin{macro}{\edtext} +% We switch to false some flag. +% \begin{itemize} +% \item The one that checks having footnotes inside a \cs{edtext}. +% \item The one that says we are inside a \cs{edtext}. +% \item The one that says we are inside à \cs{@lemma}. +% \end{itemize} % \begin{macrocode} -\newcommand{\edtext}[2]{\leavevmode - \@edtext@true% - \begingroup% - \global\renewcommand{\@tag}{\no@expands #1}% - \set@line% - \ifledRcol \global\insert@countR \z@% - \else \global\insert@count \z@ \fi% - \ignorespaces #2\relax% - \@ifundefined{xpg@main@language}{%if not polyglossia - \flag@start}% - {\if@RTL\flag@end\else\flag@start\fi% With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic). - }% - \endgroup% - \showlemma{#1}% - \ifx\end@lemmas\empty \else% - \gl@p\end@lemmas\to\x@lemma% - \x@lemma% - \global\let\x@lemma=\relax% + \global\@noneed@Footnotefalse% + \@edtext@false% + \global\@lemmacommand@false% +% \end{macrocode} +% If we are outside of a numbered paragraph, +% we send error message and print the first argument. +% \begin{macrocode} + \else% + \showlemma{#1} (\textbf{\textsc{Edtext outside numbered paragraph}})\led@err@edtextoutsidepstart% \fi% - \@ifundefined{xpg@main@language}{%if not polyglossia - \flag@end}% - {\if@RTL\flag@start\else\flag@end\fi% With polyglossia, you must track whether the language reads left to right (English) or right to left (Arabic). - }% - \global\@noneed@Footnotefalse% - \@edtext@false% - \global\@lemmacommand@false% }% \newcommand*{\flag@end}{% -- cgit v1.2.3