在 reledmac 中使用节和行号标记脚注

在 reledmac 中使用节和行号标记脚注

我正在尝试评估将一个我仍在使用的旧项目迁移到 的可行性ledmacreledmac一个关键要求是使用节和行号标记脚注,包中ledmac有示例 A.7,爱尔兰诗句,ledbraonain.tex我只是根据自己的需要对其进行了轻微的调整。

正如所料,我的文件在更改为 后就无法再编译\usepackage{ledmac},看起来所需的修改并不简单。此外,浏览reledmac文档后,我没有找到任何可以满足我要求的示例。

在以下一个相当简化但肯定不是最小的文件中,我的真实项目包含对诗句的两段评论和四个设备寄存器。

\documentclass{memoir}
\usepackage{fontspec}
\usepackage{reledmac}
\usepackage{amssymb}%For Sigma and friends.

\newcommand{\sn}{SN757}

\newcounter{stanzanum}
\setcounter{stanzanum}{4}
%\newlength{\stanzaindentbase} Obviously already defined.
\setlength{\stanzaindentbase}{20pt} %Play with it later.
\setstanzaindents{4,1,2,1,2,3,3,1,2,1}


%%% Want to label the footnotes with the stanza and line number
%%% We'll use \linenum to replace the sub-line number
%%% with the stanza number, redefining \edtext to do this
%%% automatically for us.
%%%%%%%%%%%%%%%%%%%%%%%%%%
%\makeatletter
%
%\renewcommand{\edtext}[2]{\leavevmode
%  \begingroup
%    \no@expands
%    \xdef\@tag{#1}%
%    \set@line
%    \global\insert@count=0
%    \ignorespaces \linenum{||\the\c@stanzanum}#2\relax
%    \flag@start
%  \endgroup
%  #1%
%  \ifx\end@lemmas\empty \else
%    \gl@p\end@lemmas\to\x@lemma
%    \x@lemma
%    \global\let\x@lemma=\relax
%  \fi
%  \flag@end}
%
%%% We need only a very simple macro for footnote numbers,
%%% to produce the stanza number (sub-line) then the line number.
%\def\printstanzalines#1|#2|#3|#4|#5|#6|#7|{\begingroup
%%  #3\fullstop \linenumrep{#2} % Got rid of the full stop
%#3\linenumrep{#2}
%  \endgroup}
%\let\oldprintlines\printlines
%
%\makeatother



\begin{document}

\beginnumbering
\linenumberstyle{alph}
{\large 
\stanza 

kim akāṇḍa eva jagatāṃ \edtext{viparyayād}{\Bfootnote{$\Sigma$; viparyād \sn}} &
iva śūnyatām \edtext{upagatāḥ}{\Bfootnote{E$_{DR}$\sn D$_{BC^{pc}DE}$; upagatā Ś$_C$JD$_{AC^{ac}}$.}} stha śuṣmiṇaḥ | &
kathayanti vo hṛdaya\edtext{śalyaduḥkhitām}{\Bfootnote{E$_D$\sn Ś$_{CD}D_{BCD}$; śalyaduḥkhatām JD$_{AF}$; duḥkhaśalyatām D$_E$ }} &
adhunā mukhacchavaya eva dhūsarāḥ || 5 || \&

}
\endnumbering


\end{document}

答案1

reledmac 2.1.0 版本现已发布,下载地址:https://github.com/maieul/ledmac/archive/2.1.0-2.2.0.zip并且,我希望下周发送 CTAN,提供完成您需要的操作的工具。

  1. \numberstanzatrue启用自动节编号。
  2. \Xstanza在注释中添加此号码。
  3. \Xstanzaseparator{.}更改节号和行号之间的分隔符。

这里是 MWE

\documentclass{memoir}
\usepackage{fontspec}
\usepackage{reledmac}

\usepackage{amssymb}%For Sigma and friends.

\newcommand{\sn}{SN757}

\setlength{\stanzaindentbase}{20pt} %Play with it later.
\setstanzaindents{4,1,2,1,2,3,3,1,2,1}


\numberstanzatrue
\Xstanza
\Xstanzaseparator{.}
\begin{document}

\beginnumbering
\linenumberstyle{alph}
{\large 
\stanza 
 kim akāṇḍa eva jagatāṃ \edtext{viparyayād}{\Bfootnote{$\Sigma$; viparyād \sn}} &
iva śūnyatām \edtext{upagatāḥ}{\Bfootnote{E$_{DR}$\sn D$_{BC^{pc}DE}$; upagatā Ś$_C$JD$_{AC^{ac}}$.}} stha śuṣmiṇaḥ | &
kathayanti vo hṛdaya\edtext{śalyaduḥkhitām}{\Bfootnote{E$_D$\sn Ś$_{CD}D_{BCD}$; śalyaduḥkhatām JD$_{AF}$; duḥkhaśalyatām D$_E$ }} &
adhunā mukhacchavaya eva dhūsarāḥ || 5 || \&

\stanza 
 kim akāṇḍa eva jagatāṃ \edtext{viparyayād}{\Bfootnote{$\Sigma$; viparyād \sn}} &
iva śūnyatām \edtext{upagatāḥ}{\Bfootnote{E$_{DR}$\sn D$_{BC^{pc}DE}$; upagatā Ś$_C$JD$_{AC^{ac}}$.}} stha śuṣmiṇaḥ | &
kathayanti vo hṛdaya\edtext{śalyaduḥkhitām}{\Bfootnote{E$_D$\sn Ś$_{CD}D_{BCD}$; śalyaduḥkhatām JD$_{AF}$; duḥkhaśalyatām D$_E$ }} &
adhunā mukhacchavaya eva dhūsarāḥ || 5 || \&

}
\endnumbering


\end{document}

相关内容