0

The problem is that I cite some book and the cite number starts with 12 but I want the order how I cite ( first cite = 1, second = 2, etc.).

\documentclass[oneside]{ausarbeitung}
\usepackage[backend=biber,style=numeric,sorting = none]{biblatex}
\bibliography{latexlit.bib}
\newtheorem{Bsp}{Beispiel}[chapter]

\begin{document}

...
\cite{1}
\cite{2}
....

\printbibliography
\end{document}

I get this error:

The package biblatex has already been loaded with options:
[toc=bib,style=numeric,backend=biber]
There has now been an attempt to load it with options
[toc=bib,style=numeric,backend=biber,sorting = none]

Adding the global options: toc=bib,style=numeric,backend=biber,toc=bib,style=numeric,backend=biber,sorting = none but when I'm adding this, the problem is still there.

  • 3
    Does this answer your question? Biblatex citation order – Marijn Feb 19 '20 at 21:19
  • From the proposed duplicate: \usepackage[backend = biber, style = numeric, sorting = none]{biblatex} should work. – Marijn Feb 19 '20 at 21:20
  • sorting=none should do what you want. – moewe Feb 19 '20 at 21:20
  • no guys it doesnt work, i get an error (see edit) – akameme Feb 19 '20 at 21:33
  • Regarding the error: you should only have one \usepackage{biblatex} statement, it appears you have two separate statements now. Also, when you have reduced it to one statement and you run without error, then you may need to run biber again and then LaTeX again to see the changes in the pdf. – Marijn Feb 19 '20 at 21:34
  • You'll have to show us ausarbeitung.cls (where did you get it from?): Apparently it loads biblatex itself. – moewe Feb 19 '20 at 21:35
  • 2
    There is https://github.com/r4gus/Wahlprojekt/blob/master/ausarbeitung.cls from Hochschule Aalen, is that it? That class indeed loads biblatex with toc=bib,style=numeric,backend=biber. You can try putting \PassOptionsToPackage{sorting=none}{biblatex} on the top of your document (even before \documentclass{ausarbeitung}) and then remove the \usepackage statement from your code. – Marijn Feb 19 '20 at 21:41
  • @Marijn, my guess is that your comment will very likely solve the problem. Can you post it as an answer? – Alessandro Cuttin Feb 20 '20 at 11:30
  • @Marijn Would you like to type up a quick answer here or do you want to close the question as a duplicate of https://tex.stackexchange.com/questions/51434/biblatex-citation-order? – moewe Feb 23 '20 at 15:10
  • @moewe I'll answer, this one seems a bit different because of the class setup. – Marijn Feb 23 '20 at 15:17

1 Answers1

1

To number the citations in the order that they appear in the document you can use the sorting=none option for biblatex.

However, the class ausarbeitung (from https://github.com/r4gus/Wahlprojekt/blob/master/ausarbeitung.cls) loads biblatex itself. If you try to load it again in the preamble of the document then the compilation will fail with the error ! LaTeX Error: Option clash for package biblatex.. In this case you can use the command \PassOptionsToPackage in your preamble before the package is loaded. In this case the package is loaded by the class, so the command should be placed before \documentclass.

MWE:

\PassOptionsToPackage{sorting=none}{biblatex}
\documentclass[oneside]{ausarbeitung}
\addbibresource{biblatex-examples.bib}

\begin{document}

\cite{aksin}
\cite{yoon}
\cite{bertram}

\printbibliography
\end{document}

Result:

enter image description here

Note that I used \addbibresource instead of \bibliography, which is deprecated in biblatex (see the manual on page 88). For the citations I used biblatex-examples.bib, which is an example file that is pre-installed with each biblatex installation, so it is convenient for asking and answering questions because it is available for everybody.

Marijn
  • 37,699