# Cover pages for References, Appendix; fit them nicely in TOC

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.

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

According to the school, the toc should look like

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:

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.

 \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

\setlength{\cftbeforetoctitleskip}{0.5in}
\setlength{\cftaftertoctitleskip}{0.2in}

\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

\setlength{\cftbeforechapskip}{0em}
\renewcommand{\cftchapfont}{\scshape}
% 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
\setlength{\mylen}{1.5em}
\renewcommand{\cftchappresnum}{\hfill}
\renewcommand{\cftchapaftersnum}{.\hspace*{\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},
}
@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,

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

• Do you also want this page to appear in toc? – Umz Jan 7 '14 at 2:55
• Hi UMZ, I saw your post and tested it. :) yes indeed. Meaning just one line for the whole reference "part", with the page number where the cover letter would be. – Juan Zuluaga Jan 7 '14 at 2:57
• I have just posted edited version to my previous post. If this does not solve your problem then let me know so I can delete this post. – Umz Jan 7 '14 at 3:41

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

\setlength{\cftbeforetoctitleskip}{0.5in}
\setlength{\cftaftertoctitleskip}{0.2in}

\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

\setlength{\cftbeforechapskip}{0em}
\renewcommand{\cftchapfont}{\scshape}
% 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
\setlength{\mylen}{1.5em}
\renewcommand{\cftchappresnum}{\hfill}
\renewcommand{\cftchapaftersnum}{.\hspace*{\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},
}
@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):

Output (References):

• Hi Karl. It is a very clean solution, but in my full tex file the References line does not show up in TOC. It bet this is due to some tinkering that was done to the appendix environment. This is another case where I don't know how to build a working minimal example. I'll add the patched appendix code that I think is interfering, and a a screenshot of the school requirements for the TOC. – Juan Zuluaga Jan 7 '14 at 21:38
• I think that I got it. That final chunk could be \begin{references} \begin{spacing}{0.9} \addcontentsline{toc}{chapter}{References} \bibliography{Seq} \end{spacing} \end{references} and it fixes it. Nice, very clean, thank you Karl! – Juan Zuluaga Jan 7 '14 at 22:57