summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/reledmac
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-08-17 21:16:23 +0000
committerKarl Berry <karl@freefriends.org>2017-08-17 21:16:23 +0000
commit8752481311daf908372f21728c152ca10ae0973e (patch)
treeec009734d0de97ee4fed31d17425243eaac1ccad /Master/texmf-dist/tex/latex/reledmac
parent0f4a34d1fe6262bc72205b50adb2ae5ab576d427 (diff)
reledmac (17aug17)
git-svn-id: svn://tug.org/texlive/trunk@45055 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/reledmac')
-rw-r--r--Master/texmf-dist/tex/latex/reledmac/reledmac.sty165
-rw-r--r--Master/texmf-dist/tex/latex/reledmac/reledpar.sty259
2 files changed, 316 insertions, 108 deletions
diff --git a/Master/texmf-dist/tex/latex/reledmac/reledmac.sty b/Master/texmf-dist/tex/latex/reledmac/reledmac.sty
index 74e63cd12c4..5e12a48f12f 100644
--- a/Master/texmf-dist/tex/latex/reledmac/reledmac.sty
+++ b/Master/texmf-dist/tex/latex/reledmac/reledmac.sty
@@ -35,7 +35,7 @@
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledmac}[2017/07/31 v2.23.0 typesetting critical editions]%
+\ProvidesPackage{reledmac}[2017/08/17 v2.24.0 typesetting critical editions]%
\RequirePackage{xkeyval}
\newif\ifparledgroup
\DeclareOptionX{series}[A,B,C,D,E]{\xdef\default@series{#1}}
@@ -114,6 +114,7 @@
\ProcessOptionsX*\relax
\RequirePackage{xargs}
+\RequirePackage{xparse}%
\RequirePackage{etoolbox}
\@ifl@t@r\fmtversion{2015/10/01}
{\ifboolexpr{not test{\@ifl@t@r\fmtversion{2016/03/31}} or (test{\ifdefstring{\fmtversion}{2016/03/31}} and test {\ifnumless{\patch@level}{3}})}%
@@ -370,7 +371,7 @@
\global\@afterindenttrue%In order to retablish normal feature if the \begingroup was not here
\initnumbering@quote
\ifwidthliketwocolumns%
- \csuse{setwidthliketwocolumns@\columns@position}%
+ \setwidthliketwocolumns%
\csuse{setpositionliketwocolumns@\columns@position}%
\fi%
\fi
@@ -399,6 +400,11 @@
\global\sublines@false
\global\let\next@page@num=\relax
\global\let\sub@change=\relax
+ \global\last@page@num=-10000%
+ \ifdefined\line@numR%
+ \line@numR=\z@%
+ \last@page@numR=\z@%
+ \fi%
\resetprevline@
\resetprevpage@num
\global\stopmsdata@inserted@true%
@@ -438,26 +444,34 @@
\endgroup
\fi
}
+\newcount\pausenumbering@page@num%
\newcommand{\pausenumbering}{%
+ \ifx\next@page@num\relax%
+ \global\pausenumbering@page@num=0%
+ \else%
+ \global\pausenumbering@page@num=\next@page@num%
+ \fi%
\ifautopar\global\autopar@pausetrue\fi%
\endnumbering\global\numberingtrue}
+\newif\ifresumenumbering@start%
\newcommand*{\resumenumbering}{%
\ifnumbering
\ifautopar@pause\autopar\fi
\global\pst@rtedLtrue
\global\advance\section@num \@ne
+ \global\resumenumbering@starttrue%
\led@mess@SectionContinued{\the\section@num}%
+ \set@continuousnumberingforL%
\line@list@stuff{\jobname.\extensionchars\the\section@num}%
\l@dend@stuff
\ifl@dpairing\else%
\begingroup%
\initnumbering@quote%
\ifwidthliketwocolumns%
- \csuse{setwidthliketwocolumns@\columns@position}%
+ \setwidthliketwocolumns%
\csuse{setpositionliketwocolumns@\columns@position}%
\fi%
\fi%
- \set@continuousnumberingforL%
\else
\led@err@NumberingShouldHaveStarted
\endnumbering
@@ -468,7 +482,9 @@
\ifcontinuousnumberingwithcolumns%
\ifdefined\line@numR%
\ifnum\line@numR>\line@num%
- \expandafter\setlinenum\expandafter{\the\line@numR}%
+ \global\appto\next@line@list@stuff{%
+ \expandafter\setlinenum\expandafter{\the\line@numR}%
+ }%
\fi%
\ifnum\last@page@numR>\last@page@num%
\global\last@page@num=\last@page@numR%
@@ -733,12 +749,6 @@
\fi%
\list@clear{\maxlinesinpar@list}
\get@linelistfile{#1}%
- \ifcontinuousnumberingwithcolumns
- \global\page@numR=\page@numR\relax
- \global\last@page@numR=\last@page@numR\relax
- \global\page@num=\page@num\relax
- \global\last@page@num=\last@page@num\relax
- \fi
\@stopmsd%Security if last \endms{} is forgotten
\unless\ifledRcol%Get the last line of the last page
\csnumgdef{@lastabsline@forpage@\the\page@num}{\the\absline@num}%
@@ -808,6 +818,7 @@
\newcommand*{\@nl@reg}{%
\ifx\l@dchset@num\relax \else
\advance\absline@num \@ne
+ \csgdef{l@dchset@num@\the\absline@num}{}%To remember this line have been marked by a \setlinenum
\set@line@action
\let\l@dchset@num=\relax
\advance\absline@num \m@ne
@@ -859,11 +870,13 @@
\csnumgdef{@lastabsline@forpageR@\the\page@numR}{\the\absline@numR}%
\csnumgdef{@lastline@forpageR@\the\page@numR}{\the\line@numR}%
\ifbypage@R
- \line@numR \z@ \subline@numR \z@
+ \ifx\l@dchset@num\relax%Not resetting if preceded by a \setlinenum
+ \line@numR \z@ \subline@numR \z@%
+ \fi%
\fi
- \page@numR=#1\relax
- \last@page@numR=#1\relax
- \def\next@page@numR{#1}%
+ \global\page@numR=#1%
+ \global\last@page@numR=#1%
+ \global\def\next@page@numR{#1}%
\fi
\else
\ifnum #1=\last@page@num
@@ -871,11 +884,13 @@
\csnumgdef{@lastabsline@forpage@\the\page@num}{\the\absline@num}%
\csnumgdef{@lastline@forpage@\the\page@num}{\the\line@num}%
\ifbypage@
- \line@num \z@ \subline@num \z@
+ \ifx\l@dchset@num\relax%Not resetting if preceded by a \setlinenum
+ \line@num \z@ \subline@num \z@%
+ \fi%
\fi
- \page@num=#1\relax
- \last@page@num=#1\relax
- \def\next@page@num{#1}%
+ \global\page@num=#1%
+ \global\last@page@num=#1%
+ \global\def\next@page@num{#1}%
\listxadd{\normal@page@break}{\the\absline@num}
\fi
\fi}
@@ -1215,6 +1230,7 @@
\newif\iffirst@linenum@out@
\first@linenum@out@true
\newcommand{\this@line@list@version}{7}%
+\let\next@line@list@stuff\relax%
\newcommand*{\line@list@stuff}[1]{%
\global\newtoggle{notfirstrun@#1}%
\IfFileExists{\l@auxdir#1}%
@@ -1222,7 +1238,6 @@
{\global\togglefalse{notfirstrun@#1}}%
\read@linelist{#1}%
\iffirst@linenum@out@
- \immediate\closeout\linenum@out%
\global\first@linenum@out@false%
\immediate\openout\linenum@out=\l@auxdir#1\relax%
\immediate\write\linenum@out{\string\line@list@version{\this@line@list@version}}%
@@ -1239,7 +1254,10 @@
\ifl@dpaging%
\write\linenum@out{\string\@par@sync@option{\@par@this@sync@option}}%
\fi%
- \fi}
+ \fi%
+ \next@line@list@stuff%
+ \global\let\next@line@list@stuff\relax%
+}%
\newcommand*{\new@line}{%
\IfStrEq{\led@pb@setting}{after}%
@@ -1551,12 +1569,7 @@
\newcommand{\get@sw@txt}[1]{%
\begingroup%
- \let\sameword\@firstofone%Allow to have nested \sameword
- \let\emph\@firstofone%
- \let\textit\@firstofone%
- \let\textbf\@firstofone%
- \let\textsc\@firstofone%
- \let\framebox\@firstofone%
+ \swnoexpands%
\ifsw@caseinsensitive%
\def\@tmpa##1{\lowercase{##1}}%
\else%
@@ -1569,6 +1582,26 @@
\fi%
\endgroup%
}%
+\newcommand{\swnoexpands}{%
+ \let\sameword\@firstofone%Allow to have nested \sameword
+ \let\emph\@firstofone%
+ \let\textit\@firstofone%
+ \let\textbf\@firstofone%
+ \let\textsc\@firstofone%
+ \let\framebox\@firstofone%
+ \RenewExpandableDocumentCommand{\edindex}{om}{}%
+ \ifdefined\index%
+ \RenewExpandableDocumentCommand{\index}{om}{}%
+ \fi%
+ \let\selectlanguage\@gobble%
+ \let\foreignlanguage\@secondoftwo%
+ \ifdefined\xpg@loaded%
+ \renewcommand\do[1]{%
+ \expandafter\RenewExpandableDocumentCommand\expandafter{\csname text##1\endcsname}{om}{####2}%
+ }%
+ \expandafter\docsvlist\expandafter{\xpg@loaded}%
+ \fi%
+}%
\newcommandx{\sameword}[2][1,usedefault]{%
\leavevmode%
\get@sw@txt{#2}%
@@ -1754,8 +1787,8 @@
\fi%
\fi%
\numberedpar@true%
- \iflabelpstart\protected@edef\@currentlabel%
- {\p@pstart\thepstart}
+ \iflabelpstart%
+ \protected@edef\@currentlabel{\p@pstart\thepstart}%
\fi%
\l@dzeropenalties%
\@at@start@every@pstart%
@@ -1964,9 +1997,27 @@
\gdef\l@dcsnotetext{}}
\newcommand{\l@dlsn@te}{%
- \hb@xt@ \z@{\hss\box\l@dlp@rbox\kern\ledlsnotesep}}
+ \ifboolexpr{%
+ bool {l@dprintingcolumns}%
+ and bool {ledRcol@}%
+ }{% If we are on a right column
+ \@tempdima=\@morespace@leftnote@rightcolumn%
+ }{%
+ \@tempdima=\z@%
+ }%
+ \hb@xt@ \z@{\hss\box\l@dlp@rbox\kern\ledlsnotesep\hskip\@tempdima}%
+}%
\newcommand{\l@drsn@te}{%
- \hb@xt@ \z@{\kern\ledrsnotesep\box\l@drp@rbox\hss}}
+ \ifboolexpr{%
+ bool {l@dprintingcolumns}%
+ and not bool {ledRcol@}%
+ }{% If we are on a left column
+ \@tempdima=\@morespace@rightnote@leftcolumn%
+ }{%
+ \@tempdima=\z@%
+ }%
+ \hb@xt@ \z@{\hskip\@tempdima\kern\ledrsnotesep\box\l@drp@rbox\hss}%
+}%
\newcommand*{\ledllfill}{\hfil}
\newcommand*{\ledrlfill}{}
@@ -2005,11 +2056,28 @@
\ifnum\absline@num<\next@actionline\else
\ifnum\next@action>-1001
\global\page@num=\next@action
- \global\@firstlineofpagetrue%
+ \ifresumenumbering@start%
+ \setbox0=\hbox{}%Required to get the correct page number, when the \resumenumbering is just after a \newpage
+ \ifnum\pausenumbering@page@num<\page@num%
+ \global\resumenumbering@startfalse%
+ \fi%
+ \fi%
+ \unless\ifresumenumbering@start%
+ \global\@firstlineofpagetrue%
+ \fi%
\ifbypage@
- \global\line@num=\z@ \global\subline@num=\z@
- \resetprevline@
+ \ifcsdef{l@dchset@num@\the\absline@num}%
+ {%
+ \global\csundef{l@dchset@num@\the\absline@num}%
+ }%
+ {%
+ \unless\ifresumenumbering@start%
+ \global\line@num=\z@ \global\subline@num=\z@%
+ \resetprevline@%
+ \fi%
+ }%
\fi
+ \global\resumenumbering@startfalse%
\add@msdata@firstlineofpage%
\else
\ifnum\next@action<-4999
@@ -2127,11 +2195,26 @@
\ifnum\@l@dtempcntb>\@ne
\advance\@l@dtempcntb \page@num
\fi
- \ifodd\@l@dtempcntb
+ \ifboolexpr{%
+ bool {l@dprintingcolumns}%
+ and (%
+ (test {\ifdefstring{\linenum@OnlyPages@ForColumns}{left}}%
+ and test {\ifnumodd{\page@num}}%
+ )%
+ or%
+ (test {\ifdefstring{\linenum@OnlyPages@ForColumns}{right}}%
+ and not test {\ifnumodd{\page@num}}%
+ )%
+ )%
+ }%
+ {}%
+ {%
+ \ifodd\@l@dtempcntb%
\gdef\l@drd@ta{\rlap{{\rightlinenum}}}%
- \else
+ \else%
\gdef\l@dld@ta{\llap{{\leftlinenum}}}%
- \fi
+ \fi%
+ }%
\fi
\fi
\fi
@@ -4110,7 +4193,7 @@
\let\old@columwidth=\columnwidth%
\iftoggle{Xnoteswidthliketwocolumns@#1}%
{%
- \csuse{setwidthliketwocolumns@\columns@position}%
+ \setwidthliketwocolumns%
\global\let\hsize@fornote=\hsize%
}%
{}%
@@ -4124,7 +4207,7 @@
\let\old@columwidth=\columnwidth%
\iftoggle{noteswidthliketwocolumnsX@#1}%
{%
- \csuse{setwidthliketwocolumns@\columns@position}%
+ \setwidthliketwocolumns%
\global\let\hsize@fornote=\hsize%
}%
{}%
@@ -5446,9 +5529,7 @@
\newcommand*{\zz@@@}{000|000|000}% Set three counters to zero in one go
\newcommand*{\edlabel}[1]{%
- \ifl@dpairing\ifautopar%
- \strut%
- \fi\fi%
+ \leavevmode%
\@bsphack%
\ifboolexpr{bool{ledRcol} or bool{ledRcol@}}{%
\ifXnote@%
diff --git a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty
index 04598785b77..af89d06a767 100644
--- a/Master/texmf-dist/tex/latex/reledmac/reledpar.sty
+++ b/Master/texmf-dist/tex/latex/reledmac/reledpar.sty
@@ -27,9 +27,8 @@
-
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledpar}[2017/08/10 v2.19.5 reledmac extension for parallel texts]%
+\ProvidesPackage{reledpar}[2017/08/17 v2.20.0 reledmac extension for parallel texts]%
\RequirePackage{xspace}%
\RequirePackage{xkeyval}
@@ -61,6 +60,10 @@
\DeclareOptionX{movecolumnspositiononrightpage}{%
\movecolumnspositiononrightpagetrue%
}%
+\newif\if@sidenotesmarginpage%
+\DeclareOptionX{sidenotesmarginpage}{%
+ \@sidenotesmarginpagetrue%
+}%
\DeclareOptionX{parledgroup}{\parledgrouptrue}
\DeclareOptionX{widthliketwocolumns}{\widthliketwocolumnstrue}%
\DeclareOptionX{continuousnumberingwithcolumns}{\continuousnumberingwithcolumnstrue}%
@@ -200,16 +203,19 @@
\global\sublines@Rfalse
\global\let\next@page@numR\relax
\global\let\sub@change\relax
+ \global\last@page@numR=-10000%
\global\stopmsdata@inserted@true%
\global\let\@msdata@list\relax%
\global\csundef{@msdata@\add@msd@cR @dataR}%
\ifcontinuousnumberingwithcolumns%
- \addtocounter{pstartR}{1}%
+ \ifnumberpstart%
+ \addtocounter{pstartR}{1}%
+ \fi%
\else%
\setcounter{pstartR}{1}%
\fi%
- \set@continuousnumberingforR%
\message{Section \the\section@numR R }%
+ \set@continuousnumberingforR%
\line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
\l@dend@stuff
\begingroup
@@ -286,20 +292,28 @@
\let\c@subsection\c@subsectionR%
\let\c@subsubsection\c@subsubsectionR%
}%
+\newcount\pausenumbering@page@numR%
\newcommand*{\pausenumberingR}{%
+ \ifx\next@page@numR\relax%
+ \global\pausenumbering@page@numR=0%
+ \else%
+ \global\pausenumbering@page@numR=\next@page@numR%
+ \fi%
\endnumberingR\global\numberingRtrue}
+\newif\ifresumenumberingR@start%
\newcommand*{\resumenumberingR}{%
\ifnumberingR
\global\pst@rtedRtrue
\global\advance\section@numR \@ne
+ \global\resumenumberingR@starttrue%
\led@mess@SectionContinued{\the\section@numR R}%
+ \set@continuousnumberingforR%
\line@list@stuffR{\jobname.\extensionchars\the\section@numR R}%
\l@dend@stuff
\begingroup%
\initnumbering@sectcountR%
- \set@continuousnumberingforR%
\else
- \led@err@numberingShouldHaveStarted
+ \led@err@NumberingShouldHaveStarted
\endnumberingR
\beginnumberingR
\fi}
@@ -360,7 +374,9 @@
\newcommand{\set@continuousnumberingforR}{%
\ifcontinuousnumberingwithcolumns%
\ifnum\line@numR<\line@num%
- \expandafter\setlinenum\expandafter{\the\line@num}%
+ \global\appto\next@line@list@stuffR{%
+ \expandafter\setlinenum\expandafter{\the\line@num}%
+ }%
\fi%
\ifnum\last@page@num>\last@page@numR%
\global\last@page@numR=\last@page@num%
@@ -418,6 +434,15 @@
\fi%
}%
+\def\linenum@OnlyPages@ForColumns{}%
+\newcommand{\linenumOnlyPagesForColumns}[1]{%
+ \gdef\linenum@OnlyPages@ForColumns{#1}%
+}%
+
+\def\linenum@OnlyPages@ForColumnsR{}%
+\newcommand{\linenumOnlyPagesForColumnsR}[1]{%
+ \gdef\linenum@OnlyPages@ForColumnsR{#1}%
+}%
\newcounter{firstlinenumR}
\setcounter{firstlinenumR}{5}
\newcounter{linenumincrementR}
@@ -529,6 +554,7 @@
\newcommand{\@nl@regR}{%
\ifx\l@dchset@num\relax \else
\advance\absline@numR \@ne
+ \csgdef{l@dchset@num@R\the\absline@numR}{}%To remember this line have been marked by a \setlinenum
\set@line@action
\let\l@dchset@num\relax
\advance\absline@numR \m@ne
@@ -700,6 +726,8 @@
\newwrite\linenum@outR
\newif\iffirst@linenum@out@R
\first@linenum@out@Rtrue
+
+\let\next@line@list@stuffR\relax%
\newcommand*{\line@list@stuffR}[1]{%
\global\newtoggle{notfirstrun@#1}%
\IfFileExists{\l@auxdir#1}%
@@ -707,7 +735,6 @@
{\global\togglefalse{notfirstrun@#1}}%
\read@linelist{#1}%
\iffirst@linenum@out@R
- \immediate\closeout\linenum@outR
\global\first@linenum@out@Rfalse
\immediate\openout\linenum@outR=\l@auxdir#1%
\immediate\write\linenum@outR{\string\line@list@version{\this@line@list@version}}%
@@ -720,7 +747,10 @@
\fi%
\closeout\linenum@outR%
\openout\linenum@outR=\l@auxdir#1%
- \fi}
+ \fi%
+ \next@line@list@stuffR%
+ \global\let\next@line@list@stuffR\relax%
+}%
\newcommand*{\new@lineL}{%
\write\linenum@out{\string\@nl[\the\c@page][\thepage]}}
@@ -954,8 +984,9 @@
\@at@start@every@pstart%
\hsize=\Lcolwidth%
\numberedpar@true%
- \iflabelpstart\protected@edef\@currentlabel%
- {\p@pstartL\thepstartL}\fi%
+ \iflabelpstart%
+ \protected@edef\@currentlabel{\p@pstartL\thepstartL}%
+ \fi%
\providetoggle{before@pstartL@\the\l@dnumpstartsL @par}%
\ifboolexpr{%
test {\ifstrempty{#1}}%
@@ -1026,8 +1057,9 @@
\@at@start@every@pstart%
\hsize=\Rcolwidth%
\numberedpar@true%
- \iflabelpstart\protected@edef\@currentlabel%
- {\p@pstartR\thepstartR}\fi%
+ \iflabelpstart%
+ \protected@edef\@currentlabel{\p@pstartR\thepstartR}%
+ \fi%
\providetoggle{before@pstartR@\the\l@dnumpstartsR @par}%
\ifboolexpr{%
test {\ifstrempty{#1}}%
@@ -1071,10 +1103,10 @@
\dump@pstartL@pc%
\ifnumberpstart%
\addtocounter{pstartL}{1}%
+ \ifcontinuousnumberingwithcolumns%
+ \addtocounter{pstart}{1}%
+ \fi%
\fi
- \ifcontinuousnumberingwithcolumns%
- \addtocounter{pstart}{1}%
- \fi%
\parledgroup@beforenotes@save{L}%
\providetoggle{after@pendL@\the\l@dnumpstartsL @par}%
\ifboolexpr{%
@@ -1500,11 +1532,23 @@
\@l@dtempcntb=\absline@numR
\ifnum\@l@dtempcntb<\next@actionlineR\else
\ifnum\next@actionR>-1001\relax
- \@firstlineofpageRtrue%
+ \unless\ifresumenumberingR@start%
+ \@firstlineofpageRtrue%
+ \fi%
\global\page@numR=\next@actionR
\ifbypage@R
- \global\line@numR \z@ \global\subline@numR \z@
+ \ifcsdef{l@dchset@num@R\the\absline@numR}%
+ {%
+ \global\csundef{l@dchset@num@R\the\absline@numR}%
+ }%
+ {%
+ \unless\ifresumenumberingR@start%
+ \global\line@numR \z@%
+ \global\subline@numR \z@%
+ \fi%
+ }%
\fi
+ \global\resumenumberingR@startfalse%
\add@msdata@firstlineofpage%
\else
\ifnum\next@actionR<-4999\relax % 9/05 added relax here
@@ -1630,11 +1674,26 @@
\ifnum\@l@dtempcntb>\@ne
\advance\@l@dtempcntb by\page@numR
\fi
- \ifodd\@l@dtempcntb
- \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}%
- \else
- \gdef\l@dld@ta{\llap{{\leftlinenumR}}}%
- \fi
+ \ifboolexpr{%
+ bool {l@dprintingcolumns}%
+ and (%
+ (test {\ifdefstring{\linenum@OnlyPages@ForColumnsR}{left}}%
+ and test {\ifnumodd{\page@numR}}%
+ )%
+ or%
+ (test {\ifdefstring{\linenum@OnlyPages@ForColumnsR}{right}}%
+ and not test {\ifnumodd{\page@numR}}%
+ )%
+ )%
+ }%
+ {}%
+ {%
+ \ifodd\@l@dtempcntb%
+ \gdef\l@drd@ta{\rlap{{\rightlinenumR}}}%
+ \else%
+ \gdef\l@dld@ta{\llap{{\leftlinenumR}}}%
+ \fi%
+ }%
\fi
\fi
\fi
@@ -1911,7 +1970,18 @@
\sidenotemarginR{outer}%
\fi%
+\newdimen\@morespace@leftnote@rightcolumn%
+\newdimen\@morespace@rightnote@leftcolumn%
+\newcommand{\get@sidenote@morespace@columns}{%
+ \if@sidenotesmarginpage%
+ \global\@morespace@leftnote@rightcolumn=\dimexpr\intercolumns@width + \Lcolwidth\relax%
+ \global\@morespace@rightnote@leftcolumn=\dimexpr\intercolumns@width + \Rcolwidth\relax%
+ \else%
+ \global\@morespace@leftnote@rightcolumn=\z@%
+ \global\@morespace@rightnote@leftcolumn=\z@%
+ \fi%
+}%
\newcommand*{\affixside@noteR}{%
\prepare@edindex@fornote{\the\page@numR|\the\line@numR|\the\subline@numR|\the\page@numR|\the\line@numR|\the\subline@numR|}%
\def\sidenotecontent@{}%
@@ -2214,6 +2284,8 @@
\global\l@dpscL=\z@
\global\l@dpscR=\z@
\get@familiarfootnote@number%
+ \get@intercolumns@width%
+ \get@sidenote@morespace@columns%
\check@pstarts
\loop\if@pstarts
\global\pstartnumtrue
@@ -2298,6 +2370,101 @@
\hspace{\aftercolumnseparator}%
\fi%
}%
+\newdimen\intercolumns@width%
+\newcommand{\get@intercolumns@width}{%
+ \global\intercolumns@width=\z@%
+ \ifdefstring{\columns@position}{C}%
+ {%
+ \ifboolexpr{%
+ test {\ifdimless{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimless{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth +%
+ (\textwidth - \Lcolwidth - \Rcolwidth - \columnrulewidth)*1/2% The total of the width before and after column separator
+ \relax%
+ }%
+ {}%
+ \ifboolexpr{%
+ test {\ifdimgreater{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimgreater{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth + \beforecolumnseparator + \aftercolumnseparator%
+ \relax%
+ }%
+ {}%
+ \ifboolexpr{%
+ test {\ifdimgreater{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimless{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth + \beforecolumnseparator +%
+ (\textwidth - \Lcolwidth - \Rcolwidth - \columnrulewidth - \beforecolumnseparator) * 1/3%
+ \relax%
+ }%
+ {}%
+ \ifboolexpr{%
+ test {\ifdimless{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimgreater{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth + \aftercolumnseparator +%
+ (\textwidth - \Lcolwidth - \Rcolwidth - \columnrulewidth - \aftercolumnseparator) * 1/3%
+ \relax%
+ }%
+ {}%
+ }%
+ {%
+ \ifboolexpr{%
+ test {\ifdimless{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimless{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth +%
+ (\textwidth - \Lcolwidth - \Rcolwidth - \columnrulewidth)*2/3% The total of the width before and after column separator
+ \relax%
+ }%
+ {}%
+ \ifboolexpr{%
+ test {\ifdimgreater{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimgreater{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth + \beforecolumnseparator + \aftercolumnseparator%
+ \relax%
+ }%
+ {}%
+ \ifboolexpr{%
+ test {\ifdimgreater{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimless{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth + \beforecolumnseparator +%
+ (\textwidth - \Lcolwidth - \Rcolwidth - \columnrulewidth - \beforecolumnseparator) * 1/2%
+ \relax%
+ }%
+ {}%
+ \ifboolexpr{%
+ test {\ifdimless{\beforecolumnseparator}{\z@}}%
+ and test {\ifdimgreater{\aftercolumnseparator}{\z@}}%
+ }%
+ {%
+ \global\intercolumns@width=\dimexpr%
+ \columnrulewidth + \aftercolumnseparator +%
+ (\textwidth - \Lcolwidth - \Rcolwidth - \columnrulewidth - \aftercolumnseparator) * 1/2%
+ \relax%
+ }%
+ {}%
+ }%
+}%
\newcommand{\print@leftcolumn}{%
\if\page@num>\page@numR%
\@l@dtempcntb=\page@num%
@@ -2381,15 +2548,9 @@
\newlength{\aftercolumnseparator}%
\setlength{\aftercolumnseparator}{-2pt}%
-\newcommand{\setwidthliketwocolumns@L}{%
- \newdimen\temp%
- \temp=\hsize%
- \hsize=\Lcolwidth%
- \advance\hsize\Rcolwidth%
- \advance\temp-\hsize%
- \multiply\temp by 2%
- \divide\temp by 3%
- \advance\hsize\temp%
+\newcommand{\setwidthliketwocolumns}{%
+ \get@intercolumns@width%As \columns is not necessary called before \setwidthliketwocolumns
+ \hsize=\dimexpr \Lcolwidth + \intercolumns@width + \Rcolwidth \relax%
}%
\newcommand{\setpositionliketwocolumns@L}{%
@@ -2399,16 +2560,6 @@
\newcommand{\setnotespositionliketwocolumns@L}{%
}%
-\newcommand{\setwidthliketwocolumns@C}{%
- \newdimen\temp%
- \temp=\hsize%
- \hsize=\Lcolwidth%
- \advance\hsize\Rcolwidth%
- \advance\temp-\hsize%
- \divide\temp by 2%
- \advance\hsize\temp%
-}%
-
\newcommand{\setpositionliketwocolumns@C}{%
\doinsidelinehook{\hfill}%
\renewcommand{\ledrlfill}{\hfill}%
@@ -2426,33 +2577,9 @@
\rightskip=-\temp%
}%
-\newcommand{\setwidthliketwocolumns@R}{%
- \newdimen\temp%
- \temp=\hsize%
- \hsize=\Lcolwidth%
- \advance\hsize\Rcolwidth%
- \advance\temp-\hsize%
- \multiply\temp by 2%
- \divide\temp by 3%
- \advance\hsize\temp%
-}%
-
\newcommand{\setpositionliketwocolumns@R}{%
\doinsidelinehook{\hfill}%
}%
-
-\newcommand{\setnotespositionliketwocolumns@R}{%
- \newdimen\temp%
- \newdimen\tempa%
- \temp=\hsize%
- \tempa=\Lcolwidth%
- \advance\tempa\Rcolwidth%
- \advance\temp-\tempa%
- \divide\temp by 2%
- \leftskip=\temp%
- \rightskip=-\temp%
-}%
-
\newcommand{\Columns@print@before@pstart}{%
\ifboolexpr{%
test{\ifcsstring{before@pstartL@\the\l@dpscL}{\at@every@pstart}}%