diff options
author | Karl Berry <karl@freefriends.org> | 2012-09-25 23:00:00 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-09-25 23:00:00 +0000 |
commit | 4c5eb9f03246f903cbbe86ed62b18f76fb5baaf6 (patch) | |
tree | 4879ab4ba4845e9ee7f9b7b105ea6146d184bb99 /Master/texmf-dist/tex/latex/eledmac | |
parent | 190692c83a9a7628a00303febcaa3167d9424f1e (diff) |
eledmac (25sep12)
git-svn-id: svn://tug.org/texlive/trunk@27808 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 | 353 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/eledmac/eledpar.sty | 136 |
2 files changed, 360 insertions, 129 deletions
diff --git a/Master/texmf-dist/tex/latex/eledmac/eledmac.sty b/Master/texmf-dist/tex/latex/eledmac/eledmac.sty index 3c8c433b41c..54050a81e7b 100644 --- a/Master/texmf-dist/tex/latex/eledmac/eledmac.sty +++ b/Master/texmf-dist/tex/latex/eledmac/eledmac.sty @@ -24,16 +24,20 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{eledmac}[2012/09/16 v1.0.1 LaTeX port of EDMAC] +\ProvidesPackage{eledmac}[2012/09/25 v1.1 LaTeX port of EDMAC] \newif\ifledfinal +\newif\ifparapparatus@ +\parapparatus@false \DeclareOption{final}{\ledfinaltrue} \DeclareOption{draft}{\ledfinalfalse} +\DeclareOption{parapparatus}{\parapparatus@true} \ExecuteOptions{final} \ProcessOptions*\relax \RequirePackage{xargs} \RequirePackage{etoolbox} +\RequirePackage{suffix} \ifledfinal \newcommand*{\showlemma}[1]{#1} \else @@ -148,6 +152,8 @@ \line@list@stuff{\jobname.\extensionchars\the\section@num}% \l@dend@stuff \setcounter{pstart}{1} + \begingroup + \initnumbering@sectcmd } \newcommand*{\initnumbering@reg}{% \global\pst@rtedLfalse @@ -163,6 +169,65 @@ \resetprevline@ } +\newcommand{\initnumbering@sectcmd}{ + \newcommand{\ledsection}[2][]{% + \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering% + \pstart% + \leavevmode\section[##1]{##2}\leavevmode\vspace{2.3ex \@plus.2ex}\skipnumbering\pend% + \vspace{-2\parskip}\vspace{-2\baselineskip}% + \pstart + } + \WithSuffix\newcommand\ledsection*[1]{% + \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering% + \pstart% + \leavevmode\section*{##1}\leavevmode\vspace{2.3ex \@plus.2ex}\skipnumbering\pend% + \vspace{-2\parskip}\vspace{-2\baselineskip}% + \pstart + } + \newcommand{\ledsubsection}[2][]{% + \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering% + \pstart% + \leavevmode\subsection[##1]{##2}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend% + \vspace{-2\parskip}\vspace{-2\baselineskip}% + \pstart + } + \WithSuffix\newcommand\ledsubsection*[1]{% + \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering% + \pstart% + \leavevmode\subsection*{##1}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend% + \vspace{-2\parskip}\vspace{-2\baselineskip}% + \pstart + } + \newcommand{\ledsubsubsection}[2][]{% + \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering% + \pstart% + \leavevmode\subsubsection[##1]{##2}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend% + \vspace{-2\parskip}\vspace{-2\baselineskip}% + \pstart + } + \WithSuffix\newcommand\ledsubsubsection*[1]{% + \leavevmode\pend\vspace{3.5ex \@plus 1ex \@minus .2ex}\skipnumbering% + \pstart% + \leavevmode\subsubsection*{##1}\leavevmode\vspace{1.5ex \@plus .2ex}\skipnumbering\pend% + \vspace{-2\parskip}\vspace{-2\baselineskip}% + \pstart + } + \newcommand\ledchapter[2][]{~\pend\skipnumbering\pstart\chapter[##1]{##2}\pend\pstart} + \WithSuffix\newcommand\ledchapter*[1]{~\pend\skipnumbering\pstart\chapter*{##1}\pend\pstart} + \patchcmd{\@makeschapterhead}{1\par}{1}{}{} + \pretocmd{\@makeschapterhead}{\par}{}{} + \apptocmd{\@makeschapterhead}{\par}{}{} + \patchcmd{\@makeschapterhead}{\vskip 40\p@}{}{}{} + \patchcmd{\@makechapterhead}{1\par}{1}{}{} + \pretocmd{\@makechapterhead}{\par}{}{} + \apptocmd{\@makechapterhead}{\par}{}{} + \patchcmd{\@makechapterhead}{\vskip 40\p@}{}{}{} + \apptocmd{\@chapter}{\par\leavevmode\vspace{40 \p@}\skipnumbering}{}{} + \apptocmd{\@schapter}{\par\leavevmode\vspace{40 \p@}\skipnumbering}{}{} + \newcommand\beforeledchapter{\pend\cleardoublepage\pstart} + \patchcmd{\chapter}{\cleardoublepage}{\relax}{}{} + \patchcmd{\chapter}{\clearpage}{\relax}{}{} +} \def\endnumbering{% \ifnumbering \global\numberingfalse @@ -183,7 +248,7 @@ \else \led@err@NumberingNotStarted \fi - \autoparfalse} + \autoparfalse\endgroup} \newcommand{\pausenumbering}{% \endnumbering\global\numberingtrue} \newcommand*{\resumenumbering}{% @@ -209,16 +274,19 @@ \ifx\@tempa\@tempb \global\bypage@true \global\bypstart@false + \pstartinfootnote[][false] \else \def\@tempb{pstart}% \ifx\@tempa\@tempb \global\bypage@false \global\bypstart@true + \pstartinfootnote \else \def\@tempb{section} \ifx\@tempa\@tempb \global\bypage@false \global\bypstart@false + \pstartinfootnote[][false] \else \led@warn@BadLineation \fi @@ -754,6 +822,8 @@ \renewcommand{\thepstart}{{\bfseries\@arabic\c@pstart}. } \newif\ifnumberpstart \numberpstartfalse +\newif\iflabelpstart +\labelpstartfalse \newcommand*{\pstart}{ \if@nobreak \let\@oldnobreak\@nobreaktrue @@ -773,7 +843,10 @@ \global\let\next@insert=\empty \begingroup\normal@pars \global\setbox\raw@text=\vbox\bgroup\ifautopar\else\ifnumberpstart\ifinstanza\else\ifsidepstartnum\else\thepstart\fi\fi\fi\fi - \numberedpar@true} + \numberedpar@true + \iflabelpstart\protected@edef\@currentlabel + {\p@pstart\thepstart}\fi + } \newcommand*{\pend}{\ifnumbering \else \led@err@PendNotNumbered \fi @@ -1179,8 +1252,9 @@ }% \notblank{#2}{\docsvlist{#2}}{}% Parsing all options } -\newcommand*{\normalvfootnote}[2]{% +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\normalvfootnote}[2]{% \insert\csname #1footins\endcsname\bgroup + \csuse{bhookXnote@#1} \csuse{Xnotefontsize@#1} \footsplitskips \spaceskip=\z@skip \xspaceskip=\z@skip @@ -1191,9 +1265,10 @@ \splittopskip=\ht\strutbox \splitmaxdepth=\dp\strutbox \leftskip=\z@skip \rightskip=\z@skip} -\newcommand*{\mpnormalvfootnote}[2]{% +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\mpnormalvfootnote}[2]{% \global\setbox\@nameuse{mp#1footins}\vbox{% \unvbox\@nameuse{mp#1footins} + \csuse{bhookXnote@#1} \csuse{Xnotefontsize@#1} \hsize\columnwidth \@parboxrestore @@ -1202,8 +1277,8 @@ \newcommand*{\ledsetnormalparstuff}{% \normal@pars - \parindent \z@ \parfillskip \z@ \@plus 1fil} -\newcommandx*{\normalfootfmt}[4][4=Z]{% 4th arg is optional, for backward compatibility + \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} \strut{\printlinefootnote{#1}{#4}}% @@ -1217,6 +1292,17 @@ \newcommand*{\fullstop}{\textnormal{.}} \newcommand*{\rbracket}{\textnormal{\thinspace]}} +\newcommand{\printpstart}[0]{% + \ifl@dpairing% + \ifledRcol% + \thepstartR% + \else% + \thepstartL% + \fi% + \else% + \thepstart% + \fi% +} \newif\ifl@d@pnum \l@d@pnumfalse \newif\ifl@d@ssub @@ -1270,17 +1356,6 @@ \fi \fi} \def\printlines#1|#2|#3|#4|#5|#6|#7|{\begingroup - \ifbypstart@% - \ifl@dpairing% - \ifledRcol% - \thepstartR% - \else% - \thepstartL% - \fi% - \else% - \thepstart% - \fi% - \fi% \setprintlines{#1}{#2}{#3}{#4}{#5}{#6}% \ifl@d@pnum #1\fullstop\fi \linenumrep{#2} @@ -1291,21 +1366,37 @@ \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi \endgroup} \newcommand*{\normalfootstart}[1]{% - \vskip\skip\csname #1footins\endcsname + \ifdimequal{0pt}{\preXnotes@}{}% + {% + \iftoggle{preXnotes@}{% + \togglefalse{preXnotes@}\skip\csname #1footins\endcsname=\csuse{preXnotes@}}% + {}% + }% + \vskip\skip\csname #1footins\endcsname% \leftskip0pt \rightskip0pt \csname #1footnoterule\endcsname} \let\normalfootnoterule=\footnoterule -\newcommand*{\normalfootgroup}[1]{\unvbox\csname #1footins\endcsname} +\newcommand*{\normalfootgroup}[1]{{\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\unvbox\csname #1footins\endcsname} \newcommand*{\mpnormalfootgroup}[1]{{ \vskip\skip\@nameuse{mp#1footins} \normalcolor \@nameuse{#1footnoterule} - \unvbox\csname mp#1footins\endcsname}} - -\newcommand*{\ledfootinsdim}{0.8\vsize} - + {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}} + \unvbox\csname mp#1footins\endcsname}} + +\newcommand*{\ledfootinsdim}{0.8\vsize} % kept for backward compatibility, should'nt be used anymore. + +\newtoggle{preXnotes@} +\toggletrue{preXnotes@} +\newcommand{\preXnotes@}{0pt} +\newcommand*{\preXnotes}[1]{\renewcommand{\preXnotes@}{#1}} +\newtoggle{prenotesX@} +\toggletrue{prenotesX@} +\newcommand{\prenotes@X}{0pt} +\newcommand*{\prenotesX}[1]{\renewcommand{\prenotesX@}{#1}} \newcommand*{\footnormal}[1]{% + \csgdef{series@display#1}{normal} \expandafter\let\csname #1footstart\endcsname=\normalfootstart \expandafter\let\csname v#1footnote\endcsname=\normalvfootnote \expandafter\let\csname #1footfmt\endcsname=\normalfootfmt @@ -1313,16 +1404,17 @@ \expandafter\let\csname #1footnoterule\endcsname=% \normalfootnoterule \count\csname #1footins\endcsname=1000 - \dimen\csname #1footins\endcsname=\ledfootinsdim - \skip\csname #1footins\endcsname=1.2em \@plus .6em \@minus .6em + \dimen\csname #1footins\endcsname=\csuse{maxhXnotes@#1} + \skip\csname #1footins\endcsname=\csuse{beforeXnotes@#1} \expandafter\let\csname mpv#1footnote\endcsname=\mpnormalvfootnote \expandafter\let\csname mp#1footgroup\endcsname=\mpnormalfootgroup \count\csname mp#1footins\endcsname=1000 - \dimen\csname mp#1footins\endcsname=\ledfootinsdim - \skip\csname mp#1footins\endcsname=1.2em \@plus .6em \@minus .6em + \dimen\csname mp#1footins\endcsname=\csuse{maxhXnotes@#1} + \skip\csname mp#1footins\endcsname=\csuse{beforeXnotes@#1} } \newcommand*{\footparagraph}[1]{% + \csgdef{series@display#1}{paragraph} \expandafter\newcount\csname prevpage#1@num\endcsname \expandafter\let\csname #1footstart\endcsname=\parafootstart \expandafter\let\csname v#1footnote\endcsname=\para@vfootnote @@ -1345,11 +1437,18 @@ \newcommand*{\parafootstart}[1]{% \rightskip=0pt \leftskip=0pt \parindent=0pt - \vskip\skip\csname #1footins\endcsname + \ifdimequal{0pt}{\preXnotes@}{}% + {% + \iftoggle{preXnotes@}{% + \togglefalse{preXnotes@}\skip\csname #1footins\endcsname=\csuse{preXnotes@}}% + {}% + }% + \vskip\skip\csname #1footins\endcsname% \csname #1footnoterule\endcsname} \newcommand*{\para@vfootnote}[2]{% \insert\csname #1footins\endcsname \bgroup + \csuse{bhookXnote@#1} \csuse{Xnotefontsize@#1} \footsplitskips \setbox0=\vbox{\hsize=\maxdimen @@ -1364,6 +1463,7 @@ \newcommand*{\mppara@vfootnote}[2]{% \global\setbox\@nameuse{mp#1footins}\vbox{% \unvbox\@nameuse{mp#1footins}% + \csuse{bhookXnote@#1} \csuse{Xnotefontsize@#1} \footsplitskips \setbox0=\vbox{\hsize=\maxdimen @@ -1397,7 +1497,7 @@ \newcommand*{\para@footgroup}[1]{% \unvbox\csname #1footins\endcsname \makehboxofhboxes - \setbox0=\hbox{\unhbox0 \removehboxes}% + \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{txtbeforeXnotes@#1}}\unhbox0 \removehboxes}% \csuse{Xnotefontsize@#1} \noindent\unhbox0\par} @@ -1407,7 +1507,7 @@ \@nameuse{#1footnoterule}% \unvbox\csname mp#1footins\endcsname \makehboxofhboxes - \setbox0=\hbox{\unhbox0 \removehboxes}% + \setbox0=\hbox{{\csuse{Xnotefontsize@#1}\csuse{txtbeforeXnotes@#1}}\unhbox0 \removehboxes}% \csuse{Xnotefontsize@#1} \noindent\unhbox0\par}} @@ -1448,6 +1548,7 @@ \unvbox2 } \newcommand*{\footthreecol}[1]{% + \csgdef{series@display#1}{threecol} \expandafter\let\csname v#1footnote\endcsname=\threecolvfootnote \expandafter\let\csname #1footfmt\endcsname=\threecolfootfmt \expandafter\let\csname #1footgroup\endcsname=\threecolfootgroup @@ -1464,12 +1565,12 @@ \count\csname mp#1footins\endcsname 333 \multiply\dimen\csname mp#1footins\endcsname \thr@@} -\newcommand*{\threecolvfootnote}[2]{% +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\threecolvfootnote}[2]{% \insert\csname #1footins\endcsname\bgroup \csuse{Xnotefontsize@#1} \footsplitskips \csname #1footfmt\endcsname #2[#1]\egroup} -\newcommandx*{\threecolfootfmt}[4][4=Z]{% +\notbool{parapparatus@}{\newcommandx*}{\newcommandx}{\threecolfootfmt}[4][4=Z]{% \normal@pars \hsize \csuse{hsizethreecol@#4} \parindent=0pt @@ -1485,6 +1586,7 @@ }}% #3\strut\par\allowbreak} \newcommand*{\threecolfootgroup}[1]{{\notefontsetup + {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname #1footins\endcsname \thr@@ \splittopskip}} @@ -1492,11 +1594,13 @@ \vskip\skip\@nameuse{mp#1footins} \normalcolor \@nameuse{#1footnoterule} + {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname mp#1footins\endcsname \thr@@ \splittopskip}} \newcommand*{\foottwocol}[1]{% + \csgdef{series@display#1}{twocol} \expandafter\let\csname v#1footnote\endcsname=\twocolvfootnote \expandafter\let\csname #1footfmt\endcsname=\twocolfootfmt \expandafter\let\csname #1footgroup\endcsname=\twocolfootgroup @@ -1509,11 +1613,11 @@ \newcommand*{\twocolfootsetup}[1]{% \count\csname #1footins\endcsname 500 \multiply\dimen\csname #1footins\endcsname \tw@} -\newcommand*{\twocolvfootnote}[2]{\insert\csname #1footins\endcsname\bgroup +\notbool{parapparatus@}{\newcommand*}{\newcommand}{\twocolvfootnote}[2]{\insert\csname #1footins\endcsname\bgroup \csuse{Xnotefontsize@#1} \footsplitskips \csname #1footfmt\endcsname #2[#1]\egroup} -\newcommandx*{\twocolfootfmt}[4][4=Z]{% 4th arg is optional, for backward compatibility +\notbool{parapparatus@}{\newcommandx*}{\newcommandx}{\twocolfootfmt}[4][4=Z]{% 4th arg is optional, for backward compatibility \normal@pars \hsize \csuse{hsizetwocol@#4} \parindent=0pt @@ -1529,6 +1633,7 @@ }}% #3\strut\par\allowbreak} \newcommand*{\twocolfootgroup}[1]{{\csuse{Xnotefontsize@#1} + {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname #1footins\endcsname \tw@ \splittopskip}} @@ -1540,6 +1645,7 @@ \vskip\skip\@nameuse{mp#1footins} \normalcolor \@nameuse{#1footnoterule} + {\csuse{Xnotefontsize@#1}\noindent\csuse{txtbeforeXnotes@#1}}\par \splittopskip=\ht\strutbox \expandafter \rigidbalance\csname mp#1footins\endcsname \tw@ \splittopskip}} @@ -1613,6 +1719,7 @@ \hbox{\textsuperscript{\normalfont\@nameuse{@thefnmark#1}}}} \newcommand*{\normalvfootnoteX}[2]{% \insert\@nameuse{footins#1}\bgroup + \csuse{bhooknoteX@#1} \csuse{notefontsizeX@#1} \footsplitskips \spaceskip=\z@skip \xspaceskip=\z@skip @@ -1621,6 +1728,7 @@ \newcommand*{\mpnormalvfootnoteX}[2]{% \global\setbox\@nameuse{mpfootins#1}\vbox{% \unvbox\@nameuse{mpfootins#1} + \csuse{bhooknoteX@#1} \csuse{notefontsizeX@#1} \hsize\columnwidth \@parboxrestore @@ -1637,7 +1745,13 @@ \textsuperscript{\@nameuse{@thefnmark#1}}} \newcommand*{\normalfootstartX}[1]{% - \vskip\skip\@nameuse{footins#1}% + \ifdimequal{0pt}{\prenotesX@}{}% + {% + \iftoggle{prenotesX@}{% + \togglefalse{prenotesX@} \skip\csname footins#1\endcsname=\csuse{prenotesX@}}% + {}% + }% + \vskip\skip\csname footins#1\endcsname% \leftskip=\z@ \rightskip=\z@ \@nameuse{footnoterule#1}} @@ -1672,6 +1786,7 @@ \fi} \newcommand*{\footnormalX}[1]{% + \csgdef{series@displayX#1}{normalX} \expandafter\let\csname footstart#1\endcsname=\normalfootstartX \@namedef{@footnotemark#1}{\normal@footnotemarkX{#1}} \@namedef{bodyfootmark#1}{\normalbodyfootmarkX{#1}} @@ -1682,16 +1797,17 @@ \expandafter\let\csname footgroup#1\endcsname=\normalfootgroupX \expandafter\let\csname footnoterule#1\endcsname=\normalfootnoteruleX \count\csname footins#1\endcsname=1000 - \dimen\csname footins#1\endcsname=\ledfootinsdim - \skip\csname footins#1\endcsname=1.2em \@plus .6em \@minus .6em + \dimen\csname footins#1\endcsname=\csuse{maxhnotesX@#1} + \skip\csname footins#1\endcsname=\csuse{beforenotesX@#1} \expandafter\let\csname mpvfootnote#1\endcsname=\mpnormalvfootnoteX \expandafter\let\csname mpfootgroup#1\endcsname=\mpnormalfootgroupX \count\csname mpfootins#1\endcsname=1000 - \dimen\csname mpfootins#1\endcsname=\ledfootinsdim - \skip\csname mpfootins#1\endcsname=1.2em \@plus .6em \@minus .6em + \dimen\csname mpfootins#1\endcsname=\csuse{maxhnotesX@#1} + \skip\csname mpfootins#1\endcsname=\csuse{beforenotesX@#1} } \newcommand*{\foottwocolX}[1]{% + \csgdef{series@displayX#1}{twocol} \expandafter\let\csname regvfootnote#1\endcsname=\twocolvfootnoteX \expandafter\let\csname footfmt#1\endcsname=\twocolfootfmtX \expandafter\let\csname footgroup#1\endcsname=\twocolfootgroupX @@ -1739,6 +1855,7 @@ \rigidbalance\csname mpfootins#1\endcsname \tw@ \splittopskip}} \newcommand*{\footthreecolX}[1]{% + \csgdef{series@displayX#1}{threecol} \expandafter\let\csname regvfootnote#1\endcsname=\threecolvfootnoteX \expandafter\let\csname footfmt#1\endcsname=\threecolfootfmtX \expandafter\let\csname footgroup#1\endcsname=\threecolfootgroupX @@ -1785,6 +1902,7 @@ \rigidbalance\csname mpfootins#1\endcsname \thr@@ \splittopskip}} \newcommand*{\footparagraphX}[1]{% + \csgdef{series@displayX#1}{paragraph} \expandafter\newcount\csname prevpage#1@num\endcsname \expandafter\let\csname footstart#1\endcsname=\parafootstartX \expandafter\let\csname regvfootnote#1\endcsname=\para@vfootnoteX @@ -1806,7 +1924,13 @@ \expandafter\strip@pt\dimen0 }}} \newcommand*{\parafootstartX}[1]{% - \vskip\skip\@nameuse{footins#1}% + \ifdimequal{0pt}{\prenotesX@}{}% + {% + \iftoggle{prenotesX@}{% + \togglefalse{prenotesX@}\skip\csname footins#1\endcsname=\csuse{prenotesX@}}% + {}% + }% + \vskip\skip\csname footins#1\endcsname% \leftskip=\z@ \rightskip=\z@ \parindent=\z@ @@ -1816,6 +1940,7 @@ \newcommand*{\para@vfootnoteX}[2]{% \insert\csname footins#1\endcsname \bgroup + \csuse{bhooknoteX@#1} \csuse{notefontsizeX@#1} \footsplitskips \setbox0=\vbox{\hsize=\maxdimen @@ -1829,6 +1954,7 @@ \newcommand*{\mppara@vfootnoteX}[2]{% \global\setbox\@nameuse{mpfootins#1}\vbox{% \unvbox\@nameuse{mpfootins#1} + \csuse{bhooknoteX@#1} \csuse{notefontsizeX@#1} \footsplitskips \setbox0=\vbox{\hsize=\maxdimen @@ -1911,9 +2037,15 @@ \csgdef{Xnotefontsize@#1}{\notefontsetup}% \csgdef{notefontsizeX@#1}{\notefontsetup}% \csgdef{Xendnotefontsize@#1}{\notefontsetup}% + \csgdef{bhooknoteX@#1}{}% + \csgdef{bhookXnote@#1}{}% + \csgdef{bhookXendnote@#1}{}% \csgdef{boxlinenum@#1}{0pt}% \csgdef{boxsymlinenum@#1}{0pt}% \newtoggle{numberonlyfirstinline@#1}% + \newtoggle{numberonlyfirstintwolines@#1}% + \newtoggle{onlypstartinfootnote@#1}% + \newtoggle{pstartinfootnote@#1}% \csgdef{symlinenum@#1}{\symplinenum}% \newtoggle{nonumberinfootnote@#1}% \csgdef{beforenumberinfootnote@#1}{0pt}% @@ -1927,13 +2059,18 @@ \csgdef{inplaceoflemmaseparator@#1}{1em}% \csgdef{afternote@#1}{1em plus.4em minus.4em}% \csgdef{parafootsep@#1}{\parafootftmsep}% + \csgdef{beforeXnotes@#1}{1.2em \@plus .6em \@minus .6em} + \csgdef{beforenotesX@#1}{1.2em \@plus .6em \@minus .6em} + \csgdef{txtbeforeXnotes@#1}{} + \csgdef{maxhnotesX@#1}{\ledfootinsdim}% + \csgdef{maxhXnotes@#1}{\ledfootinsdim} \expandafter\newinsert\csname mpfootins#1\endcsname \expandafter\newinsert\csname footins#1\endcsname \expandafter\newinsert\csname #1footins\endcsname \expandafter\newinsert\csname mp#1footins\endcsname - \global\expandafter\newcommand\expandafter *\csname #1footnote\endcsname[2][]{% + \global\notbool{parapparatus@}{\expandafter\newcommand\expandafter *}{\expandafter\newcommand}\csname #1footnote\endcsname[2][]{% \begingroup% \newcommand{\content}{##2}% \ifnumberedpar@ @@ -1956,6 +2093,7 @@ \ignorespaces% \endgroup } + \csgdef{series@display#1}{} \footnormal{#1} \global\expandafter\newcommand\csname footnote#1\endcsname[1]{% @@ -1969,6 +2107,7 @@ } \newcounter{footnote#1} \global\expandafter\renewcommand\csname thefootnote#1\endcsname{\arabic{footnote#1}} + \csgdef{series@displayX#1}{} \footnormalX{#1} \global\expandafter\newcommand\csname #1endnote\endcsname[2]{{\newlinechar='40 @@ -1986,17 +2125,35 @@ } }% End of \newseries \newseries{A,B,C,D,E,Z} +\newcommand{\seriesatbegin}[1]{ + \edef\series{#1} + \def\new{} + \listeadd{\new}{\series} + \renewcommand{\do}[1]{\ifcsstring{series}{##1}{}{\listadd{\new}{##1}}} + \dolistloop{\@series} + \xdef\@series{\new} +} +\newcommand{\seriesatend}[1]{ + \edef\series{#1} + \def\new{} + \renewcommand{\do}[1]{\ifcsstring{series}{##1}{}{\listadd{\new}{##1}}} + \dolistloop{\@series} + \listeadd{\new}{\series} + \xdef\@series{\new} +} \newcommand{\settoggle@series}[3]{% - \renewcommand{\do}[1]{\settoggle{#2@##1}{#3}} + \renewcommand{\do}[1]{\global\settoggle{#2@##1}{#3}} \ifstrempty{#1}{% \dolistloop{\@series}% - }% - {% + }% + {% \docsvlist{#1}% - }% + }% } -\newcommand{\setcommand@series}[3]{% - \renewcommand{\do}[1]{\csgdef{#2@##1}{#3}} +\newcommandx{\setcommand@series}[4][4]{% + \renewcommand{\do}[1]{ + \csgdef{#2@##1}{#3} + \ifstrequal{#4}{reload}{\csuse{foot\csuse{series@display##1}}{##1}}{}} \ifstrempty{#1}{% \dolistloop{\@series}% }% @@ -2021,9 +2178,15 @@ \newhookcommand@series{Xnotenumfont} +\newhookcommand@series{notenumfontX} + \newhookcommand@series{Xendnotenumfont} -\newhookcommand@series{notenumfontX} +\newhookcommand@series{bhooknoteX} + +\newhookcommand@series{bhookXnote} + +\newhookcommand@series{bhookXendnote} \newhookcommand@series{Xnotefontsize} @@ -2059,11 +2222,28 @@ \newhookcommand@series{afternote} +\newhookcommand@series{txtbeforeXnotes} + +\newcommand{\newhookcommand@series@reload}[1]{% + \global\expandafter\newcommand\expandafter*\csname #1\endcsname[2][]{% + \csuse{setcommand@series}{##1}{#1}{##2}[reload] + }% +} +\newhookcommand@series@reload{beforeXnotes} + +\newhookcommand@series@reload{beforenotesX} + +\newhookcommand@series@reload{maxhnotesX} + +\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}}% } \newhooktoggle@series{numberonlyfirstinline} +\newhooktoggle@series{numberonlyfirstintwolines} \newhooktoggle@series{nonumberinfootnote} +\newhooktoggle@series{pstartinfootnote} +\newhooktoggle@series{onlypstartinfootnote} \newcommand*{\notenumfont}{\normalfont} \newcommand*{\notefontsetup}{\footnotesize} \newif\ifledplinenum @@ -2078,6 +2258,16 @@ \interparanoteglue{1em plus.4em minus.4em} \newcommand{\parafootftmsep}{} \newcommand{\printlinefootnote}[2]{% + \def\extractline@##1|##2|##3|##4|##5|##6|##7|{##2}% + \def\extractsubline@##1|##2|##3|##4|##5|##6|##7|{##3}% + \def\extractendline@##1|##2|##3|##4|##5|##6|##7|{##5}% + \def\extractendsubline@##1|##2|##3|##4|##5|##6|##7|{##6}% + \iftoggle{numberonlyfirstintwolines@#2}{% + \edef\lineinfo@{\extractline@ #1| - \extractsubline@ #1| - \extractendline@ #1| - \extractendsubline@ #1|}% + }% + {% + \edef\lineinfo@{\extractline@ #1| - \extractsubline@ #1|}% + }% \iftoggle{nonum@}{%Try if the line number must printed for this specific not (by default, yes) \hspace{\csuse{inplaceofnumber@#2}}% }% @@ -2092,7 +2282,7 @@ {% \ifcsdef{prevline#2}% {%Be sure the \prevline exists. - \ifnumequal{\csuse{prevline#2}}{\line@num}%Try it + \ifcsequal{prevline#2}{lineinfo@}%Try it {% \ifcsempty{symlinenum@#2}% Try if a symbol is define {% @@ -2100,16 +2290,20 @@ }% {\hspace{\csuse{beforesymlinenum@#2}}\csuse{Xnotenumfont@#2}% \ifdimequal{\csuse{boxsymlinenum@#2}}{0pt}% - {\csuse{symlinenum@#2}}% -{\hbox to \csuse{boxsymlinenum@#2}{\csuse{symlinenum@#2}\hfill}}% - \hspace{\csuse{aftersymlinenum@#2}}}% + {\csuse{symlinenum@#2}}% + {\hbox to \csuse{boxsymlinenum@#2}{\csuse{symlinenum@#2}\hfill}}% + \hspace{\csuse{aftersymlinenum@#2}}}% }% {% \hspace{\csuse{beforenumberinfootnote@#2}}\csuse{Xnotenumfont@#2}% \ifdimequal{\csuse{boxlinenum@#2}}{0pt}{% + \iftoggle{pstartinfootnote@#2}{\printpstart}{}% \printlines#1|}% {% - \hbox to \csuse{boxlinenum@#2}{\printlines#1|\hfill}% + \hbox to \csuse{boxlinenum@#2}{% + \iftoggle{pstartinfootnote@#2}{\printpstart}{}% + \iftoggle{onlypstartinfootnote@#2}{}{\printlines#1|}% + \hfill}% }% \hspace{\csuse{afternumberinfootnote@#2}}% }% @@ -2117,9 +2311,13 @@ {% \hspace{\csuse{beforenumberinfootnote@#2}}\csuse{Xnotenumfont@#2}% \ifdimequal{\csuse{boxlinenum@#2}}{0pt}{% - \printlines#1|}% + \iftoggle{pstartinfootnote@#2}{\printpstart}{}% + \iftoggle{onlypstartinfootnote@#2}{}{\printlines#1|}}% {% - \hbox to \csuse{boxlinenum@#2}{\printlines#1|\hfill}% + \hbox to \csuse{boxlinenum@#2}{% + \iftoggle{pstartinfootnote@#2}{\printpstart}{}% + \iftoggle{onlypstartinfootnote@#2}{}{\printlines#1|}% + \hfill}% }% \hspace{\csuse{afternumberinfootnote@#2}}% }% @@ -2127,13 +2325,18 @@ {% \hspace{\csuse{beforenumberinfootnote@#2}}\csuse{Xnotenumfont@#2}% \ifdimequal{\csuse{boxlinenum@#2}}{0pt}{% - \printlines#1|}% + \iftoggle{pstartinfootnote@#2}{\printpstart}{}% + \iftoggle{onlypstartinfootnote@#2}{}{\printlines#1|}% + }% {% - \hbox to \csuse{boxlinenum@#2}{\printlines#1|\hfill}% + \hbox to \csuse{boxlinenum@#2}{% + \iftoggle{pstartinfootnote@#2}{\printpstart}{}% + \iftoggle{onlypstartinfootnote@#2}{}{\printlines#1|}% + \hfill}% }% \hspace{\csuse{afternumberinfootnote@#2}}% }% - \csnumgdef{prevline#2}{\line@num}% + \csxdef{prevline#2}{\lineinfo@}% }% }% }% @@ -2392,7 +2595,7 @@ \fi \immediate\write\l@d@end{\string\l@d@section{\the\section@num}}} -\def\endprint#1#2#3#4{{\csuse{Xendnotefontsize@#4}{\csuse{Xendnotenumfont@#4}\printendlines#1|}% +\def\endprint#1#2#3#4{{\csuse{bhookXendnote@#4}\csuse{Xendnotefontsize@#4}{\csuse{Xendnotenumfont@#4}\printendlines#1|}% \enspace{\select@lemmafont#1|#2}\enskip#3\par}} \providecommand*{\@gobblethree}[3]{} @@ -2524,7 +2727,7 @@ \newcommand*{\vl@dlsnote}[1]{\setl@dlp@rbox{#1}} \newcommand*{\vl@drsnote}[1]{\setl@drp@rbox{#1}} -\newcommand*{\vl@dcsnote}[1]{\gdef\l@dcsnotetext{#1}} +\newcommand*{\vl@dcsnote}[1]{\listgadd{\l@dcsnotetext}{#1}} \newcommand*{\setl@dlp@rbox}[1]{% {\parindent\z@\hsize=\ledlsnotewidth\ledlsnotefontsetup @@ -2534,7 +2737,6 @@ \else =\vbox to 0.70\baselineskip{\strut#1\vss}% \fi}} -%% \global\setbox\l@dlp@rbox=\vbox to\z@{#3\vss}}}% aligns on top line \newcommand*{\setl@drp@rbox}[1]{% {\parindent\z@\hsize=\ledrsnotewidth\ledrsnotefontsetup \global\setbox\l@drp@rbox @@ -2545,17 +2747,27 @@ \fi}} \newif\ifleftnoteup \leftnoteuptrue -\newcommand*{\savel@dcsnote}[3]{% - \gdef\l@dcsnotetext{#3}} - +\newcommand{\sidenotesep}{, } \newcommand*{\affixside@note}{% + \def\sidenotecontent@{}% + \numdef{\itemcount@}{0}% + \renewcommand{\do}[1]{% + \ifnumequal{\itemcount@}{0}% + {% + \appto\sidenotecontent@{##1}}% Not print not separator before the 1st note + {\appto\sidenotecontent@{\sidenotesep ##1}% + }% + \numdef{\itemcount@}{\itemcount@+1}% + }% + \dolistloop{\l@dcsnotetext}% + \ifnumgreater{\itemcount@}{1}{\eledmac@warning{\itemcount@\space sidenotes on line \the\line@num\space p. \the\page@num,}}{} \gdef\@templ@d{}% \ifx\@templ@d\l@dcsnotetext \else \if@twocolumn \if@firstcolumn - \setl@dlp@rbox{\l@dcsnotetext}% + \setl@dlp@rbox{##1}{\sidenotecontent@}% \else - \setl@drp@rbox{\l@dcsnotetext}% + \setl@drp@rbox{\sidenotecontent@}% \fi \else \@l@dtempcntb=\sidenote@margin @@ -2563,13 +2775,12 @@ \advance\@l@dtempcntb by\page@num \fi \ifodd\@l@dtempcntb - \setl@drp@rbox{\l@dcsnotetext}% + \setl@drp@rbox{\sidenotecontent@}% \else - \setl@dlp@rbox{\l@dcsnotetext}% + \setl@dlp@rbox{\sidenotecontent@}% \fi \fi - \fi} - +\fi} \newcommand*{\l@dfeetbeginmini}{\l@dedbeginmini\l@dfambeginmini} \newcommand*{\l@dfeetendmini}{\l@dedendmini\l@dfamendmini} diff --git a/Master/texmf-dist/tex/latex/eledmac/eledpar.sty b/Master/texmf-dist/tex/latex/eledmac/eledpar.sty index eeed6e1bdef..871a524420f 100644 --- a/Master/texmf-dist/tex/latex/eledmac/eledpar.sty +++ b/Master/texmf-dist/tex/latex/eledmac/eledpar.sty @@ -24,11 +24,13 @@ %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{eledpar}[2012/09/16 v1.0.1 eledmac extension for parallel texts] +\ProvidesPackage{eledpar}[2012/09/25 v1.1 eledmac extension for parallel texts] -\newif\ifshiftedverses -\shiftedversesfalse -\DeclareOption{shiftedverses}{\shiftedversestrue} +\newif\ifshiftedpstarts +\let\shiftedversestrue\shiftedpstartstrue +\let\shiftedversesfalse\shiftedpstartsfalse +\DeclareOption{shiftedverses}{\shiftedpstartstrue} +\DeclareOption{shiftedpstarts}{\shiftedpstartstrue} \ProcessOptions \l@dpairingfalse \newif\ifl@dpaging @@ -162,12 +164,12 @@ \global\bypage@Rfalse \global\bypstart@Rtrue \else - \def@tempb{section} - \ifx\@tempa\@tempb + \def@tempb{section} + \ifx\@tempa\@tempb \global\bypage@Rfalse \global\bypstart@Rfalse - \else - \led@warn@BadLineation + \else + \led@warn@BadLineation \fi \fi \fi @@ -792,11 +794,11 @@ \newcommand*{\pstartL}{ \if@nobreak -\let\@oldnobreak\@nobreaktrue + \let\@oldnobreak\@nobreaktrue \else -\let\@oldnobreak\@nobreakfalse + \let\@oldnobreak\@nobreakfalse \fi -\@nobreaktrue + \@nobreaktrue \ifnumbering \else \led@err@PstartNotNumbered \beginnumbering @@ -806,7 +808,7 @@ \pend \fi \ifpst@rtedL\else - \setcounter{pstartLold}{\value{pstartL}}% + \setcounter{pstartLold}{\value{pstartL}}% \list@clear{\inserts@list}% \global\let\next@insert=\empty \global\pst@rtedLtrue @@ -819,14 +821,17 @@ \fi \global\setnamebox{l@dLcolrawbox\the\l@dnumpstartsL}=\vbox\bgroup\ifautopar\else\ifnumberpstart\ifsidepstartnum\else\thepstartL\fi\fi\fi% \hsize=\Lcolwidth - \numberedpar@true} + \numberedpar@true + \iflabelpstart\protected@edef\@currentlabel + {\p@pstartL\thepstartL}\fi + } \newcommand*{\pstartR}{ \if@nobreak -\let\@oldnobreak\@nobreaktrue + \let\@oldnobreak\@nobreaktrue \else -\let\@oldnobreak\@nobreakfalse + \let\@oldnobreak\@nobreakfalse \fi -\@nobreaktrue + \@nobreaktrue \ifnumberingR \else \led@err@PstartNotNumbered \beginnumberingR @@ -836,7 +841,7 @@ \pendR \fi \ifpst@rtedR\else - \setcounter{pstartRold}{\value{pstartR}}% + \setcounter{pstartRold}{\value{pstartR}}% \list@clear{\inserts@listR}% \global\let\next@insertR=\empty \global\pst@rtedRtrue @@ -849,7 +854,10 @@ \fi \global\setnamebox{l@dRcolrawbox\the\l@dnumpstartsR}=\vbox\bgroup\ifautopar\else\ifnumberpstart\ifsidepstartnum\else\thepstartR\fi\fi\fi% \hsize=\Rcolwidth - \numberedpar@true} + \numberedpar@true + \iflabelpstart\protected@edef\@currentlabel + {\p@pstartR\thepstartR} + } \newcommand*{\pendL}{\ifnumbering \else \led@err@PendNotNumbered \fi @@ -862,9 +870,9 @@ \endgroup \ignorespaces \@oldnobreak -\ifnumberpstart -\addtocounter{pstartL}{1} -\fi} + \ifnumberpstart + \addtocounter{pstartL}{1} + \fi} \newcommand*{\pendR}{\ifnumberingR \else \led@err@PendNotNumbered @@ -878,9 +886,9 @@ \endgroup \ignorespaces \@oldnobreak -\ifnumberpstart -\addtocounter{pstartR}{1} -\fi + \ifnumberpstart + \addtocounter{pstartR}{1} + \fi } \newbox\l@dleftbox @@ -910,7 +918,7 @@ \ifnum\@lock>\@ne\inserthangingsymboltrue\else\inserthangingsymbolfalse\fi \setbox\l@dleftbox \hb@xt@ \Lcolwidth{% - \affixpstart@numL + \affixpstart@numL \affixline@num \l@dld@ta \add@inserts @@ -944,7 +952,7 @@ \ifnum\@lockR>\@ne\inserthangingsymbolRtrue\else\inserthangingsymbolRfalse\fi \setbox\l@drightbox \hb@xt@ \Rcolwidth{% - \affixpstart@numR + \affixpstart@numR \affixline@numR \l@dld@ta \add@insertsR @@ -979,7 +987,7 @@ \fi } \newcommand*{\getline@numL}{% -\global\advance\absline@num \@ne + \global\advance\absline@num \@ne \do@actions \do@ballast \ifnumberline @@ -1295,7 +1303,7 @@ \gl@p\labelref@listR\to\label@refs \fi \ifvmode - \advancelabel@refs + \advancelabel@refs \fi \protected@write\@auxout{}% {\string\l@dmake@labelsR\space\thepage|\label@refs|{#1}}% @@ -1307,7 +1315,7 @@ \gl@p\labelref@list\to\label@refs \fi \ifvmode - \advancelabel@refs + \advancelabel@refs \fi \protected@write\@auxout{}% {\string\l@dmake@labels\space\thepage|\label@refs|{#1}}% @@ -1385,13 +1393,25 @@ \fi\ignorespaces} \newcommand*{\affixside@noteR}{% + \def\sidenotecontent@{}% + \numdef{\itemcount@}{0}% + \renewcommand{\do}[1]{% + \ifnumequal{\itemcount@}{0}% + {% + \appto\sidenotecontent@{##1}}% Not print not separator before the 1st note + {\appto\sidenotecontent@{\sidenotesep ##1}% + }% + \numdef{\itemcount@}{\itemcount@+1}% + }% + \dolistloop{\l@dcsnotetext}% + \ifnumgreater{\itemcount@}{1}{\eledmac@warning{\itemcount@\space sidenotes on line \the\line@numR R p. \the\page@numR,}}{} \gdef\@templ@d{}% \ifx\@templ@d\l@dcsnotetext \else \if@twocolumn \if@firstcolumn - \setl@dlp@rbox{\l@dcsnotetext}% + \setl@dlp@rbox{\sidenotecontent@}% \else - \setl@drp@rbox{\l@dcsnotetext}% + \setl@drp@rbox{\sidenotecontent@}% \fi \else \@l@dtempcntb=\sidenote@marginR @@ -1399,9 +1419,9 @@ \advance\@l@dtempcntb by\page@num \fi \ifodd\@l@dtempcntb - \setl@drp@rbox{\l@dcsnotetext}% + \setl@drp@rbox{\sidenotecontent@t}% \else - \setl@dlp@rbox{\l@dcsnotetext}% + \setl@dlp@rbox{\sidenotecontent@}% \fi \fi \fi} @@ -1436,34 +1456,34 @@ \newif\ifinserthangingsymbolR \newcommand{\inserthangingsymbolL}{% \ifinserthangingsymbol% -\ifinstanzaL% -\hfill\hangingsymbol% -\fi% + \ifinstanzaL% + \hfill\hangingsymbol% + \fi% \fi} \newcommand{\inserthangingsymbolR}{% \ifinserthangingsymbolR% -\ifinstanzaR% -\hfill\hangingsymbol% -\fi% + \ifinstanzaR% + \hfill\hangingsymbol% + \fi% \fi} \newcommand{\correcthangingL}{% \ifl@dpaging\else% -\ifinstanzaL% -\ifinserthangingsymbol% -\hskip \@ifundefined{sza@0@}{0}{\expandafter% - \noexpand\csname sza@0@\endcsname}\stanzaindentbase% -\fi% -\fi% + \ifinstanzaL% + \ifinserthangingsymbol% + \hskip \@ifundefined{sza@0@}{0}{\expandafter% + \noexpand\csname sza@0@\endcsname}\stanzaindentbase% + \fi% + \fi% \fi} \newcommand{\correcthangingR}{% \ifl@dpaging\else% -\ifinstanzaR% -\ifinserthangingsymbolR% -\hskip \@ifundefined{sza@0@}{0}{\expandafter% - \noexpand\csname sza@0@\endcsname}\stanzaindentbase% -\fi% -\fi% + \ifinstanzaR% + \ifinserthangingsymbolR% + \hskip \@ifundefined{sza@0@}{0}{\expandafter% + \noexpand\csname sza@0@\endcsname}\stanzaindentbase% + \fi% + \fi% \fi} \chardef\next=\catcode`\& \catcode`\&=\active @@ -1775,10 +1795,10 @@ \do@lineL \advance\numpagelinesL \@ne - \ifshiftedverses - \ifdim\ht\l@dleftbox>0pt\hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}\fi% + \ifshiftedpstarts + \ifdim\ht\l@dleftbox>0pt\hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}\fi% \else - \hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}% + \hb@xt@ \hsize{\ledstrutL\unhbox\l@dleftbox}% \fi \get@nextboxL @@ -1796,10 +1816,10 @@ { \loop\ifl@dsamepage \do@lineR \advance\numpagelinesR \@ne - \ifshiftedverses - \ifdim\ht\l@drightbox>0pt\hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}\fi% + \ifshiftedpstarts + \ifdim\ht\l@drightbox>0pt\hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}\fi% \else - \hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}% + \hb@xt@ \hsize{\ledstrutR\unhbox\l@drightbox}% \fi \get@nextboxR \checkpageR @@ -1937,7 +1957,7 @@ \fi} \newdimen\ledthegoal -\ifshiftedverses +\ifshiftedpstarts \newcommand*{\goalfraction}{0.95} \else \newcommand*{\goalfraction}{0.9} |