[Xy-pic] Compilation error:
Lars Peter Cleary
lc at publius.ch
Thu Dec 13 15:33:38 CET 2007
Dear Ross
For my setup I also needed to add $ to indicate mathematical formulas.
Below the final code for the tree, it's a Markow-event-tree:
\xymatrix{
& & & & {\circ} \ar@{-}[dll]_{$\frac{1}{2}$}
\ar@{-}[drr]^{$\frac{1}{2}$} & & & & \\
& & *+[F]\txt{L1} \ar@{-}[dl]_{$\frac{1}{2}$}
\ar@{-}[d]^{$\frac{1}{2}$} & & & & *+[F]\txt{L2}
\ar@{-}[d]_{$\frac{1}{4}$} \ar@{-}[dr]^{$\frac{3}{4}$} & & \\
& *+[o][F-]\txt{G} \ar@{-}[d]_1 & *+[o][F-]\txt{V} \ar@{-}[d]^1 & & &
& *+[o][F-]\txt{G} \ar@{-}[d]_1 &
*+[o][F-]\txt{V} \ar@{-}[d]^1 & \\
& *+[F]\txt{L1} \ar@{-}[dl]_{$\frac{1}{2}$}
\ar@{-}[d]^{$\frac{1}{2}$} & *+[F]\txt{L2}
\ar@{-}[d]_{$\frac{1}{4}$} \ar@{-}[dr]^{$\frac{3}{4}$} & & & &
*+[F]\txt{L2} \ar@{-}[dl]_{$\frac{1}{4}$}
\ar@{-}[d]^{$\frac{3}{4}$} & *+[F]\txt{L1} \ar@{-}[d]_{$\frac{1}{2}$}
\ar@{-}[dr]^{$\frac{1}{2}$} & \\
*+[o][F-]\txt{G+} & *+[o][F-]\txt{V} & *+[o][F-]\txt{G+} &
*+[o][F-]\txt{V} & & *+[o][F-]\txt{G+} & *+[o][F-]\txt{V} &
*+[o][F-]\txt{G+} & *+[o][F-]\txt{V}
}
If the following is of any interest:
My setup is Windows XP, MikTex 2.7 (all packages) and GPL ghostscript 8.61.
My editor is Eclipse (3.3.1.1) with the TeXlipse plugin (1.2.1).
This setup works very well, by the way.
For the math I use following packages:
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage[all]{xy}
\usepackage{xytree}
Thanks a lot for the pointer, Ross, that was very helpful!
Kind regards
Lars
On 12/13/07, Ross Moore <ross at ics.mq.edu.au> wrote:
> Hello Lars,
>
> On 12/12/2007, at 10:20 PM, Lars Peter Cleary wrote:
>
> > Hi all
> >
> > I have some trouble compiling this bit of added code (without it it
> > works):
> >
> > \xymatrix{
> > & & & & & & & {\circ} \ar@{-}[dl]_\frac{1}{2} \ar@{-}[dr]^\frac{1}{2}
>
> You cannot set a complicated object, such as a fraction,
> as a label in this way. It has to be:
>
> \ar@{-}[dl]_{\frac{1}{2}} \ar@{-}[dr]^{\frac{1}{2}}
>
> using extra braces.
> Otherwise the \frac will end up being used in a place
> quite apart from its arguments, thus triggering the kind
> of messages that you are seeing.
>
>
> > & & & & & & & \\
> > & & & *+[F]\txt{L1} \ar@{-}[dl]_\frac{1}{2} \ar@{-}[dr]^\frac{1}{2} &
> > & & & & & & & *+[F]\txt{L2} \ar@{-}[dl]_\frac{1}{4}
> > \ar@{-}[dr]^\frac{3}{4} & & & \\
> > & & *+[o][F-]\txt{G} \ar@{-}[dl]_1 \ar@{-}[dr]^1 & & *+[o][F-]\txt{V}
> > \ar@{-}[dl]_1 \ar@{-}[dr]^1 & & & & & &
> > *+[o][F-]\txt{G} \ar@{-}[dl]_1 \ar@{-}[dr]^1 & & *+[o][F-]\txt{V}
> > \ar@{-}[dl]_1 \ar@{-}[dr]^1 & & \\ & *+[F]\txt{L1}
> > \ar@{-}[dl]_\frac{1}{2} \ar@{-}[dr]^\frac{1}{2} & & & &
> > *+[F]\txt{L2} \ar@{-}[dl]_\frac{1}{4} \ar@{-}[dr]^\frac{3}{4} & & &
> > *+[F]\txt{L2} \ar@{-}[dl]_\frac{1}{4}
> > \ar@{-}[dr]^\frac{3}{4} & & & & *+[F]\txt{L1} \ar@{-}[dl]_\frac{1}{2}
> > \ar@{-}[dr]^\frac{1}{2} & \\
> > *+[o][F-]\txt{G} & & *+[o][F-]\txt{V} & & *+[o][F-]\txt{G} &
> > *+[o][F-]\txt{V} & & *+[o][F-]\txt{G} & & *+[o][F-]\txt{V}
> > & & *+[o][F-]\txt{G} & & *+[o][F-]\txt{V}
> > }
>
> Put braces around all the \frac constructions, and it all
> compiles just fine --- though the resulting tree diagram makes
> no sense to me, presumably because it is incomplete at this stage.
>
>
> Hope this helps,
>
> Ross Moore
>
>
> >
> > The error messages I get from the console:
> > Argument of \frac has an extra }. } (followed by: )
> > Paragraph ended before \frac was complete. } (followed by: )
> >
> > The lines indicated are the ones of the last bracket closing
> > '\xymatrix{}'.
> >
> >
> >
> > I tried omitting the fractions, then it compiles (some formatting
> > corrections are needed though, I'll sort that later.).
> >
> >
> >
> > Does anybody see an obvious error in my code?
> >
> > Thanks and kind regards
> > Lars
> > _______________________________________________
> > xy-pic mailing list
> > http://tug.org/mailman/listinfo/xy-pic
>
> ------------------------------------------------------------------------
> Ross Moore ross at maths.mq.edu.au
> Mathematics Department office: E7A-419
> Macquarie University tel: +61 +2 9850 8955
> Sydney, Australia 2109 fax: +61 +2 9850 8114
> ------------------------------------------------------------------------
>
>
>
More information about the xy-pic
mailing list