1

I want to execute the following Makefile:

main.pdf: main.tex main.bib
pdflatex main.tex
bibtex main.aux
pdflatex main.tex
pdflatex main.tex

It comes from this site: http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management#Why_won.27t_LaTeX_generate_any_output.3F.

I type the command "make" in the same directory and get the following error message:

make: *** No rule to make target main.bib', needed bymain.pdf'. Stop.

I don't know how to procede. This site with error messages does not help me.

I'm using Ubuntu 14.04

Greetings!

2 Answers 2

1

You need to indent starting from pdflatex because they are the rules to make the target. Hint from here https://stackoverflow.com/questions/1739434/whats-wrong-with-this-makefile

1

A working Makefile will be:

main.pdf: main.tex main.bib
    pdflatex main.tex
    bibtex main.aux
    pdflatex main.tex
    pdflatex main.tex

note that you can't simply copy and paste the thing, because the first character in the command line MUST be a physical "TAB" character (ascii code 8). How to enter it, it depends on your editor. vim should automatically switch to a mode protecting TABs when editing a makefile, but other editors I do not know.

Makefile syntax is, eh, funny.

I heartily suggest using something like latexmk (in standard repos) to do the job; it will take care of dependencies and of multiple passes quite nicely.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .