GeneralPSTRICKS: what is \space ? I could not find its definition.

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
yoyoimut
Posts: 120
Joined: Mon Oct 19, 2009 6:58 am

PSTRICKS: what is \space ? I could not find its definition.

Post by yoyoimut »

Hi,

I have attempted to figure out what \space actually is.
Googling ends with nothing.

Can anybody here let me know what \space is?

Why is it needed as an example below:

Code: Select all

\psframe(\nx,0)
(!%
   \nx\space 1 add%
   \nx\space 0.5 exp 3 mul%
)%
Note that: \nx is a multido counter defined as \multido{\nx=1+1}{...}{...}

Thank you.

yoyo
Last edited by yoyoimut on Wed Oct 06, 2010 10:11 am, edited 1 time in total.

Recommended reading 2024:

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

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

CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

PSTRICKS: what is \space ? I could not find its definition.

Post by CrazyHorse »

yoyoimut wrote: I have attempted to figure out what \space actually is.
Googling ends with nothing.
Can anybody here let me know what \space is?
Why is it needed as an example below:

Code: Select all

\psframe(\nx,0)
(!%
   \nx\space 1 add%
   \nx\space 0.5 exp 3 mul%
)%
When you have PostScript code, like the above, then never
write immediately a % after commands or numbers. The above
should be:

Code: Select all

\psframe(\nx,0)
(! 
   \nx\space 1 add
   \nx\space 0.5 exp 3 mul
)%
or

Code: Select all

\psframe(\nx,0)
(! 
   \nx\space 1 add % a space before the %!
   \nx\space 0.5 exp 3 mul 
)%
the contents inside the (! ...) is passed to postscript
but before expanded by TeX. Let's see what happens
without \space:

Code: Select all

\psframe(\nx,0)
(! 
   \nx 1 add  
   \nx 0.5 exp 3 mul 
)%
Without \space, which will be a space also after expanding, we have
for \nx=1 after expanding:

Code: Select all

\psframe(1,0)(! 11 add 10.5 exp 3 mul )%
this will produce a PostScript error.
With the space command we get

Code: Select all

\psframe(1,0)(! 1 1 add 1 0.5 exp 3 mul )%
TeX ignores all whitespace after expanding, but \space
is a macro, will be exapnded to a space, which is then
not ignored by TeX.

Herbert
yoyoimut
Posts: 120
Joined: Mon Oct 19, 2009 6:58 am

Re: PSTRICKS: what is \space ? I could not find its definiti

Post by yoyoimut »

Thanks for your good explanation, Herbert.
:P
Post Reply