I am having following code, due to which the heading of bibliograpy/references is center align, if \titleformat{\chapter}[display]
is removed then it is left justified but all the chapter heading is also left justified, I want chapter heading center align with bibliography heading left justified.
\documentclass[12pt,a4paper]{report}
\usepackage{graphicx, subfigure}
\usepackage{amsmath}
%\renewcommand\bibname{References}
\usepackage{fancyhdr}
\makeatletter
\let\ps@plain\ps@fancy
\makeatother
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\LARGE\bfseries\centering}{\chaptertitlename\ \thechapter}{5pt}{\LARGE}
\titlespacing*{\chapter}{0pt}{-30pt}{10pt}
\titleformat{\section}
{\normalfont\normalsize\bfseries}{\thesection}{5pt}{\normalsize}
\titlespacing*{\section}{0pt}{2pt}{2pt}
\titleformat{\subsection}
{\normalfont\normalsize\bfseries}{\thesubsection}{5pt}{\normalsize}
\titlespacing*{\subsection}{0pt}{0pt}{0pt}
\titleformat{\subsubsection}
{\normalfont\normalsize\bfseries}{\thesubsubsection}{5pt}{\normalsize}
\titlespacing*{\subsubsection}{0pt}{0pt}{0pt}
\begin{document}
\include{chapter1}
\include{chapter2 }
\nocite{*}
\bibliographystyle{ieeetr}
\bibliography{xyz}
\addcontentsline{toc}{chapter}{References}
\end{document}
Best Answer
You can just repeat the definition of
\chapter
omitting\centering
must before the\bibliography
instruction, that is:By the way, adding
\addcontentsline{toc}{chapter}{References}
after the bibliography produces a wrong result if the bibliography is longer than one page. It is better to use thetocbibind
package to insert the bibliography/references in the table of contents