-1

I would like to change the appearance of the References section such that:

  • the labels appear like 1. instead of [1]
  • the labels are hanging left into the margin, and the text is aligned with the margin instead of the numbers

I would like to keep the reference appearance as [1] as it appears in the main body of my text.

Looking through the biblatex manual, this doesn't seem obvious.

moewe
  • 175,683

2 Answers2

1

You want to set leftmargin to zero in the bibliography environment. Take the default from numeric.bbx (ll. 24-37) and play around with the values until you like the outcome.

The number formatting in the bibliography can be modified by playing with the labelnumberwidth field format.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage{lipsum}

\usepackage[backend=biber, style=numeric]{biblatex}

\DeclareFieldFormat{labelnumberwidth}{#1\addperiod} \defbibenvironment{bibliography} {\list {\printtext[labelnumberwidth]{% \printfield{labelprefix}% \printfield{labelnumber}}} {\setlength{\labelwidth}{\labelnumberwidth}% \setlength{\leftmargin}{0pt}% \setlength{\labelsep}{\biblabelsep}% \setlength{\itemsep}{\bibitemsep}% \setlength{\parsep}{\bibparsep}}% \renewcommand*{\makelabel}[1]{\hss##1}} {\endlist} {\item}

\addbibresource{biblatex-examples.bib}

\begin{document} Lorem \autocite{sigfridsson,worman,geer,nussbaum}

\lipsum[1-2]

\printbibliography \end{document}

Numbers formatted and aligned as described.

moewe
  • 175,683
0

Using enumitem package, I did the following:

\defbibenvironment{bibliography}%
{\begin{enumerate}[leftmargin=0pt,labelsep=2ex,itemsep=2pt]}%
{\end{enumerate}}%
{\item}%
  • 1
    This is really not a great way to do it because you're relying on the labels to coincidentally match. That's much more liable to break. – cfr Nov 12 '23 at 06:11
  • What is the better approach? 3.8.7 of the manual provides an example not much different than this. Is better to explicitly show \printfield{labelnumber}?

    https://mirrors.ibiblio.org/CTAN/macros/latex/contrib/biblatex/doc/biblatex.pdf

    – likethevegetable Nov 13 '23 at 16:18
  • moewe's is a better approach. Defining a suitable field format and using the label is better. – cfr Nov 13 '23 at 16:45