BibTeX, biblatex and biberProblems with second bibliography using natbib

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
lunartex
Posts: 3
Joined: Mon Aug 01, 2016 3:32 pm

Problems with second bibliography using natbib

Post by lunartex »

Hello everyone,

I try to create two bibliographies, one for literature and one for pics. My original problem is that the second auxiliary-file consists of double entries. For reducing complexity, I created a smaller example, but this worked neither. I hope you can help me with solving the small problem, so we can solve the original one :)

Here is the "small" example.tex:

Code: Select all

\documentclass[
	pdftex,%              PDFTex verwenden
	a4paper,%             A4 Papier
	oneside,%             Einseitig
	bibtotoc,%    		Literaturverzeichnis einfuegen bibtotocnumbered: nummeriert
	liststotoc,%		Verzeichnisse einbinden in toc
	idxtotoc,%            Index ins Verzeichnis einfgen
	halfparskip,%        Europischer Satz mit abstand zwischen Abstzen
	chapterprefix,%       Kapitel anschreiben als Kapitel
	headsepline,%         Linie nach Kopfzeile
	%footsepline,%         Linie vor Fusszeile
	%pointlessnumbers,%     Nummern ohne abschlieenden Punkt
	12pt%                 Grssere Schrift, besser lesbar am bildschrim
]{scrbook}
\usepackage{url}
%
% Paket fuer Uebersetzungen ins Deutsche
%
\usepackage[ngerman]{babel}
\usepackage{textcomp}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage[babel,german=swiss]{csquotes}

% Naturwissenschaftliches Zitieren mglich, z.B. et al
%\usepackage{natbib}
%zwei Literaturverzeichnisse
\usepackage{multibib}
\newcites{bild}{Bildquellen}
\usepackage[round]{natbib}
%
% Literaturverzeichnis-Stil
%
\begin{document}
Hier ist der Text \cite{text}, und hier das Bild \citebild{bild}. 


%Literaturverzeichnisse 
%\def\bibfont{\small}
%\renewcommand\refname{Literaturverzeichnis} 

\bibliographystyle{apalike} 
\bibliographystylebild{apalike}


\bibliography{literatur/bib}
\bibliographybild{literatur/bib}

\end{document}
And here is the bib.bib:

Code: Select all

% Hier kommen Referenzen hinein
% Damit diese auch gefunden werden, muss im Hauptverzeichnis
% bibtex "datei.aux" also hier diplom.aux ausgeführt werden 
% address = {\url{http://www.eine.url.der.referenz.de}},
% note = {ein paar zusätzliche Sachen}
@article{text,
	author = {texto},
	title = {text},
	journal = {buch},
	year = {2015},
}
@online{bild,
	title = {bild},
	author = {bildo},
	year = {2016},
	howpublished = {\url{https://wikipedia.de/bild.jpg}},
	note = {accessed 2016-01-13},
}
I use kile. At first I make "PDFlatex" for the example.tex, after that I load example.aux and bild.aux. I make "BibTex" for example.aux and then for bild.aux. After that I finally make a second time "PDFlatex" for example.tex. But than, the citation of the "bild"-bibligraphy didn't work. There occurs a question mark in the text for \citebild{bild} and I get the error "Citation 'bild' on page 1 undefined on input line 35." and "There were undefined citations". When I make a third time "PDFlatex" for example.tex, I get an error "finished with exit code 1". I also looked into the .log-file, but didn't find something interesting...

Can someone help me please? :)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Problems with second bibliography using natbib

Post by Johannes_B »

I would use the new system of biblatex and biber instead of the old BibTeX. You can find more details in the important notes concerning bibliographies.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
lunartex
Posts: 3
Joined: Mon Aug 01, 2016 3:32 pm

Problems with second bibliography using natbib

Post by lunartex »

Thank you Johannes for your quick answer. I installed biblatex and biber. I configure the biber-command in kile after that instruction:
http://tex.stackexchange.com/questions/ ... 763#154763

My example.tex looks like that:

Code: Select all

\documentclass[
	pdftex,%              PDFTex verwenden
	a4paper,%             A4 Papier
	oneside,%             Einseitig
	bibliography=totoc,%    		Literaturverzeichnis einfuegen bibtotocnumbered: nummeriert
	listof=totoc,%		Verzeichnisse einbinden in toc
	index=totoc,%            Index ins Verzeichnis einfgen
	parskip=half,%        Europischer Satz mit abstand zwischen Abstzen
	chapterprefix,%       Kapitel anschreiben als Kapitel
	headsepline,%         Linie nach Kopfzeile
	%footsepline,%         Linie vor Fusszeile
	%pointlessnumbers,%     Nummern ohne abschlieenden Punkt
	fontsize=12pt%                 Grssere Schrift, besser lesbar am bildschrim
]{scrbook}
\usepackage{url}
%
% Paket fuer Uebersetzungen ins Deutsche
%
\usepackage[ngerman]{babel}
\usepackage{textcomp}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage[babel,german=swiss]{csquotes}

% Naturwissenschaftliches Zitieren mglich, z.B. et al
%\usepackage{natbib}
%zwei Literaturverzeichnisse
%\usepackage{multibib}
\usepackage[sorting=none, backend=biber]{biblatex}

%
% Literaturverzeichnis-Stil
%
\begin{document}
Hier ist der Text \cite{text}, und hier das Bild \cite{bild}. 


%Literaturverzeichnisse 
\printbibliography[keyword=text]
\printbibliography[notkeyword=bild]
\end{document}
and my bib.bib like that:

Code: Select all

% Hier kommen Referenzen hinein
% Damit diese auch gefunden werden, muss im Hauptverzeichnis
% bibtex "datei.aux" also hier diplom.aux ausgeführt werden 
% address = {\url{http://www.eine.url.der.referenz.de}},
% note = {ein paar zusätzliche Sachen}
@article{text,
	author = {texto},
	title = {text},
	journal = {buch},
	year = {2015},
	keywords = {text},
}
@online{bild,
	title = {bild},
	author = {bildo},
	year = {2016},
	howpublished = {\url{https://wikipedia.de/bild.jpg}},
	note = {accessed 2016-01-13},#
	keywords = {bild},
}
I do "latex" and "biber". Now I get this error:
[biber] finished with exit code 2
and in the ".blg"-file I find this:
ERROR - No data files on command line or provided in the file 'example.bcf'! Exiting
What is now wrong? :/
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Problems with second bibliography using natbib

Post by Johannes_B »

You never defined how your bibliography file is called.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
lunartex
Posts: 3
Joined: Mon Aug 01, 2016 3:32 pm

Problems with second bibliography using natbib

Post by lunartex »

Ok, I got it. Forgot the
\addbibresource{literatur/bib.bib}
Now it works. Thanks. Hope it works also for my thesis :)
Post Reply