1

Consider the following code:

\begin{filecontents}{biblio.bib}
  @article{Key1,
    title = {First title},
    author = {First author},
    shorthand = {ShortHand},
    keywords = {shorthanded}
  }

  @article{Key2,
    title = {Second title},
    author = {Second author}
  }
\end{filecontents}

\documentclass{article}

\usepackage[style=numeric]{biblatex}

\addbibresource{biblio.bib}

\begin{document}

My text cites both \cite{Key1} and \cite{Key2}.

\printbibliography[keyword=shorthanded]

\printbibliography[notkeyword=shorthanded]

\end{document}

Here I print two distinct bibliographies differentiating by keyword, and the first kind of entries happen to be referenced by shorthands (conference names).

As you can see from the output, the large spacing due to the shorthand in the first bibliography is retained when printing the second.

output

This appears nice in the MWE, but in my real document the two bibliographies are printed on separate pages anyway (separate chapters* in a book class), so the vertical alignment is not needed, and the wasted horizontal space in the second one is annoying and useless.

How can I reset the second call to \printbibliography so to independently reserve the right horizontal space for its entries?

2
  • With multibib package it would be like you want by default. Check this if you don't have too many references and it helps: tex.stackexchange.com/a/457454/120578
    – koleygr
    Commented Oct 31, 2018 at 19:47
  • Unfortunately I'm specifically using biblatex in many other ways so I need a solution working with it Commented Oct 31, 2018 at 19:50

1 Answer 1

2

You can use biblatex's option locallabelwidth=true.

I also suggest the use of \printshorthands instead of \printbibliography[keyword=shorthanded]. As a matter of fact, you could well forgo with the need to declare such a keyword altogether. See, for example, this lockstep's answer, incorporated below.

\begin{filecontents}{biblio.bib}
  @article{Key1,
    title = {First title},
    author = {First author},
    shorthand = {ShortHand},
  }

  @article{Key2,
    title = {Second title},
    author = {Second author}
  }
\end{filecontents}

\documentclass{article}

\usepackage[style=numeric,locallabelwidth=true]{biblatex}

% from https://tex.stackexchange.com/a/44436/105447
\defbibcheck{noshorthand}{%
  \iffieldundef{shorthand}{}{\skipentry}%
}

\addbibresource{biblio.bib}

\begin{document}

My text cites both \cite{Key1} and \cite{Key2}.

\printshorthands

\printbibliography[check=noshorthand]

\end{document}

enter image description here

10
  • Thanks! I get an error Package xkeyval Error: 'locallabelwidth' undefined in families 'blx@opt@pre'. Do I have an outdated version of the biblatex package? Commented Oct 31, 2018 at 19:54
  • That might be the case, which version are you using? (current is 3.11).
    – gusbrs
    Commented Oct 31, 2018 at 19:57
  • That is indeed a recent inclusion. Revision history for biblatex shows us "Added locallabelwidth option" for version 3.11.
    – gusbrs
    Commented Oct 31, 2018 at 20:00
  • Do you think there might be a way to hack the same effects in older versions? Commented Oct 31, 2018 at 20:19
  • 2
    thanks.. not just for this answer, but I'll greet TeX.SE in the acknowledgements for sure ;) Commented Oct 31, 2018 at 21:00

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