0

I am using the documentclass scrbook and want to cite so that it looks like this:

Author(Year).

Is there a possibility to use \biboptions{authoryear} in scrbook or anything similar to it?

I use a template from my university and every time I try to change the documentclass to elsarticle I get an error. That's why I am looking for a solution with scrbook.

Thanks in advance.

code:

     \documentclass
    [paper=a4,      
    twoside=on,     
    DIV=13,         
    fontsize=12pt,  
    BCOR=15mm,  
    parskip=half,   
    numbers=noenddot,
    cleardoublepage=empty] 
    {scrbook} 
\usepackage{palatino}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{eurosym}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsbsy}
\usepackage{amssymb}
\usepackage{subfig}
\usepackage{multirow}
\usepackage{makeidx}
\usepackage[absolute]{textpos}
\usepackage[style=numeric, backend=biber, natbib=true]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}
\addbibresource{quellen.bib} 
\usepackage{url}
\setcounter{biburlnumpenalty}{9000}
\setcounter{biburlucpenalty}{9000}
\setcounter{biburllcpenalty}{9000}
\usepackage[]{acronym}
\usepackage{lmodern,textcomp}
\usepackage{csquotes}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{url}
\usepackage{listings}
\usepackage{scrhack}

I want to use something like this:

\usepackage{natbib}
\bibliographystyle{model2-names}
\biboptions{authoryear}

If I try to change the documentclass to elsarticle, the following error appears:

/usr/share/texlive/texmf-dist/tex/latex/biblatex/biblatex.sty:462:
LaTeX Error:
 Command \bibhang already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.462 \newlength{\bibhang}
Peter
  • 3

1 Answers1

1

In the preamble code you load biblatex

\usepackage[style=numeric, backend=biber, natbib=true]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}
\addbibresource{quellen.bib} 
\setcounter{biburlnumpenalty}{9000}
\setcounter{biburlucpenalty}{9000}
\setcounter{biburllcpenalty}{9000}

But then you want to use natbib

\usepackage{natbib}
\bibliographystyle{model2-names}
\biboptions{authoryear}

The two packages biblatex and natbib are incompatible since they use completely different approaches to bibliography and citation formatting.

The particular error

/usr/share/texlive/texmf-dist/tex/latex/biblatex/biblatex.sty:462:
LaTeX Error:
 Command \bibhang already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ...

l.462 \newlength{\bibhang}

you quote happens if you load biblatex after you have already loaded natbib. Since the two packages are fundamentally incompatible, there are some definition clashes between the two, which is fine under the reasonable assumption that they are never loaded in the same document.

Load either biblatex or natbib but not both. You can find out more about natbib vs. biblatex at bibtex vs. biber and biblatex vs. natbib and What to do to switch to biblatex?.

moewe
  • 175,683