diff options
author | Karl Berry <karl@freefriends.org> | 2014-10-27 22:15:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-10-27 22:15:24 +0000 |
commit | 6c5b4e52c1569a69d18faaf047e69b51a046d875 (patch) | |
tree | 100d235255bf6231c7e76f71ab0b8af4ab19aac6 /Master/texmf-dist/tex/latex/eledmac | |
parent | 015111b3269fcfe362d570771acbccf5276900a2 (diff) |
eledmac (27oct14)
git-svn-id: svn://tug.org/texlive/trunk@35453 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 | 122 |
1 files changed, 60 insertions, 62 deletions
diff --git a/Master/texmf-dist/tex/latex/eledmac/eledmac.sty b/Master/texmf-dist/tex/latex/eledmac/eledmac.sty index ae2eee74105..395b386bda8 100644 --- a/Master/texmf-dist/tex/latex/eledmac/eledmac.sty +++ b/Master/texmf-dist/tex/latex/eledmac/eledmac.sty @@ -25,7 +25,7 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{eledmac}[2014/10/20 v1.13.4 LaTeX port of EDMAC]% +\ProvidesPackage{eledmac}[2014/10/27 v1.14.0 LaTeX port of EDMAC]% \newif\ifledfinal \newif\ifparapparatus@ \newif\ifnoquotation@ @@ -51,21 +51,26 @@ \RequirePackage{xstring} \RequirePackage{ifluatex} \RequirePackage{ragged2e} -\ifcsdef{if@RTL}{}{\newif\if@RTL} +\ifdef{\if@RTL}{}{\newif\if@RTL} \ifledfinal \newcommand*{\showlemma}[1]{#1} \else \newcommand*{\showlemma}[1]{\underline{#1}} \fi -\let\linenumberlist=\empty - -\newcount\@l@dtempcnta \newcount\@l@dtempcntb +\RequirePackage{xargs} +\RequirePackage{etoolbox} +\reserveinserts{32} +\RequirePackage{suffix} +\RequirePackage{xstring} +\RequirePackage{ifluatex} +\RequirePackage{ragged2e} \newif\ifl@dmemoir \@ifclassloaded{memoir}{\l@dmemoirtrue}{\l@dmemoirfalse} \newif\ifl@imakeidx \@ifpackageloaded{imakeidx}{\l@imakeidxtrue}{\l@imakeidxfalse} +\ifcsdef{if@RTL}{}{\newif\if@RTL} \newcommand{\eledmac@warning}[1]{\PackageWarning{eledmac}{#1}} \newcommand{\eledmac@error}[2]{\PackageError{eledmac}{#1}{#2}} \newcommand*{\led@err@NumberingStarted}{% @@ -187,6 +192,11 @@ \newcommand{\led@error@ImakeidxAfterEledmac}{% \eledmac@error{Imakeidx must be loaded before eledmac.}{\@ehd}% }% +\providecommand*{\@gobblethree}[3]{} +\providecommand*{\@gobblefour}[4]{} +\let\linenumberlist=\empty + +\newcount\@l@dtempcnta \newcount\@l@dtempcntb \newcount\section@num \section@num=0 \let\extensionchars=\empty @@ -2506,12 +2516,13 @@ \fi \immediate\write\l@d@end{\string\l@d@section{\the\section@num}}} + \def\endprint#1#2#3#4{{\csuse{bhookXendnote@#4}\csuse{Xendnotefontsize@#4}{\csuse{Xendnotenumfont@#4}\printendlines#1|}% \enspace{\nottoggle{Xendlemmadisablefontselection@#4}{\select@lemmafont#1|#2}{#2}}\enskip#3\par}} -\providecommand*{\@gobblethree}[3]{} \let\l@d@section=\@gobble + \newcommand*{\setprintendlines}[6]{% \l@d@pnumfalse \l@d@dashfalse \ifnum#4=#1 \else @@ -2680,7 +2691,7 @@ {\ifnumberedpar@\csexpandonce{@tag}\fi}{\csexpandonce{content}}{#1}}}\ignorespaces% } - \global\csletcs{#1end}{@gobblethree} + \global\cslet{#1end}{\@gobblefour} \global\csletcs{#1@@footnote}{#1footnote} @@ -3116,7 +3127,7 @@ \fi \protected@write\@auxout{}% {\string\l@dmake@labels\space\thepage|\label@refs|\the\c@pstart|{#1}}% - \ifcsdef{hypertarget}{\hypertarget{#1}{}}{}% + \ifdef{\hypertarget}{\hypertarget{#1}{}}{}% \@esphack} \newcounter{line}% @@ -3603,86 +3614,80 @@ } \newcommand{\ledinnote}[2]{\csuse{#1}{#2\emph{n}}} \newcommand{\ledinnotehyperpage}[2]{\csuse{#1}{\hyperpage{#2}\emph{n}}} -\@ifclassloaded{memoir}{% +\def\create@edindex@for@memoir{ \g@addto@macro{\makememindexhook}{% \def\edindex{\@bsphack% \@ifnextchar [{\l@d@index}{\l@d@index[\jobname]}}} \newcommand{\edindex}[2][\jobname]{\@bsphack\@esphack} - \def\l@d@index[#1]{% - \@ifundefined{#1@idxfile}% + \def\l@d@index[##1]{% + \@ifundefined{##1@idxfile}% {\ifreportnoidxfile - \led@warn@NoIndexFile{#1}% + \led@warn@NoIndexFile{##1}% \fi \begingroup \@sanitize \@nowrindex}% - {\def\@idxfile{#1}% + {\def\@idxfile{##1}% \doedindexlabel \begingroup \@sanitize \l@d@wrindexm@m}} - \newcommand{\l@d@wrindexm@m}[1]{\l@d@@wrindexhyp#1||\\} - \def\l@d@@wrindexhyp#1|#2|#3\\{% - \ifshowindexmark\@showidx{#1}\fi - \ifx\\#2\\% + \newcommand{\l@d@wrindexm@m}[1]{\l@d@@wrindexhyp##1||\\} + \def\l@d@@wrindexhyp##1|##2|##3\\{% + \ifshowindexmark\@showidx{##1}\fi + \ifx\\##2\\% \if@edindex@fornote@% \protected@write\@auxout{}% - {\string\@@wrindexm@m{\@idxfile}{#1|(ledinnotehyperpage}{\thestartpageline}}% + {\string\@@wrindexm@m{\@idxfile}{##1|(ledinnotehyperpage}{\thestartpageline}}% \protected@write\@auxout{}% - {\string\@@wrindexm@m{\@idxfile}{#1|)ledinnotehyperpage}{\theendpageline}}% + {\string\@@wrindexm@m{\@idxfile}{##1|)ledinnotehyperpage}{\theendpageline}}% \else% \protected@write\@auxout{}% - {\string\@@wrindexm@m{\@idxfile}{#1|hyperpage}{\thepageline}}% + {\string\@@wrindexm@m{\@idxfile}{##1|hyperpage}{\thepageline}}% \fi% \else - \def\Hy@temp@A{#2}% + \def\Hy@temp@A{##2}% \ifx\Hy@temp@A\HyInd@ParenLeft \if@edindex@fornote@% \protected@write\@auxout{}% - {\string\@@wrindexm@m{\@idxfile}{#1|(ledinnotehyperpage{#2}}{\thestartpageline}}% + {\string\@@wrindexm@m{\@idxfile}{##1|(ledinnotehyperpage{##2}}{\thestartpageline}}% \protected@write\@auxout{}% - {\string\@@wrindexm@m{\@idxfile}{#1|)ledinnotehyperpage{#2}}{\theendpageline}}% + {\string\@@wrindexm@m{\@idxfile}{##1|)ledinnotehyperpage{##2}}{\theendpageline}}% \else% \protected@write\@auxout{}% - {\string\@@wrindexm@m{\@idxfile}{#1|#2hyperpage}{\thepageline}}% + {\string\@@wrindexm@m{\@idxfile}{##1|##2hyperpage}{\thepageline}}% \fi% \else \if@edindex@fornote@% \protected@write\@auxout{}% - {\string\@@wrindexm@m{\@idxfile}{#1|(ledinnote{#2}}{\thestartpageline}}% + {\string\@@wrindexm@m{\@idxfile}{##1|(ledinnote{##2}}{\thestartpageline}}% \protected@write\@auxout{}% - {\string\@@wrindexm@m{\@idxfile}{#1|)ledinnote{#2}}{\theendpageline}}% + {\string\@@wrindexm@m{\@idxfile}{##1|)ledinnote{##2}}{\theendpageline}}% \else% \protected@write\@auxout{}% - {\string\@@wrindexm@m{\@idxfile}{#1|#2}{\thepageline}}% + {\string\@@wrindexm@m{\@idxfile}{##1|##2}{\thepageline}}% \fi% \fi \fi \endgroup \@esphack} -}{% - \pretocmd{\makeindex}{% - \def\edindex{\@bsphack - \doedindexlabel - \begingroup - \@sanitize - \@wredindex}}{}{} - \newcommand{\edindex}[1]{\@bsphack\@esphack} +} +\def\create@edindex@notfor@memoir{ \newcommandx{\@wredindex}[2][1=\expandonce\jobname,usedefault]{%#1 = the index name, #2 = the text \global\let\old@Rlineflag\Rlineflag% \gdef\Rlineflag{}% \ifl@imakeidx% \if@edindex@fornote@% - \IfSubStr[1]{#2}{|}{\get@index@command#2+}{\get@index@command#2|+}% - \expandafter\imki@wrindexentry{#1}{\@index@txt|(ledinnote{\@index@command}}{\thestartpageline}% - \expandafter\imki@wrindexentry{#1}{\@index@txt|)ledinnote{\@index@command}}{\theendpageline}% + \IfSubStr[1]{##2}{|}{\get@index@command##2+}{\get@index@command##2|+}% + \expandafter\imki@wrindexentry{##1}{\@index@txt|(ledinnote{\@index@command}}{\thestartpageline}% + \expandafter\imki@wrindexentry{##1}{\@index@txt|)ledinnote{\@index@command}}{\theendpageline}% \else% - \get@edindex@hyperref{#2}% - \imki@wrindexentry{#1}{\@index@txt\@edindex@hyperref}{\thepageline}% + \get@edindex@hyperref{##2}% + \imki@wrindexentry{##1}{\@index@txt\@edindex@hyperref}{\thepageline}% \fi% \else% \if@edindex@fornote@% - \IfSubStr[1]{#2}{|}{\get@index@command#2+}{\get@index@command#2|+}% + \IfSubStr[1]{##2}{|}{\get@index@command##2+}{\get@index@command##2|+}% \expandafter\protected@write\@indexfile{}% {\string\indexentry{\@index@txt|(ledinnote{\@index@command}}{\thestartpageline} }% @@ -3691,15 +3696,26 @@ }% \else% \protected@write\@indexfile{}% - {\string\indexentry{#2}{\thepageline} + {\string\indexentry{##2}{\thepageline} }% \fi% \fi% \endgroup \global\let\Rlineflag\old@Rlineflag% \@esphack} + \pretocmd{\makeindex}{% + \def\edindex{\@bsphack + \doedindexlabel + \begingroup + \@sanitize + \@wredindex}}{}{} + \newcommand{\edindex}[1]{\@bsphack\@esphack} } - +\@ifclassloaded{memoir}{% + \@ifpackageloaded{imakeidx}% + {\create@edindex@notfor@memoir}{\create@edindex@for@memoir}% + }% + {\create@edindex@notfor@memoir}% \newcommand{\hyperlinkformat}[3]{% \ifstrempty{#1}% {\hyperlink{#2}{#3}}% @@ -3714,7 +3730,7 @@ }% \newcommand{\get@edindex@hyperref}[1]{% - \ifcsdef{hyperlink}% + \ifdef{\hyperlink}% {% \edef\temp@{% \catcode`\ =9 %space need for catcode @@ -3745,24 +3761,6 @@ \gdef\@index@txt{#1}% \gdef\@edindex@hyperref{}}% } -\ifl@dmemoir\else% -\AtBeginDocument{\@ifpackageloaded{hyperref}{}{% - \def\l@d@@wrindexhyp#1||\\{% - \ifshowindexmark\@showidx{#1}\fi - \IfSubStr[1]{#1}{|}{\get@index@command#1+}{\get@index@command#1|+}% - \if@edindex@fornote@% - \protected@write\@auxout{}% - {\string\@@wrindexm@m{\@idxfile}{\@index@txt|(ledinnote{\@index@command}}{\thestartpageline}}% - \protected@write\@auxout{}% - {\string\@@wrindexm@m{\@idxfile}{\@index@txt|)ledinnote{\@index@command}}{\theendpageline}}% - \else% - \protected@write\@auxout{}% - {\string\@@wrindexm@m{\@idxfile}{#1}{\thepageline}}% - \fi% - \endgroup - \@esphack}}} -\fi% - \newtoks\@emptytoks \newtoks\l@denvbody |