我正在使用book
文档类,并想删除它在标题和目录后添加的空白页。实际上,我并不介意整个文档中有任何空白页,但是这两个地方目前有空白。我尝试按照许多 Stackoverflow 答案的建议重新定义 /cleardoublepage,但我仍然看到新页面,感觉我一定是做错了什么或缺少了包。
以下是我目前为我的 tex 所做的设置:
\documentclass[12pt,oneside,openany]{book}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in,includeheadfoot,asymmetric]{geometry}
\usepackage{makeidx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\rhead{Assignment}
\lhead{}
\title{Assignment}
\author{Person One \and Person 2}
\begin{document}
\begingroup
\let\cleardoublepage\relax
\let\clearpage\relax
\maketitle
\endgroup
\frontmatter
\begingroup
\let\cleardoublepage\relax
\let\clearpage\relax
\tableofcontents
\endgroup
\mainmatter
\chapter{Report}
\end{document}
答案1
额外的页面是由重新定义的\chapter
组之外的页面生成的。\cleardoublepage
\documentclass[12pt,oneside,openany]{book}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in,includeheadfoot,asymmetric]{geometry}
\usepackage{makeidx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\rhead{Assignment}
\lhead{}
\title{Assignment}
\author{Person One \and Person 2}
\let\cleardoublepage=\clearpage
\begin{document}
\maketitle
\frontmatter
\tableofcontents
\mainmatter
\chapter{Report}
\end{document}
一个稍微安全的选择是使用报告类并直接使用页码。
\documentclass[12pt,oneside,openany]{report}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in,includeheadfoot,asymmetric]{geometry}
\usepackage{makeidx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\rhead{Assignment}
\lhead{}
\title{Assignment}
\author{Person One \and Person 2}
\begin{document}
\maketitle
\clearpage
\renewcommand{\thepage}{\roman{page}}
\setcounter{page}{1}
\tableofcontents
\clearpage
\renewcommand{\thepage}{\arabic{page}}
\setcounter{page}{1}
\chapter{Report}
\end{document}