summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/eledmac/eledpar.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/eledmac/eledpar.dtx')
-rw-r--r--Master/texmf-dist/source/latex/eledmac/eledpar.dtx345
1 files changed, 268 insertions, 77 deletions
diff --git a/Master/texmf-dist/source/latex/eledmac/eledpar.dtx b/Master/texmf-dist/source/latex/eledmac/eledpar.dtx
index 8aec3e74504..59a3a2395d8 100644
--- a/Master/texmf-dist/source/latex/eledmac/eledpar.dtx
+++ b/Master/texmf-dist/source/latex/eledmac/eledpar.dtx
@@ -51,7 +51,7 @@
%
% \fi
%
-% \CheckSum{4601}
+% \CheckSum{4749}
%
% \makeatletter
% \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters
@@ -174,12 +174,13 @@
% \changes{v1.7.0}{2014/04/14}{Add, as in eledmac, features to make crossrefs with pstart numbers.}
% \changes{v1.8.0}{2014/08/05}{Debug eledmac sectioning command after using \cs{resumenumbering}.}
% \changes{v1.8.0}{2014/08/05}{Compatibility with \Lpack{musixtex}.}
-% \changes{v1.8.0}{2014/08/05}{Add, as in eledmac, possibility to insert something after \cs{pend}s / verses.}
-% \changes{v1.8.0}{2014/08/05}{Add, as in eledmac, possibility to insert something between \cs{pstart}s / verse.}
+% \changes{v1.8.0}{2014/08/05}{Add, as in eledmac, option to insert something after \cs{pend}s / verses.}
+% \changes{v1.8.0}{2014/08/05}{Add, as in eledmac, option to insert something between \cs{pstart}s / verse.}
% \changes{v1.8.0}{2014/08/05}{Add, as in eledmac, new system of sectioning commands.}
% \changes{v1.8.2}{2014/08/15}{Debug left and side note (bugs added by 1.8.0)}
-% \changes{v1.8.2}{2014/08/15}{Debug \cs{eledxxx} with some paper size}
+% \changes{v1.8.2}{2014/08/15}{Debug \cs{eledxxx} with some paper sizes}
% \changes{v1.8.3}{2014/08/31}{Add \cs{noeledxxx}, as in eledmac}
+% \changes{v1.9.0}{2014/09/16}{Compatibility with \cs{Xnoteswidthliketwocolumns} and \cs{notesXwidthliketwocolumns}}
% \hyphenation{man-u-script man-u-scripts}
%
%
@@ -363,6 +364,13 @@
% \end{pairs}
% \end{verbatim}
%
+% \DescribeMacro{\AtBeginPairs}
+% \changes{v1.9.0}{2014/09/16}{Add \cs{AtBeginPairs} macro.}
+% You can use the macro \cs{AtBeginPairs} to insert a code at the begining of each \verb+pairs+ environments.
+% That could be useful to add the \cs{sloppy} macro to prevent overfull hboxes in two columns.
+% \begin{verbatim}
+% \AtBeginPairs{\sloppy}
+% \end{verbatim}
% There is no required pagebreak before or after the columns.
%
% \DescribeMacro{\Lcolwidth}
@@ -405,6 +413,12 @@
% \setlength{\aftercolumseparator}{length}
% \end{verbatim}
% If you want to come back to the previous behavior, just set them with a negative value.
+% \DescribeMacro{\widthliketwocolumns}
+% If you want to mix texts in columns and text without columns, you can horizontally align text in one column to text in two columns with \cs{widthliketwocolumnstrue}. To reset this feature, just use \cs{widthliketwocolumnsfalse}.
+%
+% \DescribeMacro{\Xnoteswidthliketwocolumns}
+% \DescribeMacro{\notesXwidthliketwocolumns}
+% In most case, you should use \cs{widthliketwocolumns} in combination with \cs{Xnoteswidthliketwocolumns} and \cs{notesXwidthliketwocolumns} to align the critical/familiar footnotes with the two colums. \Lpack{eledmac} handbook for more details.
% \section{Facing pages}\label{pages}
%
% \DescribeEnv{pages}
@@ -718,7 +732,7 @@
%
%
%
-% \DescribeMacro{\hangingsymbol}Like in eledmac, you could redefine the command \cmd{\hangingsymbol} to insert a character in each hanged line. If you use it, you must run \LaTeX\ two time. Example for the french typographie
+% \DescribeMacro{\hangingsymbol}Like in eledmac, you could redefine the command \cmd{\hangingsymbol} to insert a character in each hanging line. If you use it, you must run \LaTeX\ two time. Example for the French typography
%\begin{verbatim}
%\renewcommand{\hangingsymbol}{[\,}
%\end{verbatim}
@@ -800,15 +814,14 @@
% \endnumbering
% \end{..side}
% \end{verbatim}
-% \subsection{Parallel ledgroups and \Lpack{setspace} package}.
-% If you use the \Lpack{setspace} package and want your notes in parallel ledgroups ledgroups to be single-spaced (not half-spaced or double-spaced), just add to your preamble:
+% \subsection{Parallel ledgroups and \Lpack{setspace} package}
+% If you use the \Lpack{setspace} package and want your notes in parallel ledgroups to be single-spaced (not half-spaced or double-spaced), just add to your preamble:
% \begin{verbatim}
% \let\parledgroupnotespacing\singlespacing
% \end{verbatim}
% \emph{In effect, to have correct spacing, don't change the font size of your notes}.
% \StopEventually{}
%
-% \clearpage
% \section{Sectioning commands}
% \changes{v1.8.0}{2014/08/05}{New sectioning commands, as in eledmac.}
% The standard sectioning commands of eledmac are available, and provide parallel sectionings, for both two-column and two-page layout.
@@ -855,7 +868,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{eledpar}[2014/08/31 v1.8.3 eledmac extension for parallel texts]%
+\ProvidesPackage{eledpar}[2014/09/16 v1.9.0 eledmac extension for parallel texts]%
% \end{macrocode}
% With the option `shiftedpstarts' a long pstart one the left side (or in the right side) don't make a blank on the corresponding pstart, but the blank is put on the bottom of the page. Consequently, the pstarts on the parallel pages are shifted, but the shifted stop at every end of pages.
@@ -868,9 +881,18 @@
\DeclareOption{shiftedverses}{\shiftedpstartstrue}
\DeclareOption{shiftedpstarts}{\shiftedpstartstrue}
\DeclareOption{parledgroup}{\parledgrouptrue}
-\ProcessOptions
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\ifwidthliketwocolumns}
+% The \cs{widthliketwocolumns} option can be called both in eledpar and eledmac.
+% \changes{v1.9.0}{2014/09/16}{Added widthliketwocolumns option}
+% \begin{macrocode}
+\DeclareOption{widthliketwocolumns}{\widthliketwocolumnstrue}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\ProcessOptions%
+% \end{macrocode}
% As noted above, much of the code is a duplication of the original
% \Eledmac{} code to handle the extra box(es) for the right hand side text,
% and sometimes for the left hand side as well. In order to distinguish
@@ -1082,6 +1104,7 @@
% \begin{macro}{\resumenumberingR}
% These are the right text equivalents of \cs{pausenumbering} and
% \cs{resumenumbering}.
+% \changes{v1.8.3}{2014/08/31}{Debug \cs{resumenumberingR}}
% \begin{macrocode}
\newcommand*{\pausenumberingR}{%
\endnumberingR\global\numberingRtrue}
@@ -1092,7 +1115,8 @@
\led@mess@SectionContinued{\the\section@numR R}%
\line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
\l@dend@stuff
- \initnumbering@sectcmd
+ \begingroup%
+ \initnumbering@sectcountR%
\else
\led@err@numberingShouldHaveStarted
\endnumberingR
@@ -2329,10 +2353,20 @@
\l@dpairingtrue
\l@dpagingfalse
\initnumbering@sectcmd
+ \at@begin@pairs%
}{%
\l@dpairingfalse
}
+
% \end{macrocode}
+% \begin{macro}{\AtBeginPairs}
+% The \cs{AtBeginPairs} macro just define a \cs{at@begin@pairs} macro, called at the begining of each \verb+pairs+ environments.
+% \begin{macrocode}
+\newcommand{\AtBeginPairs}[1]{\xdef\at@begin@pairs{#1}}%
+\def\at@begin@pairs{}%
+
+% \end{macrocode}
+% \end{macro}
% The \verb?pages? environment additionally sets the `column' widths to the
% \cs{textwidth} (as known at the time the package is called). In this environment, there are two text in parallel on 2 pages. To prevent chapters starting on a lefthand page, the \cs{chapter} command is redefined to not clear pages.
% \begin{macrocode}
@@ -2805,6 +2839,7 @@
\l@dlsn@te %space kept for backward compatibility
{\ledllfill\hb@xt@ \wd\one@line{\do@insidelineLhook\inserthangingsymbolL\new@lineL\l@dunhbox@line{\one@line}}\correcthangingL\ledrlfill\l@drd@ta%
\l@drsn@te}}
+
% \end{macrocode}
% \end{macro}
% \begin{macro}{\print@eledsectionL}
@@ -2830,8 +2865,27 @@
\fi%
\vskip\eledsection@correcting@skip%
}
+
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\dolineLhook}
+% \begin{macro}{\dolineRhook}
+% \begin{macro}{\doinsidelineLhook}
+% \begin{macro}{\doinsidelineRhook}
+% \changes{v1.8.3}{2014/08/31}{Added \cs{dolineLhook}, \cs{dolineRhook}, \cs{doinsidelineLhook} and \cs{doinsidelineRhook}}
+% These high-level commands just redefine the low-level commands.
+% They have to be used be user, without \cs{makeatletter}.
+% \begin{macrocode}
+\newcommand*{\dolineLhook}[1]{\gdef\do@lineLhook{#1}}%
+\newcommand*{\dolineRhook}[1]{\gdef\do@lineRhook{#1}}%
+\newcommand*{\doinsidelineLhook}[1]{\gdef\do@insidelineLhook{#1}}%
+\newcommand*{\doinsidelineRhook}[1]{\gdef\do@insidelineRhook{#1}}%
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
% \changes{v0.3}{2005/02/10}{Added \cs{do@lineLhook} and \cs{do@lineRhook}}
% \changes{v1.4}{2013/07/11}{Added \cs{do@insidelineLhook} and \cs{do@insidelineRhook}}
% \begin{macro}{\do@lineLhook}
@@ -4091,6 +4145,7 @@
% \end{macrocode}
% If on Polyglossia
% \changes{v1.8.0}{2014/08/05}{Correct left/right language setting with polyglossia.}
+% \changes{v1.9.0}{2014/09/16}{Debug left/right language switching with polyglossia. Don't write in .aux file when setting left/right lines.}
% \begin{macrocode}
{ \let\old@otherlanguage\otherlanguage%
\renewcommand{\otherlanguage}[2][]{%
@@ -4098,10 +4153,10 @@
\ifledRcol \gdef\theledlanguageR{#2}%
\else \gdef\theledlanguageL{#2}%
\fi}%
- \let\l@duselanguage\xpg@set@language%
+ \let\l@duselanguage\select@language%
\gdef\theledlanguageL{\xpg@main@language}%
\gdef\theledlanguageR{\xpg@main@language}%
-% \end{macrocode}
+% \end{macrocode}
% That's it.
% \begin{macrocode}
}}
@@ -4112,6 +4167,80 @@
% \end{macro}
%
%
+% \begin{macro}{\if@pstarts}
+% \begin{macro}{\@pstartstrue}
+% \begin{macro}{\@pstartsfalse}
+% \begin{macro}{\check@pstarts}
+% \cs{check@pstarts} returns \cs{@pstartstrue} if there are any unprocessed
+% chunks.
+% \begin{macrocode}
+\newif\if@pstarts
+\newcommand*{\check@pstarts}{%
+ \@pstartsfalse
+ \ifnum\l@dnumpstartsL>\l@dpscL
+ \@pstartstrue
+ \else
+ \ifnum\l@dnumpstartsR>\l@dpscR
+ \@pstartstrue
+ \fi
+ \fi
+}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ifaraw@text}
+% \begin{macro}{\araw@texttrue}
+% \begin{macro}{\araw@textfalse}
+% \begin{macro}{\checkraw@text}
+% \cs{checkraw@text} checks whether the current Left or Right box is
+% void or not. If one or other is not void it sets \cs{araw@texttrue},
+% otherwise both are void and it sets \cs{araw@textfalse}.
+% \begin{macrocode}
+\newif\ifaraw@text
+ \araw@textfalse
+\newcommand*{\checkraw@text}{%
+ \araw@textfalse
+ \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}
+ \araw@texttrue
+ \else
+ \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}
+ \araw@texttrue
+ \fi
+ \fi
+}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \begin{macro}{\@writelinesinparL}
+% \begin{macro}{\@writelinesinparR}
+% These write the number of text lines in a chunk to the section files,
+% and then afterwards zero the counter.
+% \begin{macrocode}
+\newcommand*{\@writelinesinparL}{%
+ \edef\next{%
+ \write\linenum@out{\string\@pend[\the\@donereallinesL]}}%
+ \next
+ \global\@donereallinesL \z@}
+\newcommand*{\@writelinesinparR}{%
+ \edef\next{%
+ \write\linenum@outR{\string\@pendR[\the\@donereallinesR]}}%
+ \next
+ \global\@donereallinesR \z@}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
% \section{Parallel columns}
%
% \begin{macro}{\@eledsectionL}
@@ -4336,82 +4465,146 @@
\newlength{\aftercolumnseparator}%
\setlength{\aftercolumnseparator}{-2pt}%
+
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \begin{macro}{\if@pstarts}
-% \begin{macro}{\@pstartstrue}
-% \begin{macro}{\@pstartsfalse}
-% \begin{macro}{\check@pstarts}
-% \cs{check@pstarts} returns \cs{@pstartstrue} if there are any unprocessed
-% chunks.
+%
+% \begin{macro}{setwidthliketwocolumns@L}
+% \begin{macro}{setpositionliketwocolumns@L}
+% \begin{macro}{setnotepositionliketwocolumns@L}
+% \begin{macro}{setwidthliketwocolumns@C}
+% \begin{macro}{setpositionliketwocolumns@C}
+% \begin{macro}{setnotepositionliketwocolumns@C}
+% \begin{macro}{setwidthliketwocolumns@R}
+% \begin{macro}{setpositionliketwocolumns@R}
+% \begin{macro}{setnotepositionliketwocolumns@R}
+% The \cs{setwidth…} macros are called in \cs{beginnumbering} in a \textbf{not parallel}
+% typesetting, to fix the width of the lines to be vertically aligned with parallel columns. They are also called at the beginning of a note's group, if some options are enabled.
+% The \cs{setposition…} macros are called in \cs{beginnumbering} in a \textbf{not parallel} to fix the position of the lines.
+% The \cs{setnoteposition…} macros are called \cs{xxxfootstart} in a \textbf{not parallel} to fix the position of notes block.
+% \begin{macrocode}
+\newcommand{\setwidthliketwocolumns@L}{%
+% Temporary dimension, initially equal to the standard hsize, i.e. text width
% \begin{macrocode}
-\newif\if@pstarts
-\newcommand*{\check@pstarts}{%
- \@pstartsfalse
- \ifnum\l@dnumpstartsL>\l@dpscL
- \@pstartstrue
- \else
- \ifnum\l@dnumpstartsR>\l@dpscR
- \@pstartstrue
- \fi
- \fi
-}
+ \newdimen\temp%
+ \temp=\hsize%
+% \end{macrocode}
+% Hsize : Left + Right width
+% \begin{macrocode}
+ \hsize=\Lcolwidth%
+ \advance\hsize\Rcolwidth%
+% \end{macrocode}
+% Now, calculating the remaining space
+% \begin{macrocode}
+ \advance\temp-\hsize%
+% \end{macrocode}
+% And multiply the hsize by 2/3 of this space
+% \begin{macrocode}
+ \multiply\temp by 2%
+ \divide\temp by 3%
+ \advance\hsize\temp%
+}%
+
+\newcommand{\setpositionliketwocolumns@L}{%
+ \renewcommand{\ledrlfill}{\hfill}%
+}%
+
+\newcommand{\setnotespositionliketwocolumns@L}{%
+}%
+
+
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand{\setwidthliketwocolumns@C}{%
+% Temporary dimension, initially equal to the standard hsize, i.e. text width
+% \end{macrocode}
+% \begin{macrocode}
+ \newdimen\temp%
+ \temp=\hsize%
+% Hsize : Left + Right width
+% \end{macrocode}
+% \begin{macrocode}
+ \hsize=\Lcolwidth%
+ \advance\hsize\Rcolwidth%
+% Now, calculating the remaining space
+% \end{macrocode}
+% \begin{macrocode}
+ \advance\temp-\hsize%
+% \end{macrocode}
+% And multiply the hsize by 1/2 of this space
+% \begin{macrocode}
+ \divide\temp by 2%
+ \advance\hsize\temp%
+}%
+
+\newcommand{\setpositionliketwocolumns@C}{%
+ \doinsidelinehook{\hfill}%
+ \renewcommand{\ledrlfill}{\hfill}%
+}%
+
+\newcommand{\setnotespositionliketwocolumns@C}{%
+ \newdimen\temp%
+ \newdimen\tempa%
+ \temp=\hsize%
+ \tempa=\Lcolwidth%
+ \advance\tempa\Rcolwidth%
+ \advance\temp-\tempa%
+ \divide\temp by 2%
+ \leftskip=\temp%
+ \rightskip=-\temp%
+}%
+
+\newcommand{\setwidthliketwocolumns@R}{%
+% \end{macrocode}
+% Temporary dimension, initially equal to the standard hsize, i.e. text width
+% \begin{macrocode}
+ \newdimen\temp%
+ \temp=\hsize%
+% \end{macrocode}
+% Hsize : Left + Right width
+% \begin{macrocode}
+ \hsize=\Lcolwidth%
+ \advance\hsize\Rcolwidth%
+% \end{macrocode}
+% Now, calculating the remaining space
+% \begin{macrocode}
+ \advance\temp-\hsize%
+% \end{macrocode}
+% And multiply the hsize by 2/3 of this space
+% \begin{macrocode}
+ \multiply\temp by 2%
+ \divide\temp by 3%
+ \advance\hsize\temp%
+}%
+
+\newcommand{\setpositionliketwocolumns@R}{%
+ \doinsidelinehook{\hfill}%
+}%
+
+\newcommand{\setnotespositionliketwocolumns@R}{%
+ \newdimen\temp%
+ \newdimen\tempa%
+ \temp=\hsize%
+ \tempa=\Lcolwidth%
+ \advance\tempa\Rcolwidth%
+ \advance\temp-\tempa%
+ \divide\temp by 2%
+ \leftskip=\temp%
+ \rightskip=-\temp%
+}%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
-%
-% \begin{macro}{\ifaraw@text}
-% \begin{macro}{\araw@texttrue}
-% \begin{macro}{\araw@textfalse}
-% \begin{macro}{\checkraw@text}
-% \cs{checkraw@text} checks whether the current Left or Right box is
-% void or not. If one or other is not void it sets \cs{araw@texttrue},
-% otherwise both are void and it sets \cs{araw@textfalse}.
-% \begin{macrocode}
-\newif\ifaraw@text
- \araw@textfalse
-\newcommand*{\checkraw@text}{%
- \araw@textfalse
- \ifvbox\namebox{l@dLcolrawbox\the\l@dpscL}
- \araw@texttrue
- \else
- \ifvbox\namebox{l@dRcolrawbox\the\l@dpscR}
- \araw@texttrue
- \fi
- \fi
-}
-
-% \end{macrocode}
-% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
-%
-%
-% \begin{macro}{\@writelinesinparL}
-% \begin{macro}{\@writelinesinparR}
-% These write the number of text lines in a chunk to the section files,
-% and then afterwards zero the counter.
-% \begin{macrocode}
-\newcommand*{\@writelinesinparL}{%
- \edef\next{%
- \write\linenum@out{\string\@pend[\the\@donereallinesL]}}%
- \next
- \global\@donereallinesL \z@}
-\newcommand*{\@writelinesinparR}{%
- \edef\next{%
- \write\linenum@outR{\string\@pendR[\the\@donereallinesR]}}%
- \next
- \global\@donereallinesR \z@}
-
-% \end{macrocode}
% \end{macro}
% \end{macro}
-%
+%
% \section{Parallel pages}
%
% This is considerably more complicated than parallel columns.
@@ -4430,8 +4623,6 @@
% \end{macro}
% \end{macro}
% \end{macro}
-%
-%
% \begin{macro}{\Pages}
% \changes{v1.8.0}{2014/07/28}{Modify \cs{Pages} to enable to add section's title.}
% \changes{v1.8.3}{2014/08/31}{Debug blank pages when using optional argument in the last \cs{pend}.}
@@ -5119,7 +5310,7 @@
\newskip\eledsection@correcting@skip
% \end{macrocode}
% \end{macro}
-% \begin{macro}
+% \begin{macro}{\eled@sectioningR@out}
% We save the sectioning commands of the right side in the \cs{eled@sectioningR@out} file.
% \begin{macrocode}
\newwrite\eled@sectioningR@out