I'm trying to create a "flow chart" of papers that shows the progression of key ideas over time. A very basic example is this:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\newcommand{\oldpaper}{2}
\newcommand{\newpaper}{1}
\begin{tikzpicture}[show/.style={circle,draw}]
\node[show] (\newpaper) at (0,2) [label=right:{This 2011 paper utilizes the good ideas and makes them even better}] {\newpaper};
\node[show] (\oldpaper) at (0,0) [label=right:{This paper came out in 1900 and has good ideas}] {\oldpaper};
\draw[->] (\oldpaper) -- (\newpaper);
\end{tikzpicture}
\bibliographystyle{amsplain}
\begin{thebibliography}{10}
\bibitem{newpaper}C. Charles, \emph{New Stuff}, 2011.
\bibitem{oldpaper}H. Huckley, \emph{Old Stuff}, 1900.
\end{thebibliography}
\end{document}
The point is that the circular nodes have a number inside of them that equals the number in the bibliography, so if you're looking at the flowchart and see a paper that looks interesting, you can look at the references to see exactly what paper it is. The only way I could figure out how to do this somewhat efficiently was by the \newcommand
stuff -- but this requires me compiling the code, looking at the bibliography, and then manually defining the \newpaper
and \oldpaper
to be what they "should" be. If I add another reference, say,
\documentclass{article}
\usepackage{tikz}
\begin{document}
\newcommand{\oldpaper}{2}
\newcommand{\newpaper}{1}
\begin{tikzpicture}[show/.style={circle,draw}]
\node[show] (\newpaper) at (0,2) [label=right:{This 2011 paper utilizes the good ideas and makes them even better}] {\newpaper};
\node[show] (\oldpaper) at (0,0) [label=right:{This paper came out in 1900 and has good ideas}] {\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}
then I have to redefine my \oldpaper
and \newpaper
variables by hand. It's also important that the nodes are named with the same variable, that way the drawing looks right no matter what value the variables have. My real flow chart has over 30 papers in it, and the real bibliography has over 50. Obviously it's getting cumbersome to do this by hand, so I'm wondering if I can somehow use \cite{}
and extract what the reference number "should be," and name/number the nodes accordingly, and it will update dynamically should I add or drop a reference (some of my references don't show up in the flow chart). I tried adding
\makeatletter
\renewcommand*{\@biblabel}[1]{#1}
\makeatother
in the preamble, then defining
\newcommand{\oldpaper}{\cite{oldpaper}}
so that the variable \oldpaper
would have the value equal to the current citation number \cite{oldpaper}
but that didn't work at all. The error message is:
Argument of \XC@definec@lor has an extra }
This is beyond my TeX knowledge, and I've spent hours reading about BiBTeX and googling to no avail. Does anyone know how to solve this? Thank you in advance, and I hope my question is clear.