\markboth 在 reledmac 节中产生可见输出

\markboth 在 reledmac 节中产生可见输出

我的理解\markboth是,它设置了用于标题的标签,但它不会立即在文档中产生任何输出。但是,我发现,如果您\markboth在 reledmac 节中调用,它会在文档中产生可见的输出。

下面是我所指的输出类型的示例: 在此处输入图片描述 如您所见,\markboth从 reledmac 节内部调用会在文档中产生一行空白的输出。

演示此内容的 MWE 如下:

\documentclass[10pt,openany]{book}

\usepackage{reledmac}
\usepackage{fancyhdr}
\usepackage[paperheight=9in,paperwidth=6in,asymmetric]{geometry}

\pagestyle{fancy}
\fancyhead[LE,RO]{\rightmark--\leftmark}

\newcommand{\showverse}[2]{%
    \raisebox{0.5ex}{#2}\nobreak\hspace*{0.2em}%
}

\setstanzaindents{2,1}
\setcounter{stanzaindentsrepetition}{1}
\setlength{\stanzaindentbase}{30pt}
\firstlinenum{100}

\begin{document}

\markboth{1:1}{1:1}\showverse{1}{1}Now is the time for all good men to come to the aid of their country.
\markboth{1:1}{1:1}\showverse{1}{2}Now is the time for all good men to come to the aid of their country.
\markboth{1:1}{1:1}\showverse{1}{3}Now is the time for all good men to come to the aid of their country.

\beginnumbering
\stanza
This is a line of verse&
\markboth{1:4}{1:4}\showverse{1}{4}And another line of verse& % <=== \markboth produces visible output
And the last line of verse\&
\endnumbering

\end{document}

删除该\markboth命令会产生以下输出: 在此处输入图片描述

有谁知道我可以在 reledmac 节中调用而不产生此空行输出的方法吗\markboth?另外,有谁看到我做错了什么导致这种情况?

答案1

\doinsidethislinehook您必须按照手册第 5.7 节的说明使用。

\documentclass[10pt,openany]{book}

\usepackage{reledmac}
\usepackage{fancyhdr}
\usepackage[paperheight=9in,paperwidth=6in,asymmetric]{geometry}

\pagestyle{fancy}
\fancyhead[LE,RO]{\rightmark--\leftmark}

\newcommand{\showverse}[2]{%
    \raisebox{0.5ex}{#2}\nobreak\hspace*{0.2em}%
}

\setstanzaindents{2,1}
\setcounter{stanzaindentsrepetition}{1}
\setlength{\stanzaindentbase}{30pt}
\firstlinenum{100}

\begin{document}

\markboth{1:1}{1:1}\showverse{1}{1}Now is the time for all good men to come to the aid of their country.
\markboth{1:1}{1:1}\showverse{1}{2}Now is the time for all good men to come to the aid of their country.
\markboth{1:1}{1:1}\showverse{1}{3}Now is the time for all good men to come to the aid of their country.

\beginnumbering
\stanza
This is a line of verse&
\doinsidethislinehook{\markboth{1:4}{1:4}}\showverse{1}{4}And another line of verse& % <=== \markboth produces visible output
And the last line of verse\&
\endnumbering

\end{document}
```

相关内容