我想在使用 pspictures 绘制的树下添加标题。这是我的代码。
\documentclass[12pt]{article}
\usepackage{pst-pdgr,pstricks,pst-pdf,graphicx}
\usepackage[top=2cm, left=2cm, bottom=2cm,right=2cm]{geometry}
\usepackage{caption}
\begin{document}
Blah blah.
\begin{figure}
\begin{pspicture}(7,7)
%\psgrid
\psset{descarmA=1.2}
\rput(2.5,4.5){\pstPerson[male]{A}}
\rput(4.5,4.5){\pstPerson[female]{B}}
\rput(2.5,2.5){\pstPerson[male, affected, belowtext={\small A1}]{C}}
\rput(4.5,2.5){\pstPerson[female]{D}}
\pstRelationship[descentnode=AB]{A}{B}
\pstDescent{AB}{C}
\pstDescent{AB}{D}
\end{pspicture}
\caption{figure}{figure text}
\end{figure}
More blah.
\end{document}
树看起来不错,但是缺少标题。没有错误消息,所以我真的不知道我这里缺少什么。谢谢。
答案1
通过auto-pst-pdf
pdflatex 编译,它运行良好:
\documentclass[12pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{pst-pdgr, pstricks, graphicx}%
\usepackage{auto-pst-pdf}
\usepackage{caption}
\begin{document}
Blah blah.
\begin{figure}
\centering \begin{pspicture}(7,7)
\psset{descarmA=1.2}
\rput(2.5,4.5){\pstPerson[male]{A}}
\rput(4.5,4.5){\pstPerson[female]{B}}
\rput(2.5,2.5){\pstPerson[male, affected, belowtext={\small A1}]{C}}
\rput(4.5,2.5){\pstPerson[female]{D}}
\pstRelationship[descentnode=AB]{A}{B}
\pstDescent{AB}{C}
\pstDescent{AB}{D}
\end{pspicture}
\caption{figure text}
\end{figure}
More blah.
\end{document}