1

I tried the following:

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

I am trying to run, but error occurs. Please someone help me. Thank you

3
  • Please note, that we use markdown for the formatting here. For example code blocks are formatted by an indent of 4 spaces. This can easily be done by selecting the code and clicking to the {} symbol in the toolbar. Alternatively you can use Ctrl-k after selecting the code lines. See “How do I format my posts using Markdown or HTML?” for more information.
    – cabohah
    Commented Dec 7, 2022 at 8:25
  • I cannot reproduce your issue or it is quite unclear what you mean with: “but error occurs”. Please give some information about the error, i.e., show the exact error message you get. Have you used latex + dvips + ps2pdf to make the PDF using pst-all? See also: How to use PSTricks in pdfLaTeX?
    – cabohah
    Commented Dec 7, 2022 at 8:31
  • @cabohah Well, I will try this soon, when I return to my system.
    – gete
    Commented Dec 7, 2022 at 8:36

1 Answer 1

3

run it with lualatex or 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}

enter image description here

4
  • pst-all isn't really necessary, pstricks does just as well. Similarly lualatex does not add anything except to avoid a little effort of reflection. compiling in dvi mode gives the same result. Consuming resources unnecessarily can produce disastrous side effects. If you use ` Emacs+AUCTeX, there is no special intervention to compile with pdflatex, the configuration is automatic provided you have declared pstricks`.
    – gigiair
    Commented Dec 7, 2022 at 10:24
  • it doesn't hurt to load pst-all! Using the dvi route is from last century ... No need to use pdflatex...
    – user187802
    Commented Dec 7, 2022 at 19:27
  • It is still not working in my system. Showing that, "PSTricks is not configured in this format"
    – gete
    Commented Dec 8, 2022 at 8:32
  • It looks like that you were running pdflatex, but you should use xelatex or lualatex.
    – user187802
    Commented Dec 8, 2022 at 10:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .