10

(repost/moved from stackoverflow: currently no answers)

Here is my LateX question:

I'm using (PDF)LaTeX with IEEEtran documentclass and biblatex/biber as bibliography system. As mentioned in the IEEE example (two column paper), references should be balanced between columns on the last page. The presented \IEEEtriggeratref{} command inserts a \newpage command after the given reference to manually balance the references list. But, it's not working with biblatex -> nothing happens.

How can I balance my references with biblatex in an equivalent way?

Here are my settings:

\documentclass[conference]{IEEEtran}
[...]
\usepackage[backend=biber,      % replace bibtex with biber (bibliography backend engine)
    bibstyle=ieee,              % write literature lists in IEEE style
    citestyle=numeric-comp,     % \cite uses a numeric key
    sortcites=true,                             
    maxbibnames=3
]{biblatex}
[...]

Here is the original natbib/bibtex example:

% trigger a \newpage just before the given reference
% number - used to balance the columns on the last page
% adjust value as needed - may need to be readjusted if
% the document is modified later
\IEEEtriggeratref{8}
Paebbels
  • 219
  • 5
  • 18
  • 1
    You don't/can't. Because conferences don't require that's first and also if needed they do it manually upon publication so you don't need to worry about it. The tools you mention are meant specifically for BibTeX and they are not precise anyway. They break the bibliography roughly. If you really need it use \enlargethispage{<a negative dimension>} – percusse Jun 11 '14 at 23:24
  • 1
    @percusse a) It's recomended to do so. b) "who can read is in advantage" and c) there is a solution -> see below – Paebbels Jun 12 '14 at 08:48
  • @percusse: just re your first point — I have just submitted a paper for a conference which (a) explicitly requires balancing columns on last page, and (b) asks authors to do this ourselves, without giving instructions for how to do so. The required class file — sigplanconf.cls — provides a macro that appears to be intended for this, but it’s not documented and doesn’t seem to work. So this is a real and recurring problem in the wild. – Peter LeFanu Lumsdaine Dec 09 '16 at 14:53
  • @PeterLeFanuLumsdaine They will require it but never check it. I can guarantee you. And my point is only valid for IEEE context – percusse Dec 09 '16 at 15:04
  • @percusse: They did check it: we had initially forgotten to balance them (along with a couple of other small style infractions) and they explicitly asked us to fix it. Indeed this isn’t IEEE, though. (It’s http://cpp2017.mpi-sws.org, an ACM SIGPLAN conference, fwiw.) – Peter LeFanu Lumsdaine Dec 09 '16 at 15:57

3 Answers3

10

Based on Paul's answer, this is a drop-in replacement for the \IEEEtriggeratref macro that works with biblatex:

\usepackage{ifthen}

\makeatletter
\newcounter{IEEE@bibentries}
\renewcommand\IEEEtriggeratref[1]{%
  \renewbibmacro{finentry}{%
    \stepcounter{IEEE@bibentries}%
    \ifthenelse{\equal{\value{IEEE@bibentries}}{#1}}
    {\finentry\@IEEEtriggercmd}
    {\finentry}%
  }%
}
\makeatother

The usage is the same as the original macro:

\IEEEtriggeratref{9} % Breaks the column after the 9th entry
\printbibliography
8

I don't use that class, so I may have misunderstood your question. But I think you should be able to do something like this, in your preamble

\renewbibmacro{finentry}{%
  \iffieldequalstr{entrykey}{KEY}%<- key after which you want the break
   {\finentry\newpage}
   {\finentry}}

Instead of giving the reference by number, you give the key of the entrytype after which you want to insert \newpage (in the place where I have KEY in the macro above). Of course, you can add anything else you want here. Basically, the code you put in place of \newpage will be executed after the entry in question has been printed.

Paul Stanley
  • 18,151
1

Adapting this answer to biblatex, here's an automatic version.

\usepackage{balance}
\usepackage{lastpage}

\makeatletter
\def\lastreferencepage{\lastpage@lastpage} % can use a hard-coded number instead
\makeatother
\def\balanceissued{unbalanced}% ensure \balance only used once
\renewbibmacro{finentry}{%
    \ifnum\thepage=\lastreferencepage%
        \expandafter\ifx\expandafter\relax\balanceissued\relax%
        \else%
            \balance%
            \gdef\balanceissued{\relax}%
        \fi%
    \fi%
    \finentry%
}
golvok
  • 175