I'm using biber and want to cite references inside a tikzpicture. I followed this answer that described how to do it with bibtex and it works nicely, but when switching to use biber, it doesn't work anymore:
\documentclass{article}
\usepackage{tikz}
\usepackage[backend=biber]{biblatex}
\begin{document}
\begin{tikzpicture}[show/.style={circle,draw}]
\node[show] (newpaper) at (0,2)
[label=right:{This 2011 paper ...}]
{\cite{newpaper}};
\node[show] (oldpaper) at (0,0)
[label=right:{This paper came out in 1900 ...}]
{\cite{oldpaper}};
\draw[->] (oldpaper) -- (newpaper);
\end{tikzpicture}
%\bibliographystyle{amsplain}
\begin{thebibliography}{10}
\bibitem{newerpaper}B. Becker, \emph{Even Newer Stuff}, 2012.
\bibitem{newpaper}C. Charles, \emph{New Stuff}, 2011.
\bibitem{oldpaper}H. Huckley, \emph{Old Stuff}, 1900.
\end{thebibliography}
\end{document}
Does anyone know of a solution without me having to switch to use bibtex?
UPDATE:
As noted by several below, my original code I posted was an easy fix. The actual bug I found was a result of my larger LaTeX code and I found the issue. Here's the updated code that has the issue:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize[prefix=fig/]
\usepackage[backend=biber]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{newerpaper,
author={B. Becker},
title={Even Newer Stuff},
date={2012}
}
@book{newpaper,
author={C. Charles},
title={New Stuff},
date={2011}
}
@book{oldpaper,
author={H. Huckley},
title={Old Stuff},
date={1900}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
%\tikzexternaldisable
\begin{tikzpicture}[show/.style={circle,draw}]
\node[show] (newpaper) at (0,2)
[label=right:{This 2011 paper ...}]
{\cite{newpaper}};
\node[show] (oldpaper) at (0,0)
[label=right:{This paper came out in 1900 ...}]
{\cite{oldpaper}};
\draw[->] (oldpaper) -- (newpaper);
\end{tikzpicture}
%\tikzexternalenable
\printbibliography
\end{document}
The problem is with the \tikzexternalize[prefix=fig/]
command. I got around this issue by adding \tikzexternaldisable
before the tikzpicture and \tikzexternalenable
after the tikzpicture.
addbibresource
?biblatex
but your bibliography is done by hand? If' you're really doing things by hand, then don't usebiblatex
. If you're really usingbiblatex
delete your hand-done bibliography and replace it with\printbibliography
, tellbiblatex
where to find your.bib
file (using\addbibresource
) and letbiblatex
do the work. See biblatex in a nutshell (for beginners).\usetikzlibrary{external}
if you are "getting around it" with\tikzexternaldisable
in the only tikz drawing you have?