diff options
author | Karl Berry <karl@freefriends.org> | 2012-11-16 23:23:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-11-16 23:23:49 +0000 |
commit | b6a5cf35c860440520074aaab583ac9e43ca7488 (patch) | |
tree | 83f57832e729d4f581a5f1b3fb590fbe4e989c52 /Master/texmf-dist/tex/latex/eledmac | |
parent | 46c968cdb2125472e0393519e086437993caa589 (diff) |
eledmac (16nov12)
git-svn-id: svn://tug.org/texlive/trunk@28280 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/eledmac')
-rw-r--r-- | Master/texmf-dist/tex/latex/eledmac/eledmac.sty | 98 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/eledmac/eledpar.sty | 24 |
2 files changed, 107 insertions, 15 deletions
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 |