summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/eledmac
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-11-09 23:38:16 +0000
committerKarl Berry <karl@freefriends.org>2013-11-09 23:38:16 +0000
commit9d1f0b004cd5a2bdf8014aef14a0afb6f54c3c06 (patch)
tree327dd724a3e886e675aec58dcba21b1451078e49 /Master/texmf-dist/source/latex/eledmac
parented47a420cd7d5ffcfc9106fbb61a9e25bc47c577 (diff)
eledmac (9nov13)
git-svn-id: svn://tug.org/texlive/trunk@32113 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/eledmac')
-rw-r--r--Master/texmf-dist/source/latex/eledmac/eledmac.dtx247
-rw-r--r--Master/texmf-dist/source/latex/eledmac/eledpar.dtx203
2 files changed, 412 insertions, 38 deletions
diff --git a/Master/texmf-dist/source/latex/eledmac/eledmac.dtx b/Master/texmf-dist/source/latex/eledmac/eledmac.dtx
index 5a0cfb2c36c..e6bf5d84352 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{8451}
+% \CheckSum{8620}
%
% \makeatletter
% \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters
@@ -1244,8 +1244,9 @@
% \DescribeMacro{\afternumberinfootnote}
% With \cs{afternumberinfootnote}\oarg{s}\marg{l} you can add some space after the line number in a footnote. If the line number is not printed, the space is not either. The default value is 0.5~em.
%
-%\DescribeMacro{\nonbreakableafternumber}\changes{v1.4.3}{2012/12/18}{Add \cs{nonbreakableafternumber}.}
-%By default, the space defined by \cs{afternumberinfootnote} is breakable. With \cs{afternumberinfootnote}\oarg{s} it becomes non breakable. Use \cs{afternumberinfootnote}\oarg{s}\oarg{false} to cancel it (\verb|<s>| can be empty if you want to disable it for every series).
+%\changes{v1.4.3}{2012/12/18}{Add \cs{nonbreakableafternumber}.}
+%\DescribeMacro{\nonbreakableafternumber}
+% By default, the space defined by \cs{afternumberinfootnote} is breakable. With \cs{nonbreakableafternumber}\oarg{s} it becomes nonbreakable. Use \cs{nonbreakableafternumber}\oarg{s}\oarg{false} to cancel it (\verb|<s>| can be empty if you want to disable it for every series).
%
% \DescribeMacro{\beforesymlinenum}
% With \cs{beforesymlinenum}\oarg{s}\marg{l} you can add some space before the line symbol in a footnote. The default value is value set by \cs{beforenumberinfootnote}.
@@ -1630,19 +1631,19 @@
% \subsection{False verse}
% \label{falseverse}In some special cases, you want to add false verse after true verse.
% This false verse:
-% \begin{enumerate}
-% \item Won't be numbered.
-% \item Won't affect the indent of the next verse.
-% \end{enumerate}
+% \begin{enumerate}
+% \item Won't be numbered.
+% \item Won't affect the indent of the next verse.
+% \end{enumerate}
% It could be used, for example, to add some space between verses.
% To add this type of false verse, you have to finish the previous verse with \cs{falseverse} (and not with \verb+&+).
% For example:
% \begin{verbatim}
-% True verse&
-% True verse\falseverse
-% \vspace{3ex}&
-% True verse&
-% True verse
+% True verse&
+% True verse\falseverse
+% \vspace{3ex}&
+% True verse&
+% True verse
% \end{verbatim}
% \subsection{Hanging symbol}
% It's possible to insert a symbol in each line of hanging verse, as in French typography for `['., as in French typography for `['. To insert in eledmac, redefine macro \DescribeMacro{\hangingsymbol}\cmd{\hangingsymbol} with this code:
@@ -1653,6 +1654,9 @@
% \begin{verbatim}
% \renewcommand{\hangingsymbol}{\protect\hfill}
% \end{verbatim}
+% \subsection{Long verse and page break}
+% If you want to prevent page breaks inside long verses, use the option \verb+nopbinverse+ when loading package, or use \cs{lednopbinversetrue}.
+% Read \ref{lednopbinversetrue} p.~\pageref{lednopbinversetrue} for further details.
% \subsection{Various tools}
% \DescribeMacro{\ampersand}
% If you need to print an \& symbol in a stanza, use the \verb?\ampersand?
@@ -1691,6 +1695,11 @@
% \stanza
% \numberit First line, second stanza...
% \end{verbatim}
+% \subsection{Hanging symbol}
+%It's possible to insert a symbol on each line of hanging verse, as in French typography for `['. To insert in eledmac, redefine macro \DescribeMacro{\hangingsymbol}\cmd{\hangingsymbol} with this code:
+%\begin{verbatim}
+%\renewcommand{\hangingsymbol}{[\,}
+%\end{verbatim}
% \section{Grouping}
% In a \verb?minipage? environment LaTeX changes \verb?\footnote? numbering from
% arabic to alphabetic and puts the footnotes at the end of the minipage.
@@ -2013,8 +2022,8 @@
%
% 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{eledmac}.
+% \item Load \Lpack{imakeidx}.
+% \item Load \Lpack{eledmac}.
% \item Declare the index with the macro \cs{makeindex} of \Lpack{imakeidx}.
% \end{enumerate}
% \DescribeMacro{\pagelinesep}
@@ -2308,7 +2317,7 @@
% The standard sectioning command (\cs{chapter}, \cs{section} etc.) can be used inside a numbered text.
% But the line which contains it won't be numbered, and you can't add critical notes inside.
%
-% However, eledmac provides the following commands :
+% However, eledmac provides the following commands:
% \begin{itemize}
% \item \cs{ledchapter}\oarg{text}\marg{critical text}
% \item \cs{ledchapter*}
@@ -2320,7 +2329,7 @@
% \item \cs{ledsubsubsection*}
% \end{itemize}
% Which are the equivalent of the standard LaTeX commands, but be careful.
-% Note the following points :
+% Note the following points:
% \begin{enumerate}
% \item All these commands close a \cs{pstart}, and open a new one. The content of the command itself is between \cs{pstart} and \cs{pend}.
% \item Don't try to make \verb|\let\chapter\ledchapter|, or other things like it: the \cs{led}section commands call the standard commands.
@@ -2346,6 +2355,25 @@
%
% In some case, you don't want these environments be redefined in numbered section.
% You can load the package with the option \verb+noquotation+ to prevent this redefinition.
+% \section{Page breaks}
+% \changes{v1.7.0}{2013/11/08}{New features for managing page breaks.}
+% \Lpack{Eledmac} and \Lpack{eledpar} break pages automatically.
+% However, you may sometimes want to either force page breaks or prevent them.
+% \DescribeMacro{\ledpb} \DescribeMacro{\lednopb} The packages provide two macros:
+% \begin{itemize}
+% \item \cs{ledpb} adds a page break.
+% \item \cs{lednopb} prevents a page break, by adding one line to the current page if needed.
+% \end{itemize}
+% \textbf{These commands have effect only at the second run}.
+%
+% These two commands take effect at the beginning of line in which they are called. For example, if you call \cs{ledpb} at l.~444, the l.~443 will be at the p.~$n$, and the l.~444 at the p.~$n+1$.
+% \DescribeMacro{\ledpbsetting} However you can change the behavior, and decide they will have effect after the end of the line, adding \verb+\ledpbsetting{after}+ at the begining of your file (better: in your preamble). With the previous example, the l.~444 will be at the p.~$n$ and the l.~445 will be at the p.~$n+1$.
+%
+% If you are using \Lpack{eledpar} to typeset parallel pages you must use \cs{lednopb} on
+% both sides in the two corresponding lines. This is especially important when you are using
+% stanzas; otherwise the pages will run out of sync.
+% \label{lednopbinversetrue}\DescribeMacro{\lednopbinversetrue} You can also decide to prevent page breaks between two lines of a long verse. To do this, use \verb+nopbinverse+ when loading package, or add \cs{lednopbinversetrue} in the begining of your file (better: in your preamble). This feature works only with verse of 2 lines, not more. It works at the third run, or at fourth run with \Lpack{eledpar}.
+% By default, when a long verse runs normally between two pages, a page break will be placed at the beginning of the verse. However, if you have added\verb+ledpbsetting{after}+, the page break will be placed at the end of the long verse, and the page containing the long verse will have one extra line.
% \section{Miscellaneous}
%
%
@@ -2719,7 +2747,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{eledmac}[2013/10/27 v1.6.1 LaTeX port of EDMAC]
+\ProvidesPackage{eledmac}[2013/11/08 v1.7.0 LaTeX port of EDMAC]
% \end{macrocode}
%
% Generally, these are the modifications to the original.
@@ -2746,11 +2774,13 @@
\newif\ifledfinal
\newif\ifparapparatus@
\newif\ifnoquotation@
+\newif\iflednopbinverse
\parapparatus@false
\DeclareOption{noquotation}{\noquotation@true}
\DeclareOption{final}{\ledfinaltrue}
\DeclareOption{draft}{\ledfinalfalse}
\DeclareOption{parapparatus}{\parapparatus@true}
+\DeclareOption{nopbinverse}{\lednopbinversetrue}
\ExecuteOptions{final}
% \end{macrocode}
% Use the starred form of \verb?\ProcessOptions? which executes options in
@@ -3178,6 +3208,9 @@
\global\pst@rtedLfalse
\global\l@dnumpstartsL \z@
\global\absline@num \z@
+ \gdef\normal@page@break{}
+ \gdef\l@prev@pb{}
+ \gdef\l@prev@nopb{}
\global\line@num \z@
\global\subline@num \z@
\global\@lock \z@
@@ -4377,6 +4410,7 @@
\page@num=#1\relax
\last@page@num=#1\relax
\def\next@page@num{#1}%
+ \listcsxadd{normal@page@break}{\the\absline@num}
\fi}
% \end{macrocode}
@@ -4807,7 +4841,34 @@
% file, to mark the start of a new text line, and its page number.
% \changes{v0.6}{2004/11/16}{Extended \cs{new@line} to output page numbers}
% \begin{macrocode}
-\newcommand*{\new@line}{\write\linenum@out{\string\@l[\the\c@page][\thepage]}}
+\newcommand*{\new@line}{%
+ \IfStrEq{\led@pb@setting}{after}%
+ {\xifinlistcs{\the\absline@num}{l@prev@nopb}%
+ {\xifinlistcs{\the\absline@num}{normal@page@break}%
+ {\numgdef{\@next@page}{\thepage+1}%
+ \write\linenum@out{\string\@l[\@next@page][\@next@page]}%
+ }%
+ {\write\linenum@out{\string\@l[\the\c@page][\thepage]}}%
+ }%
+ {\write\linenum@out{\string\@l[\the\c@page][\thepage]}}}%
+ {}%
+ \IfStrEq{\led@pb@setting}{before}%
+ {%
+\numdef{\next@absline}{\the\absline@num+1}
+\xifinlistcs{\next@absline}{l@prev@nopb}%
+ {\xifinlistcs{\the\absline@num}{normal@page@break}%
+ {%
+ \numgdef{\nc@page}{\c@page+1}%
+ \write\linenum@out{\string\@l[\nc@page][\nc@page]}%
+ }%
+ {\write\linenum@out{\string\@l[\the\c@page][\thepage]}}%
+ }%
+ {\write\linenum@out{\string\@l[\the\c@page][\thepage]}}%
+}%
+ {}%
+ \IfStrEqCase{\led@pb@setting}{{before}{\relax}{after}{\relax}}[\write\linenum@out{\string\@l[\the\c@page][\thepage]}]%
+}
+
% \end{macrocode}
% \end{macro}
%
@@ -5720,18 +5781,22 @@
\global\setbox\one@line=\vsplit\raw@text to\baselineskip}%
\unvbox\one@line \global\setbox\one@line=\lastbox
\getline@num
+ \IfStrEq{\led@pb@setting}{before}{\led@check@pb\led@check@nopb}{}
\ifnum\@lock>\@ne
\inserthangingsymboltrue
\else
\inserthangingsymbolfalse
\fi
+ \check@pb@in@verse
\affixline@num
\affixpstart@num
\hb@xt@ \linewidth{\do@insidelinehook\l@dld@ta\add@inserts\affixside@note
\l@dlsn@te
{\ledllfill\hb@xt@ \wd\one@line{\new@line\inserthangingsymbol\l@dunhbox@line{\one@line}}\ledrlfill\l@drd@ta%
\l@drsn@te
- }}}%
+ }}
+ \IfStrEq{\led@pb@setting}{after}{\led@check@pb\led@check@nopb}{}
+ }%
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -7926,7 +7991,7 @@
\newcommand{\vl@dbfnote}[2]{%
\def\@thefnmark{#2}%
\l@doldold@footnotetext{#1}}
-% \end{macrocode}
+% \end{macrocode}
% \end{macro}
% \end{macro}
%
@@ -8790,7 +8855,7 @@
% \end{macro}
% \begin{macro}{\newhookcommand@series}
% \cs{newhookcommand@series}\cs{command names} is a generic command to add new commands for new commands hook, like \cs{hsizetwocol}.
-% \begin{macrocode}
+% \begin{macrocode}
\newcommand{\newhookcommand@series}[1]{%
\global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{\csuse{setcommand@series}{##1}{#1}{##2}}%
}
@@ -9183,9 +9248,9 @@
% \begin{macro}{\ifFN@bottom}
% \changes{v1.5}{2013/07/11}{Use the bottom option of \Lpack{footmisc} package.}
% The \cs{ifFN@bottom} macro is defined by the \Lpack{footmisc} package. If this package is not loaded, we define it.
-% \begin{macrocode}
+% \begin{macrocode}
\AtBeginDocument{\@ifpackageloaded{footmisc}{}{\newif\ifFN@bottom}}
-% \end{macrocode}
+% \end{macrocode}
% \end{macro}
% \begin{macro}{\l@ddofootinsert}
% This macro essentially holds the initial portion of the kernel
@@ -10477,10 +10542,10 @@
% \begin{macro}{\thestartpageline}
% \begin{macro}{\theendpageline}
% These macros make up the page/line start/end number when the \cs{edindex} command is called in critical notes.
-% \begin{macrocode}
+% \begin{macrocode}
\newcommand{\thestartpageline}{\l@dparsedstartpage\pagelinesep\l@dparsedstartline}
\newcommand{\theendpageline}{\l@dparsedendpage\pagelinesep\l@dparsedendline}
-% \end{macrocode}
+% \end{macrocode}
% \end{macro}
% \end{macro}
%
@@ -10504,10 +10569,10 @@
% \end{macro}
% \begin{macro}{\get@index@command}
% This macro is used to analyse if a text to be indexed has a command after a \verb+|+.
-% \begin{macrocode}
+% \begin{macrocode}
\def\get@index@command#1|#2{\gdef\@index@command{#2}\gdef\@index@txt{#1}}
+% \end{macrocode}
% \end{macro}
-% \end{macrocode}
% \begin{macro}{\ledinnote}
% \begin{macro}{\ledinnotehyperpage}
% These macros are used to specifiy that an index reference points to a note.
@@ -12464,6 +12529,134 @@
%
%
%
+% \section{Page breaking or no page breaking depending of specific lines}
+% By default, page breaks are automatic. However, the use can define lines which will force page breaks, or prevent page breaks around one specific line.
+% On the first run, the line-list file records the line number of where the page break is being changed (either forced, or prevented).
+% On the next run, page breaks occur either before or after this line, depending on how the user sets the command. The default setting is after the line.
+% \begin{macro}{\normal@page@break}
+% \cs{normal@page@break} is an etoolbox list which contains the absolute line number of the last line, for each page.
+% \begin{macrocode}
+\def\normal@page@break{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\prev@pb}
+% \begin{macro}{\prev@nopb}
+% The \cs{l@prev@pb} macro is a etoolbox list, which contains the lines in which page breaks occur (before or after).
+% The \cs{l@prev@nopb} macro is a etoolbox list, which contains the lines with NO page break before or after.
+% \begin{macrocode}
+\def\l@prev@pb{}
+\def\l@prev@nopb{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\ledpb}
+% \begin{macro}{\ledpbnum}
+% \begin{macro}{\lednopb}
+% \begin{macro}{\lednopbnum}
+% The \cs{ledpb} macro writes the call to \cs{led@pb} in line-list file.
+% The \cs{ledpbnum} macro writes the call to \cs{led@pbnum} in line-list file.
+% The \cs{lednopb} macro writes the call to \cs{led@nopb} in line-list file.
+% The \cs{lednopbnum} macro writes the call to \cs{led@nopbnum} in line-list file.
+% \begin{macrocode}
+\newcommand{\ledpb}{\write\linenum@out{\string\led@pb}}
+\newcommand{\ledpbnum}[1]{\write\linenum@out{\string\led@pbnum{#1}}}
+\newcommand{\lednopb}{\write\linenum@out{\string\led@nopb}}
+\newcommand{\lednopbnum}[1]{\write\linenum@out{\string\led@nopbnum{#1}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\led@pb}
+% \begin{macro}{\led@pbnum}
+% \begin{macro}{\led@nopb}
+% \begin{macro}{\led@nopbnum}
+% The \cs{led@pb} adds the absolute line number in the \cs{prev@pb} list.
+% The \cs{led@pbnum} adds the argument in the \cs{prev@pb} list.
+% The \cs{led@nopb} adds the absolute line number in the \cs{prev@nopb} list.
+% The \cs{led@nopbnum} adds the argument in the \cs{prev@nopb} list.
+% \begin{macrocode}
+\newcommand{\led@pb}{\listcsxadd{l@prev@pb}{\the\absline@num}}
+\newcommand{\led@pbnum}[1]{\listcsxadd{l@prev@pb}{#1}}
+\newcommand{\led@nopb}{\listcsxadd{l@prev@nopb}{\the\absline@num}}
+\newcommand{\led@nopbnum}[1]{\listcsxadd{l@prev@nopb}{#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\ledpbsetting}
+% \begin{macro}{\led@pb@setting}
+% The \cs{ledpbsetting} macro only changes the value of \cs{led@pb@macro}, for which the default value is \verb+before+.
+% \begin{macrocode}
+\def\led@pb@setting{before}
+\newcommand{\ledpbsetting}[1]{\gdef\led@pb@setting{#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\led@check@pb}
+% \begin{macro}{\led@check@nopb}
+% The \cs{led@check@pb} and \cs{led@check@nopb} are called before or after each line.
+% They check if a page break must occur, depending on the current line and on the content of \cs{l@pb}.
+% \begin{macrocode}
+\newcommand{\led@check@pb}{\xifinlistcs{\the\absline@num}{l@prev@pb}{\pagebreak[4]}{}}
+\newcommand{\led@check@nopb}{%
+ \IfStrEq{\led@pb@setting}{before}{%
+ \xifinlistcs{\the\absline@num}{l@prev@nopb}%
+ {\numdef{\abs@prevline}{\the\absline@num-1}%
+ \xifinlistcs{\abs@prevline}{normal@page@break}%
+ {\nopagebreak[4]\enlargethispage{\baselineskip}}%
+ {}}%
+ {}}%
+ {}%
+ {}%
+ \IfStrEq{\led@pb@setting}{after}{%
+ \xifinlistcs{\the\absline@num}{l@prev@nopb}{%
+ \xifinlistcs{\the\absline@num}{normal@page@break}%
+ {\nopagebreak[4]\enlargethispage{\baselineskip}}%
+ {}%
+}%
+ {}}%
+ {}%
+ {}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \section{Long verse: prevents being separated by a page break}
+% \begin{macro}{\iflednopbinverse}
+% The \cs{lednopbinverse} boolean is set to false by default.
+% If set to true, eledmac will automatically prevent page breaks inside verse.
+% The declaration is made at the beginning of the file, because it is used as a package option.
+% \end{macro}
+% \begin{macro}{\check@pb@in@verse}
+% The \cs{check@pb@in@verse} checks if a verse is broken in two page.
+% If true, it adds:
+% \begin{itemize}
+% \item The absolute line number of the first line of the verse -1 in the \cs{led@pb} list, if the page break must occur before the verse.
+% \item The absolute line number of the first line of the verse -1 in the \cs{led@nopb} list, if the page break must occur after the verse.
+% \end{itemize}
+% \begin{macrocode}
+\newcommand{\check@pb@in@verse}{%
+ \ifinstanza\iflednopbinverse\ifinserthangingsymbol% Using stanzas and enabling page breaks in verse control, while on a hanging verse.
+ \ifnum\page@num=\last@page@num\else%If we have change page
+ \IfStrEq{\led@pb@setting}{before}{%
+ \numgdef{\abs@line@verse}{\the\absline@num-1}%
+ \ledpbnum{\abs@line@verse}%
+ }{}%
+ \IfStrEq{\led@pb@setting}{after}{%
+ \numgdef{\abs@line@verse}{\the\absline@num-1}%
+ \lednopbnum{\abs@line@verse}%
+ }{}%
+ \fi%
+ \fi\fi\fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \section{The End}\label{end}
+%
+%
+%</code>
% \newpage
% \appendix
% \let\oldthesection\thesection
diff --git a/Master/texmf-dist/source/latex/eledmac/eledpar.dtx b/Master/texmf-dist/source/latex/eledmac/eledpar.dtx
index 49f413a7eb9..e35ff1ebf96 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{4003}
+% \CheckSum{4254}
%
% \makeatletter
% \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters
@@ -157,6 +157,7 @@
% \changes{v1.2}{2012/10/15}{Support for \cs{led}\meta{section} commands in parallel texts.}
% \changes{v1.3.2}{2012/12/11}{Debug with some classes.}
% \changes{v1.4.3}{2013/10/27}{Corrects a false hanging verse when a verse is exactly the length of a line.}
+% \changes{v1.5.0}{2013/11/08}{Add, as in eledmac, features to manage page breaks.}
% \hyphenation{man-u-script man-u-scripts}
%
% \newcommand{\Lpack}[1]{\textsf{#1}}
@@ -435,6 +436,10 @@
% \DescribeMacro{\linenumincrement}
% \DescribeMacro{\firstsublinenum}
% \DescribeMacro{\sublinenumincrement}
+% \DescribeMacro{\firstlinenum*}
+% \DescribeMacro{\linenumincrement*}
+% \DescribeMacro{\firstsublinenum*}
+% \DescribeMacro{\sublinenumincrement*}
% The \Eledmac{} package originally used counters for specifying the
% numbering scheme; now both \Eledmac\footnote{when used with \Lpack{ledpatch}
% v0.2 or greater.} and
@@ -446,6 +451,7 @@
% control over the left and right numbering schemes. The \cs{firstsublinenum}
% and \cs{sublinenumincrement} macros correspondingly set the numbering
% scheme for sublines.
+% The starred versions change both left and right numbering schemes.
%
% \DescribeMacro{\pstart}
% \DescribeMacro{\pend}
@@ -680,6 +686,14 @@
%\begin{verbatim}
%\renewcommand{\hangingsymbol}{[\,}
%\end{verbatim}
+% You can also use it to force hanging verse to be flush right:
+% \begin{verbatim}
+% \renewcommand{\hangingsymbol}{\protect\hfill}
+% \end{verbatim}
+%
+%
+% When you use \cs{lednopb} make sure to use it on both sides in the corresponding
+% verses to keep the pages in sync.
% \StopEventually{}
%
% \clearpage
@@ -720,7 +734,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{eledpar}[2013/10/27 v1.4.3 eledmac extension for parallel texts]
+\ProvidesPackage{eledpar}[2013/11/08 v1.5.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.
@@ -780,7 +794,7 @@
% All the error and warning messages are collected here as macros.
%
% \begin{macro}{\led@err@TooManyPstarts}
-% \begin{macrocode}
+% \begin{macrocode}
\newcommand*{\led@err@TooManyPstarts}{%
\eledmac@error{Too many \string\pstart\space without printing.
Some text will be lost}{\@ehc}}
@@ -788,7 +802,7 @@
% \end{macro}
%
% \begin{macro}{\led@err@BadLeftRightPstarts}
-% \begin{macrocode}
+% \begin{macrocode}
\newcommand*{\led@err@BadLeftRightPstarts}[2]{%
\eledmac@error{The numbers of left (#1) and right (#2)
\string\pstart s do not match}{\@ehc}}
@@ -797,7 +811,7 @@
%
% \begin{macro}{\led@err@LeftOnRightPage}
% \begin{macro}{\led@err@RightOnLeftPage}
-% \begin{macrocode}
+% \begin{macrocode}
\newcommand*{\led@err@LeftOnRightPage}{%
\eledmac@error{The left page has ended on a right page}{\@ehc}}
\newcommand*{\led@err@RightOnLeftPage}{%
@@ -875,6 +889,9 @@
\global\numberingRtrue
\global\advance\section@numR \@ne
\global\absline@numR \z@
+ \gdef\normal@page@breakR{}
+ \gdef\l@prev@pbR{}
+ \gdef\l@prev@nopbR{}
\global\line@numR \z@
\global\@lockR \z@
\global\sub@lockR \z@
@@ -1001,8 +1018,8 @@
% \label{lineation}\relax
%
% \subsection{Choosing the system of lineation}
-%% \changes{v0.11}{2012/06/11}{Lineation can be by pstart (like in eledmac 0.15).}
-%M \changes{v1.0}{2012/09/14}{Debug in lineation by pstart}
+% \changes{v0.11}{2012/06/11}{Lineation can be by pstart (like in eledmac 0.15).}
+% \changes{v1.0}{2012/09/14}{Debug in lineation by pstart}
% Sometimes you want line numbers that start at $1$ at the top of each
% page; sometimes you want line numbers that start at $1$ at each \cs{pstart}; other times you want line numbers that start at $1$ at the start
% of each section and increase regardless of page breaks.
@@ -1139,9 +1156,15 @@
% \begin{macro}{\linenumincrement}
% \begin{macro}{\firstsublinenum}
% \begin{macro}{\sublinenumincrement}
+% \begin{macro}{\firstlinenum*}
+% \begin{macro}{\linenumincrement*}
+% \begin{macro}{\firstsublinenum*}
+% \begin{macro}{\sublinenumincrement*}
+% \changes{v1.5.0}{2013/11/08}{Add starred version of \cs{firstlinenum}, \cs{linenumincrement}, \cs{firstsublinenum}, \cs{sublinenumincrement} to change both Left and Rightside.}
% These are the user's macros for changing (sub) line numbers. They are
% defined in \Lpack{eledmac} v0.7, but just in case
% I have started by \cs{provide}ing them.
+% The starred versions are specifi to \Lpack{eledpar}.
% \begin{macrocode}
\providecommand*{\firstlinenum}{}
\providecommand*{\linenumincrement}{}
@@ -1163,12 +1186,19 @@
\ifledRcol \setcounter{sublinenumincrementR}{#1}%
\else \setcounter{sublinenumincrement}{#1}%
\fi}
-
+\WithSuffix\newcommand\firstlinenum*[1]{\setcounter{firstlinenumR}{#1}\setcounter{firstlinenum}{#1}}
+\WithSuffix\newcommand\linenumincrement*[1]{\setcounter{linenumincrementR}{#1}\setcounter{linenumincrement}{#1}}
+\WithSuffix\newcommand\firstsublinenum*[1]{\setcounter{subfirstlinenumR}{#1}\setcounter{subfirstlinenum}{#1}}
+\WithSuffix\newcommand\sublinenumincrement*[1]{\setcounter{sublinenumincrementR}{#1}\setcounter{sublinenumincrement}{#1}}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\Rlineflag}
% This is appended to the line numbers of right text.
@@ -1467,6 +1497,7 @@
\page@num=#1\relax
\last@page@num=#1\relax
\def\next@page@num{#1}%
+ \listcsxadd{normal@page@break}{\the\absline@num}
\fi
\fi}
@@ -1909,6 +1940,14 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\new@lineL}
+% The \cs{new@lineL} macro sends the \cs{@l} command to the left text
+% line-list file, to mark the start of a new text line.
+% \begin{macrocode}
+\newcommand*{\new@lineL}{%
+ \write\linenum@out{\string\@l[\the\c@page][\thepage]}}
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\new@lineR}
% The \cs{new@lineR} macro sends the \cs{@l} command to the right text
% line-list file, to mark the start of a new text line.
@@ -2277,6 +2316,8 @@
\let\thepstart\thepstartR
\let\pstart\pstartR
\let\pend\pendR
+ \let\ledpb\ledpbR
+ \let\lednopb\lednopbR
\let\lineation\lineationR
\Rightsidehook
\let\oldstanza\stanza
@@ -2601,7 +2642,7 @@
\add@inserts
\affixside@note
\l@dlsn@te
- {\ledllfill\hb@xt@ \wd\one@line{\do@insidelineLhook\inserthangingsymbolL\new@line\l@dunhbox@line{\one@line}}\correcthangingL\ledrlfill\l@drd@ta%
+ {\ledllfill\hb@xt@ \wd\one@line{\do@insidelineLhook\inserthangingsymbolL\new@lineL\l@dunhbox@line{\one@line}}\correcthangingL\ledrlfill\l@drd@ta%
\l@drsn@te
}}%
\add@penaltiesL
@@ -3981,6 +4022,9 @@
\unhbox\l@drightbox
}%
\checkraw@text
+ \checkverseL
+ \checkverseR
+ \checkpb@columns
\repeat}
% \end{macrocode}
% Having completed a pair of chunks, write the number of lines
@@ -4020,7 +4064,32 @@
% \end{macrocode}
% \end{macro}
-%
+% \begin{macro}{\checkpb@columns}
+% \cs{checkpb@columns} prevent or make pagebreaking in columns, depending of the use of \cs{ledpb} or \cs{lednopb}.
+% \begin{macrocode}
+
+\newcommand{\checkpb@columns}{%
+ \newif\if@pb
+ \newif\if@nopb
+ \IfStrEq{\led@pb@setting}{before}{
+ \numdef{\next@absline}{\the\absline@num+1}%
+ \numdef{\next@abslineR}{\the\absline@numR+1}%
+ \xifinlistcs{\next@absline}{l@prev@pb}{\@pbtrue}{}%
+ \xifinlistcs{\next@abslineR}{l@prev@pbR}{\@pbtrue}{}
+ \xifinlistcs{\next@absline}{l@prev@nopb}{\@nopbtrue}{}%
+ \xifinlistcs{\next@abslineR}{l@prev@nopbR}{\@nopbtrue}{}
+ }{}
+ \IfStrEq{\led@pb@setting}{after}{
+ \xifinlistcs{\the\absline@num}{l@prev@pb}{\@pbtrue}{}%
+ \xifinlistcs{\the\absline@numR}{l@prev@pbR}{\@pbtrue}{}
+ \xifinlistcs{\the\absline@num}{l@prev@nopb}{\@nopbtrue}{}%
+ \xifinlistcs{\the\absline@numR}{l@prev@nopbR}{\@nopbtrue}{}
+ }{}
+\if@nopb\nopagebreak[4]\enlargethispage{\baselineskip}\fi
+\if@pb\pagebreak[4]\fi
+}
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\columnseparator}
% \begin{macro}{\columnrulewidth}
% The separator between line pairs in parallel columns is in the form
@@ -4248,6 +4317,8 @@
\get@nextboxL
\checkpageL
+ \checkverseL
+ \checkpbL
\repeat
% \end{macrocode}
% That (left) page has been filled. Output the number of real lines
@@ -4283,6 +4354,8 @@
\fi
\get@nextboxR
\checkpageR
+ \checkverseR
+ \checkpbR
\repeat
\ifl@dpagefull
\@writelinesonpageR{\the\numpagelinesR}%
@@ -4510,6 +4583,7 @@
\newif\ifl@dsamepage
\l@dsamepagetrue
\newif\ifl@dpagefull
+
\newcommand*{\checkpageL}{%
\l@dpagefulltrue
\l@dsamepagetrue
@@ -4548,7 +4622,66 @@
% \end{macro}
% \end{macro}
% \end{macro}
-%
+% \begin{macro}{\checkpbL}
+% \begin{macro}{\checkpbR}
+% \cs{checkpbL} and \cs{checkpbR} are called after each line is printed, and after the page is checked. These commands correct page breaks depending on \cs{ledpb} and \cs{lednopb}.
+% \begin{macrocode}
+\newcommand{\checkpbL}{
+ \IfStrEq{\led@pb@setting}{after}{
+ \xifinlistcs{\the\absline@num}{l@prev@pb}{\l@dpagefulltrue\l@dsamepagefalse}{}
+ \xifinlistcs{\the\absline@num}{l@prev@nopb}{\l@dpagefullfalse\l@dsamepagetrue}{}
+ }{}
+ \IfStrEq{\led@pb@setting}{before}{
+ \numdef{\next@absline}{\the\absline@num+1}
+ \xifinlistcs{\next@absline}{l@prev@pb}{\l@dpagefulltrue\l@dsamepagefalse}{}
+ \xifinlistcs{\next@absline}{l@prev@nopb}{\l@dpagefullfalse\l@dsamepagetrue}{}
+ }{}
+}
+
+\newcommand{\checkpbR}{
+ \IfStrEq{\led@pb@setting}{after}{
+ \xifinlistcs{\the\absline@numR}{l@prev@pbR}{\l@dpagefulltrue\l@dsamepagefalse}{}
+ \xifinlistcs{\the\absline@numR}{l@prev@nopbR}{\l@dpagefullfalse\l@dsamepagetrue}{}
+ }{}
+ \IfStrEq{\led@pb@setting}{before}{
+ \numdef{\next@abslineR}{\the\absline@numR+1}
+ \xifinlistcs{\next@abslineR}{l@prev@pbR}{\l@dpagefulltrue\l@dsamepagefalse}{}
+ \xifinlistcs{\next@abslineR}{l@prev@nopbR}{\l@dpagefullfalse\l@dsamepagetrue}{}
+ }{}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\checkverseL}
+% \begin{macro}{\checkverseR}
+% \cs{checkverseL} and \cs{checkverseR} are called after each line is printed.
+% They prevent page break inside verse.
+% \begin{macrocode}
+\newcommand{\checkverseL}{
+\ifinstanzaL
+ \iflednopbinverse
+ \ifinserthangingsymbol
+ \numgdef{\prev@abslineverse}{\the\absline@num-1}
+ \IfStrEq{\led@pb@setting}{after}{\lednopbnum{\prev@abslineverse}}{}
+ \IfStrEq{\led@pb@setting}{before}{\ifnum\numpagelinesL<3\ledpbnum{\prev@abslineverse}\fi}{}
+ \fi
+ \fi
+\fi
+}
+\newcommand{\checkverseR}{
+\ifinstanzaR
+ \iflednopbinverse
+ \ifinserthangingsymbolR
+ \numgdef{\prev@abslineverse}{\the\absline@numR-1}
+ \IfStrEq{\led@pb@setting}{after}{\lednopbnumR{\prev@abslineverse}}{}
+ \IfStrEq{\led@pb@setting}{before}{\ifnum\numpagelinesR<3\ledpbnumR{\prev@abslineverse}\fi}{}
+ \fi
+ \fi
+\fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
% \begin{macro}{\ledthegoal}
% \begin{macro}{\goalfraction}
% \begin{macro}{\check@goal}
@@ -4676,6 +4809,54 @@
% \end{macro}
% \end{macro}
%
+% \section{Page break/no page break, depending on the specific line}
+% We need to adapt the macro of the homonym section of eledmac to eledpar.
+% \begin{macro}{\prev@pbR}
+% \begin{macro}{\prev@nopbR}
+% The \cs{l@prev@pbR} macro is a etoolbox list, which contains the lines in which page breaks occur (before or after).
+% The \cs{l@prev@nopbR} macro is a etoolbox list, which contains the lines in which NO page breaks occur (before or after).
+% \begin{macrocode}
+\def\l@prev@pbR{}
+\def\l@prev@nopbR{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\ledpbR}
+% \begin{macro}{\ledpbnumR}
+% \begin{macro}{\lednopbnum}
+% \begin{macro}{\lednopbnumR}
+% The \cs{ledpbR} macro writes the call to \cs{led@pbR} in line-list file.
+% The \cs{ledpbnumR} macro writes the call to \cs{led@pbnumR} in line-list file.
+% The \cs{lednopbR} macro writes the call to \cs{led@nopbR} in line-list file.
+% The \cs{lednopbnumR} macro writes the call to \cs{led@nopbnumR} in line-list file.
+% \begin{macrocode}
+\newcommand{\ledpbR}{\write\linenum@outR{\string\led@pbR}}
+\newcommand{\ledpbnumR}[1]{\write\linenum@outR{\string\led@pbnumR{#1}}}
+\newcommand{\lednopbR}{\write\linenum@outR{\string\led@nopbR}}
+\newcommand{\lednopbnumR}[1]{\write\linenum@outR{\string\led@nopbnumR{#1}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\led@pbR}
+% \begin{macro}{\led@pbnumR}
+% \begin{macro}{\led@nopbR}
+% \begin{macro}{\led@nopbnumR}
+% The \cs{led@pbR} add the absolute line number in the \cs{prev@pbR} list.
+% The \cs{led@pbnumR} add the argument in the \cs{prev@pbR} list.
+% The \cs{led@nopbR} add the absolute line number in the \cs{prev@nopbR} list.
+% The \cs{led@nopbnumR} add the argument in the \cs{prev@nopbR} list.
+% \begin{macrocode}
+\newcommand{\led@pbR}{\listcsxadd{l@prev@pbR}{\the\absline@numR}}
+\newcommand{\led@pbnumR}[1]{\listcsxadd{l@prev@pbR}{#1}}
+\newcommand{\led@nopbR}{\listcsxadd{l@prev@nopbR}{\the\absline@numR}}
+\newcommand{\led@nopbnumR}[1]{\listcsxadd{l@prev@nopbR}{#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
% \section{The End}\label{end}
%
%