summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/eledmac/eledmac.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-09-18 22:58:23 +0000
committerKarl Berry <karl@freefriends.org>2014-09-18 22:58:23 +0000
commit5c46cbe2d34d3ae0d9f584f9b183265358484397 (patch)
tree0f840ecd0904500ceac6d2e054f15fc62f773b2f /Master/texmf-dist/tex/latex/eledmac/eledmac.sty
parent049e1d558c44f46e601b82c3183b9865a5c3e488 (diff)
eledmac (16sep14)
git-svn-id: svn://tug.org/texlive/trunk@35199 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/eledmac/eledmac.sty')
-rw-r--r--Master/texmf-dist/tex/latex/eledmac/eledmac.sty248
1 files changed, 202 insertions, 46 deletions
diff --git a/Master/texmf-dist/tex/latex/eledmac/eledmac.sty b/Master/texmf-dist/tex/latex/eledmac/eledmac.sty
index 04e18190549..8d4dfd3ccca 100644
--- a/Master/texmf-dist/tex/latex/eledmac/eledmac.sty
+++ b/Master/texmf-dist/tex/latex/eledmac/eledmac.sty
@@ -25,12 +25,13 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{eledmac}[2014/09/12 v1.12.8 LaTeX port of EDMAC]%
+\ProvidesPackage{eledmac}[2014/09/16 v1.13.0 LaTeX port of EDMAC]%
\newif\ifledfinal
\newif\ifparapparatus@
\newif\ifnoquotation@
\newif\iflednopbinverse
\newif\ifparledgroup
+\newif\ifwidthliketwocolumns%
\newif\ifledsecnolinenumber
\parapparatus@false
\DeclareOption{noquotation}{\noquotation@true}
@@ -39,6 +40,7 @@
\DeclareOption{parapparatus}{\parapparatus@true}
\DeclareOption{nopbinverse}{\lednopbinversetrue}
\DeclareOption{ledsecnolinenumber}{\ledsecnolinenumbertrue}
+\DeclareOption{widthliketwocolumns}{\widthliketwocolumnstrue}%
\ExecuteOptions{final}
\ProcessOptions*\relax
@@ -215,6 +217,10 @@
\else
\begingroup
\initnumbering@sectcmd
+ \ifwidthliketwocolumns%
+ \csuse{setwidthliketwocolumns@\columns@position}%
+ \csuse{setpositionliketwocolumns@\columns@position}%
+ \fi%
\fi
\gdef\eled@sections@@{}%
\if@noeled@sec\else%
@@ -265,6 +271,7 @@
\immediate\closeout\eled@sectioning@out%
\fi%
\ifl@dpairing\else
+ \global\l@dnumpstartsL=\z@%
\endgroup
\fi
}
@@ -279,8 +286,14 @@
\led@mess@SectionContinued{\the\section@num}%
\line@list@stuff{\jobname.\extensionchars\the\section@num}%
\l@dend@stuff
- \begingroup
- \initnumbering@sectcmd
+ \ifl@dpairing\else%
+ \begingroup%
+ \initnumbering@sectcmd%
+ \ifwidthliketwocolumns%
+ \csuse{setwidthliketwocolumns@\columns@position}%
+ \csuse{setpositionliketwocolumns@\columns@position}%
+ \fi%
+ \fi%
\else
\led@err@NumberingShouldHaveStarted
\endnumbering
@@ -1059,6 +1072,9 @@
\fi%
\vskip-\baselineskip%
}
+\newcommand*{\dolinehook}[1]{\gdef\do@linehook{#1}}%
+\newcommand*{\doinsidelinehook}[1]{\gdef\do@insidelinehook{#1}}%
+
\newcommand*{\do@linehook}{}
\newcommand*{\do@insidelinehook}{}
\newcommand*{\l@demptyd@ta}{%
@@ -1437,6 +1453,10 @@
\csuse{bhookXnote@#1}
\csuse{Xnotefontsize@#1}
\footsplitskips
+ \ifl@dpairing%
+ \csuse{setwidthliketwocolumns@\columns@position}%
+ \fi%
+ \setXnotespositionliketwocolumns@{#1}%
\spaceskip=\z@skip \xspaceskip=\z@skip
\csname #1footfmt\endcsname #2[#1]\egroup}
\newcommand*{\footsplitskips}{%
@@ -1568,11 +1588,20 @@
}%
\vskip\skip\csname #1footins\endcsname%
\leftskip0pt \rightskip0pt
- \csname #1footnoterule\endcsname%
+ \ifl@dpairing\else%
+ \hsize=\old@hsize%
+ \fi%
+ \setXnoteswidthliketwocolumns@{#1}%
+ \setXnotespositionliketwocolumns@{#1}%
+ \print@Xfootnoterule{#1}%%
\vskip\csuse{afterXrule@#1}%
\noindent\leavevmode}
\let\normalfootnoterule=\footnoterule
-\newcommand*{\normalfootgroup}[1]{{\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\unvbox\csname #1footins\endcsname}
+\newcommand*{\normalfootgroup}[1]{%
+ {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}%
+ \unvbox\csname #1footins\endcsname%
+ \hsize=\old@hsize%
+ }%
\newcommand*{\mpnormalfootgroup}[1]{{
\vskip\skip\@nameuse{mp#1footins}
@@ -1584,11 +1613,15 @@
\ifparledgroup%
\ifl@dpairing%
\else%
- \@nameuse{#1footnoterule}%
- \vskip\csuse{afterXrule@#1}%
+ \setXnoteswidthliketwocolumns@{#1}%
+ \setXnotespositionliketwocolumns@{#1}%
+ \print@Xfootnoterule{#1}%%
+ \vskip\csuse{afterXrule@#1}%
\fi%
\else%
- \@nameuse{#1footnoterule}%
+ \setXnoteswidthliketwocolumns@{#1}%
+ \setXnotespositionliketwocolumns@{#1}%
+ \print@Xfootnoterule{#1}%%
\vskip\csuse{afterXrule@#1}%
\fi%
\setlength{\parindent}{0pt}
@@ -1642,11 +1675,11 @@
}
\providecommand{\footfudgefiddle}{64}
\newcommand*{\para@footsetup}[1]{{\csuse{Xnotefontsize@#1}
+ \setXnoteswidthliketwocolumns@{#1}%
\dimen0=\baselineskip
\multiply\dimen0 by 1024
\divide \dimen0 by \columnwidth \multiply\dimen0 by \footfudgefiddle\relax
- \expandafter
- \xdef\csname #1footfudgefactor\endcsname{%
+ \csxdef{#1footfudgefactor}{%
\expandafter\strip@pt\dimen0 }}}
\newcommand*{\parafootstart}[1]{%
@@ -1658,7 +1691,9 @@
{}%
}%
\vskip\skip\csname #1footins\endcsname%
- \csname #1footnoterule\endcsname%
+ \setXnoteswidthliketwocolumns@{#1}%
+ \setXnotespositionliketwocolumns@{#1}%
+ \print@Xfootnoterule{#1}%%
\vskip\csuse{afterXrule@#1}%
\noindent\leavevmode}
\newcommand*{\para@vfootnote}[2]{%
@@ -1717,9 +1752,12 @@
\makehboxofhboxes
\setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{txtbeforeXnotes@#1}}\unhbox0 \removehboxes}%
\csuse{Xnotefontsize@#1}
- \noindent\unhbox0\par}
+ \noindent\unhbox0\par%
+ \global\hsize=\old@hsize%
+ }%
\newcommand*{\mppara@footgroup}[1]{{%
+ \setXnoteswidthliketwocolumns@{#1}%
\vskip\skip\@nameuse{mp#1footins}
\ifl@dpairing\ifparledgroup%
\leavevmode\marks\parledgroup@{begin}%
@@ -1729,12 +1767,16 @@
\ifparledgroup%
\ifl@dpairing%
\else%
- \@nameuse{#1footnoterule}%
- \vskip\csuse{afterXrule@#1}%
+ \setXnoteswidthliketwocolumns@{#1}%
+ \setXnotespositionliketwocolumns@{#1}%
+ \print@Xfootnoterule{#1}%%
+ \vskip\csuse{afterXrule@#1}%
\fi%
\else%
- \@nameuse{#1footnoterule}%
- \vskip\csuse{afterXrule@#1}%
+ \setXnoteswidthliketwocolumns@{#1}%
+ \setXnotespositionliketwocolumns@{#1}%
+ \print@Xfootnoterule{#1}%%
+ \vskip\csuse{afterXrule@#1}%
\fi%
\unvbox\csname mp#1footins\endcsname
\ifcsstring{Xragged@#1}{L}{\RaggedLeft}{}%
@@ -1833,11 +1875,15 @@
\ifparledgroup%
\ifl@dpairing%
\else%
- \@nameuse{#1footnoterule}%
- \vskip\csuse{afterXrule@#1}%
+ \setXnoteswidthliketwocolumns@{#1}%
+ \setXnotespositionliketwocolumns@{#1}%
+ \print@Xfootnoterule{#1}%%
+ \vskip\csuse{afterXrule@#1}%
\fi%
\else%
- \@nameuse{#1footnoterule}%
+ \setXnoteswidthliketwocolumns@{#1}%
+ \setXnotespositionliketwocolumns@{#1}%
+ \print@Xfootnoterule{#1}%%
\vskip\csuse{afterXrule@#1}%
\fi%
{\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par
@@ -1897,11 +1943,15 @@
\ifparledgroup%
\ifl@dpairing%
\else%
- \@nameuse{#1footnoterule}%
- \vskip\csuse{afterXrule@#1}%
+ \setXnoteswidthliketwocolumns@{#1}%
+ \setXnotespositionliketwocolumns@{#1}%
+ \print@Xfootnoterule{#1}%%
+ \vskip\csuse{afterXrule@#1}%
\fi%
\else%
- \@nameuse{#1footnoterule}%
+ \setXnoteswidthliketwocolumns@{#1}%
+ \setXnotespositionliketwocolumns@{#1}%
+ \print@Xfootnoterule{#1}%%
\vskip\csuse{afterXrule@#1}%
\fi%
{\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par
@@ -1981,6 +2031,10 @@
\csuse{bhooknoteX@#1}
\csuse{notefontsizeX@#1}
\footsplitskips
+ \ifl@dpairing%
+ \csuse{setwidthliketwocolumns@\columns@position}%
+ \fi%
+ \setnotesXpositionliketwocolumns@{#1}%
\spaceskip=\z@skip \xspaceskip=\z@skip
\csuse{\csuse{footnote@dir}}\if@RTL\else\noindent\leavevmode\fi\@nameuse{footfmt#1}{#1}{#2}\egroup}
@@ -2016,13 +2070,20 @@
\vskip\skip\csname footins#1\endcsname%
\leftskip=\z@
\rightskip=\z@
- \@nameuse{footnoterule#1}%
+ \ifl@dpairing\else%
+ \hsize=\old@hsize%
+ \fi%
+ \setnotesXwidthliketwocolumns@{#1}%
+ \setnotesXpositionliketwocolumns@{#1}%
+ \print@footnoteXrule{#1}%
\vskip\csuse{afterruleX@#1}}
\let\normalfootnoteruleX=\footnoterule
\newcommand*{\normalfootgroupX}[1]{%
- \unvbox\@nameuse{footins#1}}
+ \unvbox\@nameuse{footins#1}%
+ \hsize=\old@hsize%
+ }%
\newcommand*{\mpnormalfootgroupX}[1]{%
\vskip\skip\@nameuse{mpfootins#1}
@@ -2034,11 +2095,15 @@
\ifparledgroup%
\ifl@dpairing%
\else%
- \@nameuse{footnoterule#1}%
- \vskip\csuse{afterruleX@#1}%
+ \setnotesXwidthliketwocolumns@{#1}%
+ \setnotesXpositionliketwocolumns@{#1}%
+ \print@footnoteXrule{#1}%
+ \vskip\csuse{afterruleX@#1}%
\fi%
\else%
- \@nameuse{footnoterule#1}%
+ \setnotesXwidthliketwocolumns@{#1}%
+ \setnotesXpositionliketwocolumns@{#1}%
+ \print@footnoteXrule{#1}%
\vskip\csuse{afterruleX@#1}%
\fi%
\unvbox\@nameuse{mpfootins#1}}
@@ -2136,11 +2201,15 @@
\ifparledgroup%
\ifl@dpairing%
\else%
- \@nameuse{footnoterule#1}%
- \vskip\csuse{afterruleX@#1}%
+ \setnotesXwidthliketwocolumns@{#1}%
+ \setnotesXpositionliketwocolumns@{#1}%
+ \print@footnoteXrule{#1}%
+ \vskip\csuse{afterruleX@#1}%
\fi%
\else%
- \@nameuse{footnoterule#1}%
+ \setnotesXwidthliketwocolumns@{#1}%
+ \setnotesXpositionliketwocolumns@{#1}%
+ \print@footnoteXrule{#1}%
\vskip\csuse{afterruleX@#1}%
\fi%
\splittopskip=\ht\strutbox
@@ -2199,11 +2268,15 @@
\ifparledgroup%
\ifl@dpairing%
\else%
- \@nameuse{footnoterule#1}%
- \vskip\csuse{afterruleX@#1}%
+ \setnotesXwidthliketwocolumns@{#1}%
+ \setnotesXpositionliketwocolumns@{#1}%
+ \print@footnoteXrule{#1}%
+ \vskip\csuse{afterruleX@#1}%
\fi%
\else%
- \@nameuse{footnoterule#1}%
+ \setnotesXwidthliketwocolumns@{#1}%
+ \setnotesXpositionliketwocolumns@{#1}%
+ \print@footnoteXrule{#1}%
\vskip\csuse{afterruleX@#1}%
\fi%
\splittopskip=\ht\strutbox
@@ -2229,9 +2302,10 @@
\para@footsetupX{#1}}
\newcommand*{\para@footsetupX}[1]{{\csuse{notefontsizeX@#1}
+ \setnotesXwidthliketwocolumns@{#1}%
\dimen0=\baselineskip
\multiply\dimen0 by 1024
- \divide\dimen0 by \hsize \multiply\dimen0 by \footfudgefiddle\relax
+ \divide\dimen0 by \columnwidth \multiply\dimen0 by \footfudgefiddle\relax%
\expandafter
\xdef\csname footfudgefactor#1\endcsname{%
\expandafter\strip@pt\dimen0 }}}
@@ -2248,7 +2322,9 @@
\rightskip=\z@
\parindent=\z@
\vskip\skip\@nameuse{footins#1}%
- \@nameuse{footnoterule#1}%
+ \setnotesXwidthliketwocolumns@{#1}%
+ \setnotesXpositionliketwocolumns@{#1}%
+ \print@footnoteXrule{#1}%
\vskip\csuse{afterruleX@#1}%
}
@@ -2298,6 +2374,7 @@
\csuse{notefontsizeX@#1}
\noindent\unhbox0\par}
\newcommand*{\mppara@footgroupX}[1]{{%
+ \setnotesXwidthliketwocolumns@{#1}%
\vskip\skip\@nameuse{mpfootins#1}
\ifl@dpairing\ifparledgroup
\leavevmode%
@@ -2308,12 +2385,16 @@
\ifparledgroup%
\ifl@dpairing%
\else%
- \@nameuse{footnoterule#1}%
- \vskip\csuse{afterruleX@#1}%
+ \setnotesXwidthliketwocolumns@{#1}%
+ \setnotesXpositionliketwocolumns@{#1}%
+ \print@footnoteXrule{#1}%
+ \vskip\csuse{afterruleX@#1}%
\fi%
\else%
- \@nameuse{footnoterule#1}%
- \vskip\csuse{afterruleX@#1}%
+ \setnotesXwidthliketwocolumns@{#1}%
+ \setnotesXpositionliketwocolumns@{#1}%
+ \print@footnoteXrule{#1}%
+ \vskip\csuse{afterruleX@#1}%
\fi%
\unvbox\csname mpfootins#1\endcsname
\ifcsstring{raggedX@#1}{L}{\RaggedLeft}{}%
@@ -2323,10 +2404,61 @@
\csuse{notefontsizeX@#1}
\noindent\unhbox0\par}}
+
+\newdimen\old@hsize%
+\old@hsize=\hsize%
+
+\newcommand{\setXnoteswidthliketwocolumns@}[1]{%
+ \global\let\hsize@fornote=\hsize%
+ \old@hsize=\hsize%
+ \iftoggle{Xnoteswidthliketwocolumns@#1}%
+ {%
+ \csuse{setwidthliketwocolumns@\columns@position}%
+ \global\let\hsize@fornote=\hsize%
+ }%
+ {}%
+ \let\hsize=\hsize@fornote%
+ \let\columnwidth=\hsize@fornote%
+}%
+
+\newcommand{\setnotesXwidthliketwocolumns@}[1]{%
+ \global\let\hsize@fornote=\hsize%
+ \old@hsize=\hsize%
+ \iftoggle{notesXwidthliketwocolumns@#1}%
+ {%
+ \csuse{setwidthliketwocolumns@\columns@position}%
+ \global\let\hsize@fornote=\hsize%
+ }%
+ {}%
+ \let\hsize=\hsize@fornote%
+ \let\columnwidth=\hsize@fornote%
+}%
+
+\newcommand{\setXnotespositionliketwocolumns@}[1]{%
+ \iftoggle{Xnoteswidthliketwocolumns@#1}{%
+ \csuse{setnotespositionliketwocolumns@\columns@position}%
+ }{}%
+}%
+
+\newcommand{\setnotesXpositionliketwocolumns@}[1]{%
+ \iftoggle{notesXwidthliketwocolumns@#1}{%
+ \csuse{setnotespositionliketwocolumns@\columns@position}%
+ }{}%
+}%
+
\def\@fnpos{familiar-critical}
\def\@mpfnpos{critical-familiar}
\newcommand{\fnpos}[1]{\xdef\@fnpos{#1}}
\newcommand{\mpfnpos}[1]{\xdef\@mpfnpos{#1}}
+\newcommand{\print@Xfootnoterule}[1]{%
+ \moveleft-\leftskip\vbox{\csuse{#1footnoterule}}%
+ \nointerlineskip%
+}%
+
+\newcommand{\print@footnoteXrule}[1]{%
+ \moveleft-\leftskip\vbox{\csuse{footnoterule#1}}%
+ \nointerlineskip%
+}%
\newcommand*{\doxtrafeeti}{%
\setbox\@outputbox \vbox{%
@@ -2472,6 +2604,8 @@
\csgdef{txtbeforeXnotes@#1}{}
\csgdef{maxhnotesX@#1}{\ledfootinsdim}%
\csgdef{maxhXnotes@#1}{\ledfootinsdim}
+ \newtoggle{Xnoteswidthliketwocolumns@#1}%
+ \newtoggle{notesXwidthliketwocolumns@#1}%
\expandafter\newinsert\csname mpfootins#1\endcsname
\expandafter\newinsert\csname footins#1\endcsname
@@ -2564,8 +2698,17 @@
\listeadd{\new}{\series}
\xdef\@series{\new}
}
-\newcommand{\settoggle@series}[3]{%
- \def\do##1{\global\settoggle{#2@##1}{#3}}
+
+\newcommandx{\settoggle@series}[4][4]{%
+ \def\do##1{%
+ \global\settoggle{#2@##1}{#3}%
+ \ifstrequal{#4}{reload}%
+ {%
+ \csuse{foot\csuse{series@display##1}}{##1}%
+ \csuse{foot\csuse{series@displayX##1}}{##1}%
+ }%
+ {}%
+ }%
\ifstrempty{#1}{%
\dolistloop{\@series}%
}%
@@ -2588,7 +2731,9 @@
}%
}%
\newcommand{\newhookcommand@series}[1]{%
- \global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{\csuse{setcommand@series}{##1}{#1}{##2}}%
+ \global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{%
+ \setcommand@series{##1}{#1}{##2}%
+ }%
}
\newhookcommand@series{Xhangindent}
@@ -2660,7 +2805,7 @@
\newcommand{\newhookcommand@series@reload}[1]{%
\global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{%
- \csuse{setcommand@series}{##1}{#1}{##2}[reload]
+ \setcommand@series{##1}{#1}{##2}[reload]%
}%
}
\newhookcommand@series@reload{beforeXnotes}
@@ -2671,7 +2816,9 @@
\newhookcommand@series@reload{maxhXnotes}
\newcommand{\newhooktoggle@series}[1]{%
- \global\expandafter\newcommandx\expandafter*\csname #1\endcsname[2][1,2={true},usedefault]{\settoggle@series{##1}{#1}{##2}}%
+ \global\expandafter\newcommandx\expandafter*\csname #1\endcsname[2][1,2={true},usedefault]{%
+ \settoggle@series{##1}{#1}{##2}%
+ }%
}
\newhooktoggle@series{numberonlyfirstinline}
\newhooktoggle@series{numberonlyfirstintwolines}
@@ -2681,6 +2828,15 @@
\newhooktoggle@series{nonbreakableafternumber}
\newhooktoggle@series{Xlemmadisablefontselection}
\newhooktoggle@series{Xendlemmadisablefontselection}
+\newcommand{\newhooktoggle@series@reload}[1]{%
+ \global\expandafter\newcommandx\expandafter*\csname #1\endcsname[2][1,2={true},usedefault]{%
+ \settoggle@series{##1}{#1}{##2}[reload]%
+ }%
+}%
+
+\newhooktoggle@series@reload{Xnoteswidthliketwocolumns}%
+\newhooktoggle@series@reload{notesXwidthliketwocolumns}%
+
\newcommand*{\notenumfont}{\normalfont}
\newcommand*{\notefontsetup}{\footnotesize}
\newif\ifledplinenum
@@ -3102,7 +3258,7 @@
\newcommand*{\ledrightnote}[1]{\edtext{}{\l@drsnote{#1}}}
\newcommand*{\ledinnernote}[1]{%
- \ifodd\c@page% Do not use \page@num, because not yet calculated when command is called
+ \ifodd\c@page% Do not use \page@num, because it is not yet calculated when command is called
\ledleftnote{#1}%
\else%
\ledrightnote{#1}%
@@ -3110,7 +3266,7 @@
}
\newcommand*{\ledouternote}[1]{%
- \ifodd\c@page% Do not use \page@num, because not yet calculated when command is called
+ \ifodd\c@page% Do not use \page@num, because it is not yet calculated when command is called
\ledrightnote{#1}%
\else%
\ledleftnote{#1}%