Document ClassesWhere should I declare \psset{unit=dim} ?

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
fractal.generator
Posts: 66
Joined: Tue Oct 07, 2008 9:39 am

Where should I declare \psset{unit=dim} ?

Post by fractal.generator »

Dear all,

When I want to modify the drawing scale, I am confused with where the best place to declare \psset{unit=dim} is. Whether it should be declared before \begin{pspicture}, after \begin{pspicture}, or in pspicture's option.

Please let me know the differences.


regards,

Hayashi

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

Where should I declare \psset{unit=dim} ?

Post by localghost »

You presumably have some pspicture environments which demand different scales. I assume that you put those into a figure environment. You can insert the settings for the units inside this float environment to keep the settings local. Take this as an example.

Code: Select all

\begin{figure}[!ht]
  \centering
  \psset{unit=0.5cm}
  \begin{pspicture}[showgrid=true](-4,-3)(4,3)
  \end{pspicture}
  \caption{Example for scaling a PSTricks picture}\label{fig:scale}
\end{figure}
This is a setting for the whole pspicture environment, which could also be done as optional key value in its option list. However, there might be cases where it can be necessary to change the scaling inside the picture. Then you can put the setup command inside the pspicture environment wherever it is needed. The unit value can also be set as optional parameter for every drawing command.


Best regards
Thorsten¹
fractal.generator
Posts: 66
Joined: Tue Oct 07, 2008 9:39 am

Re: Where should I declare \psset{unit=dim} ?

Post by fractal.generator »

Thank you localhost for replying.


regards,

Hayashi
Post Reply