3

Current situation: I'm required to cite "normative" documents (read: standards and manuals) separately from articles and books etc. Using biblatex and biber with the numeric style I'm doing that by issuing multiple printbibliography commands like so:

\usepackage[style=numeric,backend=biber,bibencoding=utf8]{biblatex}
%... lots of stuff
\printbibliography[type=standard,title=Standards \& Manuals]
\vskip\baselineskip
\printbibliography[type=manual,heading=none]
\printbibliography[nottype=standard,nottype=manual]

which gives a heading Standards & Manuals, prints a list of manuals, leaves a bit of space then the list of standards and finally, under a new heading Bibliography gives books and articles etc. Thus far everything is fine, enter:

The Problem: I'm using the shorthand field in my database for the standards and manuals which works perfect as far as output within the text is concerned and sets the shorthand as the label in the bibliography and prints the details to the right of it - problem is: my shorthands are considerably longer than the labels generated by the numeric style, but even though they're in three different \printbibliography commands, everything gets indented to the maximum width of the label, making the part for books and articles look quite ridiculous.

The following shows the problem with only two separate \printbibliography (and an obviously exaggeratedly long shorthand): output with problem

Now what I would obviously want is for each of the \printbibliography commands to only use the indentation actually necessary to accommodate the largest label appearing within, i.e. rendering the Manuals section as above, but the Bibliography section like follows: output bibliography correct

Can anyone help me to achieve this? Or give me some pointer where to look?

The above was produced with the following MWE on an up-to-date TeXLive 2014:

\documentclass[10pt,british]{scrbook}

\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@manual{HowTo,
    title = {How to Make the World Go Round},
    shorthand = {HowToMakeTheWorlGoRound},
    publisher = {The Publisher},
    year = {2000}
}

@article{Article,
    author = {Author, A. and Buthor, B.},
    journal = {Journal Title},
    pages = {113--126},
    title = {The Article},
    volume = {65},
    year = {1900}
}
\end{filecontents*}

\usepackage[style=numeric,backend=biber,bibencoding=utf8]{biblatex}
\addbibresource{\jobname.bib}

\usepackage[hidelinks]{hyperref}

\begin{document}
\let\cleardoublepage\relax
\chapter{The Document}
Nothing to see here, but we refer to the \parencite{HowTo} based on a principle discovered by \textcite{Article}.

\printbibliography[type=manual,title=Manuals]
\printbibliography[nottype=manual]
\end{document}
4

As mentioned in Biblatex, Use of prefixnumber changes indentation of all subbibliographies biblatex 3.11 has the new option locallabelwidth which makes the labelwidth calculation local for each \printbibliography.

\documentclass[10pt,british]{scrbook}

\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@manual{HowTo,
    title = {How to Make the World Go Round},
    shorthand = {HowToMakeTheWorlGoRound},
    publisher = {The Publisher},
    year = {2000}
}

@article{Article,
    author = {Author, A. and Buthor, B.},
    journal = {Journal Title},
    pages = {113--126},
    title = {The Article},
    volume = {65},
    year = {1900}
}
\end{filecontents*}

\usepackage[style=numeric,backend=biber,locallabelwidth]{biblatex}
\addbibresource{\jobname.bib}

\usepackage[hidelinks]{hyperref}

\begin{document}
\let\cleardoublepage\relax
\chapter{The Document}
Nothing to see here, but we refer to the \parencite{HowTo} based on a principle discovered by \textcite{Article}.

\printbibliography[type=manual,title=Manuals]
\printbibliography[nottype=manual]
\end{document}

Two bibliographies with different indentations each.

2

Thanks to @moewe's link and the comments in there I found a solution that seems to work and which allows setting the width of the label for the numeric part arbitrarily.

Defining a new bibenvironment with \defbibenvironment{bibnumeric}... and therein setting \labelnumberwidth allows adjusting the width of the label for any \printbibliography using that bibenvironment - by adding env=bibnumeric to the \printbibliography command.

Thus the above MWE can be fixed by adding:

%% make substyle for normal numbered bib
\defbibenvironment{bibnumeric}
    {\list
        {\printtext[labelnumberwidth]{%
            \printfield{prefixnumber}%
            \printfield{labelnumber}}}
        {\settowidth{\labelnumberwidth}{8888}%
            \setlength{\labelwidth}{\labelnumberwidth}%
            \setlength{\leftmargin}{\labelwidth}%
            \setlength{\labelsep}{\biblabelsep}%
            \addtolength{\leftmargin}{\labelsep}%
            \setlength{\itemsep}{\bibitemsep}%
            \setlength{\parsep}{\bibparsep}}%
        \renewcommand*{\makelabel}[1]{\hss##1}}
    {\endlist}
    {\item}

which is a copy of the \defbibenvironment{bibliography} found in numeric.bbx of biblatex, apart from the added \settowidth{\labelnumberwidth}{8888} which allows setting the label width for the new bibenvironment arbitrarily - the value used allows for a three digit citation number.

The full MWE then is:

\documentclass[10pt,british]{scrbook}

\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@manual{HowTo,
    title = {How to Make the World Go Round},
    shorthand = {HowToMakeTheWorlGoRound},
    publisher = {The Publisher},
    year = {2000}
}

@article{Article,
    author = {Author, A. and Buthor, B.},
    journal = {Journal Title},
    pages = {113--126},
    title = {The Article},
    volume = {65},
    year = {1900}
}
\end{filecontents*}

\usepackage[style=numeric,backend=biber,bibencoding=utf8]{biblatex}
\addbibresource{\jobname.bib}

%% make substyle for normal numbered bib
\defbibenvironment{bibnumeric}
    {\list
        {\printtext[labelnumberwidth]{%
            \printfield{prefixnumber}%
            \printfield{labelnumber}}}
        {\settowidth{\labelnumberwidth}{8888}%
            \setlength{\labelwidth}{\labelnumberwidth}%
            \setlength{\leftmargin}{\labelwidth}%
            \setlength{\labelsep}{\biblabelsep}%
            \addtolength{\leftmargin}{\labelsep}%
            \setlength{\itemsep}{\bibitemsep}%
            \setlength{\parsep}{\bibparsep}}%
        \renewcommand*{\makelabel}[1]{\hss##1}}
    {\endlist}
    {\item}

\usepackage[hidelinks]{hyperref}

\begin{document}
\let\cleardoublepage\relax
\chapter{The Document}
Nothing to see here, but we refer to the \parencite{HowTo} based on a principle discovered by \textcite{Article}.

\printbibliography[type=manual,title=Manuals]
\printbibliography[nottype=manual,env=bibnumeric]
\end{document}

giving the output:

fixed output

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.