8

How do I properly remove the space above bibliography inserted without the respective caption? Please see the screenshot below with the inconsistent spaces being delimited by red lines. Two-column layout has been obtained with the 'paracol' package. (I should mention here that using this package has no influence on the resulting extra space being added.)

Inconsistent spaces; output generated using the enclosed MWE

MWE used to generate the output:

\documentclass[11pt,a4paper]{article}
\def\section*#1{}          % let's get rid of the caption 'References'
\usepackage{bibunits}
\usepackage{paracol}
\setcolumnwidth{3cm,10cm}  % column widths
\begin{document}
\noindent\textbf{Published articles}
\par\begin{paracol}{2}
  \noindent peer-reviewed\\journals
  \switchcolumn
  \begin{bibunit}\nocite{*}\putbib[pub]\end{bibunit}
\end{paracol}
\end{document}

BibTeX file pub.bib:

@article{art,
    author  = {John Doe and Jane Smith},
    title   = {Some witty paper title},
    journal = {Journal},
    year    = {2014},
    volume  = {1},
    number  = {2},
    pages   = {1--5}
}

Please note that since the package 'bibunits' is used (I need to insert multiple bibliographies), one has to run BibTeX with the parameter 'bu1' instead of the name of the .bib file.

I am aware of the topic 'Remove heading from bibunit' but the hack mentioned therein was unfortunately of no help.

When I tried to remove the extra space via setting various dimensions/lengths to 0 pt, there was sometimes a slight change but the spaces were still far from equal. So, which parameter do I need to set to 0 pt to remove the extra space? Or - do I need to redefine section heading in some other way than \def\section*#1{}?

So far the only thing that helped was using \vskip\correction\vskip0pt with \correction being an experimentally determined negative length, but this is more of a workaround rather than a solution. :/

Thanks.

nvx

0
3

It is due to the \topsep as the bibliography is typeset as a list. If you make \topsep and \partopsep zero, then the problem is solved. Taking egreg's code and adding \setlength{\topsep}{0pt} and \setlength{partopsep}{0pt} in the re-definition of thebibliography removes the extra space.

\documentclass[11pt,a4paper]{article}
\makeatletter
\renewenvironment{thebibliography}[1]
     {\list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \setlength{\topsep}{0pt}                     %%<--- here. 
            \setlength{\partopsep}{0pt}
            \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          % let's get rid of the caption 'References'
\usepackage{bibunits}
\usepackage{paracol}
\setcolumnwidth{3cm,10cm}  % column widths
\begin{document}
\noindent\textbf{Published articles}
\par\begin{paracol}{2}
  \noindent peer-reviewed\\journals
  \switchcolumn
  \begin{bibunit}\nocite{*}\putbib[pub]\end{bibunit}
\end{paracol}
\end{document}

enter image description here

Here is a stab using tcolorbox as an added bonus:

\documentclass[11pt,a4paper]{article}
\def\section*#1{}          % let's get rid of the caption 'References'
\usepackage{bibunits}
\usepackage[many]{tcolorbox}
\tcbuselibrary{skins,breakable}
\newtcolorbox{mycolumn}[1][]{
    colback=white,
    left=0.5ex,
    top=0pt,
    arc=0pt,
    outer arc=0pt,
    enlarge left by=1in,
    enlarge right by=-\dimexpr1in+\parindent\relax,
    right=\dimexpr1in\relax,
    leftrule=0pt,
    rightrule=0pt,
    toprule=0pt,
    bottomrule=0pt,
    breakable,
    nobeforeafter,
    enhanced jigsaw,
    overlay={
      \node[anchor=north east,inner sep=0pt,align=left,text width=1in]
        at ([yshift=-1.5ex]frame.north west) {#1};
    },
    before=\vskip\itemsep\noindent
  }

\begin{document}
\noindent\textbf{Published articles}
\begin{mycolumn}[peer-reviewed\\journals] 
  \begin{bibunit}
    \nocite{*}
    \putbib[xampl]
  \end{bibunit}
\end{mycolumn}
\end{document}

enter image description here

Adjust all instances 1in in the definition of mucolumn suitably. Advantage with tcolorbox is one can go fancy with colors and border rules.

2
  • Thanks for the exhaustive answer! Although there still remains some extra space there even if I set \topsep to 0 pt (please notice that the baselines are different for the left and right columns in your first screenshot), this can be easily corrected via \setlength{\partopsep}{0pt}. In other words, one does not even need to estimate the correction as you did ("may be -2pt is better"). :) – nvx Jul 24 '14 at 6:53
  • @nvx I am very sorry. Before I could add it, my net connection was cut. Glad you found it. I have added it now. – user11232 Jul 24 '14 at 23:35

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.