我使用这个article
类(为了兼容性,我更喜欢坚持使用这个类),在双面模式下,目录占用两页(但如果代码能够处理任意数量的页面,那就更好了)。我想要
- 标题页(页面样式为空)
- 空白页(页面样式为空)
- 摘要(页面样式为空)
- 致谢(页面样式为空)(我不希望致谢与摘要在同一页上,而只在正面)
- 空白页(页面样式为空)(我不需要目录中的确认信息)
- toc p1(页面样式为空)
- toc p2(页面样式为空)
- 空白页(页面样式为空),以使第一部分从左侧开始,并且第一部分的第一页不是目录最后一页的正面
- 第一部分
通常,目录从左页开始(在书本视图中),但我的 MWE 显示并非如此。我尝试引入空白页,但\newpage
没有效果。
\documentclass[twoside, a4paper, 12pt]{article}
\usepackage{lipsum}
\makeatletter
\renewcommand\tableofcontents{%
\thispagestyle{empty}
\small
\section*{\contentsname
\@mkboth{\MakeUppercase\contentsname}
{\MakeUppercase\contentsname}}%
\@starttoc{toc}
\thispagestyle{empty}
}%
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\thispagestyle{empty}
\begin{title}
Title
\end{title}
\cleardoublepage
%\thispagestyle{empty}
%\clearpage
%\newpage
\newenvironment{mysum}
{
%\clearpage
\thispagestyle{empty}
\null\vfill
\begin{center}
\rmfamily\bfseries\scshape\selectfont Summary\end{center}
}
{\vfill\null}
\begin{mysum}
My summary.
\end{mysum}
\clearpage
\newenvironment{myack}
{
%\clearpage
\thispagestyle{empty}
\null\vfill
\begin{center}
\rmfamily\bfseries\scshape\selectfont Acknowledgements\end{center}
}
{\vfill\null}
\begin{myack}
\begin{center}
We thank you.
\end{center}
\end{myack}
\cleardoublepage
\newpage
\tableofcontents
\cleardoublepage
\pagenumbering{arabic}
\normalfont
\normalsize
\section{first section}
\lipsum[1-3]
\subsection{first subsection of the first section}
\lipsum[1-3]
\subsection{second subsection of the first section}
\lipsum[1-3]
\subsection{third subsection of the first section}
\lipsum[1-11]
\section{second section}
\lipsum[1-11]
\subsection{first subsection of the second section}
\lipsum[1-3]
\subsection{second subsection of the second section}
\lipsum[1-11]
\subsection{third subsection of the second section}
\lipsum[1-11]
\section{third section}
%\lipsum[1-3]
\subsection{first subsection of the third section}
\lipsum[1-3]
\subsection{second subsection of the third section}
\lipsum[1-3]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-3]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-22]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\section{first section}
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-3]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-22]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\section{third section}
%\lipsum[1-3]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-3]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-22]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-22]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-22]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\section{first section}
\lipsum[1-3]
\subsection{first subsection of the first section}
\lipsum[1-3]
\subsection{second subsection of the first section}
\lipsum[1-3]
\subsection{third subsection of the first section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-22]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-22]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\section{second section}
\lipsum[1-11]
\subsection{first subsection of the second section}
\lipsum[1-3]
\subsection{second subsection of the second section}
\lipsum[1-11]
\subsection{third subsection of the second section}
\lipsum[1-11]
\section{third section}
%\lipsum[1-3]
\subsection{first subsection of the third section}
\lipsum[1-3]
\subsection{second subsection of the third section}
\lipsum[1-3]
\subsection{third subsection of the third section}
\lipsum[1-11]
\section{first section}
\lipsum[1-3]
\subsection{first subsection of the first section}
\lipsum[1-3]
\subsection{second subsection of the first section}
\lipsum[1-3]
\subsection{third subsection of the first section}
\lipsum[1-11]
\section{second section}
\lipsum[1-11]
\subsection{first subsection of the second section}
\lipsum[1-3]
\subsection{second subsection of the second section}
\lipsum[1-11]
\subsection{third subsection of the second section}
\lipsum[1-11]
\end{document}
答案1
你基本上需要一个像这样的宏
\newcommand{\emptypage}{\clearpage\null\thispagestyle{empty}\clearpage}
它将插入一个空白页,正如名称和定义所暗示的那样。在解决方案中,它将用于在标题页后添加一个空白页,并将目录强制移到左页。(如果\emptypage
遵循,则\cleardoublepage
以下内容将自动显示在左页上。)
此外,该解决方案使用一个简单的 shipout 技巧(使用everyshi
包)来使“frontmatter”中的所有页面都“为空” - 从技术上讲,这对于该article
课程来说并不存在。必然地,您需要告诉 LaTeX frontmatter 在哪里结束,即 mainmatter 在哪里开始。因此,该解决方案提供了与课程\StartMainmatter
类似的解决方案。\mainmatter
book
还请注意自定义环境的细微变化。我应用它们主要是为了在文档主体中获得更紧凑的代码。
完整的解决方案
\documentclass[twoside,a4paper,12pt]{article}
\usepackage{everyshi}
\usepackage{lipsum}
\newcommand{\emptypage}{\clearpage\null\thispagestyle{empty}\clearpage}
\newenvironment{myack}
{\null\thispagestyle{empty} \vfill
\begin{center}
\rmfamily\bfseries\scshape Acknowledgements
\end{center}
\begin{center}}%
{\vfill\null
\end{center}
\cleardoublepage}
\newenvironment{mysum}
{\null\thispagestyle{empty} \vfill
\begin{center}
\rmfamily\bfseries\scshape Summary
\end{center}}%
{\vfill\null \clearpage}
\makeatletter
\renewcommand\tableofcontents{%
\thispagestyle{empty}
\small
\section*{\contentsname
\@mkboth{\MakeUppercase\contentsname}
{\MakeUppercase\contentsname}}%
\@starttoc{toc}
\thispagestyle{empty}}%
\newif\if@mainmatter %\mainmatterfalse
\newcommand{\StartMainmatter}{\@mainmattertrue \thispagestyle{plain}}
\EveryShipout{\if@mainmatter\else\thispagestyle{empty}\fi} %'empty' pagestyle in the frontmatterpages that are created through \clearpage, etc.
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{titlepage}
\null\thispagestyle{empty}
Title
\end{titlepage}
\emptypage
\begin{mysum}
\lipsum[1-3]
\end{mysum}
\begin{myack}
We thank you.
\end{myack}
\emptypage
\tableofcontents
\cleardoublepage
\StartMainmatter
\section{first section}
\lipsum[1-3]
\subsection{first subsection of the first section}
\lipsum[1-3]
\subsection{second subsection of the first section}
\lipsum[1-3]
\subsection{third subsection of the first section}
\lipsum[1-11]
\section{second section}
\lipsum[1-11]
\subsection{first subsection of the second section}
\lipsum[1-3]
\subsection{second subsection of the second section}
\lipsum[1-11]
\subsection{third subsection of the second section}
\lipsum[1-11]
\section{third section}
%\lipsum[1-3]
\subsection{first subsection of the third section}
\lipsum[1-3]
\subsection{second subsection of the third section}
\lipsum[1-3]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-3]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-22]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\section{first section}
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-3]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-22]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\section{third section}
%\lipsum[1-3]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-3]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-22]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-22]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-22]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\section{first section}
\lipsum[1-3]
\subsection{first subsection of the first section}
\lipsum[1-3]
\subsection{second subsection of the first section}
\lipsum[1-3]
\subsection{third subsection of the first section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-22]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\subsection{first subsection of the third section}
\lipsum[1-22]
\subsection{second subsection of the third section}
\lipsum[1-22]
\subsection{third subsection of the third section}
\lipsum[1-11]
\section{second section}
\lipsum[1-11]
\subsection{first subsection of the second section}
\lipsum[1-3]
\subsection{second subsection of the second section}
\lipsum[1-11]
\subsection{third subsection of the second section}
\lipsum[1-11]
\section{third section}
%\lipsum[1-3]
\subsection{first subsection of the third section}
\lipsum[1-3]
\subsection{second subsection of the third section}
\lipsum[1-3]
\subsection{third subsection of the third section}
\lipsum[1-11]
\section{first section}
\lipsum[1-3]
\subsection{first subsection of the first section}
\lipsum[1-3]
\subsection{second subsection of the first section}
\lipsum[1-3]
\subsection{third subsection of the first section}
\lipsum[1-11]
\section{second section}
\lipsum[1-11]
\subsection{first subsection of the second section}
\lipsum[1-3]
\subsection{second subsection of the second section}
\lipsum[1-11]
\subsection{third subsection of the second section}
\lipsum[1-11]
\end{document}