From 401557891939e158c1e89c03003981afba8b02f2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 25 Jan 2015 00:01:52 +0000 Subject: eledmac (24jan15) git-svn-id: svn://tug.org/texlive/trunk@36136 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/eledmac/eledmac.dtx | 146 ++++++++++++++------- 1 file changed, 101 insertions(+), 45 deletions(-) (limited to 'Master/texmf-dist/source/latex/eledmac/eledmac.dtx') diff --git a/Master/texmf-dist/source/latex/eledmac/eledmac.dtx b/Master/texmf-dist/source/latex/eledmac/eledmac.dtx index 5afe089056c..38d1b81abc3 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{10594} +% \CheckSum{10642} % % \makeatletter % \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters @@ -167,7 +167,7 @@ % deleted the commented out original edmac texts} % \changes{v0.7}{2011/06/17}{Ma\"ieul Rouquette new maintainer} % \changes{v0.8}{2011/17/06}{Bug on endnotes fixed: in a // text, all endnotes will print and be placed at the ends of columns (!)} -% \changes{v0.8.1}{2011/07/14}{Bug on \cs{edtext} ; \cs{critex} ; \cs{lemma} fixed: we can now us non switching commands} +% \changes{v0.8.1}{2011/07/14}{Bug on \cs{edtext} ; \cs{critex} ; \cs{lemma} fixed: we can now us not switching commands} % \changes{v0.9}{2011/08/03}{No more ledpatch. All patches are now in the main file.} % \changes{v0.9.1}{2011/08/08}{Fix some bugs linked to integrating ledpatch on the main file.} % \changes{v0.10}{2011/08/22}{Corrections to \cs{section} and other titles in numbered sections} @@ -212,7 +212,9 @@ % \changes{v1.13.2}{2014/09/30}{Fix bug with normal footnotes, added by v1.13.0.} % \changes{v1.13.3}{2014/10/04}{Fix extra spaces with paragraphed footnotes, added by v1.13.0.} % \changes{v1.13.4}{2014/10/20}{Fix bug with index when memoir class is used without hyperref} -% \changes{v1.15.0}{2014/22/15}{Fix bug with footnotes layout when using some options of the geometry package (bug add by v1.13.0).} +% \changes{v1.15.0}{2015/01/12}{Fix bug with footnotes layout when using some options of the geometry package (bug add by v1.13.0).} +% \changes{v1.16.0}{2015/01/23}{Compatibility of standard footnotes with some biblatex styles.} +% \changes{v1.16.0}{2015/01/23}{New \cs{stanzaindent} command.} % \hyphenation{man-u-script man-u-scripts} % % @@ -1658,7 +1660,7 @@ % of the length \verb?\stanzaindentbase?, whose default value is 20pt. % % \DescribeMacro{\setstanzaindents} -% In order to use the stanza macros, one must set the indentation values. +% In order to use the stanza macros, \textbf{one must set the indentation values}. % First the value of \verb+\stanzaindentbase+ should be set, % unless the default value 20pt is desired. % Every stanza line indentation is a multiple of this. @@ -1713,7 +1715,15 @@ % its indentations (penalties) may be set within a group; the prior values % will be restored when the group ends. % -% % \subsection{Stanza breaking} +% \subsection{Manual stanza indent} +% \DescribeMacro{\stanzaindent} +% \DescribeMacro{\stanzaindent*} +% You can set the indent of some specific verse by calling \cs{stanzaindent}\marg{value} at the begining of the verse, before any other character. In this case, the indent defined by \cs{setstanzaindents} for this verse is skipped, and \marg{value} is used instead. +% +% If you use the mechanism of indent repetition, the next verse will be printed as it should be even if the current verse would have its normal indent value. In other word, using \cs{stanzaindent} in a verse does not shift the indent repetition. +% +% However, if you want to shift the indent repetition, and so the next verse to have the indent which should have been used for the current verse, use \cs{stanzaindent*} instead of \cs{stanzaindent}. +% \subsection{Stanza breaking} % \DescribeMacro{\setstanzapenalties} % When the stanzas run over several pages, it is often % desirable that page breaks should arise between certain lines in the @@ -2143,7 +2153,7 @@ % that \meta{item} and the current page \& linenumber should be added to % the raw index file. % -% If the \Lclass{memoir} class or the \Lpack{imakeidx} package is used then the macro takes an optional +% If the \Lclass{memoir} class or the \Lpack{imakeidx} or \Lpack{indextools} package is used then the macro takes an optional % argument, which is the name of a raw index file. For example % |\edindex[line]{item}| will use |line.idx| as the raw file instead of % |\jobname.idx|. @@ -2152,9 +2162,9 @@ % % Be careful with the order of package loading and index declaration. You must use this order: % \begin{enumerate} -% \item Load \Lpack{imakeidx}. +% \item Load \Lpack{imakeidx} or \Lpack{indextools} . % \item Load \Lpack{eledmac}. -% \item Declare the index with the macro \cs{makeindex} of \Lpack{imakeidx}. +% \item Declare the index with the macro \cs{makeindex} of \Lpack{imakeidx}/\Lpack{indextools}. % \end{enumerate} % \DescribeMacro{\pagelinesep} % The page \& linenumber combination is written as |page\pagelinesep line|, @@ -2894,7 +2904,7 @@ % \begin{macrocode} %<*code> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{eledmac}[2015/01/16 v1.15.1 LaTeX port of EDMAC]% +\ProvidesPackage{eledmac}[2015/01/23 v1.16.0 LaTeX port of EDMAC]% % \end{macrocode} % % Generally, these are the modifications to the original. @@ -3021,7 +3031,18 @@ % Define a flag for if the \Lpack{imakeidx} package has been used. % \begin{macrocode} \newif\ifl@imakeidx -\@ifpackageloaded{imakeidx}{\l@imakeidxtrue}{\l@imakeidxfalse} +\@ifpackageloaded{imakeidx}{\l@imakeidxtrue}{}%False is the default value +% \end{macrocode} +% \end{macro} +% \begin{macro}{\ifl@indextools} +% Define a flag for if the \Lpack{indextools} package has been used. +% \begin{macrocode} +\newif\ifl@indextools% +\@ifpackageloaded{indextools}{% + \l@indextoolstrue% + \l@imakeidxtrue% + \let\imki@wrindexentry\indtl@wrindexentry% + }{}%False is the default value. We consider indextools as a variant of imakeidx. That's why we set `l@imakeidx` to true. We also let \imki@wrindexentry to \indtl@wrindexentry % \end{macrocode} % \end{macro} % \begin{macro}{\if@RTL} @@ -3312,6 +3333,13 @@ }% % \end{macrocode} % \end{macro} +% \begin{macro}{\led@error@IndextoolsAfterEledmac} +% \begin{macrocode} +\newcommand{\led@error@IndextoolsAfterEledmac}{% + \eledmac@error{Indextools must be loaded before eledmac.}{\@ehd}% +}% +% \end{macrocode} +% \end{macro} % % \subsection{Gobbling} % \changes{v1.14.0}{2014/10/27}{Provide \cs{@gobblefour}} @@ -5480,6 +5508,7 @@ % \end{macrocode} % \end{macro} % \begin{macro}{\critext} +% \changes{v1.16.0}{2014/01/23}{\cs{critext} and \cs{edtext} are now defined only in eledmac, not in \Lpack{eledpar}. Debug wrong numbering when using \cs{sameword} + \Lpack{eledpar} + \cs{tag} command.} % Now we begin \cs{critext} itself. The definition requires a \verb"/" after % the arguments: this eliminates the possibility of problems about % knowing where \verb"#2" ends. This also changes the handling of spaces @@ -5524,9 +5553,12 @@ % % \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{critext}. +% If we are in a right column (eledpar), we use \cs{insert@countR} +% instead of \cs{insert@count}. % \begin{macrocode} - \global\insert@count=0 + \ifledRcol \global\insert@countR \z@% + \else \global\insert@count \z@ \fi% % \end{macrocode} % % Now process the note-generating macros in argument \verb"#2" @@ -5586,30 +5618,31 @@ % \begin{macrocode} \newcommand{\edtext}[2]{\leavevmode \@edtext@true% - \begingroup - \global\renewcommand{\@tag}{\no@expands #1}%% - \set@line - \global\insert@count=0 - \ignorespaces #2\relax + \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 + \endgroup% \showlemma{#1}% - \ifx\end@lemmas\empty \else - \gl@p\end@lemmas\to\x@lemma - \x@lemma - \global\let\x@lemma=\relax - \fi + \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). }% \global\@noneed@Footnotefalse% - \@edtext@false% - \global\@lemmacommand@false% - } + \@edtext@false% + \global\@lemmacommand@false% +}% \newcommand*{\flag@end}{% \ifledRcol% @@ -8525,10 +8558,7 @@ % \begin{macro}{\@footnotetext} % Add \cs{m@mmf@prepare} at the end of \cs{@footnotetext}. % \begin{macrocode} -\let\l@dold@footnotetext\@footnotetext -\renewcommand{\@footnotetext}[1]{% - \l@dold@footnotetext{#1}% - \m@mmf@prepare} +\apptocmd{\@footnotetext}{\m@mmf@prepare}{}{} % \end{macrocode} % \end{macro} % @@ -8561,13 +8591,12 @@ % different forms for when in numbered or regular text. % \changes{v0.5}{2004/04/03}{Enabled regular \cs{footnote} in numbered text} % \begin{macrocode} -\let\l@doldold@footnotetext\@footnotetext -\renewcommand{\@footnotetext}[1]{% +\pretocmd{\@footnotetext}{% \ifnumberedpar@ \edtext{}{\l@dbfnote{#1}}% \else - \l@doldold@footnotetext{#1}% - \fi} + }{}{} +\apptocmd{\@footnotetext}{\fi}{}{}% % \end{macrocode} % \end{macro} % \end{macro} @@ -8582,14 +8611,15 @@ % \begin{macrocode} \newcommand{\l@dbfnote}[1]{% \ifnumberedpar@ - \gdef\@tag{#1}% + \gdef\@tag{#1\relax}% \xright@appenditem{\noexpand\vl@dbfnote{{\expandonce\@tag}}{\@thefnmark}}% \to\inserts@list \global\advance\insert@count \@ne \fi\ignorespaces} \newcommand{\vl@dbfnote}[2]{% \def\@thefnmark{#2}% - \l@doldold@footnotetext{#1}} + \@footnotetext{#1}% + }% % \end{macrocode} % \end{macro} % \end{macro} @@ -11535,19 +11565,18 @@ % \changes{v1.8.5}{2014/08/28}{Debug indexing in right column, with eledpar.} % Here's some code for indexing using page \& line numbers. % -% \begin{macro}{\ifeledmac@check@imakeidx@} -% First, ensure that \Lpack{imakeidx} is loaded \emph{before} \Lpack{eledmac}. +% First, ensure that \Lpack{imakeidx} or \Lpack{indextools} is loaded \emph{before} \Lpack{eledmac}. % \changes{v1.12.0}{2014/08/05}{Ensure that \Lpack{imakeidx} is loaded \emph{before} \Lpack{eledmac}} % \begin{macrocode} -\newif\ifeledmac@after@imakeidx@ -\@ifpackageloaded{imakeidx}{\eledmac@after@imakeidx@true}{} \AtBeginDocument{% - \ifeledmac@after@imakeidx@\else% + \unless\ifl@imakeidx% \@ifpackageloaded{imakeidx}{\led@error@ImakeidxAfterEledmac}{}% - \fi + \fi% + \unless\ifl@indextools% + \@ifpackageloaded{indextools}{\led@error@indextoolsAfterEledmac}{}% + \fi% } % \end{macrocode} -% \end{macro} % \begin{macro}{\pagelinesep} % \begin{macro}{\edindexlab} % \begin{macro}{\c@labidx} @@ -11641,7 +11670,7 @@ % \end{macro} % The \Lpack{memoir} class provides more flexible indexing than the % standard classes. We need different code if the \Lpack{memoir} -% class is being used, except if \Lpack{imakeidx} is used. +% class is being used, except if \Lpack{imakeidx} or \Lpack{indextools} is used. % \begin{macro}{\edindex} % \changes{v0.4.1}{2003/03/29}{Let eledmac take advantage of memoir's indexing} % \changes{v1.5}{2013/07/11}{Compatibility with \Lpack{imakeidx} package, and possibility to use multiple index with \cs{edindex}.} @@ -11653,6 +11682,7 @@ % \begin{enumerate} % \item Memoir class is used. % \item AND \Lpack{imakeidx} is not used. +% \item AND \Lpack{indextools} is not used. % \end{enumerate} % Need to add the definition of |\edindex| to |\makeindex|, and initialise % |\edindex| to do nothing. In this case |\edindex| has an optional @@ -11747,6 +11777,7 @@ % \begin{enumerate} % \item Memoir class is NOT used. % \item OR \Lpack{imakeidx} is used. +% \item OR \Lpack{indextools} is used. % \end{enumerate} % \begin{macrocode} \def\create@edindex@notfor@memoir{ @@ -11808,7 +11839,12 @@ % \begin{macrocode} \@ifclassloaded{memoir}{% \@ifpackageloaded{imakeidx}% - {\create@edindex@notfor@memoir}{\create@edindex@for@memoir}% + {\create@edindex@notfor@memoir}% + {% + \@ifpackageloaded{indextools}% + {\create@edindex@notfor@memoir}% + {\create@edindex@for@memoir}% + }% }% {\create@edindex@notfor@memoir}% % \end{macrocode} @@ -12209,6 +12245,26 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\stanzaindent} +% \begin{macro}{\stanzaindent*} +% The macro \cs{stanzaindent}, when called at the begining of a verse, change the indentation normally defined for this verse by \cs{setstanzaindent}. +% The starred version skip the current verse for the repetition of stanza indent. +% \begin{macrocode} +\newcommand{\stanzaindent}[1]{% + \hspace{\dimexpr#1\stanzaindentbase-\parindent\relax}% + \ignorespaces% +}% +\WithSuffix\newcommand\stanzaindent*[1]{% + \stanzaindent{#1}% + \global\advance\stanza@modulo-\@ne% + \ifnum\stanza@modulo=0% + \global\stanza@modulo=\value{stanzaindentsrepetition}% + \fi% + \ignorespaces% +}% +% \end{macrocode} +% \end{macro} +% \end{macro} % \begin{macro}{\stanza@line} % \begin{macro}{\stanza@hang} % \begin{macro}{\sza@penalty} -- cgit v1.2.3