0

I would like to make modifications to my bibtex title, and this can be done by modifying \bibname. But when it comes to reducing the amount of space between the title "Bibliography" and the entries below, I want to know how much space is put there in the first place.

More generally, I am curious as to how the bibtex internals work. I can't seem to find any documentation on this. So my questions are:

  1. Where I can find information on how bibtex formats the bibliography page(s)?
  2. More specifically, what determines the amount of space between the title and the entries below?
3
  • 3
    The specific aspect depends on the class and its definition of the thebibliography environment. Usually it's what results from \section{\refname}\begin{list}{...} (if the class doesn't provide chapters) or \chapter{\bibname}\begin{list}{...}. It has nothing to do with BibTeX.
    – egreg
    Mar 26 '14 at 16:40
  • Ah, so I was looking in the wrong place. My understanding is that an environment like thebibliography is set by the documentclass and can then be further modified. Can I view the defaults for the standard documentclasses?
    – RghtHndSd
    Mar 26 '14 at 16:48
  • @egreg: I found it (i.e. the doc class I'm using) in article.cls under texlive/texmf-dist/tex/latex/base. I would consider this a full answer.
    – RghtHndSd
    Mar 26 '14 at 16:54
5

BibTeX's output is a .bbl file containing a thebibliography environment. It's the duty of the document class to define this environment.

Usually it's something like

\section*{\refname}
\begin{list}{<code>}
<bib items>
\end{list}

for classes without chapters and

\chapter*{\bibname}
\begin{list}{<code>}
<bib items>
\end{list}

This may vary according to loaded packages; for example natbib intervenes on this, but it uses a \bibsection macro that's essentially equivalent to \section* or \chapter* in the cases above.

You can find the definition using texdef from the command line. For instance, the command line

texdef -t latex -c article -s thebibliography

will output

% article.cls, line 570:
\newenvironment{thebibliography}[1]
     {\section*{\refname}%
      \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}

Modifying it needs \makeatletter and \makeatother.

Note that it could be difficult to track down the actual definition in case natbib (or other packages, maybe) is used, because it redefines the environment at begin document. However, looking at the package code reveals

\renewenvironment{thebibliography}[1]{%
 \bibsection
 \parindent\z@
 \bibpreamble
 \bibfont
 \list{\@biblabel{\the\c@NAT@ctr}}{\@bibsetup{#1}\global\c@NAT@ctr\z@}%
 \ifNAT@openbib
   \renewcommand\newblock{\par}%
 \else
   \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
 \fi
 \sloppy\clubpenalty4000\widowpenalty4000
 \sfcode`\.\@m
 \let\NAT@bibitem@first@sw\@firstoftwo
    \let\citeN\cite \let\shortcite\cite
    \let\citeasnoun\cite
}{%
 \bibitem@fin
 \bibpostamble
 \def\@noitemerr{%
  \PackageWarning{natbib}{Empty `thebibliography' environment}%
 }%
 \endlist
 \bibcleanup
}%

Changing the space between the title and the first item is just inserting a suitable \vspace command before \list, in both cases.

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.