1

This question already has an answer here:

I tried to compile the very basic example of biblatex in ShareLaTex from https://www.sharelatex.com/learn/Bibliography_management_with_biblatex in Texshop. I tried to compile first with LaTex and then with BibTex, but when I ran the BibTex, I got three errors as following:

I found no \citation commands---while reading file try2.aux
I found no \bibdata command---while reading file try2.aux
I found no \bibstyle command---while reading file try2.aux

The try2.tex file is directly copied from the ShareLaTex website:

% The main .tex file:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{biblatex}
\addbibresource{sample.bib}

\begin{document}
Let's cite! The Einstein's journal paper \cite{einstein} and the 
Dirac's book \cite{dirac} are physics related items. 

\printbibliography

\end{document}

The following is the sample.bib file, which is also a copy from the ShareLatex website:

% The sample.bib file:
@article{einstein,
author =       "Albert Einstein",
title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
             [{On} the electrodynamics of moving bodies]",
journal =      "Annalen der Physik",
volume =       "322",
number =       "10",
pages =        "891--921",
year =         "1905",
DOI =          "http://dx.doi.org/10.1002/andp.19053221004",
keywords =     "physics"
}

@book{dirac,
title={The Principles of Quantum Mechanics},
author={Paul Adrien Maurice Dirac},
isbn={9780198520115},
series={International series of monographs on physics},
year={1981},
publisher={Clarendon Press},
keywords = {physics}
}

I find ShareLaTex useful but sometimes cannot work offline, so I also use TexShop as a complimentary. I know that there must be difference between ShareLatex and TexShop, but I am not sure how I should modify this to make it compile in TexShop. Or, are there any alternative ways to make it work?

Thank you so much!

marked as duplicate by moewe biblatex Jun 18 '17 at 6:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You have to use Biber, not BibTeX. – egreg Jun 17 '17 at 21:08
  • 1
  • @moewe I think this is a dupicate and should be marked as such. I feel this site has a tendency to answer the same question multiple times, over and over again. Taking this effort into the wikibook or something similar, we wouldn't have that much questions here. Meaning less to answer, meaning less reputation. Ok, got it now why so many question are answered. >:-/ – Johannes_B Jun 18 '17 at 6:15
  • Please see if en.wikibooks.org/wiki/LaTeX/… helps – Johannes_B Jun 18 '17 at 6:15
1

TeXShop assumes bibtex as the program to process the .bib file, but biblatex uses biber. So you need to tell TeXShop to process the file with biber. You can do this two ways: if you are always going to be using biber then you can change the default BibTeX engine in the TeXShop preferences Engine panel to biber instead of bibtex.

Alternatively, (or additionally) you can add the following line to the top of your source file to tell TeXShop which program to use on a file by file basis:

For biber (if your document uses biblatex):

% !BIB TS-program = biber

Foe bibtex (if your document uses, e.g. natbib or no bibliography package at all):

% !BIB TS-program = bibtex

A third way, is to use one of the latexmk Engines in TeXShop, which will check which program to use automatically, and also do all of the relevant compiles. For this you can add:

% !TEX TS-program = pdflatexmk

(or equivalent if you are using xelatex or lualatex.)

If this last solution doesn't work you may need to move the Engine files from the Inactive folder to Engines folder and restart TeXShop. See:

For other useful directives like these see also:

  • Terrific answer. I'll add that you may leave out the TS- in the engine directive in TeXShop for compatibility with TeXworks. With TeXShop 3.77 there is an additional directive '% !TEX TS-parameter = ' (TS- optional) that will pass its argument as a second parameter to the chosen engine. Any engine can ignore it or use $2 for whatever purpose it wants. I know no engines that use that parameter at this time. – Herb Schulz Jun 17 '17 at 21:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.