你能看看这个吗?如果我问一些零碎的问题,解决方案似乎会相互冲突。请提供建议。
我正在尝试按照学校要求完成一篇论文。论文有参考文献和附录。目录看起来基本没问题,除了参考文献和附录的行。
请注意“REFERENCES”这个单独单词的大写和正常大小格式。
根据学校的说法,目录应该是这样的
对于 MWE,我去掉了很多 titlesec 格式。
抱歉,图片比较糟糕,但最后一部分(从文本最后一页到结尾)应该是这样的:
这里的第 39 页是文本的最后一页,第 40 页写着“参考”,第 41 页是“参考”加书目项目,第 42 页是书目的延续(左上角有编号),下一页(第 43 页)写着“附录”,第 44 页是附录 A 的封面信,第 45 页是附录 A 的文本,第 46 页是附录 B 的封面,第 47 页是附录 B 的文本。
因此,参考文献和附录应该有封面。参考文献在目录中占一行。附录占一行,但没有前导点或页码。A 和 B(附录)各占一行。
抱歉,在最小工作示例中添加了大量 tocloft 格式,但我试图确保结果在目录中看起来不错。例如,只需添加 \part*{References} 即可添加新页面,但会产生不良效果,导致在目录中显示不佳。
\documentclass[oneside]{book}
\usepackage{titlesec}
\usepackage[nottoc]{tocbibind}
\usepackage{blindtext}
\usepackage[toc,page]{appendix}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For TOCLOFT
%
\usepackage{tocloft}
\makeatletter
\renewcommand{\@tocrmarg}{2.75em}
\makeatother
% Change format and legend of title of page
% "Table of Contents", centered and in all caps.
\setlength{\cftbeforetoctitleskip}{0.5in}
\setlength{\cftaftertoctitleskip}{0.2in}
\renewcommand{\contentsname}{Table of Contents}
\renewcommand{\cfttoctitlefont}{\hfill\MakeUppercase}
\renewcommand{\cftaftertoctitle}{\hfill}
% "listofTables", centered and all in caps.
\renewcommand{\cftlottitlefont}{\hfill\MakeUppercase}
\renewcommand{\cftafterlottitle}{\hfill}
%\renewcommand{\cftafterlottitle}{%
% \hfill \\[\baselineskip]\mbox{}Table\hfill Page}
% "List of Figures", centered and all in caps.
\setlength{\cftbeforeloftitleskip}{0.5in}
\setlength{\cftafterloftitleskip}{0.2in}
\renewcommand{\cftloftitlefont}{\hfill\MakeUppercase}
\renewcommand{\cftafterloftitle}{\hfill}
%\renewcommand{\cftafterloftitle}{\hfill\\[\baselineskip]\mbox{}Figure\hfill Page}
%\renewcommand{\cftafterloftitle}{\hfill}
% Change typesetting of chapter lines in TOC:%%%%%%%%%%%%%%%%%
% Create lead of dots for chapters
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\setlength{\cftbeforechapskip}{0em}
\renewcommand{\cftchapfont}{\scshape}
%\renewcommand{\cftchapleader}{\bfseries\cftdotfill{\cftchapdotsep}}
% Formats chapter page number as normal -- otherwise it woudl be bold.
\renewcommand{\cftchappagefont}{\normalfont}
% Get the Roman number for chapters to align...
% This comes from tocloft manual page 11.
\setlength{\cftchapnumwidth}{3em}
\newlength{\mylen}
\settowidth{\mylen}{\cftchappresnum\cftchapaftersnum} % extra space
\addtolength{\cftchapnumwidth}{\mylen} % add the extra space
\setlength{\mylen}{1.5em}
\renewcommand{\cftchappresnum}{\hfill}
% add a dot there
\renewcommand{\cftchapaftersnum}{.\hspace*{\mylen}}
\addtolength{\cftchapnumwidth}{\mylen}
% Change typesetting of section in TOC:%%%%%%%%%%%%%%%%%%%
\renewcommand{\cftsecfont}{\scshape}
\setlength{\cftsecindent}{6em}
% Typesetting for subsections. %%%%%%%%%%%%%%%%%%%%%%
\setlength{\cftsubsecindent}{7.5em}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For bibliography, nifty chunk from an example by Gonzalo Medina.
\usepackage{apacite}
\usepackage{natbib}
\usepackage{filecontents}
\begin{filecontents}{test.bib}
@article{author99,
title = {A fine title},
year = {1899},
author = {An Author and Another Bauthor and Yeta Cauthor},
journal = {Madness}
}
@article{author05,
title = {The best title},
year = {1905},
author = {An Author and More Dauthors and Whois Thisauthor and Heis Thatauthor},
journal = {Insanity}
}
\end{filecontents}
\bibliographystyle{apacite}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For appendices:
% this chunk was kindly suggested by Ruben,
% http://tex.stackexchange.com/questions/149110/how-to-add-cover-pages-to-appendices
\makeatletter
\def\@makeappendixhead#1{%
\null\vfill%
{\parindent \z@ \centering \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\MakeUppercase \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@
\fi
\fi
\interlinepenalty\@M
#1\par\nobreak
\vfill
\clearpage
}}
\g@addto@macro\appendices{\let\@makechapterhead\@makeappendixhead}
\makeatother
% And this chunk came from asking at
% http://tex.stackexchange.com/questions/152735/how-to-change-format-of-appendix-page-name , suggested by Torbjørn T.
\makeatletter
\renewcommand{\@chap@pppage}{%
\clear@ppage
\thispagestyle{plain}%
\if@twocolumn\onecolumn\@tempswatrue\else\@tempswafalse\fi
\null\vfil
\markboth{}{}%
{\centering
\interlinepenalty \@M
\normalfont \MakeUppercase
\appendixpagename\par}%
}
\makeatother
% yes I know, this is a sorry mess. I wish I knew enough LaTeX, and how
% to build complex documents.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Document
\begin{document}
\tableofcontents
\blinddocument
The time has come for all good men to come to the aid of their country test
\citep{author05}. According to \citet{author05}, the time has come for all good men to come to the aid of their country.
\chapter{that}
\bibliography{test}
\begin{appendices}
\blinddocument
\end{appendices}
\end{document}
答案1
由于您已经在使用该包appendix
,因此有一个非常简单的方法。
首先,让我们定义一个行为类似的新环境appendices
,但插入一个参考页面(使用大写字母和正常大小的字体):
\newenvironment{references}{%
\renewcommand{\appendixtocname}{\bibname}%
\renewcommand{\appendixpagename}{\MakeUppercase{\normalsize\bibname}}%
\appendices}{%
\endappendices}
当你调用你的参考书目时,你必须将其封装在references
环境中:
\begin{references}
\bibliography{test}
\end{references}
当然,你必须说明tocbibind
你不想在目录中添加参考书目条目,否则你会有两个条目:
\usepackage[nottoc,notbib]{tocbibind}
梅威瑟:
\documentclass[oneside]{book}
\usepackage{titlesec}
\usepackage[nottoc,notbib]{tocbibind}
\usepackage{blindtext}
\usepackage[toc,page]{appendix}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For TOCLOFT
%
\usepackage{tocloft}
\makeatletter
\renewcommand{\@tocrmarg}{2.75em}
\makeatother
% Change format and legend of title of page
% "Table of Contents", centered and in all caps.
\setlength{\cftbeforetoctitleskip}{0.5in}
\setlength{\cftaftertoctitleskip}{0.2in}
\renewcommand{\contentsname}{Table of Contents}
\renewcommand{\cfttoctitlefont}{\hfill\MakeUppercase}
\renewcommand{\cftaftertoctitle}{\hfill}
% "listofTables", centered and all in caps.
\renewcommand{\cftlottitlefont}{\hfill\MakeUppercase}
\renewcommand{\cftafterlottitle}{\hfill}
%\renewcommand{\cftafterlottitle}{%
% \hfill \\[\baselineskip]\mbox{}Table\hfill Page}
% "List of Figures", centered and all in caps.
\setlength{\cftbeforeloftitleskip}{0.5in}
\setlength{\cftafterloftitleskip}{0.2in}
\renewcommand{\cftloftitlefont}{\hfill\MakeUppercase}
\renewcommand{\cftafterloftitle}{\hfill}
%\renewcommand{\cftafterloftitle}{\hfill\\[\baselineskip]\mbox{}Figure\hfill Page}
%\renewcommand{\cftafterloftitle}{\hfill}
% Change typesetting of chapter lines in TOC:%%%%%%%%%%%%%%%%%
% Create lead of dots for chapters
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\setlength{\cftbeforechapskip}{0em}
\renewcommand{\cftchapfont}{\scshape}
%\renewcommand{\cftchapleader}{\bfseries\cftdotfill{\cftchapdotsep}}
% Formats chapter page number as normal -- otherwise it woudl be bold.
\renewcommand{\cftchappagefont}{\normalfont}
% Get the Roman number for chapters to align...
% This comes from tocloft manual page 11.
\setlength{\cftchapnumwidth}{3em}
\newlength{\mylen}
\settowidth{\mylen}{\cftchappresnum\cftchapaftersnum} % extra space
\addtolength{\cftchapnumwidth}{\mylen} % add the extra space
\setlength{\mylen}{1.5em}
\renewcommand{\cftchappresnum}{\hfill}
% add a dot there
\renewcommand{\cftchapaftersnum}{.\hspace*{\mylen}}
\addtolength{\cftchapnumwidth}{\mylen}
% Change typesetting of section in TOC:%%%%%%%%%%%%%%%%%%%
\renewcommand{\cftsecfont}{\scshape}
\setlength{\cftsecindent}{6em}
% Typesetting for subsections. %%%%%%%%%%%%%%%%%%%%%%
\setlength{\cftsubsecindent}{7.5em}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For bibliography, nifty chunk from an example by Gonzalo Medina.
\usepackage{apacite}
\usepackage{natbib}
\usepackage{filecontents}
\begin{filecontents}{test.bib}
@article{author99,
title = {A fine title},
year = {1899},
author = {An Author and Another Bauthor and Yeta Cauthor},
journal = {Madness}
}
@article{author05,
title = {The best title},
year = {1905},
author = {An Author and More Dauthors and Whois Thisauthor and Heis Thatauthor},
journal = {Insanity}
}
\end{filecontents}
\bibliographystyle{apacite}
\newenvironment{references}{%
\renewcommand{\appendixtocname}{\bibname}%
\renewcommand{\appendixpagename}{\MakeUppercase{\normalsize\bibname}}%
\appendices}{%
\endappendices}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Document
\begin{document}
\tableofcontents
\blinddocument
The time has come for all good men to come to the aid of their country test
\citep{author05}. According to \citet{author05}, the time has come for all good men to come to the aid of their country.
\chapter{that}
\begin{references}
\bibliography{test}
\end{references}
\begin{appendices}
\blinddocument
\end{appendices}
\end{document}
输出(目录):
输出(参考):