summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-11-16 23:23:49 +0000
committerKarl Berry <karl@freefriends.org>2012-11-16 23:23:49 +0000
commitb6a5cf35c860440520074aaab583ac9e43ca7488 (patch)
tree83f57832e729d4f581a5f1b3fb590fbe4e989c52
parent46c968cdb2125472e0393519e086437993caa589 (diff)
eledmac (16nov12)
git-svn-id: svn://tug.org/texlive/trunk@28280 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/eledmac/eledmac.pdfbin845649 -> 849906 bytes
-rw-r--r--Master/texmf-dist/doc/latex/eledmac/eledpar.pdfbin470722 -> 471691 bytes
-rw-r--r--Master/texmf-dist/source/latex/eledmac/eledmac.dtx158
-rw-r--r--Master/texmf-dist/source/latex/eledmac/eledpar.dtx37
-rw-r--r--Master/texmf-dist/tex/latex/eledmac/eledmac.sty98
-rw-r--r--Master/texmf-dist/tex/latex/eledmac/eledpar.sty24
6 files changed, 264 insertions, 53 deletions
diff --git a/Master/texmf-dist/doc/latex/eledmac/eledmac.pdf b/Master/texmf-dist/doc/latex/eledmac/eledmac.pdf
index a2d68cde91d..7a8f066b4bc 100644
--- a/Master/texmf-dist/doc/latex/eledmac/eledmac.pdf
+++ b/Master/texmf-dist/doc/latex/eledmac/eledmac.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/eledmac/eledpar.pdf b/Master/texmf-dist/doc/latex/eledmac/eledpar.pdf
index 3842fb1fcf2..abb2fd40f02 100644
--- a/Master/texmf-dist/doc/latex/eledmac/eledpar.pdf
+++ b/Master/texmf-dist/doc/latex/eledmac/eledpar.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/eledmac/eledmac.dtx b/Master/texmf-dist/source/latex/eledmac/eledmac.dtx
index b3498697675..fe879f3293a 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{7988}
+% \CheckSum{8188}
%
% \makeatletter
% \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters
@@ -118,7 +118,7 @@
%
% \newcommand{\dtxfilename}{\texttt{eledmac.dtx}}
% \GetFileInfo{eledmac.sty}
-% ^^A Have the changes in the right order : see http://tex.stackexchange.com/a/74113/7712
+% ^^A To put the changes in the right order : see http://tex.stackexchange.com/a/74113/7712
%\makeatletter
% \let\org@changes@\changes@
% \def\my@changes v#1.#2#3\@nil{%
@@ -165,7 +165,7 @@
% \changes{v0.12}{2011/10/01}{For compatibility with eledpar, possibility to use \cs{autopar} on the right side.}
% \changes{v0.12.1}{2011/10/02}{The numbering of \cs{pstarts} restarts on each \cs{beginnumbering}.}
% \changes{v0.12.1}{2011/10/02}{Don't number \cs{pstarts} of stanza.}
-% \changes{v0.13}{2011/11/08}{New stanzaindentsrepetition counter to repeat stanza indents every \emph{n} verses.}
+% \changes{v0.13}{2011/11/08}{New stanzaindentsrepetition counter: to repeat stanza indents every \emph{n} verses.}
% \changes{v0.13.1}{2011/11/18}{\cs{thepstartL} and \cs{thepstartR} use now \cs{bfseries} and not \cs{bf}, which is deprecated and makes conflicts with memoir class.}
% \changes{v0.14}{2012/04/04}{Tweaked \cs{edlabel} to get correct line number if the command is first element of a paragraph.}
% \changes{v1.0}{2012/09/15}{Some compatibility break with eledmac. Change of name: eledmac.}
@@ -274,8 +274,8 @@
% Other LaTeX packages for critical editions include EDNOTES, and
% \Lpack{poemscol} for poetical works.
%
-% In october 2012, Maïeul Rouquette released the \emph{eledform} package\footnote{\url{http://www.ctan.org/eledform}.}.
-% Based on eledmac, this package provides macro to describe the textual variants in a formal way.
+% In October 2012, Maïeul Rouquette released the \emph{eledform} package\footnote{\url{http://www.ctan.org/eledform}.}.
+% Based on eledmac, this package provides tools for creating a formal description (formalism) of textual variants.
%
% To report bugs, please go to ledmac's GitHub page and click "New Issue": \url{https://github.com/maieul/ledmac/issues/}. You must open an account with github.com to access my page (maieul/ledmac). GitHub accounts are free for open-source users.
%
@@ -1146,7 +1146,7 @@
% If your notes are for textual criticism, you should
% use the \emph{eledform} package\footnote{\url{http://www.ctan.org/pkg/eledform}.}.
%
-% This package provides some tools to describes the textual variants in a
+% This package provides tools to describes the textual variants in a
% formal way.
%
% It is based on eledmac for the typographical aspect.
@@ -1456,7 +1456,8 @@
% footnotes, instead of explicit punctuation.
% We also define an \cs{rbracket} macro for the
% right square bracket printed at the end of the lemma in many
-% styles of textual notes (including \Eledmac's standard style).
+% styles of textual notes (including \Eledmac's standard style).
+% For polyglossia, when the lemma is RTL, the bracket automatically switches to a left bracket.
%
%
%
@@ -2261,9 +2262,9 @@
% \item The \cs{ledchapter} doesn't open a new page. You must use \cs{beforeledchapter} before. This also closes a \cs{pstart} and opens a new.
% \end{enumerate}
% \changes{v1.2}{2012/10/13}{Add \cs{ledsectnotoc} command.}
-% \DescribeMacro{\ledsectnotoc}If you use the sectionning commands in parallel texts (with eledpar),
-% you could want the table of contents works only
-% for one side, in many case, the side of the original text.
+% \DescribeMacro{\ledsectnotoc}
+% You can create a table of contents that indexes only the titles that appear on the left side of the edition:
+% for instance, titles from the original language, not the translation.
% You could use \cs{ledsectnotoc} at the begining of the side environnment :
% \begin{verbatim}
% \begin{Rightside}
@@ -2272,10 +2273,10 @@
% \end{Rightside}
% \end{verbatim}
% \subsection{Quotation environments}
-% Inside a numbered section, the \verb+quotation+ and \verb+quote+ environment can be used with the same meaning as outside.
-% The typographical consequences are similar as outside, based on the styles of the \emph{book} class.
-% However, if you used some package which redefine these environnments, theses redefinition won't be available inside the numbering section.
-% You must open the quotation environments inside a \cs{pstart}-\cs{pend} block, and not outside.
+% The verb+quotation+ and /verb+quote+ environment can be used so that same definition/note appears both inside and outside a numbered section.
+% The typographical consequences will resemble the outside numbered sections, based on the styles of the \emph{book} class.
+% However, if you use a package that redefines these environments, these redefinitions won't be available inside the numbering section.
+% You must open the quotation environments inside a \cs{start}-\cs{pend} block, not outside.
% \section{Miscellaneous}
%
%
@@ -2646,7 +2647,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{eledmac}[2012/11/01 v1.3 LaTeX port of EDMAC]
+\ProvidesPackage{eledmac}[2012/11/16 v1.4 LaTeX port of EDMAC]
% \end{macrocode}
%
% In general there is the following modifications to the original
@@ -2689,12 +2690,23 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
-% Loading package \emph{xargs} to declare commands with optional arguments. \emph{Etoolbox} is also used for more clear code, for example in dynamic command names (it could replace \cs{csname} etc.). \emph{suffix} to declare commands with starred version.
+% Loading package \emph{xargs} to declare commands with optional arguments.
+% \emph {Etoolbox} is also used to make code clearer - for example, in dynamic command names (which can replace \cs{csname} etc.).
+% Use \emph{suffix} to declare commands with starred versions/a starred version, and \emph{iflutex} to test if LuaLaTeX is running.
+% \changes{v1.4}{2012/11/16}{Compatibility with LuaTeX of RTL notes.}
% \begin{macrocode}
\RequirePackage{xargs}
\RequirePackage{etoolbox}
\RequirePackage{suffix}
+\RequirePackage{ifluatex}
% \end{macrocode}
+% \begin{macro}{\if@RTL}
+% The \cs{if@RTL} is defined by the bidi package, which is sometimes loaded by \emph{polyglossia}.
+% But we define it if the bidi package is not loaded.
+% \begin{macrocode}
+\ifcsdef{if@RTL}{}{\newif\if@RTL}
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\showlemma}
% \verb?\showlemma?\marg{lemma} typesets the lemma text in the body.
% It depends on the option.
@@ -5167,7 +5179,10 @@
% within the expansion of \verb"#2" above, or in \cs{aftergroup}
% commands within that expansion.
% \begin{macrocode}
- \flag@start
+ \@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}
@@ -5184,11 +5199,16 @@
\x@lemma
\global\let\x@lemma=\relax
\fi
- \flag@end}
+ \@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}
% \begin{macrocode}
\newcommand{\edtext}[2]{\leavevmode
@@ -5197,7 +5217,10 @@
\set@line
\global\insert@count=0
\ignorespaces #2\relax
- \flag@start
+ \@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
@@ -5205,7 +5228,11 @@
\x@lemma
\global\let\x@lemma=\relax
\fi
- \flag@end}
+ \@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}
@@ -6402,6 +6429,54 @@
% \end{macro}
%
%
+% \begin{macro}{\footnotelang@lua}
+% \cs{footnotelang@lua} is called to remember the information about the language of a lemma when LuaLaTeX is used.
+% \begin{macrocode}
+\newcommandx*{\footnotelang@lua}[1][1=L,usedefault]{%
+ \ifstrequal{#1}{L}{%
+ \xright@appenditem{{\csxdef{footnote@luatextextdir}{\the\luatextextdir}}}\to\inserts@list%Know the dir of lemma
+ \global\advance\insert@count \@ne%
+ \xright@appenditem{{\csxdef{footnote@luatexpardir}{\the\luatexpardir}}}\to\inserts@list%Know the dir of lemma
+ \global\advance\insert@count \@ne%
+ }%
+ {%
+ \xright@appenditem{{\csxdef{footnote@luatextextdir}{\the\luatextextdir}}}\to\inserts@listR%Know the dir of lemma
+ \global\advance\insert@countR \@ne%
+ \xright@appenditem{{\csxdef{footnote@luatexpardir}{\the\luatexpardir}}}\to\inserts@listR%Know the dir of lemma
+ \global\advance\insert@countR \@ne%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\footnotelang@poly}
+% \begin{macrocode}
+% \cs{footnotelang@poly} is called to remember the information about the language of a lemma when Polyglossia is used.
+\newcommandx*{\footnotelang@poly}[1][1=L,usedefault]{%
+ \ifstrequal{#1}{L}{%
+ \if@RTL%
+ \xright@appenditem{{\csxdef{footnote@dir}{@RTLtrue}}}\to\inserts@list%Know the language of lemma
+ \global\advance\insert@count \@ne%
+ \else
+ \xright@appenditem{{\csxdef{footnote@dir}{@RTLfalse}}}\to\inserts@list%Know the language of lemma
+ \global\advance\insert@count \@ne%
+ \fi%
+ \xright@appenditem{{\csxdef{footnote@lang}{\csexpandonce{languagename}}}}\to\inserts@list%Know the language of lemma
+ \global\advance\insert@count \@ne%
+ }%
+ {%
+ \if@RTL
+ \xright@appenditem{{\csxdef{footnote@dir}{@RTLtrue}}}\to\inserts@listR%Know the language of lemma
+ \global\advance\insert@countR \@ne%
+ \else
+ \xright@appenditem{{\csxdef{footnote@dir}{@RTLfalse}}}\to\inserts@listR%Know the language of lemma
+ \global\advance\insert@countR \@ne%
+ \fi
+ \xright@appenditem{{\csxdef{footnote@lang}{\csexpandonce{languagename}}}}\to\inserts@listR%Know the language of lemma
+ \global\advance\insert@countR \@ne%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
% \subsection{Normal footnote formatting} \label{sec:nfootformat}
%
% The processing of each note is done
@@ -6495,13 +6570,21 @@
%
% \verb"\par" should always be redefined to \verb"\endgraf" within
% the format macro (this is what \cs{normal@pars} does),
-% to override any tricky stuff which might be done in the main text
+% to override tricky material in the main text
% to get the lines numbered automatically (as set up by
% \cs{autopar}, for example).
+%
+% \changes{v1.4}{2012/11/16}{Direction of footnotes with polyglossia.}
% \begin{macrocode}
\newcommand*{\ledsetnormalparstuff}{%
- \normal@pars
+ \ifluatex%
+ \luatextextdir\footnote@luatextextdir%
+ \luatexpardir\footnote@luatexpardir%
+ \fi%
+ \csuse{\csuse{footnote@dir}}%
+ \normal@pars%
\noindent \parfillskip \z@ \@plus 1fil}
+
\notbool{parapparatus@}{\newcommandx*}{\newcommandx}{\normalfootfmt}[4][4=Z]{% 4th arg is optional, for backward compatibility
\ledsetnormalparstuff%
\hangindent=\csuse{Xhangindent@#4}
@@ -6532,10 +6615,22 @@
% \cs{printlines}. The right bracket macro is the same again;
% it crops up in \cs{normalfootfmt} and the other footnote
% macros for controlling the format of the footnotes.
+%
+% With polyglossia, each critical note has a \cs{footnote@lang} which shows the language of the lemma,
+% and which can be used to switch the bracket from right to left.
+% \changes{v1.4}{2012/11/16}{Switch the right bracket to a left bracket when the lemma is RTL (needs polyglossia or LuaTeX).}
% \begin{macrocode}
\def\endashchar{\textnormal{--}}
\newcommand*{\fullstop}{\textnormal{.}}
-\newcommand*{\rbracket}{\textnormal{\thinspace]}}
+\newcommand*{\rbracket}{\textnormal{%
+ \csuse{text\csuse{footnote@lang}}{%
+ \ifluatex%
+ \ifdefstring{\footnote@luatextextdir}{TRT}{\thinspace[}{\thinspace]}%
+ \else%
+ \thinspace]%
+ \fi}%
+ }%
+}
% \end{macrocode}
% \end{macro}
@@ -6777,7 +6872,7 @@
}%
\vskip\skip\csname #1footins\endcsname%
\leftskip0pt \rightskip0pt
- \csname #1footnoterule\endcsname}
+ \csname #1footnoterule\endcsname\noindent\leavevmode}
% \end{macrocode}
% \end{macro}
%
@@ -7028,7 +7123,7 @@
{}%
}%
\vskip\skip\csname #1footins\endcsname%
- \csname #1footnoterule\endcsname}
+ \csname #1footnoterule\endcsname\noindent\leavevmode}
% \end{macrocode}
% \end{macro}
%
@@ -7129,7 +7224,7 @@
% Here we produce the contents of the footnote from box $0$, and
% add a penalty of $0$ between boxes in this insert.
% \begin{macrocode}
- \box0
+ \if@RTL\noindent \leavevmode\fi\box0%
\penalty0
\egroup}
@@ -8386,6 +8481,7 @@
% \end{macrocode}
% \subsubsection{Create command for critical apparatus, \cs{Xfootnote}}
% Note the double \# in command: it's because command is made inside another command.
+% \changes{v1.4}{2012/11/16}{Remembers the language of the lemma, in order to create a correct direction for the footnote separator.}
% \begin{macrocode}
\global\notbool{parapparatus@}{\expandafter\newcommand\expandafter *}{\expandafter\newcommand}\csname #1footnote\endcsname[2][]{%
@@ -8393,12 +8489,22 @@
\newcommand{\content}{##2}%
\ifnumberedpar@
\ifledRcol%
+ \ifluatex%
+ \footnotelang@lua[R]%
+ \fi%
+ \@ifundefined{xpg@main@language}{}%if polyglossia
+ {\footnotelang@poly[R]}%
\footnoteoptions@[R]{##1}{true}%
\xright@appenditem{\noexpand\csuse{v#1footnote}{#1}%
{{\l@d@nums}{\csexpandonce{@tag}}{\csexpandonce{content}}}}\to\inserts@listR
\footnoteoptions@[R]{##1}{false}%
\global\advance\insert@countR \@ne%
\else%
+ \ifluatex%
+ \footnotelang@lua%
+ \fi%
+ \@ifundefined{xpg@main@language}{}%if polyglossia
+ {\footnotelang@poly}%
\footnoteoptions@{##1}{true}%
\xright@appenditem{\noexpand\csuse{v#1footnote}{#1}%
{{\l@d@nums}{\csexpandonce{@tag}}{\csexpandonce{content}}}}\to\inserts@list
diff --git a/Master/texmf-dist/source/latex/eledmac/eledpar.dtx b/Master/texmf-dist/source/latex/eledmac/eledpar.dtx
index bcee41d4e4c..83fa97d288c 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{3904}
+% \CheckSum{3928}
%
% \makeatletter
% \newcommand*{\DescribeIt}{\leavevmode\@bsphack\begingroup\MakePrivateLetters
@@ -117,7 +117,7 @@
%
% \newcommand{\dtxfilename}{\texttt{eledpar.dtx}}
% \GetFileInfo{eledpar.sty}
-% ^^A Have the changes in the right order : see http://tex.stackexchange.com/a/74113/7712
+% ^^A Put changes in the right order : see http://tex.stackexchange.com/a/74113/7712
%\makeatletter
% \let\org@changes@\changes@
% \def\my@changes v#1.#2#3\@nil{%
@@ -718,7 +718,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{eledpar}[2012/11/01 v1.2.1 eledmac extension for parallel texts]
+\ProvidesPackage{eledpar}[2012/11/16 v1.3 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.
@@ -925,9 +925,8 @@
% \end{macrocode}
% \end{macro}
% \begin{macro}{\initnumbering@sectcountR}
-% \changes{v1.2.1}{2012/11/01}{The counter of the right section are define only one time.}
-% For we want the numbering of the section commands in the right side to be not continous
-% with the numbering of the rightside
+% \changes{v1.2.1}{2012/11/01}{For the right section, the counter is defined only once.}
+% We don't want the numbering of the right-side section commands to be continuous with the numbering of the left side,
% we switch the \LaTeX\ counter in \cs{numberingR}.
% \begin{macrocode}
\newcounter{chapterR}
@@ -2058,7 +2057,7 @@
% \edtext{#1}{#2}
% \end{verbatim}
%
-%
+% \changes{v1.3}{2012/11/16}{Manage RTL language.}
% \begin{macro}{\critext}
% Now we begin \cs{critext} itself.
%
@@ -2073,7 +2072,10 @@
\ifledRcol \global\insert@countR \z@
\else \global\insert@count \z@ \fi
\ignorespaces #2\relax
- \flag@start
+ \@ifundefined{xpg@main@language}{%if not polyglossia
+ \flag@start}%
+ {\if@RTL\flag@end\else\flag@start\fi% be careful on the direction of writing with polyglossia
+ }%
\endgroup
\showlemma{#1}%
\ifx\end@lemmas\empty \else
@@ -2081,7 +2083,11 @@
\x@lemma
\global\let\x@lemma=\relax
\fi
- \flag@end}
+ \@ifundefined{xpg@main@language}{%if not polyglossia
+ \flag@end}%
+ {\if@RTL\flag@start\else\flag@end\fi% be careful on the direction of writing with polyglossia
+ }
+ }
% \end{macrocode}
% \end{macro}
%
@@ -2095,7 +2101,10 @@
\ifledRcol \global\insert@countR \z@
\else \global\insert@count \z@ \fi
\ignorespaces #2\relax
- \flag@start
+ \@ifundefined{xpg@main@language}{%if not polyglossia
+ \flag@start}%
+ {\if@RTL\flag@end\else\flag@start\fi% be careful on the direction of writing with polyglossia
+ }%
\endgroup
\showlemma{#1}%
\ifx\end@lemmas\empty \else
@@ -2103,7 +2112,11 @@
\x@lemma
\global\let\x@lemma=\relax
\fi
- \flag@end}
+ \@ifundefined{xpg@main@language}{%if not polyglossia
+ \flag@end}%
+ {\if@RTL\flag@start\else\flag@end\fi% be careful on the direction of writing with polyglossia
+ }
+}
% \end{macrocode}
% \end{macro}
@@ -2311,7 +2324,7 @@
% \begin{macro}{\pstartL}
% \begin{macro}{\pstartR}
% changes{v1.1}{2012/09/25}{Add \cs{labelpstarttrue} (from eledmac).}
-% changes{v1.1.1}{2012/10/01}{Correct \cs{pstartR} of bug introduced by 1.1.}
+% changes{v1.1.1}{2012/10/01}{Correct \cs{pstartR} bug introduced by 1.1.}
% \cs{pstart} starts the paragraph by
% clearing the \cs{inserts@list} list and other
% relevant variables, and then arranges for the
diff --git a/Master/texmf-dist/tex/latex/eledmac/eledmac.sty b/Master/texmf-dist/tex/latex/eledmac/eledmac.sty
index 49b4a53407b..bbea3d69724 100644
--- a/Master/texmf-dist/tex/latex/eledmac/eledmac.sty
+++ b/Master/texmf-dist/tex/latex/eledmac/eledmac.sty
@@ -24,7 +24,7 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{eledmac}[2012/11/01 v1.3 LaTeX port of EDMAC]
+\ProvidesPackage{eledmac}[2012/11/16 v1.4 LaTeX port of EDMAC]
\newif\ifledfinal
\newif\ifparapparatus@
\parapparatus@false
@@ -37,6 +37,8 @@
\RequirePackage{xargs}
\RequirePackage{etoolbox}
\RequirePackage{suffix}
+\RequirePackage{ifluatex}
+\ifcsdef{if@RTL}{}{\newif\if@RTL}
\ifledfinal
\newcommand*{\showlemma}[1]{#1}
\else
@@ -799,7 +801,10 @@
\set@line
\global\insert@count=0
\ignorespaces #2\relax
- \flag@start
+ \@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
@@ -807,14 +812,21 @@
\x@lemma
\global\let\x@lemma=\relax
\fi
- \flag@end}
+ \@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).
+ }
+ }
\newcommand{\edtext}[2]{\leavevmode
\begingroup
\global\renewcommand{\@tag}{\no@expands #1}%%
\set@line
\global\insert@count=0
\ignorespaces #2\relax
- \flag@start
+ \@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
@@ -822,7 +834,11 @@
\x@lemma
\global\let\x@lemma=\relax
\fi
- \flag@end}
+ \@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).
+ }%
+ }
\newif\ifnumberline
\numberlinetrue
@@ -1296,6 +1312,44 @@
}%
\notblank{#2}{\docsvlist{#2}}{}% Parsing all options
}
+\newcommandx*{\footnotelang@lua}[1][1=L,usedefault]{%
+\ifstrequal{#1}{L}{%
+\xright@appenditem{{\csxdef{footnote@luatextextdir}{\the\luatextextdir}}}\to\inserts@list%Know the dir of lemma
+ \global\advance\insert@count \@ne%
+ \xright@appenditem{{\csxdef{footnote@luatexpardir}{\the\luatexpardir}}}\to\inserts@list%Know the dir of lemma
+ \global\advance\insert@count \@ne%
+}%
+{%
+\xright@appenditem{{\csxdef{footnote@luatextextdir}{\the\luatextextdir}}}\to\inserts@listR%Know the dir of lemma
+ \global\advance\insert@countR \@ne%
+ \xright@appenditem{{\csxdef{footnote@luatexpardir}{\the\luatexpardir}}}\to\inserts@listR%Know the dir of lemma
+ \global\advance\insert@countR \@ne%
+}%
+}
+\newcommandx*{\footnotelang@poly}[1][1=L,usedefault]{%
+\ifstrequal{#1}{L}{%
+ \if@RTL%
+ \xright@appenditem{{\csxdef{footnote@dir}{@RTLtrue}}}\to\inserts@list%Know the language of lemma
+ \global\advance\insert@count \@ne%
+ \else
+ \xright@appenditem{{\csxdef{footnote@dir}{@RTLfalse}}}\to\inserts@list%Know the language of lemma
+ \global\advance\insert@count \@ne%
+ \fi%
+ \xright@appenditem{{\csxdef{footnote@lang}{\csexpandonce{languagename}}}}\to\inserts@list%Know the language of lemma
+ \global\advance\insert@count \@ne%
+}%
+{%
+ \if@RTL
+ \xright@appenditem{{\csxdef{footnote@dir}{@RTLtrue}}}\to\inserts@listR%Know the language of lemma
+ \global\advance\insert@countR \@ne%
+ \else
+ \xright@appenditem{{\csxdef{footnote@dir}{@RTLfalse}}}\to\inserts@listR%Know the language of lemma
+ \global\advance\insert@countR \@ne%
+ \fi
+ \xright@appenditem{{\csxdef{footnote@lang}{\csexpandonce{languagename}}}}\to\inserts@listR%Know the language of lemma
+ \global\advance\insert@countR \@ne%
+}%
+}
\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalvfootnote}[2]{%
\insert\csname #1footins\endcsname\bgroup
\csuse{bhookXnote@#1}
@@ -1320,8 +1374,14 @@
\csname #1footfmt\endcsname #2[#1]\color@endgroup}}
\newcommand*{\ledsetnormalparstuff}{%
- \normal@pars
+ \ifluatex%
+ \luatextextdir\footnote@luatextextdir%
+\luatexpardir\footnote@luatexpardir%
+ \fi%
+ \csuse{\csuse{footnote@dir}}%
+ \normal@pars%
\noindent \parfillskip \z@ \@plus 1fil}
+
\notbool{parapparatus@}{\newcommandx*}{\newcommandx}{\normalfootfmt}[4][4=Z]{% 4th arg is optional, for backward compatibility
\ledsetnormalparstuff%
\hangindent=\csuse{Xhangindent@#4}
@@ -1334,7 +1394,15 @@
#3\strut\par}
\def\endashchar{\textnormal{--}}
\newcommand*{\fullstop}{\textnormal{.}}
-\newcommand*{\rbracket}{\textnormal{\thinspace]}}
+\newcommand*{\rbracket}{\textnormal{%
+\csuse{text\csuse{footnote@lang}}{%
+\ifluatex%
+\ifdefstring{\footnote@luatextextdir}{TRT}{\thinspace[}{\thinspace]}%
+\else%
+\thinspace]%
+\fi}%
+}%
+}
\newcommand{\printpstart}[0]{%
\ifl@dpairing%
@@ -1418,7 +1486,7 @@
}%
\vskip\skip\csname #1footins\endcsname%
\leftskip0pt \rightskip0pt
- \csname #1footnoterule\endcsname}
+ \csname #1footnoterule\endcsname\noindent\leavevmode}
\let\normalfootnoterule=\footnoterule
\newcommand*{\normalfootgroup}[1]{{\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\unvbox\csname #1footins\endcsname}
@@ -1488,7 +1556,7 @@
{}%
}%
\vskip\skip\csname #1footins\endcsname%
- \csname #1footnoterule\endcsname}
+ \csname #1footnoterule\endcsname\noindent\leavevmode}
\newcommand*{\para@vfootnote}[2]{%
\insert\csname #1footins\endcsname
\bgroup
@@ -1500,7 +1568,7 @@
\setbox0=\hbox{\unvxh0[#1]}%
\dp0=0pt
\ht0=\csname #1footfudgefactor\endcsname\wd0
- \box0
+ \if@RTL\noindent \leavevmode\fi\box0%
\penalty0
\egroup}
@@ -2119,12 +2187,22 @@
\newcommand{\content}{##2}%
\ifnumberedpar@
\ifledRcol%
+ \ifluatex%
+ \footnotelang@lua[R]%
+ \fi%
+ \@ifundefined{xpg@main@language}{}%if polyglossia
+ {\footnotelang@poly[R]}%
\footnoteoptions@[R]{##1}{true}%
\xright@appenditem{\noexpand\csuse{v#1footnote}{#1}%
{{\l@d@nums}{\csexpandonce{@tag}}{\csexpandonce{content}}}}\to\inserts@listR
\footnoteoptions@[R]{##1}{false}%
\global\advance\insert@countR \@ne%
\else%
+ \ifluatex%
+ \footnotelang@lua%
+\fi%
+ \@ifundefined{xpg@main@language}{}%if polyglossia
+ {\footnotelang@poly}%
\footnoteoptions@{##1}{true}%
\xright@appenditem{\noexpand\csuse{v#1footnote}{#1}%
{{\l@d@nums}{\csexpandonce{@tag}}{\csexpandonce{content}}}}\to\inserts@list
diff --git a/Master/texmf-dist/tex/latex/eledmac/eledpar.sty b/Master/texmf-dist/tex/latex/eledmac/eledpar.sty
index 2a019cbd64c..c7f4ac9b085 100644
--- a/Master/texmf-dist/tex/latex/eledmac/eledpar.sty
+++ b/Master/texmf-dist/tex/latex/eledmac/eledpar.sty
@@ -24,7 +24,7 @@
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{eledpar}[2012/11/01 v1.2.1 eledmac extension for parallel texts]
+\ProvidesPackage{eledpar}[2012/11/16 v1.3 eledmac extension for parallel texts]
\newif\ifshiftedpstarts
\let\shiftedversestrue\shiftedpstartstrue
@@ -684,7 +684,10 @@
\ifledRcol \global\insert@countR \z@
\else \global\insert@count \z@ \fi
\ignorespaces #2\relax
- \flag@start
+ \@ifundefined{xpg@main@language}{%if not polyglossia
+ \flag@start}%
+ {\if@RTL\flag@end\else\flag@start\fi% be careful on the direction of writing with polyglossia
+ }%
\endgroup
\showlemma{#1}%
\ifx\end@lemmas\empty \else
@@ -692,7 +695,11 @@
\x@lemma
\global\let\x@lemma=\relax
\fi
- \flag@end}
+ \@ifundefined{xpg@main@language}{%if not polyglossia
+ \flag@end}%
+ {\if@RTL\flag@start\else\flag@end\fi% be careful on the direction of writing with polyglossia
+ }
+ }
\renewcommand{\edtext}[2]{\leavevmode
\begingroup
\renewcommand{\@tag}{\no@expands #1}%
@@ -700,7 +707,10 @@
\ifledRcol \global\insert@countR \z@
\else \global\insert@count \z@ \fi
\ignorespaces #2\relax
- \flag@start
+ \@ifundefined{xpg@main@language}{%if not polyglossia
+ \flag@start}%
+ {\if@RTL\flag@end\else\flag@start\fi% be careful on the direction of writing with polyglossia
+ }%
\endgroup
\showlemma{#1}%
\ifx\end@lemmas\empty \else
@@ -708,7 +718,11 @@
\x@lemma
\global\let\x@lemma=\relax
\fi
- \flag@end}
+ \@ifundefined{xpg@main@language}{%if not polyglossia
+ \flag@end}%
+ {\if@RTL\flag@start\else\flag@end\fi% be careful on the direction of writing with polyglossia
+ }
+}
\renewcommand*{\set@line}{%
\ifledRcol