0

I'm trying to get BibLatex to work on my MacTex installation. I'm using this tutorial over at sharelatex.com.

They give the following MWE

\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}

When I compile this, I get something different from them. They get

enter image description here

but I get

enter image description here

Note mine has no references section, and my citations aren't written the same.

Possibilities

  1. It's not finding my .bib file. I notice that MacTex didn't create the file ~/Library/texmf for me. I tried creating it myself, and putting my bib file in ~/Library/texmf/bibtex/bib/. I'm not sure how to tell if this is working or not. I assume it would complain if it couldn't see my bib file, but maybe not.
  2. biblatex isn't installed properly. I did just update tlmgr and updated biblatex.

Added: In response to a question, here is what my "pdfTeX" field says: Tex:pdftex --file-line-error --synctex=1 Latex:pdflatex --file-line-error --synctex=1

Here is what my "TeX + divps + distiller" field says: Tex: simpdftex etex --maxpfb --extratexopts "-file-line-error -synctex=1" Latex: simpdftex latex --maxpfb --extratexopts "-file-line-error -synctex=1"

Eric Auld
  • 1,223
  • 2
    Have you run biber between two latex runs? – Sergei Golovan Feb 23 '18 at 05:10
  • This possibly means that you don't compiled correct the file(s). You have to run 1) pdflatex mainfilename 2) bibtex mainfilename 3) twice pdflatex mainfilename (Where twice is not a command and mainfilename doesn't need extension [e.g. from tha file "main.tex"\ you need only "main") – koleygr Feb 23 '18 at 05:12
  • @koleygr My main file is called "Playing-with-biblio.tex". When I do the second command bibtex ~/.../Playing-with-biblio it says I couldn't open file name /.../Playing-with-biblio.blg. In fact, I don't know of any such file, and I don't know what that means. – Eric Auld Feb 23 '18 at 05:17
  • may be you have to run biber instead of bibtex (I haven't installed this right now) . It was my mistake the bibtex command see here (https://tex.stackexchange.com/questions/286706/troubleshooting-for-biber/287811) Sorry for that... – koleygr Feb 23 '18 at 05:25
  • @SergeiGolovan @koleygr I've tried doing both the biber and the biblatex ones, between two pdflatex runs. I omitted the .tex at the end of the main file name. Most recently the biber one gave me the error Cannot find control file '/Users/ericauld/Desktop/Latex test/Playing-with-biblio.bcf'! - did you pass the "backend=biber" option to BibLaTeX? – Eric Auld Feb 23 '18 at 05:35
  • @SergeiGolovan @kolegyr I have in fact passed the backend=biber command. (And also tried it without) – Eric Auld Feb 23 '18 at 05:35
  • Wild guess: try to put your source files into a directory without spaces in it. LaTeX sometimes breaks for such directories or file names. – Sergei Golovan Feb 23 '18 at 05:39
  • Also you could try a sharelatex or overleaf run to make sure that your installation is ok – koleygr Feb 23 '18 at 05:45
  • I made a video tutorial on the first steps with biblatex: https://www.youtube.com/watch?v=ZYvS52511oQ. I also had a hard time, in my LaTeX beginning, to understand the stuff "just" from reading, theerfoire I made this video. – Dr. Manuel Kuehner Feb 23 '18 at 07:57
  • 1
    Delete all temporary files. Then run (pdf)LaTeX on your file. If there are any errors, correct them (warnings about undefined references and rerun requests can be ignored for now, everything else needs to be addressed). Check that in the same directory as your .tex file there is now a .bcf file. Then run Biber. Biber should now find the .bcf file, the .blg file should contain any other warnings and errors you need to worry about. Then run (pdf)LaTeX twice again. – moewe Feb 23 '18 at 11:05
  • Is you .bib file called sample.bib? – cfr Feb 24 '18 at 03:04
  • @cfr No, I altered the code accordingly – Eric Auld Feb 25 '18 at 04:10
  • Any news here? Could you get things to work? It would be extremely helpful for us if you could follow the steps outlined in my last comment and show us the warnings and errors from the .log and .blg files. – moewe Mar 01 '18 at 10:55
  • @moewe I'm sorry, I've gotten distracted. I will try it and let you know how it goes – Eric Auld Mar 02 '18 at 03:01
  • Did you get anywhere? It's hard to offer helpful hints if we know only part of the symptoms and not even what exactly you tried. – moewe Mar 04 '18 at 10:13
  • Any news here? Did you have some more time to look into this? – moewe Mar 10 '18 at 14:58
  • Please have a look at https://en.wikibooks.org/wiki/LaTeX/Bibliographies_with_biblatex_and_biber @moewe I made some changes today. What do you think about it? – Johannes_B Mar 10 '18 at 17:42
  • @Johannes_B \DeclareLanguageMapping should not be needed in current versions of biblatex-apa. Other than that it's pretty solid. There are lots more things to be said, and I would probably always load babel and csquotes with biblatex, but if we start with that, the page size would explode. – moewe Mar 10 '18 at 23:37
  • Any news here? It's been more than a month now since you asked the question. We are still missing crucial bits of information here. At the moment the question is unclear. And I will vote to close as such if the question is not updated. – moewe Mar 30 '18 at 10:31
  • @moewe I am very sorry. I will update it today. – Eric Auld Mar 30 '18 at 17:34
  • @moewe I deleted all the files except the .tex file (I'm not sure which ones that TeXShop creates are the temporaries.) When I run pdflatex, it tells me No file Playing-with-biblatex.bbl. That is not even one of the files I had deleted. Further, it is spitting out the .log and .bcf files in another directory, namely /users/ericauld. So I'm not sure if I should fix these issues before running biber. – Eric Auld Mar 30 '18 at 18:36
  • If the temporary files are written to /users/ericauld instead of the working directory that is a potential problem. I assume you use TeXshop to call TeX? Can you show us a screenshot of the compilation settings? Please copy and paste the value of the most important fields, so that we can see the complete value in case it is cut off in the picture. You can try if your installation is OK by running pdflatex foo, biber foo, pdflatex foo, pdflatex foo from the command line (assuming your .tex file is called foo.tex). – moewe Mar 30 '18 at 20:10
  • @moewe Sure. I really appreciate all your help. Here's the screenshots. https://www.sendspace.com/file/n8ahyo – Eric Auld Mar 31 '18 at 18:37
  • I'd need to see the full text of the 'pdfTeX' and 'pdfLaTeX' fields. Please copy the contents and edit them into your question. I also noticed that the default bibliography engine is set to BibTeX. How do you call Biber with that setting? (See https://tex.stackexchange.com/q/154751/35864) Can you compile from the command line as suggested in one of my earlier comments? – moewe Mar 31 '18 at 19:57
  • 1
    Any news here? Can you tell us what exactly your settings are? Please try compiling from the command line, so we can find out whether your editor messes things up or if the problem is elsewhere. – moewe Apr 05 '18 at 06:28
  • @moewe I couldn't find the "pdfLaTeX" field; only the "pdfTeX" field. I edited my answer with the content of those fields. I also tried compiling from the command line. When I said biber <filename>, it told me it couldn't find the bcf file, and asked whether I passed the backend=biber command to BibLatTeX. (I went back and made sure that option was written in the TeX file, and the message still came up.) It's still putting the .bcf and .log files in that other directory when I compile from the command line. – Eric Auld Apr 06 '18 at 17:22
  • Very, very odd. Is the PDF sent to /users/ericauld as well? Is the directory of your .tex file writeable? What does kpsewhich -var-value TEXMFOUTPUT return if you type it in the command line? The fact that temporary files are sent to the wrong directory is definitely the problem here. The question is why that happens. It should not happen if the system has write access to the directory with the .tex file and you only call pdflatex foo without further options. Did you at some point change settings to allow for a separate build directory or to send temporary files elsewhere? – moewe Apr 06 '18 at 18:56
  • Oh, one thing. When you did pdflatex <filename> were you in the directory of filename? Or did you say pdflatex ~/full/path/to/file? You must be in the directory of the file for things to work properly, i.e. cd ~/full/path/to and then pdflatex file. – moewe Apr 06 '18 at 19:05
  • OK, so once I navigate to the correct file and do those four commands in sequence, the right thing is produced! That's a great milestone, and I thank you for helping me reach it. Now to make it work from TeXShop...when I try to make another file and do it from TeXShop, it tells me to please (re)run Biber and compile again. How might I get it to save the temporary files to the right place? Thanks – Eric Auld Apr 07 '18 at 01:31
  • If you run the sequence pdflatex document, biber document, pdflatex document, pdflatex document do you get a complete document with citations and bibliography? Does Biber give an error? If everything is fine, double check with https://tex.stackexchange.com/questions/154751/ that your editor is set up correctly. If it is, it should be fine. In the screenshots you posted a while ago your editor is set up to use BiBTeX by default, which means you need a magic command to make it use Biber. See the link. – moewe Apr 07 '18 at 04:59
  • It's me again. Did you get any further here? – moewe Apr 21 '18 at 06:15
  • @moewe Thanks very much for keeping up with me on this. Yes, if I run those four commands from the command line, I get a complete document with citations and bibliography. Biber didn't seem to give me any errors. Now, as for compiling from TeXShop, I have changed the option you mention from BiBTeX to Biber, but still I can't get TeXShop to produce a file with citations. – Eric Auld Apr 21 '18 at 16:06
  • To answer some of your above questions: as of now, TeXShop seems to be spitting out the .log and .bcf files in the right place. When I type kpsewhich -var-value TEXMFOUTPUT into the command line, it just thinks for a second, does nothing, and takes me back to the prompt. And no, I have never changed settings to allow for another build directory or to send temp files somewhere else. – Eric Auld Apr 21 '18 at 16:09
  • OK, that means that your system is installed correctly and works fine. The problem must be with TeXshop and its compilation settings. The settings also look OK to me. Would it be OK to try and reset the TeXshop settings to default? – moewe Apr 21 '18 at 16:14
  • @moewe Sure. I set everything to default, and the problem persists. I also tried everything default except changing bibtex to biber in the BibTeX engine field. – Eric Auld Apr 21 '18 at 17:32
  • @moewe I believe all the fields are the same as I wrote in the end of the question. – Eric Auld Apr 21 '18 at 17:34
  • @moewe Any idea how I could fix this? Thanks for your help so far, btw – Eric Auld Apr 27 '18 at 18:51
  • 2
    Not really, sorry. I think we have established that you can compile the documents fine from the command line. So the issue is not with your general installation. The issue must lie with your editor's settings. Now I don't have a Mac and don't use TeXShop, but to my untrained eyes your settings look OK. That's all I can do. – moewe Apr 27 '18 at 18:56

0 Answers0