我尝试了以下操作:
\documentclass{beamer}
\mode<presentation>
\usepackage []{graphicx}
\usepackage{caption}
\usepackage{amsmath, amstext}
\usepackage{amsmath}
\usepackage{float}
\usepackage{pst-all}
\begin{document}
\begin{figure}[h]\hspace*{2.4cm}
\begin{minipage}[t]{.45\textwidth}
\begin{pspicture}(4,4.3)
\rput(3.7,-0.2){\scalebox{1.2}{
\psdot(1.5,3.5)\rput(1.45,3.75){$v_1$}
\psdot(-1,2)\rput(-1.3,2){$v_2$}
\psdot(.5,2.3)\rput(0.9,2.3){$v_3$}
\psdot(3,1)\rput(3,0.7){$v_4$}
\psdot(4,2)\rput(4.3,2){$v_5$}
\psdot(1,0.5)\rput(1,0.2){$v_6$}
\psline(1.5,3.5)(-1,2)
\psline(1.5,3.5)(0.5,2.3)
\psline(1.5,3.5)(3,1)
\psline(1.5,3.5)(1,0.5)
\psline(-1,2)(.5,2.3)
\psline(-1,2)(1,0.5)
\psline(-1,2)(4,2)
\psline(3,1)(.5,2.3)
\psline(4,2)(3,1)
\psline(-1,2)(1,0.5)
}}
\end{pspicture}
\end{minipage}
\caption{The graph $G_1$}\label{Fig-1}
\end{figure}
\end{document}
我正在尝试运行,但出现错误。请有人帮助我。谢谢
答案1
使用lualatex
或运行它xelatex
:
% !TeX TS-program = lualatex
\documentclass{beamer}
\usepackage{pst-all}
\begin{document}
\begin{frame}
\begin{figure}
\begin{pspicture}[unit=1.2](-1,0)(4,5)
\psdot(1.5,3.5)\rput(1.45,3.75){$v_1$}
\psdot(-1,2)\rput(-1.3,2){$v_2$}
\psdot(.5,2.3)\rput(0.9,2.3){$v_3$}
\psdot(3,1)\rput(3,0.7){$v_4$}
\psdot(4,2)\rput(4.3,2){$v_5$}
\psdot(1,0.5)\rput(1,0.2){$v_6$}
\psline(1.5,3.5)(-1,2)
\psline(1.5,3.5)(0.5,2.3)
\psline(1.5,3.5)(3,1)
\psline(1.5,3.5)(1,0.5)
\psline(-1,2)(.5,2.3)
\psline(-1,2)(1,0.5)
\psline(-1,2)(4,2)
\psline(3,1)(.5,2.3)
\psline(4,2)(3,1)
\psline(-1,2)(1,0.5)
\end{pspicture}
\caption{The graph $G_1$}\label{Fig-1}
\end{figure}
\end{frame}
\end{document}