TeX Live and MacTeXTrying to get PSTricks to work...

Information and discussion about TeX Live distribution for all platforms (Windows, Linux, Mac OS X) and the related MacTeX: installing, updating, configuring
Post Reply
johnnyptheswede
Posts: 2
Joined: Mon Apr 21, 2014 8:32 pm

Trying to get PSTricks to work...

Post by johnnyptheswede »

Hi Forum,

I use Debian Wheezy and have installed texlive, full and also texlive-pstricks. I now wish to use latexdraw and use the on-the-fly generated latex code in my latex-documents. I run latexdraw, draw something and try to use the generated code but the response

Code: Select all

(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
! Undefined control sequence.
<recently read> \c@lor@to@ps 
                             
l.16 \psline[linewidth=0.04cm](
                               0.0,0.43)(0.86,-0.43)
? h
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

comes up. I inserted the 'h' to get something more legible. My latex-code is

Code: Select all

\begin{pspicture}(0,-0.45)(0.88,0.45)
\psline[linewidth=0.04cm](0.0,0.43)(0.86,-0.43)
\end{pspicture} 

with the following includes at the top:

Code: Select all

\documentclass[a4paper,11pt,pdftex]{amsart}
\usepackage{amsmath,amsthm,amssymb}
\usepackage[margin=0.5in]{geometry}
\usepackage[usenames,dvipsnames]{pstricks}
\usepackage{epsfig}
\usepackage{pst-grad} % For gradients
\usepackage{pst-plot} % For axes

I have read other posts where it is recommended that one installs the texlive package manger, however, I cannot find a download link to it, if the response to this post becomes "get texlive package manager", please include a link to where I can find it.

Greetings
Johnny
Last edited by Stefan Kottwitz on Tue Apr 22, 2014 2:57 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Trying to get PSTricks to work...

Post by Johannes_B »

I always installed a full texlive obtained directly from TUG, and i never had problems. It installs tlmgr (Texlive manager) by default.

Back to topic: If you prepare a minimal wroking example we have something to test at hand and can tell, if it is the right syntax etc. I.e. is the system lacking, or the code.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Trying to get PSTricks to work...

Post by CrazyHorse »

johnnyptheswede wrote: I use Debian Wheezy and have installed texlive, full and also texlive-pstricks. I now wish to use latexdraw and use the on-the-fly generated latex code in my latex-documents. I run latexdraw, draw something and try to use the generated code but the response

Code: Select all

(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
! Undefined control sequence.
<recently read> \c@lor@to@ps 
                             
l.16 \psline[linewidth=0.04cm](
                               0.0,0.43)(0.86,-0.43)
[/quote]

You run the document with `pdflatex` instead of the sequence `latex->dvips->ps2pdf` or (better) with `xelatex`. See http://tug.org/PSTricks/main.cgi?file=pdf/pdfoutput
johnnyptheswede
Posts: 2
Joined: Mon Apr 21, 2014 8:32 pm

Trying to get PSTricks to work...

Post by johnnyptheswede »

Hello again,

Thank you for your support. For the benefit of others I will share the complete solution.

Essentially what CrazyHorse said solved the problem, there was however one more issue, I present the minimal working example here:

Code: Select all

\documentclass[a4paper,11pt,pdftex]{amsart}
\usepackage{amsmath,amsthm,amssymb}
\usepackage[margin=0.5in]{geometry}
\usepackage[usenames,dvipsnames]{pstricks}
\usepackage{epsfig}
\usepackage{pst-grad} % For gradients
\usepackage{pst-plot} % For axes

\begin{document}

\section*{In this lecture we will study... God damnit! Work!}

\scalebox{1} % Change this value to rescale the drawing.
{
\begin{pspicture}(0,-0.85)(2.68,0.85)
\psline[linewidth=0.04cm](0.0,0.83)(2.62,0.01)
\psline[linewidth=0.04cm](2.58,0.61)(0.32,0.03)
\psline[linewidth=0.04cm](0.96,0.81)(1.58,-0.41)
\psline[linewidth=0.04cm](1.98,0.69)(2.14,-0.51)
\psline[linewidth=0.04cm](1.08,-0.83)(2.66,0.39)
\end{pspicture}
}

\end{document}

As observed by CrazyHorse, I earlier used pdflatex so I tried to switch to the required sequence latex->dvips->ps2pdf, however, when I invoked the command latex it still wanted to generate pdf:s: and it was because of the line

Code: Select all

\documentclass[a4paper,11pt,pdftex]{amsart}
which I changed to read

Code: Select all

\documentclass[a4paper,11pt]{amsart}
Now the sequence of commands latex->dvips->ps2pdf, as documented at http://tug.org/PSTricks/main.cgi?file=pdf/pdfoutput works fine and produces PSTricks-images in my documents! No more separate image files to be imported.

Many thanks!
Johnny
Post Reply