如何在图表中使用引用

如何在图表中使用引用

目标:在绘制图形时使用 \cit{...} 例如在圆圈或方框等中。然后包含此图形并使用 pdflatex 进行编译。

使用 Xfig,我们可以用数学模式做类似的事情,但是如何用 cite 来做呢?

还有其他支持 bibtex 风格引用的工具吗?

(请注意:这个问题是关于在图中引用论文,而不是使用标签和参考来引用图表。我也不打算在图标题中引用。)

谢谢!

答案1

由于您可以在 中使用数学xfig,因此您已经有了解决方案,只需\cite在 中使用数学即可。不喜欢数学模式的内容可以包装在 中\mbox

$\mbox{Whatever}$

xfig 示例

Xfig 文件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

LaTeX 文件如下:

\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}

结果

答案2

在此处输入图片描述

以下是带有链接Asymptote的引用参考文献的示例,附带文件:hyperrefc.textexbooks.bib

\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}

为了处理它latexmk,请创建文件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");

然后运行latexmk -pdf c.tex

相关内容