Document ClassesProblem with setting the baseline with pstricks

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
avp3000
Posts: 49
Joined: Thu Nov 15, 2007 4:22 pm

Problem with setting the baseline with pstricks

Post by avp3000 »

Hi,

I am learning PS Tricks now and I am using Herbert Voß' book. I wanted to try the example with setting different values for the baseline, so I just rewrote it from the book:

Code: Select all

\documentclass[10pt]{article}
\usepackage[a4paper,pagesize]{typearea}

\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\usepackage{amsmath}

\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage{pstricks-add}

\begin{document}

\textcolor{red}{\rule{5mm}{1pt}}
\begin{pspicture}[-0.5](-0.5,-0.5)(0.5,0.5)
    \psframe[linecolor=blue](-0.5,-0.5)(0.5,0.5)\rput(0,0){-0.5}
\end{pspicture}

\textcolor{red}{\rule{5mm}{1pt}}
\hspace{1cm}
\begin{pspicture}(-0.5,-0.5)(0.5,0.5)
    \psframe[linecolor=blue](-0.5,-0.5)(0.5,0.5)\rput(0,0){0}
\end{pspicture}

\textcolor{red}{\rule{5mm}{1pt}}
\hspace{1cm}
\begin{pspicture}(-0.5,-0.5)(0.5,0.5)
    \psframe[linecolor=blue](-0.5,-0.5)(0.5,0.5)\rput(0,0){0.5}
\end{pspicture}

\end{document}

However, when I try to compile it, I get:

!Package xkeyval Error: '-0.5' undefined in families ',pstricks-add'.

Anybody has a clue? Thank you

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Problem with setting the baseline with pstricks

Post by localghost »

I guess the optional argument of the first pspicture environment will not be accepted in this way.

Code: Select all

\begin{pspicture}[-0.5](-0.5,-0.5)(0.5,0.5)                        <<<--- here!
    \psframe[linecolor=blue](-0.5,-0.5)(0.5,0.5)\rput(0,0){-0.5}
\end{pspicture}
Simply omit that completely. Are you sure that the code is exactly that from the example in the book?


Best regards
Thorsten
Post Reply