3

I'm writing my Masters Thesis and I'm using quotchap package in my chapter tiles. However I want Bibliography title align at left instead of right like the other titles.

I've tried \renewcommand{\bibname}{\leftline{References}}. However, it alters the alignment in my table of contents and in the header of the bibliography pages.

Here goes a MWE:

\documentclass{book}

\usepackage{filecontents}

\usepackage[nottoc]{tocbibind}
\usepackage{tocloft}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}

\begin{filecontents}{\jobname.bib}
  @book{Knu86,
    author = {Knuth, Donald E.},
    year = {1986},
    title = {The \TeX book},
  }
\end{filecontents}

\RequirePackage[times]{quotchap}
\definecolor{chaptergrey}{gray}{0.75}

\begin{document}

\tableofcontents

\chapter{My chapter}

This is a reference \cite{Knu86}


\bibliographystyle{alpha}
\renewcommand{\bibname}{\leftline{Bibliography}} %this lines aligns left and shows how I want that bibliography title loks, but it changes the alignment in toc and in header of page 6. Comment to see how toc and the header of page 6 must look.
\bibliography{\jobname}
\newpage\clearpage\mbox{}\clearpage
\end{document}

1 Answer 1

1

This doesn't have anything to do with quotchap. Instead, it's about expanded macros making their way into the ToC where they don't belong. Specifically \leftline...

Having said that, it's easier in this case to let them migrate into the ToC, but just make them do nothing when you call \tableofcontents. Here's an example of this:

enter image description here

\documentclass{book}

\usepackage[nottoc]{tocbibind}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
  @book{Knu86,
    author = {Knuth, Donald E.},
    year = {1986},
    title = {The \TeX book},
  }
\end{filecontents}

\begin{document}

\begingroup
\renewcommand{\leftline}{}
\tableofcontents
\endgroup

\chapter{My chapter}

This is a reference \cite{Knu86}.

\bibliographystyle{alpha}
\renewcommand{\bibname}{\protect\leftline{Bibliography}}
\bibliography{\jobname}
\end{document}

Note how \tableofcontents is wrapped inside a \begingroup...\endgroup where \leftline is redefined to do nothing. Additionally, I've \protected \leftline in your \bibname redefinition, otherwise it's expanded when it's written to the .toc.

1
  • Thanks for the help. It solves my problem in toc but it doesn't solve my problem with page headers. I had added this line \newpage\clearpage\mbox{}\clearpage to show that the header in page 6 is not at right. In my thesis I have a bibliography with 3 pages, so I have that problem.
    – user59939
    Aug 4, 2014 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.