1

I want to remove the number labels from the bibliography, since I use (author, year) in my document. I managed to remove the numbers, but now I would like to second (and possibly more lines) indented to make the bibliography more easy to read.

I tried the following snippet from this post, but is does not work. I think these are settings for a different package, not my specific use of biblatex/natbib/bibtex.

\makeatletter
\let\old@biblabel\@biblabel
\def\@biblabel#1{\old@biblabel{#1}\kern\bibindent}
\let\old@bibitem\bibitem
\def\bibitem#1{\old@bibitem{#1}\leavevmode\kern-\bibindent}
\makeatother

MCVE:

\documentclass[journal, a4paper, 10pt]{IEEEtran}

\usepackage[
  backend=bibtex,
  style=nature,   
  citestyle=authoryear-comp, %authoryear, 
  natbib=true,
  doi=false,
  isbn=false,
  url=false,
]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{MyLibrary.bib}
  @article{greenwade93,
      author  = "George D. Greenwade",
      title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
      year    = "1993",
      journal = "TUGBoat",
      volume  = "14",
      number  = "3",
      pages   = "342--351"
  }
  @book{goossens93,
      author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
      title     = "The LaTeX Companion",
      year      = "1993",
      publisher = "Addison-Wesley",
      address   = "Reading, Massachusetts"
  }
\end{filecontents}

% add bib resource
\addbibresource{IEEEabrv}
\addbibresource{MyLibrary}

% remove numbers
\DeclareFieldFormat{labelnumberwidth}{}
\setlength{\biblabelsep}{0pt}

\begin{document}

\section{Test}
This is some test text. \citet{greenwade93} wrote a very interesting paper. Some other sentence with a different reference \citep{goossens93}. 

\printbibliography

\end{document}

enter image description here

2 Answers 2

2

If you are using citestyle=authoryear-comp, you should choose a matching authoryear-family bibliography style, but at the moment you have style=nature, which gives you a numeric bibliography style.

Go from

  style=nature,
  citestyle=authoryear-comp,

to

  style=authoryear-comp,

MWE

\documentclass[journal, a4paper, 10pt]{IEEEtran}

\usepackage[
  backend=biber,
  style=authoryear-comp,
  natbib=true,
  doi=false,
  isbn=false,
  url=false,
]{biblatex}

\addbibresource{biblatex-examples.bib}


\begin{document}
This is some test text. \citet{sigfridsson} wrote a very interesting paper.
Some other sentence with a different reference \citep{worman}. 

\printbibliography
\end{document}

Bibliography without numbering

You should also consider switching from backend=bibtex, to backend=biber,. Only with Biber you can use all of biblatex's features. Just change the backend option value and run Biber instead of BibTeX (see Biblatex with Biber: Configuring my editor to avoid undefined citations for help with that).


If you absolutely must stick with

  style=nature,
  citestyle=authoryear-comp,

remove the numbering via the bibliography environment.

\documentclass[journal, a4paper, 10pt]{IEEEtran}

\usepackage[
  backend=biber,
  style=numeric,
  citestyle=authoryear-comp,
  natbib=true,
  doi=false,
  isbn=false,
  url=false,
]{biblatex}

\defbibenvironment{bibliography}
  {\list
     {}
     {\setlength{\leftmargin}{\bibhang}%
      \setlength{\itemindent}{-\leftmargin}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}}
  {\endlist}
  {\item}

\addbibresource{biblatex-examples.bib}


\begin{document}
This is some test text. \citet{sigfridsson} wrote a very interesting paper.
Some other sentence with a different reference \citep{worman}. 

\printbibliography
\end{document}

Cite \cite{knuth:ct:b,knuth:ct:c} to see why this is a bad idea though.

1

With the macro \appto from the etoolbox package, I add some negative horizontal space at the beginning of the text after \item which is used to set the bibliography entries. To not affect other lists in your document, I wrap it in \AtBeginBibliography.

Full example:

\documentclass[journal, a4paper, 10pt]{IEEEtran}

\usepackage[
  backend=bibtex,
  style=nature,   
  citestyle=authoryear-comp, %authoryear, 
  natbib=true,
  doi=false,
  isbn=false,
  url=false,
]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{MyLibrary.bib}
  @article{greenwade93,
      author  = "George D. Greenwade",
      title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
      year    = "1993",
      journal = "TUGBoat",
      volume  = "14",
      number  = "3",
      pages   = "342--351"
  }
  @book{goossens93,
      author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
      title     = "The LaTeX Companion",
      year      = "1993",
      publisher = "Addison-Wesley",
      address   = "Reading, Massachusetts"
  }
\end{filecontents}

% add bib resource
\addbibresource{IEEEabrv}
\addbibresource{MyLibrary}

% remove numbers
\DeclareFieldFormat{labelnumberwidth}{}
\setlength{\biblabelsep}{0.5cm}

% add hanging indent
\usepackage{etoolbox}
\AtBeginBibliography{\appto\item{\hspace*{-\biblabelsep}}}

\begin{document}

\section{Test}
This is some test text. \citet{greenwade93} wrote a very interesting paper. Some other sentence with a different reference \citep{goossens93}.

\printbibliography

\end{document}

enter image description here

You must log in to answer this question.

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