
Estoy usando biber y quiero citar referencias dentro de una imagen tikz. Seguí estorespuestaeso describía cómo hacerlo con bibtex y funciona muy bien, pero cuando se cambia a usar biber, ya no funciona:
\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}
¿Alguien conoce alguna solución sin que tenga que cambiar a bibtex?
ACTUALIZAR:
Como lo señalan varios a continuación, mi código original que publiqué fue una solución fácil. El error real que encontré fue el resultado de mi código LaTeX más grande y encontré el problema. Aquí está el código actualizado que tiene el problema:
\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}
El problema está en el \tikzexternalize[prefix=fig/]
comando. Solucioné este problema agregando \tikzexternaldisable
antes de tikzpicture y \tikzexternalenable
después de tikzpicture.
Respuesta1
Como se sugiere en los comentarios, debería seguir biblatex
la forma de tratar la bibliografía, en lugar de hacerlo a mano. P.ej:
\documentclass{article}
\usepackage{tikz}
\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}
\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}
\printbibliography
\end{document}
Que produce:
Editar:Al final resultó que, el problema es esencialmente uno de uso correcto de biblatex
/ biber
y tiene poco que ver con TikZ, por lo que una lista de elementos iniciales biblatex
podría ser útil: