使用 reledmac 引用不同流中的脚注

使用 reledmac 引用不同流中的脚注

我需要在一个流中拥有脚注的能力 能够引用另一个流中的脚注。定义了两个系列的脚注。我希望能够在这两个系列的注释之间进行交叉引用。因此,我可以让系列 A 中的脚注引用系列 B 中的脚注。

答案必须考虑到我的 MWE 正在“删除重复”第二个脚注流中的脚​​注(这个问题已经解决这里)。因此,这与其他尝试做同样的事情但没有增加复杂性的帖子略有不同。

\documentclass[12pt]{book}
\usepackage{fontspec}
\usepackage{reledmac}
\usepackage[polutonikogreek]{babel}
\usepackage{setspace}
\usepackage{etoolbox}
\usepackage{perpage} %the perpage package


%footnote sets arrangement
\arrangementX[A]{paragraph}
\arrangementX[B]{twocol}
\colalignX{\justifying}
\makeatletter
\bhooknoteX[A]{\setstretch {\setspace@singlespace}}
\bhookgroupX[A]{\setstretch {\setspace@singlespace}}
\makeatother
\let\footnote\footnoteA

\renewcommand{\thefootnoteA}{\roman{footnote}}
\interfootnotelinepenalty=10000

%This makes the footnote numbering restart for every page
\MakePerPage{footnoteB} %the perpage package command
\let\footnoteBlist\relax%Declare a list
\newcommand{\onlyonefootnoteB}[1]{%The command to be call instead of \footnoteB
    \xifinlist{\detokenize{#1}}{\footnoteBlist}%
    {}%True : does nothing
    {%False : add to the list + add footnote
        \listxadd{\footnoteBlist}{\detokenize{#1}}%
        \footnoteB{#1}%
    }%
}

\bhookgroupX[B]{%
    \global\let\footnoteBlist\relax%Declare a list
}


\begin{document}

Lorem ipsum dolor\footnote{test text A} sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\onlyonefootnoteB{test 1} aliqua. Ut enim ad minim veniam, quis nostrud\footnote{test text B} exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor\footnote{test text A} in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur\onlyonefootnoteB{test 2} sint occaecat cupidatat non proident,\onlyonefootnoteB{test 1} sunt in culpa qui officia deserunt mollit anim id est laborum.

\end{document}

答案1

\ref通过古典和,这是可能的\label

就你的情况而言,问题在于你

\let\footnote\footnoteA
\renewcommand{\thefootnoteA}{\roman{footnote}}

所以。1. 您说该\footnote命令与命令 2 相同\footnoteA。但是您使用计数器的值footnote 来打印 A 系列的脚注编号,而不是应该使用的计数器的值footnoteA。事实上,您可以看到,使用您的代码,脚注 A 没有排版数字。

所以只需\renewcommand{\thefootnoteA}{\roman{footnote}}改为\renewcommand{\thefootnoteA}{\roman{footnoteA}}

这是 crossref 的 MWE。

\documentclass[12pt]{book}
\usepackage{fontspec}
\usepackage{reledmac}
\usepackage[polutonikogreek]{babel}
\usepackage{setspace}
\usepackage{etoolbox}
\usepackage{perpage} %the perpage package


%footnote sets arrangement
\arrangementX[A]{paragraph}
\arrangementX[B]{twocol}
\colalignX{\justifying}
\makeatletter
\bhooknoteX[A]{\setstretch {\setspace@singlespace}}
\bhookgroupX[A]{\setstretch {\setspace@singlespace}}
\makeatother
\let\footnote\footnoteA

\renewcommand{\thefootnoteA}{\roman{footnoteA}}
\interfootnotelinepenalty=10000

%This makes the footnote numbering restart for every page
\MakePerPage{footnoteB} %the perpage package command
\let\footnoteBlist\relax%Declare a list
\newcommand{\onlyonefootnoteB}[1]{%The command to be call instead of \footnoteB
    \xifinlist{\detokenize{#1}}{\footnoteBlist}%
    {}%True : does nothing
    {%False : add to the list + add footnote
        \listxadd{\footnoteBlist}{\detokenize{#1}}%
        \footnoteB{#1}%
    }%
}

\bhookgroupX[B]{%
    \global\let\footnoteBlist\relax%Declare a list
}


\begin{document}
\ref{footnoteA:crossref}

Lorem ipsum dolor\footnote{test text A} sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\onlyonefootnoteB{test 1} aliqua. Ut enim ad minim veniam, quis nostrud\footnote{\label{footnoteA:crossref}test text B} exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor\footnote{test text A} in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur\onlyonefootnoteB{test 2} sint occaecat cupidatat non proident,\onlyonefootnoteB{test 1 (see \ref{footnoteA:crossref})} sunt in culpa qui officia deserunt mollit anim id est laborum.

\end{document}

相关内容