10

I want to use references like "[1]" in my text, but "1." in the bibliography. I did find the exact same question:

How to use 1. (number followed by dot) format instead of [1] format in bibliography

However, the solution from Gonzalo Medina does not work for me (meaning there is no effect: I still have "[1]" in my bibliography, instead of the desired "1.").

MWE:

\documentclass{scrbook}
\usepackage[style=numeric-comp, backend=biber]{biblatex}
\addbibresource{bibliography.bib}
\makeatletter
\renewcommand\@biblabel[1]{#1.}
\makeatother
\begin{document}
\chapter{TestTest}
Test \cite{ADA}.
\printbibliography
\end{document}

where the file bibliography.bib contains

@BOOK{ADA,
  author = {Example Author},
  title = {Random Title},
  publisher = {Some Publisher},
  year = {2003},
  location = {City},
  edition = {2},
}

Is the solution not working any more, or is there anything wrong with my Tex distribution (up-to-date Texlive)?

(Even without a working solution, I would appreciate it, if someone could confirm that this problem exists when using the above MWE.)

Ferdi
  • 190
  • Welcome to TeX.SX! You haven't actually added Gonzalo Medina's solution to your preamble in the MWE... Also, what does it mean "does not work"? Is there an error? Is the output not what you expect? – darthbith Oct 24 '14 at 14:21
  • Thanks for pointing that out. I still have "[1]" in my bibliography, instead of the desired "1.". – Ferdi Oct 24 '14 at 14:22
  • In the cited question and answer, it is not mentioned that the solution is for biblatex. So I think the answer of Gonzalo Medina is meant for bibtex. – quinmars Oct 24 '14 at 14:49
  • 1
    I can confirm the problem with TL2014 and the scrbook, book, and article classes. – darthbith Oct 24 '14 at 14:49

1 Answers1

9

You need to alter the labelnumberwidth format

\documentclass{scrbook}
\begin{filecontents*}{\jobname.bib}
@BOOK{ADA,
  author = {Example Author},
  title = {Random Title},
  publisher = {Some Publisher},
  year = {2003},
  location = {City},
  edition = {2},
}
\end{filecontents*}
\usepackage[style=numeric-comp]{biblatex}
\DeclareFieldFormat{labelnumberwidth}{#1\adddot\midsentence}
\addbibresource{\jobname.bib}
\begin{document}
\chapter{TestTest}
Test \cite{ADA}.
\printbibliography
\end{document}

Note that this only alters the bibliography printing: the citation numbers are controlled separately.

(The biblatex package uses an entirely different structure than 'traditional' LaTeX for the bibliography environment, which is why redefining \@biblabel is not effective here.)

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • Just out of curiosity, @JosephWright, could you have done this using \defbibenvironment{bibliography}? And if so, why is your way better? – Mark Birtwistle Oct 24 '14 at 16:21
  • @MarkBirtwistle You could probably do it using \defbibenviornment. However, as the label would still be passed with formatting you'd have to strip it out. More importantly, you'd have to re-define everything needed for the environment: altering the label format targets that one specific piece of the design. – Joseph Wright Oct 24 '14 at 16:32
  • OK, thanks @JosephWright – I have a lot to learn! – Mark Birtwistle Oct 24 '14 at 17:26