Page LayoutModify Bibliography Title

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Xabier
Posts: 3
Joined: Wed Nov 16, 2011 1:17 pm

Modify Bibliography Title

Post by Xabier »

Hello everyone,

I am writing my PhD thesis and I am dealing with some problems with the bibliography title style. I have redefined the heading title of ToC, LoF and LoT as:

Code: Select all

\makeatletter
\def\tableofcontents{%
\newpage
\thispagestyle{plain}
\vspace*{24.5pt}
\rule{\textwidth}{0.4pt}
\begin{flushright}
\vspace*{15.6pt}
\bfseries\Huge Contents
\end{flushright}
\vspace*{-21.1pt}
\rule{\textwidth}{0.5mm}
%\vspace*{0.3in}
\@mkboth{Contents}{Contents}
\fancyhf{}
\fancyhead[LO]{\textbf{\leftmark}}
\fancyhead[RE]{\textbf{\rightmark}}
\fancyfoot{} % clear all footer fields
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
\@starttoc{toc}
}
\makeatother
and I would like to have the same effect in the Bibliography heading. Has anyone some idea?

Thank you very much in advance!

Xabi
Last edited by localghost on Wed Nov 16, 2011 5:38 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Modify Bibliography Title

Post by localghost »

It would be helpful if you at least tell us the used document class. Should this weird redefinition affect chapter headings in general or only the mentioned lists?


Best regards and welcome to the board
Thorsten
Xabier
Posts: 3
Joined: Wed Nov 16, 2011 1:17 pm

Modify Bibliography Title

Post by Xabier »

Dear Thorsten,

I am using the report class. I am using this common code with the numbered chapters, similar to the ger style in the memoir class, with nice results:

Code: Select all

\newcommand{\bigrule}{\titlerule[0.5mm]}
\titleformat{\chapter}[display] % cambiamos el formato de los capítulos
{\bfseries\Huge} % por defecto se usarán caracteres de tamaño \Huge en negrita
{% contenido de la etiqueta
 \titlerule % línea horizontal
 \filleft % texto alineado a la derecha
 \Large\chaptertitlename\ % "Capítulo" o "Apéndice" en tamaño \Large en lugar de \Huge
 \Large\thechapter} % número de capítulo en tamaño \Large
{0mm} % espacio mínimo entre etiqueta y cuerpo
{\filleft} % texto del cuerpo alineado a la derecha
[\vspace{0.5mm} \bigrule]
But the problem comes with the no numbered "chapters", i.e., the toc, the lot, the lof and the bibliography. For the first three I have fixed the problem with the code of the first post, while for the bibliography I am working on it.

I hope this post has made the problem a little bit more clear.

Regards
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Modify Bibliography Title

Post by localghost »

With a small modification your new headings format also works for unnumbered chapters.

Code: Select all

\documentclass[11pt,twoside]{report}
\usepackage[T1]{fontenc}
\usepackage[pagestyles,raggedright]{titlesec}

\titleformat{\chapter}[display]
{\titlerule\bfseries\Huge}
{\filleft\Large\chaptertitlename\ \Large\thechapter}
{0mm}
{\filleft}
[\vspace{0.5mm}{\titlerule[0.5mm]}]

\newpagestyle{main}[\bfseries]{%
  \headrule
  \sethead[\chaptertitlename\ \thechapter.\quad\chaptertitle][][]{}{}{\thesection.\quad\sectiontitle}
  \setfoot[][\thepage][]{}{\thepage}{}
}
\pagestyle{main}

\begin{document}
\tableofcontents
\listoffigures
\listoftables

\chapter{Foo}

\begin{thebibliography}{9}
  \bibitem{key} Bibliography Entry  
\end{thebibliography}
\end{document}
And if you are using the titlesec package, you actually don't need the fancyhdr package, because the first one also manages page styles (see code above).
Xabier
Posts: 3
Joined: Wed Nov 16, 2011 1:17 pm

Re: Modify Bibliography Title

Post by Xabier »

Thank you!

It works fine and it is pretty much closer to my initial idea! But I would like to insert in the unnumbered chapters a blank line of the same height as the line in which appears the text "Chapter 1" or "Appendix A" in the numbered ones.
Is it possible?

Thank you!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Modify Bibliography Title

Post by localghost »

The only idea I have is to define some kind of switches to balance the missing content in the heading of unnumbered chapters.

Code: Select all

\documentclass[11pt,twoside]{report}
\usepackage[T1]{fontenc}
\usepackage[pagestyles,raggedright]{titlesec}

\newlength{\drop}
\newcommand{\numbered}{\setlength{\drop}{0pt}}
\newcommand{\unnumbered}{\setlength{\drop}{4.5ex}}

\titleformat{\chapter}[display]
{\titlerule\bfseries\Huge\vspace{\drop}}
{\filleft\Large\chaptertitlename\ \thechapter}
{0mm}
{\filleft}
[\vspace{0.5mm}{\titlerule[0.5mm]}]

\newpagestyle{main}[\bfseries]{%
  \headrule
  \sethead[\chaptertitlename\ \thechapter.\quad\chaptertitle][][]{}{}{\thesection.\quad\sectiontitle}
  \setfoot[][\thepage][]{}{\thepage}{}
}
\pagestyle{main}

\begin{document}
  \unnumbered
  \tableofcontents
  \listoffigures
  \listoftables

  \numbered
  \chapter{Foo}

  \unnumbered
  \begin{thebibliography}{9}
    \bibitem{key} Bibliography Entry  
  \end{thebibliography}
\end{document}
Post Reply