4

I'm using bibunit to enter multiple bibliographies in a document. I don't want the bibunit to have a separate heading. I can remove the text with by redefining \refname, but this still leaves big vertical space. How can I drop that space entirely?

Here's a toy example:

\documentclass{article}
\usepackage{bibunits}
\begin{document}

\defaultbibliographystyle{plainyr-rev}
\defaultbibliography{ab,ty2}
\renewcommand{\refname}{}

\section{Publications}

Some text goes here.

\begin{bibunit}
  \nocite{smith_douglas_ea_2004}
  \putbib
\end{bibunit}
\end{document}

This produces:

I've drawn a red line on the image to show the space I want to reduce/eliminate.

2 Answers 2

5

A hack specific for the article class. Other classes may require different workarounds:

\documentclass{article}
\usepackage{bibunits}

%%% START HACK
\usepackage{etoolbox}
\AtBeginEnvironment{bibunit}{\renewcommand\section[5]{}}
%%% END HACK

\begin{document}

\defaultbibliographystyle{plainyr-rev}
\defaultbibliography{ab,ty2}

\section{Publications}

Some text goes here.

\begin{bibunit}
  \nocite{smith_douglas_ea_2004}
  \putbib
\end{bibunit}
\end{document}

Explanation: the code for the thebibliography environment starts with

\newenvironment{thebibliography}[1]
     {\section*{\refname}%
      \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
      [...]

and the redefinition of \section we perform when bibunits starts gobbles \section together with the five "arguments" that follow:

*
{\refname}
\@mkboth
{\MakeUppercase\refname}
{\MakeUppercase\refname}

A cleaner approach would be to redefine the environment:

\makeatletter
\renewenvironment{thebibliography}[1]
     {\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}
\makeatother

removing the code responsible for the \section* command.

1
  • Thanks! I had found the relevant code in article.cls, but didn't know what to do with it.
    – Tyler
    Commented Dec 13, 2012 at 14:19
0

You can also do

\renewcommand{\refname}{\vspace*{-21pt}}

adjusting 21 to your liking.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .