Theses, Books, Title pagesReading bibliography entries from different bib files and merging them into one bibliography at the end.

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
byn
Posts: 56
Joined: Fri Jun 10, 2022 12:27 pm

Reading bibliography entries from different bib files and merging them into one bibliography at the end.

Post by byn »

i have different bibliography entries in different bibliography files. I have tried to use the \usepackage{multibib} but I am getting an error. This is how I define the entries in the main file.

\usepackage{multibib}

\bibliographystyle{apalike}
\renewcommand\bibname{References}% Multiple bibliography entries from different bibliograph files
\bibliography{bibliography1}
\bibliography{bibliography2}
\bibliography{bibliography3}

For example in Chapter 1, I cite from bibliograpgy1 with this reference; \cite{K1
In chapter 2, I cite from from bibliograpgy2 with this reference; \cite{Gouvea,Apos}
In chapter 3, I cite from from bibliograpgy3 with this reference; ~\cite{CryptoBook,LiCai}

there is no repetition of these entries in either bibliography, however instead of appending the different citations into one bibliography, I end up with three references pages with the same repeated reference.

I have attached the log files, resultant pdf output and a simplified code for the template can be found here; https://drive.google.com/file/d/1oEuo36 ... sp=sharing
main.log
Logfile from compilation
(26.73 KiB) Downloaded 1130 times
main.pdf
pdf output result
(390.15 KiB) Downloaded 1116 times
Your suggestions and corrections are highly appreciated.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
byn
Posts: 56
Joined: Fri Jun 10, 2022 12:27 pm

Reading bibliography entries from different bib files and merging them into one bibliography at the end.

Post by byn »

The link to the simplified working template is here; https://drive.google.com/file/d/1O5c5Vh ... sp=sharing
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Reading bibliography entries from different bib files and merging them into one bibliography at the end.

Post by Stefan Kottwitz »

I don't see an error in the log file. You did not mention the text of the error message, what is it?

Stefan
LaTeX.org admin
byn
Posts: 56
Joined: Fri Jun 10, 2022 12:27 pm

Reading bibliography entries from different bib files and merging them into one bibliography at the end.

Post by byn »

This is the error from the compilation: "Process started

This is BibTeX, Version 0.99d (TeX Live 2022) The top-level auxiliary file: main.aux The style file: apalike.bst Illegal, another \bibdata command---line 53 of file main.aux : \bibdata : {bibliography2} I'm skipping whatever remains of this command Illegal, another \bibdata command---line 55 of file main.aux : \bibdata : {bibliography3} I'm skipping whatever remains of this command Database file #1: bibliography1.bib Warning--I didn't find a database entry for "Gouvea" Warning--I didn't find a database entry for "Apos" Warning--I didn't find a database entry for "CryptoBook" Warning--I didn't find a database entry for "LiCai" (There were 2 error messages)

Process exited with error(s)"
byn
Posts: 56
Joined: Fri Jun 10, 2022 12:27 pm

Reading bibliography entries from different bib files and merging them into one bibliography at the end.

Post by byn »

The auxilliary file is attached here
main.aux
Auxilliary file
(3.48 KiB) Downloaded 796 times
and everything else is as is in the template.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Reading bibliography entries from different bib files and merging them into one bibliography at the end.

Post by Stefan Kottwitz »

multibib can be complicated. From Overleaf:
If compiling on a local machine: Compiling your main document .tex will generate multiple .aux files. You must now run bibtex on all these .aux files, before compiling the main document .tex file again.
You can do that, or if it's too complicated, use a single bibliography. That's relevant for a scientist. Splitting in multiple bibliographies are cosmetics.

Stefan
LaTeX.org admin
byn
Posts: 56
Joined: Fri Jun 10, 2022 12:27 pm

Reading bibliography entries from different bib files and merging them into one bibliography at the end.

Post by byn »

I am compiling on a local machine, how would i run separate Bibtex files.
byn
Posts: 56
Joined: Fri Jun 10, 2022 12:27 pm

Reading bibliography entries from different bib files and merging them into one bibliography at the end.

Post by byn »

Gotcha! I combined and run bibtex and it worked. Thanks!
Post Reply