[Xy-pic] Positioning brace frames

Ross Moore ross at ics.mq.edu.au
Thu Nov 20 13:06:07 CET 2003

Hello Scott,

On Wed, 19 Nov 2003, Scott Morrison wrote:

> I'm trying to put some labelled braces in my diagrams, but having
> trouble with reference points, etc.
>
> At the moment the best I can do is
>
> (0,0); (10,0) \frm{^\}}

Xy-pic frames do as the name says; they "frame" an object
(or rather, the current <POS> of the object).
Thus the size of the frame is inherited from the current <POS>.

You code above has 2 problems:
1.  you need to 'drop' the \frm
2.  the <POS> has zero size, so the bracess will be mal-formed.

>
> The problem is here the reference point is at (0,0), so xy-pic draws the

No. the <POS> is at (10,0) with zero width and height.
So the \frm cannot be drawn properly and will be broken.

Try the following:

\begin{xy}
(0,0).(10,0)!C *\frm{^\}},+U*++!D\txt{label}
\end{xy}

(0,0).(10,0)
^_____ "merge"

results in a <POS> that is 10 units wide, with reference point
at (0,0) on the left-hand edge.

Here's how it works:

The  !C  centers the reference-point within the same "rectangle".
Next "drop" the frame, with  *\frm{^\}}
this does not alter the <POS>.

To put a label above the nib:
+U  moves to the top edge of the <POS>
(since the rectangle has 0 height/depth this is redundant).

*++!D  aligns the bottom edge of a rectangle enclosing the label
and expanded twice (the ++ ) by the \labelmargin amount

If you had trouble understanding that, try this variant:

\begin{xy}
(0,0).(10,10)*\frm{-},!C *\frm{^\}},+U*++!D\txt{label}
\end{xy}

The PDF at   http://www-texdev.ics.mq.edu.au/SCOTT/mtest.pdf
shows the results from these 2 code snippets.

> nib of the brace above (0,0), and as a result the brace extends further
> to the left. How can I specify the reference point arbitrarily?
>
> Additionally, I want to place some text (a single letter) immediately
> above the nib. How do I do this?

Above shows a text label.
A mathematics label is slightly simpler:

\begin{xy}
(0,0).(10,0)!C *\frm{^\}},+U*++!D{f}
\end{xy}

>
> Thanks,

Hope this helps,

Ross Moore

> Scott Morrison
>
>
> _______________________________________________
> xy-pic mailing list
> http://tug.org/mailman/listinfo/xy-pic
>