11

I'm working with TeXShop 3.61 and I'm currently switching from natbib to biblatex. Despite having tried for hours and read through all other entries, I still can't make it work.

.tex Document:

\documentclass{article}
\usepackage[backend=biber]{biblatex}
\bibliography{Ohne-Titel}
\begin{document}
Test test test \cite{Lee2009a}
\printbibliography
\end{document}

.aux File:

\relax 
\abx@aux@sortscheme{nty}
\abx@aux@cite{Lee2009a}
\@writefile{toc}{\boolfalse {citerequest}\boolfalse {citetracker}\boolfalse {pagetracker}\boolfalse {backtracker}\relax }
\@writefile{lof}{\boolfalse {citerequest}\boolfalse {citetracker}\boolfalse {pagetracker}\boolfalse {backtracker}\relax }
\@writefile{lot}{\boolfalse {citerequest}\boolfalse {citetracker}\boolfalse {pagetracker}\boolfalse {backtracker}\relax }

.bib Entry:

@article{Lee2009a,
author = {Lee, Geun},
file = {:Users/JulianLeitner/Library/Application Support/Mendeley Desktop/Downloaded/Lee - 2009 - A Theory of Soft Power and Korea's Soft Power Strategy.pdf:pdf},
journal = {The Korean Journal of Defense Analysis},
number = {2},
pages = {205--218},
title = {{A Theory of Soft Power and Korea's Soft Power Strategy}},
volume = {21},
year = {2009}
}

And here the error message:

 LaTeX Warning: Citation 'Lee2009a' on page 1 undefined on input line 5.

 LaTeX Warning: Empty bibliography on input line 6.

 [1{/usr/local/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
 (./Ohne-Titel.aux)

 LaTeX Warning: There were undefined references.

To compile I simply use the Macro --> applescript --> bibliography.

Any help would be highly appreciated! Julian

Julian
  • 157

1 Answers1

10

Since biblatex is used, the bib-file should be specified with addbibresource{...}.

\bibliography is 'deprecated` and shouldn't be used any longer.

And use biber after pdflatex, compile twice (or better three times!)

\documentclass{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{Ohne-Titel.bib}
\begin{document}
Test test test \cite{Lee2009a}
\printbibliography
\end{document}

Ohne-Titel.bib

@article{Lee2009a,
author = {Lee, Geun},
file = {:Users/JulianLeitner/Library/Application Support/Mendeley Desktop/Downloaded/Lee - 2009 - A Theory of Soft Power and Korea's Soft Power Strategy.pdf:pdf},
journal = {The Korean Journal of Defense Analysis},
number = {2},
pages = {205--218},
title = {{A Theory of Soft Power and Korea's Soft Power Strategy}},
volume = {21},
year = {2009}
}

enter image description here

  • 2
    While \bibliography{<basename>} is deprecated for \addbibresource{<basname>.<ext>}, it should still work here ... I'd hazard the guess that it's a problem of calling Biber and not BibTeX that is at the heart of the issue here. – moewe Apr 20 '16 at 16:54
  • @moewe: You're the bibliography expert here. I think it's still better to refer to \addbibresource, isn't it? –  Apr 20 '16 at 16:57
  • 1
    I certainly prefer \addbibresource over \bibliography, but there are some that like the old way of doing things. For some of the extra functionality (access to remote locations etc.) \addbibresource is required, but most people can get what they need from \bibliography. – moewe Apr 20 '16 at 16:59
  • @moewe: Thanks for explanation -- I changed to shouldn't be used in the post –  Apr 20 '16 at 17:01
  • @ChristianHupfer Is it possible to use (an adpatation of) your code above with LuaLaTeX ? For now, it does not produce any Reference, and it is written [Lee2009a] in place of the \cite command after the compilation. I could have missed something about how doing a "good" compilation... – Nicolas May 23 '16 at 14:19
  • @Nicolas: I just compiled the code above with LuaLaTeX. The citation is [1]. –  May 23 '16 at 14:22
  • @ChristianHupfer Thank you for the answer. This is strange: it does not produce the same result for me. What about the .bib file ? Did you compile it, or is it enough to save it in the same repertory as the main file ? How do you explain the difference (I just cut/pasted your code) ? – Nicolas May 23 '16 at 14:30
  • I have the .bib file in the same directory, but that shouldn't matter actually. Did you run biber at all at the end of the first compilation, then lualatex twice? At the moment, I don't have a clue what's going wrong with your compilation –  May 23 '16 at 14:33
  • @ChristianHupfer I ran the main file with Biber and then twice with LuaLaTeX, but each time I ran with LuaLaTeX, there was the error message "Package biblatex Warning: File 'test02.bbl' is wrong format version - expected 2 .6.". – Nicolas May 23 '16 at 14:39
  • @Nicolas: Either it is a misunderstanding or an error: lualatex main.tex ; biber main.aux ; lualatex main.tex ; lualatex main.tex, if the main file is called main.tex, for example –  May 23 '16 at 14:40
  • @ChristianHupfer Now you write this sequence like this, I remember having seen it in some other posts without understanding it. So precisely, where do I write the sequence lualatex main.tex; biber main.aux;``lualatex main.tex; lualatex main.tex (I use MiKTeX 2.9 and write my documents with TeXworks if it matters...) ? – Nicolas May 23 '16 at 14:45
  • @Nicolas: I assume this is incorporated in TeXWorks as click on the button with lualatex etc. –  May 23 '16 at 14:46
  • @ChristianHupfer There indeed are LuaLaTeX and Biber (that I've manually added following the instructions that a user posted on tex.stackexchange), and I ran my main file with them in the order you indicated to me. The error message appeared during the compilation of the main file with LuaLaTeX just after the one with Biber... – Nicolas May 23 '16 at 14:51
  • @Nicolas: Well, I fear I can't provide help on this. I neither use MikTeX nor such editors. I compile on console and am quite happy with that –  May 23 '16 at 14:53
  • @ChristianHupfer OK, no problem. I thank you anyway for the time you spent on my problem. – Nicolas May 23 '16 at 14:56
  • 1
    @Nicolas: I am pretty sure it's some TeXWorks configuration issue. –  May 23 '16 at 15:05
  • @moewe Since you seem to be the bibliography expert here, can I ask you what do you think about my problem please ? I cut/pasted the code of Christian Hupfer and compiled (I use MiKTeX 2.9 and TeXWorks) with LuaLaTeX, Biber and twice with LuaLaTeX, and got the error message "Package biblatex Warning: File 'test02.bbl' is wrong format version - expected 2 .6.". I did not see this kind of error in other posts here. I think that Christian Hupfer is right when he says that it should be some TeXWorks configuration issue. – Nicolas May 23 '16 at 15:11
  • @Nicolas Sounds like a version mismatch of biblatex and Biber. Update both packages, since you use MikTeX run the Update Manager in both Admin and User mode (you might even have to do this twice to update all packages). Then delete the temporary files and try again. You can check the configuration issue in the post this question is a duplicate of, for the update stuff see here. – moewe May 24 '16 at 05:20
  • @moewe Thank you for your answer. I've updated and synchronizd MiKTeX. But as I am both User and Admin, I've just do it as Admin; besides, I do not know how to update+synchronize as User... Then I ran with LuaLaTeX, Biber and both LuaLaTeX: each time, there was the error message ! Package pgf Error: Driver file ``pgfsys-luatex.def'' not found.., but my bibliography is OK now. So I have a new problem that is discussed here: http://tex.stackexchange.com/questions/309140/after-miktex-update-when-using-lualatex-package-pgf-error-driver-file-pgfsys. Thanks again for your help! – Nicolas May 24 '16 at 10:05