[pstricks] \wire in pst-circ

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sun Dec 23 17:04:31 CET 2007


Patrice Mégret schrieb:

> By the way, where can I find the explanation of the difference between \@empty, \empty and {}?

always the same, pstricks.tex defines its own \@empty
The problem is the definition of the key. When using

\define at key[psset]{}{demA}{\def\demoA{#1}}
\psset{demoA=\empty}

then \demoA is \empty, but not {}, because the macro \demoA
was not expanded and a comparision between \demoA and \empty
is wrong. See example. Always using an \edef causes other
problems, the reason why I do not use it. However, as the
example shows, \psset{demoA={}} always works.

happy Holidays and all the best for all of you in 2008

Herbert


\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{pstricks}
\usepackage{pst-xkey}

\makeatletter
\define at key[psset]{}{demoA}{\def\demoA{#1}}
\define at key[psset]{}{demoB}{\def\demoB{#1}}% \edef\demoB{#1}% works
\define at key[psset]{}{demoC}{\def\demoC{#1}}% \edef\demoC{#1}% works
\psset{demoA={},demoB=\empty,demoC=\@empty}
\makeatother

\begin{document}
\def\test{}
demoA:\meaning\demoA \par
demoB:\meaning\demoB \par
demoC:\meaning\demoC \par

\medskip
demoA: \ifx\demoA\test empty\else not empty\fi\par
demoB: \ifx\demoB\test empty\else not empty\fi\par
demoC: \ifx\demoC\test empty\else not empty\fi

\medskip
demoA: \ifx\demoA\empty empty\else not empty\fi\par
demoB: \ifx\demoB\empty empty\else not empty\fi\par
demoC: \ifx\demoC\empty empty\else not empty\fi

\medskip\makeatletter
demoA: \ifx\demoA\@empty empty\else not empty\fi\par
demoB: \ifx\demoB\@empty empty\else not empty\fi\par
demoC: \ifx\demoC\@empty empty\else not empty\fi

\end{document}





More information about the PSTricks mailing list