我试图了解\marks
、\firstmarks
和如何\botmarks
与两列输出一起工作。
在以下 MWE 中,标题按我想要的方式工作,输出一列。右侧标记是第 1 页的最后一节,左侧标记是第 2 页的第一节。
但是当我引入两列(使用包multicols
或twocolumn
类选项)时,事情就出错了。
第 3 页和第 4 页存在两个问题:
- 第 3 页的标题应为约翰福音 1:12, 不是约翰福音 1:13以匹配页面上的最后一节。(这个错误似乎只发生在
multicols
包中,而不是twocolumn
类选项中。) - 第 4 页的标题应该是约翰福音 1:13, 不是约翰福音 1:18以匹配页面上的第一节。(此错误在
multicols
包和twocolumn
类选项中都会发生。)
平均能量损失
\documentclass{book}
\usepackage{microtype}
\usepackage{multicol}
\usepackage[a6paper]{geometry}
\newmarks\versemark
\def\leftmark{\firstmarks\versemark}
\def\rightmark{\botmarks\versemark}
\newcommand*{\vs}[1]{%
\textsuperscript{#1}%
\marks\versemark{John 1:#1}%
}
\hyphenation{dwell-ing}
\newcommand{\prologue}{%
\vs{1}In the beginning was the Word, and the Word was with God, and the Word
was God. \vs{2}He was with God in the beginning. \vs{3}Through him all
things were made; without him nothing was made that has been made. \vs{4}In
him was life, and that life was the light of all mankind. \vs{5}The light
shines in the darkness, and the darkness has not overcome it.
\vs{6}There was a man sent from God whose name was John. \vs{7}He came as a
witness to testify concerning that light, so that through him all might
believe. \vs{8}He himself was not the light; he came only as a witness to
the light.
\vs{9}The true light that gives light to everyone was coming into the world.
\vs{10}He was in the world, and though the world was made through him, the
world did not recognise him. \vs{11}He came to that which was his own, but
his own did not receive him. \vs{12}Yet to all who did receive him, to those
who believed in his name, he gave the right to become children of
God---\vs{13}children born not of natural descent, nor of human decision or
a husband’s will, but born of God.
\vs{14}The Word became flesh and made his dwelling among us. We have seen
his glory, the glory of the one and only Son, who came from the Father, full
of grace and truth.
\vs{15}(John testified concerning him. He cried out, saying, ‘This is the
one I spoke about when I said, “He who comes after me has surpassed me
because he was before me.”\,’) \vs{16}Out of his fullness we have all
received grace in place of grace already given. \vs{17}For the law was given
through Moses; grace and truth came through Jesus Christ. \vs{18}No one has
ever seen God, but the one and only Son, who is himself God and is in the
closest relationship with the Father, has made him known.
}
\begin{document}
\begin{center}
\huge John
\end{center}
\prologue
\clearpage
\begin{center}
\huge John
\end{center}
\begin{multicols}{2}
\prologue
\end{multicols}
\end{document}
答案1
multicol 和 twocolumn 多次调用输出例程,这会改变标记。您最好坚持使用标准的 latex 标记命令,因为内核和 multicol 都包含在这种情况下正确重置它们的代码(例如在 multicol 中搜索keptmarks
)。
本文档显示了您的标记与标准 \left/\rightmark 之间的区别:
\documentclass{book}
\usepackage[a6paper]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lhead{\tiny fv: \firstversemark, bv: \botversemark, lm: \leftmark, rm: \rightmark}
\usepackage{microtype}
\usepackage{multicol}
\newmarks\versemark
\def\firstversemark{\firstmarks\versemark}
\def\botversemark{\botmarks\versemark}
\newcommand*{\vs}[1]{%
\textsuperscript{#1}%
\marks\versemark{John 1:#1}%
\markboth{John 1:#1}{John 1:#1}%
}
\hyphenation{dwell-ing}
\newcommand{\prologue}{%
\vs{1}In the beginning was the Word, and the Word was with God, and the Word
was God. \vs{2}He was with God in the beginning. \vs{3}Through him all
things were made; without him nothing was made that has been made. \vs{4}In
him was life, and that life was the light of all mankind. \vs{5}The light
shines in the darkness, and the darkness has not overcome it.
\vs{6}There was a man sent from God whose name was John. \vs{7}He came as a
witness to testify concerning that light, so that through him all might
believe. \vs{8}He himself was not the light; he came only as a witness to
the light.
\vs{9}The true light that gives light to everyone was coming into the world.
\vs{10}He was in the world, and though the world was made through him, the
world did not recognise him. \vs{11}He came to that which was his own, but
his own did not receive him. \vs{12}Yet to all who did receive him, to those
who believed in his name, he gave the right to become children of
God---\vs{13}children born not of natural descent, nor of human decision or
a husband’s will, but born of God.
\vs{14}The Word became flesh and made his dwelling among us. We have seen
his glory, the glory of the one and only Son, who came from the Father, full
of grace and truth.
\vs{15}(John testified concerning him. He cried out, saying, ‘This is the
one I spoke about when I said, “He who comes after me has surpassed me
because he was before me.”\,’) \vs{16}Out of his fullness we have all
received grace in place of grace already given. \vs{17}For the law was given
through Moses; grace and truth came through Jesus Christ. \vs{18}No one has
ever seen God, but the one and only Son, who is himself God and is in the
closest relationship with the Father, has made him known.
}
\begin{document}
\begin{center}
\huge John
\end{center}
\prologue
\clearpage
\begin{center}
\huge John
\end{center}
\begin{multicols}{2}
\prologue
\end{multicols}
\end{document}