[Xy-pic] 'macros' with saved points

Scott Morrison scott_m at uclink.berkeley.edu
Tue Nov 4 03:07:01 CET 2003


Ross,

thanks for your help -- but I can't get this to work. Presumably I'm 
just doing something silly - I'm getting frustrated trying to work this 
out. Here's what you suggested:

> But this works:
> 
>   \newcommand{\dropblob}[1]{\POS*\xycircle(1,1){}="#1"}
> or
>   \newcommand{\dropblob}[1]{\drop\xycircle(1,1){}="#1"}
> 
>  * is a non-active shorthand for \drop , when in the
> appropriate parser context.
> 
> Another useful way to define a macro expansion is as:
> 
>   \newcommand{\dropblob}[1]{\save*\xycircle(1,1){}="#1"\restore}
> 
> where now the graphics state reverts to what it was before
> the  \dropblob  macro is called.

Here's what I tried. The first equation is what I want. The second two 
equations should produce the same output (it seems!), but they don't. 
What's happening?

\documentclass{article}
\usepackage{amsmath}
\usepackage[curve]{xy}

\newcommand{\dropcircle}{\drop\xycircle(2,4){}}
\newcommand{\dropcircletwo}{\save*\xycircle(2,4){}\restore}

\begin{document}

\begin{equation*}
\xy
  *\xycircle(2,4){}; (0,1) *{a}
\endxy
\end{equation*}

\begin{equation*}
\xy
  \dropcircle; (0,1) *{a}
\endxy
\end{equation*}

\begin{equation*}
\xy
  \dropcircletwo; (0,1) *{a}
\endxy
\end{equation*}

\end{document}

Thanks, Scott



More information about the xy-pic mailing list