Setup
I am using Rubber to compile my LaTeX document.
In my root folder I have main.tex
, mybib.bib
(both coming from here) and Makefile
.
main.tex
\documentclass[11pt]{article}
\usepackage{cite}
\begin{document}
\title{My Article}
\author{Nobody Jr.}
\date{Today}
\maketitle
Blablabla said Nobody ~\cite{Nobody06}.
\bibliography{mybib}{}
\bibliographystyle{plain}
\end{document}
mybib.bib
@misc{ Nobody06,
author = "Nobody Jr",
title = "My Article",
year = "2006" }
Makefile
.PHONY: clean
LATEX_SRC=$(wildcard *.tex)
REFS=$(wildcard *.bib)
all: main.pdf
%.pdf: %.tex $(LATEX_SRC) $(REFS)
mkdir -p build
rubber --into build --short --pdf $<
rubber-info --into build --check $<
clean:
rm -rf build
Running make
will complain that
running: bibtex main.aux...
[biblio] There were errors running bibtex.
build/main.aux:3: [bibtex] I couldn't open database file mybib.bib
Workaround
Replacing \bibliography{mybib}{}
with \bibliography{../mybib}{}
in main.tex
is a valid workaround.
Question
Now, how do I get Rubber to tell BibTeX the correct folder? Both main.tex
and myref.bib
are arguments to rubber
, so I'm not sure how BibTeX is not seeing the latter.
My main.aux
contains the line \bibdata{mybib}
, which is causing the problem, and that's why adding the ../
to main.tex
was giving a working solution, but I rather have a better understanding about how to use Rubber than patching its behaviour myself, since I believe I might be misusing it.
rubber
but I doubt this is reallyrubber
's problem. BibTeX is run on the generated.aux
file and so looks formybib.bib
from the location of that.aux
. Usually, you'd put your.bib
file into your personal TEXMF tree rather than the working directory, which isn't very convenient for general usage, so this wouldn't be a problem.bibtex build/main.aux
, or copy all files (including the tex and the bib) to the build directory before the compilation (imho the better way, compilations steps are easier to handle in the long run if everything is in the same folder).bibtex
,rubber
is. That's why I posted this question, i.e. how do I getrubber
to callbibtex
from the root directory? I'm not looking for "fixes", since I've already found one. I'm trying to understand why others don't have a similar issue, and what's their workflow and setup. Btw, thank you both for commenting.--into build
option (i.e. having all files in the same directory) actually does not throw this issue. I wrote this question to understand whether I am misusingrubber
, which is very likely, since I'm a newbie. I did not intend to sound arrogant; my apologies.