我正在使用\documentclass{article}
来制定一种a4paper
模式twoside
;一切都很好......嗯,差不多,在页码功能和边距设置之间的标准 LaTeX 默认值中存在一个小故障。
这是该问题的简化版本,初始页面用罗马数字编号;文档的主要部分然后用阿拉伯数字枚举。
在罗马数字和阿拉伯数字之间;双页跨页的边距权重从外移到内,或反之亦然;如果在偶数页上进行格式更改,则会出现问题,因为它会将计数重置为奇数。
\documentclass[a4paper, twoside]{article}
\begin{document}
\pagenumbering{gobble}
\title{Jabberwocky}
\author{Lewis Carroll}
\date{1871}
\maketitle
\newpage
\pagenumbering{roman}
\tableofcontents
\setcounter{tocdepth}{1}
This is an unfathomably long line of relative yet diminutive sense, such that
the totality of the page is spread with ink.
\newpage
\pagenumbering{arabic}
\section{Twas brillig}
`Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
\section{Beware the Jabberwock}
"Beware the Jabberwock, my son!
The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
The frumious Bandersnatch!"
\section{He took his vorpal sword}
He took his vorpal sword in hand:
Long time the manxome foe he sought --
So rested he by the Tumtum tree,
And stood awhile in thought.
\section{And, as in uffish}
And, as in uffish thought he stood,
The Jabberwock, with eyes of flame,
Came whiffling through the tulgey wood,
And burbled as it came!
\newpage
\section{One, two! One, two!}
One, two! One, two! And through and through
The vorpal blade went snicker-snack!
He left it dead, and with its head
He went galumphing back.
\section{And, has thou slain}
"And, has thou slain the Jabberwock?
Come to my arms, my beamish boy!
O frabjous day! Callooh! Callay!'
He chortled in his joy.
\section{Twas brillig}
`Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe.
\end{document}
这是 pdf 的屏幕截图;请注意标题页和内容页 i 之间并列边距的宽度差异,以及内容页和第 1 页之间的并列边距的宽度差异:
答案1
根据定义, \pagenumbering 将编号重置为 1。
标准包装将奇数放在正面页面,将偶数放在反面页面(对于从左到右的语言,正面 = 正面,偶数 = 反面)。
您可以用类似以下内容替换 \pagenumbering{arabic}:
\renewcommand{\thepage}{\arabic{page}}
它将命令 \thepage 更新为阿拉伯格式,而无需重置页码计数器。
如果您想要从某一页中放入特定数字,请使用:
\setcounter{page}{7} % sustitute 7 for the number you want.
答案2
我已经使用上面的评论和回复中给出的建议解决了我最初的难题;也许这将帮助其他人快速解决这个理解上的飞跃,这对于避免在使用 LaTeX 包时出现初期问题是相当必要的。
如上所述,编号系统与双面打印布局密不可分;因此,如果左右边距的宽度不相等,这会影响左右边距的放置,如果包含边距注释,也会影响边距注释的放置。要解决这个问题,有各种不同的技术,其中:以下方法对我来说很有效。
首先将标题页设置为\pagenumbering{gobble}
并将页码设置为\setcounter{page}{0}
;然后用罗马数字枚举序言和目录部分;通过命令强制在偶数页上结束\cleardoublepage
。使用命令使用印度数字对实际内容进行编号\pagenumbering{arabic}
;这给出了所需的结果。本质上;每个段必须以偶数结束,否则,在将页数重置为 1 之前;页边距会换边。在我的屏幕截图示例中,包含一个图像,它实现了相同的效果;请注意,命令\cleardoublepage
保留在代码中,但在不需要时它不会添加页面。
\documentclass[a4paper, twoside]{article}
\begin{document}
\pagenumbering{gobble}
\setcounter{page}{0}
\title{Jabberwocky}
\author{Lewis Carroll}
\date{1871}
\maketitle
\newpage
\pagenumbering{roman}
\tableofcontents
\setcounter{tocdepth}{1}
\cleardoublepage
\newpage
\pagenumbering{arabic}
\section{Twas brillig}
`Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
\section{Beware the Jabberwock}
"Beware the Jabberwock, my son!
The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
The frumious Bandersnatch!"
\section{He took his vorpal sword}
He took his vorpal sword in hand:
Long time the manxome foe he sought --
So rested he by the Tumtum tree,
And stood awhile in thought.
\section{And, as in uffish}
And, as in uffish thought he stood,
The Jabberwock, with eyes of flame,
Came whiffling through the tulgey wood,
And burbled as it came!
\newpage
\section{One, two! One, two!}
One, two! One, two! And through and through
The vorpal blade went snicker-snack!
He left it dead, and with its head
He went galumphing back.
\section{And, has thou slain}
"And, has thou slain the Jabberwock?
Come to my arms, my beamish boy!
O frabjous day! Callooh! Callay!'
He chortled in his joy.
\section{Twas brillig}
`Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe.
\end{document}
最终效果:(已添加图片)
\setcounter{page}{0}
如果您要求在每页的另一侧放置较大的边距,可以通过从标题页中省略并\cleardoublepage
改为包含、献词或者图像来实现。