I am trying to add my bib files for my PhD dissertation and I am getting an error message that says I have an empty bibliography and citations are missing. I used the subfiles package to break up individual chapters and subchapters which is awesome! However, I would like to get the bibliography working so that my citations show up.
The current file structure for my project is as follows:
dissertation/
|-- Dissertation.tex
|-- Dissertation.cls
|-- makefile (Dissertation, release, clean)
|-- Release/
| |-- Dissertation.pdf
|-- Chapter1/
| |-- Intro1.tex
| |-- Methods1.tex
| |-- Results1.tex
| |-- Discussion1.tex
| |-- Conclusion1.tex
| |-- Figures/
| | -- Figure1.pdf
| | -- Figure2.pdf
| | -- Figure3.pdf
| |-- bib_files/
| | -- bib1.bib
| |-- makefile (Chapter1, Intro1, Methods1, release, clean, etc.)
| |-- Release/
| |-- | -- Chapter1.pdf
| |-- | -- Intro1.pdf
| |-- | -- Methods1.pdf
|-- Chapter2/
| |-- Intro2.tex
| |-- Methods2.tex
| |-- Results2.tex
| |-- Discussion2.tex
| |-- Conclusion2.tex
| |-- bib_files/
| | -- bib2.bib
| |-- Figures/
| | -- Figure1.pdf
| | -- Figure2.pdf
| | -- Figure3.pdf
| |-- makefile (Chapter2, Intro2, Methods2, release, clean, etc.)
| |-- Release/
| |-- | -- Chapter2.pdf
| |-- | -- Intro2.pdf
| |-- | -- Methods2.pdf
|-- AppendixA/
| |-- AppendixA.tex
| |-- Code/
| | -- code1.py
| | -- code2.m
| | -- code3.cc
| |-- Data/
| | -- Data1.csv
| | -- Data2.csv
| | -- Data3.csv
I have tried putting the following in my main.tex file:
% References
\addbibresource{./Chapter2/bib_files/bibliography.bib}
\addbibresource{./Chapter3/bib_files/bibliography.bib}
\addbibresource{./Chapter4/bib_files/bibliography.bib}
I have also tried putting these commands in the individual chapters and that didn't work either:
%%% -*-LaTeX-*-
\documentclass[../Dissertation]{subfiles}
\graphicspath{{Chapter2/Figures/}} % Graphics path for images
\addbibresource{./Chapter2/bib_files/bibliography.bib} % Chapter 2 references
\begin{document}
% Needs to be capitalized (University Rules)
\chapter{\uppercase{Chapter title here}}
\hspace{\parindent}
Experimental data measurement.
\subfile{./Chapter2/0_Abstract}
\subfile{./Chapter2/1_Introduction}
\subfile{./Chapter2/2_Methods}
\subfile{./Chapter2/3_Results}
\subfile{./Chapter2/4_Discussion}
\subfile{./Chapter2/5_Conclusion}
\subfile{./Chapter2/6_Acknowledgment}
% bibliography
\printbibliography[segment=\therefsegment,heading=references]
\end{document}
However, each of these approaches was unsuccessful.
In my .cls file here is how I have defined the bibliography:
%----------------------------------------------------------------------%
% References
%----------------------------------------------------------------------%
\RequirePackage[defernums=true,
hyperref,
backref,
backend=biber,
style=ieee,
natbib=true,
refsegment=chapter,
block=space
]{biblatex} % Use the bibtex backend, biber
\setlength\bibitemsep{1.5\itemsep} % Spacing between items in bilbiography
% Define typesetting of references heading
\defbibheading{references}[References]{%
\section{#1}% Add section so that the table of contents adds the chapter references
\markboth{#1}{#1}%
\singlespacing
}
%----------------------------------------------------------------------%
% Final Bibliography
% Add type=book, article, online, thesis for specific references
%----------------------------------------------------------------------%
\def\finalBibliography{
{\singlespacing
\printbibliography[heading=bibintoc, title={\uppercase{Bibliography}}] % Whole
}
}
At the very end of my main.tex I call my \finalBibliography to show all citations used.
I am also using Ubuntu to execute, compile, and output the final PDF here after a lot of help from previous posts with my final command being make file:
DISSERTATION = Dissertation
TEX = pdflatex -synctex=1 -interaction=nonstopmode --shell-escape
BIBTOOLS = biber
OPEN = open -a Skim.app
RESOURCES = ${DISSERTATION}.pdf
Executables
default:
${TEX} ${DISSERTATION}
${OPEN} ${DISSERTATION}
Order of compiling (LaTeX --> biber --> LaTeX --> LaTeX)
file:
${TEX} ${DISSERTATION}
${BIBTOOLS} ${DISSERTATION}
${TEX} ${DISSERTATION}
${TEX} ${DISSERTATION}
clean:
rm -rf auto _minted- .log .aux .synctex.gz .out .toc .run .bcf .lof .lot .tdo .run.xml .pdf
release:
rm -rf Release
mkdir Release
cp *.pdf Release
make clean
Here is the makefile for each individual chapter/section (Chapter2 specific):
CHAPTER = Chapter2
ABSTRACT = 0_Abstract
INTRODUCTION = 1_Introduction
METHODS = 2_Methods
RESULTS = 3_Results
DISCUSSION = 4_Discussion
CONCLUSION = 5_Conclusion
ACKNOWLEDGE = 6_Acknowledgment
Tex commands
TEX = pdflatex -synctex=1 -interaction=nonstopmode --shell-escape
BIBTOOLS = biber
OPEN = open -a Skim.app
RESOURCES = ${CHAPTER}.pdf
Executables
default:
${TEX} ${CHAPTER}
${OPEN} ${CHAPTER}
clean:
rm -rf auto _minted- .log .aux .synctex.gz .out .bcf .run run.xml .pdf .swo *.swp
release:
rm -rf Release
mkdir Release
cp *.pdf Release
make clean
chapter:
${TEX} ${CHAPTER}
${BIBTOOLS} ${CHAPTER}
${TEX} ${CHAPTER}
${TEX} ${CHAPTER}
file:
make chapter
rm -rf Release
mkdir Release
cp ${RESOURCES} Release
make clean
abstract:
${TEX} ${ABSTRACT}
${BIBTOOLS} ${ABSTRACT}
${TEX} ${ABSTRACT}
${TEX} ${ABSTRACT}
introduction:
${TEX} ${INTRODUCTION}
${BIBTOOLS} ${INTRODUCTION}
${TEX} ${INTRODUCTION}
${TEX} ${INTRODUCTION}
methods:
${TEX} ${METHODS}
${BIBTOOLS} ${METHODS}
${TEX} ${METHODS}
${TEX} ${METHODS}
results:
${TEX} ${RESULTS}
${BIBTOOLS} ${RESULTS}
${TEX} ${RESULTS}
${TEX} ${RESULTS}
discussion:
${TEX} ${DISCUSSION}
${BIBTOOLS} ${DISCUSSION}
${TEX} ${DISCUSSION}
${TEX} ${DISCUSSION}
conclusion:
${TEX} ${CONCLUSION}
${BIBTOOLS} ${CONCLUSION}
${TEX} ${CONCLUSION}
${TEX} ${CONCLUSION}
acknowledge:
${TEX} ${ACKNOWLEDGE}
${BIBTOOLS} ${ACKNOWLEDGE}
${TEX} ${ACKNOWLEDGE}
${TEX} ${ACKNOWLEDGE}
If you have any suggestions, that would be fantastic. The commands don't seem to execute the creation of the bibliography.
Here is a sample error output:
LaTeX Warning: Citation 'Kita_1992' on page 24 undefined on input line 146.
LaTeX Warning: Citation 'Kita_1990' on page 24 undefined on input line 152.
[24]) (./5_Conclusion.tex [25]) (./6_Acknowledgment.tex)
LaTeX Warning: Empty bibliography on input line 25.
[26] (./Chapter2.aux)
LaTeX Warning: There were undefined references.
Package biblatex Warning: Please (re)run Biber on the file:
(biblatex) Chapter2
(biblatex) and rerun LaTeX afterwards.
)
After trying to only run the biber command to create the bibliography
BIBTOOLS = biber
bib:
${BIBTOOLS} ${DISSERTATION}
I am getting this error message and I'm not sure how to debug it:
biber Dissertation
INFO - This is Biber 2.14 (beta)
INFO - Logfile is 'Dissertation.blg'
ERROR - Cannot find 'Dissertation.bcf'!
INFO - ERRORS: 1
make: *** [Makefile:20: bib] Error 2
\addbibresourcecommands in the main preamble, but add\subfixaround the path name, i.e.,\addbibresource{\subfix{./Chapter2/bib_files/bibliography.bib}}. The preambles of the subfiles will only be processed when typesetting the subfile separately. – gernot Feb 27 '21 at 21:36\subfix{...}inside of the\addbibresourceand it still resulted in the same error message. – Christopher Creveling Feb 27 '21 at 22:23