[Tex/LaTex] No hanging indent with biblatex in bibliography

biblatexbibliographies

I try to get rid of the hanging indent in my bibliography. The biblatex manual suggests \setlength{\bibhang}{0pt}, but it does not work in this case.

MWE:

\documentclass{article}

% arara: pdflatex
% arara: biber
% arara: pdflatex

\usepackage[
    backend=biber,
    style=chem-angew,
    articletitle=true,
    defernumbers=true
]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{D04,
  author = {Duthor, D.},
  year = {2004},
  volume = {1},
  pages = {2},
  title = {Nanoscale magnetic skyrmions in metallic films and multilayers: a new twist for spintronics Nanoscale magnetic skyrmions in metallic films and multilayers: a new twist for spintronics},
}

\end{filecontents}

\addbibresource{\jobname.bib}

\setlength{\bibhang}{0pt}

\begin{document}

Some text \cite{D04}.

\printbibliography

\end{document}

How do I avoid the indentation for the second (and third) line of the reference?

enter image description here

Best Answer

The bibliography environment for numeric and alphabetic styles does not use \bibhang, because they work more like an enumerate. In those lists, all lines have the same indentation, but additionally there is a label on the first line.

So you if you want to use \bibhang you need something like this

\documentclass{article}
\usepackage[
    backend=biber,
    style=chem-angew,
    articletitle=true,
    defernumbers=true
]{biblatex}

\addbibresource{biblatex-examples.bib}

\setlength{\bibhang}{0pt}
\defbibenvironment{bibliography}
  {\list
     {}
     {\setlength{\leftmargin}{\bibhang}%
      \setlength{\itemindent}{-\leftmargin}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}}
  {\endlist}
  {\item
   \printtext[labelnumberwidth]{%
     \printfield{labelprefix}%
      \printfield{labelnumber}}%
   \addspace}

\begin{document}
Some text \cite{sigfridsson,cicero,worman}.

\printbibliography
\end{document}

A simpler solution is

\defbibenvironment{bibliography}
  {\trivlist}
  {\endtrivlist}
  {\item
   \printtext[labelnumberwidth]{%
     \printfield{labelprefix}%
      \printfield{labelnumber}}%
   \addspace}
Related Question