![\markboth 在 reledmac 节中产生可见输出](https://linux22.com/image/461303/%5Cmarkboth%20%E5%9C%A8%20reledmac%20%E8%8A%82%E4%B8%AD%E4%BA%A7%E7%94%9F%E5%8F%AF%E8%A7%81%E8%BE%93%E5%87%BA.png)
我的理解\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}
有谁知道我可以在 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}
```