1

I have a bibliography generated by biblatex and biber that is placed in the TOC, however vertical spacing is wrong. Chapters are supposed to be double spaced (before and after). My institution provides a template that styles the TOC and performs the double space, but doesn't do it for the Bibliography.

Bibliography - should have vertical space above: enter image description here

MWE

This has a separate style file - the style file wouldn't work when I put it inline in the tex document.

\documentclass[12pt,letterpaper,oneside,pdftex]{book}
\usepackage{style}
\usepackage{filecontents}
\usepackage[
    backend=biber,
    style=numeric,
    sorting=ynt
]{biblatex}
\begin{filecontents}{\jobname.bib}
    @article{Bli74,
        author = {Blinder, Alan S.},
        year = {1974},
        title = {The economics of brushing teeth},
        journaltitle = {Journal of Political Economy},
        volume = {82},
        number = {4},
        pages = {887--891},
    }
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

\frontmatter
    \tableofcontents

\mainmatter
    \chapter{A Cat}
        \section{Whiskers}
        \section{Meow}

    \chapter{A Dog}
        \section{Tail}
        \section{Woof}

\appendix
    \chapter{Utilities}
    A reference \cite{Bli74}
        \section{Util 1}
        \section{Util 2}

    \chapter{Stuff}
    Here's a second reference
        \section{Crom}
        \section{Ulent}

\backmatter
    \printbibliography[
        heading=bibintoc,
        title={Bibliography}
    ]
\end{document}

style.sty

\def\@chapter[#1]#2{
    \ifnum \c@secnumdepth >\m@ne
        \if@mainmatter
            \refstepcounter{chapter}
            \typeout{\@chapapp\space\thechapter.}
            \addtocontents{toc}{\protect\addvspace{10\p@}}
            \ifx\@chapapp\appflag
                \addcontentsline{toc}{appendix}{\protect\numberline{Appendix \thechapter.}#1}
            \else
                \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter.}#1}
            \fi
            \addtocontents{toc}{\protect\addvspace{10\p@}}
        \else
            \addcontentsline{toc}{chapter}{#1}
        \fi
    \else
        \addcontentsline{toc}{chapter}{#1}
    \fi}

\renewcommand\tableofcontents{%
    \@starttoc{toc}%
    \newpage   
  }


\def\l@chapter{\pagebreak[3]
 \vskip 0.0em 
  \@dottedtocline{0}{0em}{2.4em}}
  • 1
    It would really help if you could show a full MWE that lets us reproduce the output you get. What document class do you use? Do you use other packages to modify chapter headings? At the moment it is quite hard to answer your question. – moewe Feb 6 '18 at 7:48
  • I'll throw one together – elBradford Feb 6 '18 at 13:27
  • 1
    Great. Please make sure that we can compile your MWE, the best approach is to check if the MWE compiles and shows the problem when you compile it in a new, clean directory. In particular you need to get rid of \include and \input statements. See tex.meta.stackexchange.com/q/228/35864 – moewe Feb 6 '18 at 13:36
1

The bibliography is added to the TOC with \addcontentsline{toc}{chapter}{#1}, so we need to mimic what you do in \@chapter in the definition of the bibliography heading as well

\makeatletter
\defbibheading{bibintoc}[\bibname]{%
  \chapter*{#1}%
  \addtocontents{toc}{\protect\addvspace{10\p@}}%
  \addcontentsline{toc}{chapter}{#1}%
  \addtocontents{toc}{\protect\addvspace{10\p@}}%
  \@mkboth{\abx@MakeMarkcase{#1}}{\abx@MakeMarkcase{#1}}}
\makeatother

I assume there are more elegant ways to modify the TOC to your liking.

  • If you are using an older version of biblatex and \abx@MakeMarkcase is not defined you might need \newcommand*{\abx@MakeMarkcase}{\MakeUppercase} – moewe Feb 6 '18 at 16:09

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.