3

Goal: Use \cit{...} e.g. in a circle or box, etc., when drawing a figure. And then include this figure and compile it with pdflatex.

With Xfig, we can do similar things with math mode, but how to do it with cite?

Is there another tool supporting cite in bibtex style?

(Please note: This question is about to cite a paper within a figure, NOT about using label and ref to cite the figure. Nor do I mean to cite in the figure caption.)

Thanks!

lukmac
  • 1,073
  • 1
  • 8
  • 7

2 Answers2

5

Since you can use math in xfig, you already have the solution, just use \cite in math. Stuff that does not like math mode can be wrapped in \mbox:

$\mbox{Whatever}$

Example for xfig

Xfig file cite.fig:

#FIG 3.2  Produced by xfig version 3.2.5b
Landscape
Center
Metric
A4      
100.00
Single
-2
1200 2
2 4 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5
         2565 2025 2565 1710 2160 1710 2160 2025 2565 2025
4 0 0 50 -1 0 12 0.0000 6 165 1080 2250 1935 $\\cite{foo}$\001

And the LaTeX file:

\documentclass{article}
\usepackage{graphicx}
\usepackage{color}
\begin{document}
\begin{figure}
\input{cite.pdf_t}
\end{figure}
\begin{thebibliography}{9}
\bibitem{abc}John Doe, \textit{The Alphabet}, 2000.
\bibitem{foo}N.\,N., \textit{The Mysteries of Foobar}, 1970.
\end{thebibliography}
\end{document}

Result

Heiko Oberdiek
  • 271,626
0

enter image description here

Here is an Asymptote example of cited references with hyperref links, c.tex, with attached texbooks.bib file:

\begin{filecontents*}{texbooks.bib}
@Book{TeXbook,
  author = {Knuth, Donald},
  title = {The TeXbook},
  publisher = {Addison-Wesley},
  year = {1986},
  address = {Reading, Mass},
  isbn = {0201134470}
}
@Book{MFbook,
  author = {Knuth, Donald},
  title = {The METAFONTbook},
  publisher = {Addison-Wesley},
  year = {1986},
  address = {Reading, Mass},
  isbn = {0201134454}
}
@Book{Goossens:1994,
  author = {Goossens, Michel},
  title = {The LaTeX companion},
  publisher = {Addison},
  year = {1994},
  address = {Reading, Mass},
  isbn = {0201541998}
}
@Book{Karow:1994font,
  author = {Karow, Peter},
  title = {Font technology : methods and tools},
  publisher = {Springer-Verlag},
  year = {1994},
  address = {Berlin New York},
  isbn = {3540572236}
}
@Book{Knuth:1999digital,
  author = {Knuth, Donald},
  title = {Digital typography},
  publisher = {CSLI Publications},
  year = {1999},
  address = {Stanford, Calif},
  isbn = {1575860104}
}
\end{filecontents*}
%
\documentclass{article}
\usepackage{lmodern}
\usepackage{natbib}
\usepackage[svgnames]{xcolor}
\usepackage[inline]{asymptote}
\usepackage[colorlinks=true,citecolor=DarkBlue]{hyperref}
\begin{document}
\begin{figure}
\begin{asy}
size(300);
string[] citeName={
"MFbook",
"TeXbook",
"Goossens:1994",
"Karow:1994font",
"Knuth:1999digital"
};

pen p=orange+1.3pt;
real w=90;
draw(Label("\hbox to "+string(w)+"pt{\cite{"+citeName[0]+"}}",(-3w,w)),ellipse,p);
draw(Label("\hbox to "+string(w)+"pt{\cite{"+citeName[1]+"}}",(0,0)),ellipse,p);
draw(Label("\hbox to "+string(w)+"pt{\cite{"+citeName[2]+"}}",(3w,w)),roundbox,p);
draw(Label("\hbox to "+string(w)+"pt{\cite{"+citeName[3]+"}}",(-3w,-w)),ellipse,p);
draw(Label("\hbox to "+string(w)+"pt{\cite{"+citeName[4]+"}}",(3w,-w)),roundbox,p);

\end{asy}
\caption{Some citations in a figure. Inline \texttt{Asymptote} example.}
\end{figure}

\bibliographystyle{agsm}
\bibliography{texbooks}

\end{document}

To process it with latexmk, create file latexmkrc:

sub asy {return system("asy '$_[0]'");}
add_cus_dep("asy","eps",0,"asy");
add_cus_dep("asy","pdf",0,"asy");
add_cus_dep("asy","tex",0,"asy");

and run latexmk -pdf c.tex.

g.kov
  • 21,864
  • 1
  • 58
  • 95