# How to keep a code in a bbl file?

In my previously asked question about changing the chaptermark in a bibliography, I got a nice answer but unfortunately I need to place the code in my BBL file. This means I need to rewrite my code every run. Is there a solution for this, new, problem?

My first problem was: I'm writing my thesis. The references span across multiple pages. On the top of the second (and further) page there is a header (that appears on every page where a new chapter does not begin). The header informs a reader about the current chapter he/she is reading. But in the references it says "Algemene conclusies", which is my last chapter. I would like this not to appear in the references and say "Bibliografie" instead.

This is my code for the preamble:

    \documentclass[11pt, a4paper, twoside, openright]{report}

%\usepackage[left=2.5cm,top=3cm,right=2.5cm,bottom=3cm]{geometry}

\usepackage{xspace}
\usepackage{setspace} \onehalfspacing
\usepackage[dutch]{babel}
\usepackage{graphicx}
\usepackage[latin1]{inputenc}
\usepackage{subfigure}
\usepackage{appendix}
\usepackage{amsmath}
\usepackage{pdfpages}
\usepackage{pdflscape}
\usepackage{capt-of}
\usepackage{longtable}
\usepackage[square]{natbib}
\usepackage{lscape}
\usepackage{url}
\usepackage{tocvsec2}
\usepackage[hang,small,bf]{caption}
\usepackage{pslatex}
\usepackage{titlesec}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}{}}
\fancyhf{}

%\renewcommand{\sectionmark}[1]{\markright{#1}}
\renewcommand{\baselinestretch}{1.2}

\setlength{\parindent}{0cm}
\setlength{\parskip}{2.3ex plus 0.3ex minus 0.3ex}

\usepackage{pstricks}
\makeatletter
\def\LigneVerticale{\vrule height 2cm depth 2cm\hspace{0.1cm}\relax}
\def\LignesVerticales{%
\let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV}
\def\GrosCarreAvecUnChiffre#1{%
\rlap{\vrule height 0.8cm width 1cm depth 0.2cm}%
\rlap{\hbox to 1cm{\hss\mbox{\white #1}\hss}}%
\vrule height 0pt width 1cm depth 0pt}
\huge
\LignesVerticales
\hspace{-0.5cm}%
\GrosCarreAvecUnChiffre{\thechapter}
\hspace{0.2cm}\hbox{#1}%
}\par\vskip 2cm}
\huge
\LignesVerticales
%\hspace{0.5cm}%
\hbox{#1}%
}\par\vskip 2cm}


This is my file:

\chapter{Algemene conclusies}
\input{Conclusie}
\newpage

\clearpage{\pagestyle{empty}\cleardoublepage}
\input{Bibliografie}


and this is the code in the file Bibliografie:

\bibliography{bronnen}
\bibliographystyle{agsm}%plainnat

• Maybe by setting \renewcommand{\bibname}{Bibliografie} and addcontentsline{toc}{chapter}{Bibliogafie} ? – Mario S. E. May 24 '13 at 9:59
• I have posted some code, I don't now if this helps. The addcontentsline{toc}{chapter}{Bibliogafie} is already in my code. I 'll try to add \renewcommand{\bibname}{Bibliografie} – Mus Liselot May 24 '13 at 10:04

Others have pointed to the fact you don't change code in the .bbl file, and that you should be setting the \bibname and adding an entry for the contents.

Now the headings error lies with the marks not changing. Internally report starts the bibliography with \chapter* which does not set the marks. In the standard set-up the command \@mkboth is then issued with the \bibname, giving headings in the bibliography. In your set-up this is not happening. One fix is to simply add

\chaptermark{\bibname}


The other is the change your definition of \@makeschapterhead to

\def\@makeschapterhead#1{\hbox{%
\huge
\LignesVerticales
\hbox{#1}\chaptermark{#1}
}\par\vskip 2cm}


or to

\def\@makeschapterhead#1{\hbox{%
\huge
\LignesVerticales
#1
}\par\vskip 2cm}


The first one will change the marks to the current chapter name in all \chapter* cases and produce running heads in line with your other chapters. The other will revert to standard report behaivour i.e., in bibliography left and right heads displaying \bibname, and no resetting of header names at ordinary \chapter*.

To answer your question on how to keep code in a bbl file: you don't. It's a temporary file used to generate the bibliography from. If you need to put code in that file, your solution isn't a solution.

You can set the name of the bibliography by using \renewcommand{\bibname}{Bibliografie}.

Just please bear in mind that if you are using hyperref, you should also include:

\newpage{\pagestyle{empty}\cleardoublepage}
\renewcommand{\bibname}{Bibliografie}
\phantomsection
\bibliographystyle{agsm}
\bibliography{bronnen}


*There is no need to \input a file named "Bibliografie", you can call it directly with the command \bibliography{nameofyourfile}.

• I tries to put your code instead of mine (\clearpage{\pagestyle{empty}\cleardoublepage} \addcontentsline{toc}{chapter}{Bibliografie} \input{Bibliografie}) but unfortunatly it still doesn't give what I want. It still gives "algemene conclusies" on the left side page in the chaptermark... – Mus Liselot May 24 '13 at 10:18
• Try adding \newpage{\pagestyle{empty}\cleardoublepage} at the beginning of my code – Mario S. E. May 24 '13 at 10:28
• @MusLiselot Did it work? – Mario S. E. May 24 '13 at 10:36
• Sorry, my computer was still running, it's a big file. No, unfortunatly it doesn't work. – Mus Liselot May 24 '13 at 10:37
• @MusLiselot The problem is in the way you define the top header. I've run this without your definition and works just fine. For example, try replacing everything inside the makeatletter for \lhead[\fancyplain{}{\rm\thepage}]{\fancyplain{}{\sl\rightmark}} \chead{} \rhead[\fancyplain{}{\sl\leftmark}]{\fancyplain{}{\rm\thepage}} \lfoot{} \cfoot{\fancyplain{\rm\thepage}{}} \rfoot{} – Mario S. E. May 24 '13 at 11:25