[Tex/LaTex] Cover pages for References, Appendix; fit them nicely in TOC

bibliographiestable of contentstocloft

Would you please take a look at this? If I ask piecemeal questions, solutions seem to break each other. Please advice.

I 'm trying to finish a thesis according to school requirements. Thesis has References and Appendices. TOC seems mostly OK, except for lines for References and Appendices.

enter image description here

Notice the upper case, normal size format of the REFERENCES lonely word.


According to the school, the toc should look like

enter image description here

For the MWE I took a lot of titlesec formatting out.

Sorry the crappy images, here is what the final part, from last page of text to end, should look like:

enter image description here

Page 39 in here is last page of text, page 40 says "REFERENCE", 41 is "REFERENCE" plus bibliographic items, 42 would be a continuation of bibliography (with numbering in upper left), next one (43) says "APPENDICES", 44 is a cover letter for APPENDIX A, 45 is text of Appendix A, 46 is cover for Appendix B, 47 is text of Appendix B.


So, References and Appendices should have a cover letter. References get a line in TOC. Appendices gets one but without leadings dots or page number. A and B (appendices) get their lines.


Sorry for adding to the minimal working example a ton of tocloft formatting, but I'm trying to ensure that the result looks good in the table of contents. For instance, just adding \part*{References} will add a new page, but has the undesirable effect of showing up badly in the table of contents.

 \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}

Best Answer

Since you are already using the package appendix, there is a very simple way.

First of all, let's define a new environment that behaves like appendices, but inserts a page for references (with uppercase letters and normal size font):

\newenvironment{references}{%
\renewcommand{\appendixtocname}{\bibname}%
\renewcommand{\appendixpagename}{\MakeUppercase{\normalsize\bibname}}%
\appendices}{%
\endappendices}

When you call your bibliography, you have to encase it inside the references environment:

\begin{references}
\bibliography{test}
\end{references}

Of course, you have to tell tocbibind that you don't want an entry for the bibliography in the ToC, otherwise you would have two entries:

\usepackage[nottoc,notbib]{tocbibind}

MWE:

\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} 

Output (ToC):

enter image description here

Output (References):

enter image description here

Related Question