[Tex/LaTex] titlesec – set top margin for the appendix and bibliography

appendicesbibliographiessectioningspacingtitlesec

A while ago I was helped using titlesec to format the chapter title for my thesis. Today a reviewer says that the appendix and the bibliography need 1in top margin. How do I do it? Thanks.

\documentclass[letter, 12pt]{report}
\usepackage{cite}
\usepackage{amsthm}
\usepackage{amsmath}
\newtheorem{definition}{Definition}
\usepackage[tight,footnotesize]{subfigure}
\usepackage{graphicx}
\usepackage{fullpage}
\usepackage[breaklinks = true]{hyperref} 
\usepackage{color}
\usepackage{caption}
\usepackage{url}
%\usepackage{lscape}
%\usepackage{times}
%\usepackage{minted}
%\usepackage{listings}

\usepackage{textcomp}
\definecolor{listinggray}{gray}{0.9}
\definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
\usepackage{setspace}
\doublespacing
\usepackage{indentfirst}
\usepackage[top=1.0in, bottom=1.25in, left=1.5in, right=1.0in]{geometry}

\usepackage{etoolbox}

\patchcmd{\thebibliography}{\chapter*{\bibname}}{\chapter*{\MakeUppercase{\bibname}}}{}{}

\usepackage{titlesec}
 \titlespacing*{\chapter}{0pt}{1in}{20pt}
 \titleformat{\chapter}[display]
   {\centering\normalfont\normalsize}{\MakeUppercase{\chaptertitlename} \thechapter}{0pt}{\small}

 \titleformat{\section}
     {\normalfont\normalsize\bfseries}{\thesection}{1em}{}
 \titleformat{\subsection}
     {\normalfont\normalsize\bfseries}{\thesubsection}{1em}{}
 \titleformat{\subsubsection}
     {\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{}

\begin{document}
\raggedright
\setlength{\parindent}{1cm}
\chapter{INTRODUCTION}
\chapter{PROBLEM}
\appendix

\chapter{CODES}
\chapter{LIST OF PUBLICATIONS}

\begin{thebibliography}{100}
\bibitem{Niesen}
Niesen.
\newblock Social networks/blogs now account for one in every four and a half minutes online.
\newblock {\em http://blog.nielsen.com/nielsenwire/global/social-media-accounts-for-22-percent-of-time-online/}.
\newblock (June 2010).
\end{thebibliography}
\end{document}

Best Answer

In your example, the space before the appendix chapters and the unnumbered bibliography is the same as for the main chapters (presumably 1in, as you specified in \titlespacing*). Should you need a different space starting with the appendix chapters (though that seems inconsistent), issue another \titlespacing* immediately after \appendix in the document body.

Note that in the "before code" argument of \titleformat, "[t]he very last command can take an argument, which is the title text" (manual, p. 4). That is, you may use \MakeUppercase and do without writing chapter names capitalized. Also note that (within titlesec commands) you should replace \centering with \filcenter to ensure correct left and right spacing.

\documentclass[12pt]{report}

\usepackage[doublespacing]{setspace}

\usepackage{titlesec}
\titlespacing*{\chapter}{0pt}{1in}{20pt}
\titleformat{\chapter}[display]
    {\filcenter\normalfont\normalsize}{\MakeUppercase{\chaptertitlename} \thechapter}{0pt}
    {\small\MakeUppercase}

\begin{document}

\chapter{Introduction}

\appendix
\titlespacing*{\chapter}{0pt}{0.5in}{20pt}

\chapter{Codes}

\begin{thebibliography}{100}
\bibitem{Niesen}
Niesen.
\newblock Social networks/blogs now account for one in every four and a half minutes online.
\newblock {\em http://blog.nielsen.com/nielsenwire/global/social-media-accounts-for-22-percent-of-time-online/}.
\newblock (June 2010).
\end{thebibliography}

\end{document}