# [Xy-pic] Macros in xygraph

Alan P Sexton A.P.Sexton at cs.bham.ac.uk
Sat Oct 16 22:47:45 CEST 2004

I am having great difficulty getting macros in xygraph working. I know
about using \POS to restart the parser but I can't get it to work right.
The following is for Hasse diagrams: I need to be able to draw filled
nodes as well as empty nodes. Hence I use \circ and \bullet and change
the frames around them to circular and change the size of the frame to
make the lines touch the nodes but not cross into the centre of the
\circ nodes.

The fully expanded version works perfectly. The macroised version shows
very strange behavior: the locations are being set correctly (as can be
seen from the lines drawn) but the objects are being dropped in the
wrong places. Also the frames around the positions where the objects
should be dropped have not been set correctly. Can anyone explain what I
am doing wrong and how to fix it?

\xygraph{
[]
*-<1.5pt,1.5pt>[o]{\circ}="A"
[dr]
*-<1.5pt,1.5pt>[o]{\bullet}="B"
[ur]
*-<1.5pt,1.5pt>[o]{\circ}="C"
"A"-"B"
"B"-"C"
}

\vspace{2cm}

\newcommand{\node}{\POS*-<1.5pt,1.5pt>[o]{\circ}}
\newcommand{\nodeFill}{\POS*-<1.5pt,1.5pt>[o]{\bullet}}

\xygraph{
[]
\node="A"
[dr]
\nodeFill="B"
[ur]
\node="C"
"A"-"B"
"B"-"C"
}