[Tex/LaTex] Example from PSTricks manual not rendering

pstrickstexmaker

Can you set me straight in the very first attempt to use PSTricks drawing features please? The ultimate goal is to draw a triangle with the vertices angles marked on the inside with \alpha, \beta, and \gamma and sides marked with a, b, and c on the outside.

I've started by copying a sample from PSTricks user manual page 70 and wrapping it in a \pspicture:

\documentclass[10pt,letterpaper]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{pstricks}
\begin{document}

\pspicture(0,0)(5,5)
\pspolygon(0,0)(4,3)(4,0)
\pcline[offset=12pt]{|-|}(0,0)(4,3)
\ncput*[nrot=:U]{Length}
\endpspicture

\end{document}

Doing this in Texmaker, I fcompile using latex –> dvips –> ps2pdf.
latex-build ends with the errors:

Line 13 ! ! Undefined control sequence.<recently read> \pcline \pcline
Line 14 ! Undefined control sequence. 3 \ncput

The rendered file displays a triangle drawn correctly, but overlaid along the adjucent cathetus with the following text:

12 [offset=12pt]—-—(0,0)(4,3) 3 *[nrot=:U]Length

Best Answer

To use \pcline and \ncput you must include the pst-node package. Also, the 1 etc. are left from some line numbers in the code example.

A minimal examples, which should work is:

\documentclass{article}
\usepackage{pstricks, pst-node}
\begin{document}
\begin{pspicture}(0,0)(5,5)
 \pspolygon(0,0)(4,3)(4,0)
 \pcline[offset=12pt]{|-|}(0,0)(4,3)
 \ncput*[nrot=:U]{Length}
\end{pspicture}
\end{document}
Related Question