Dear Mr. Moore,<br>I thank you for the solution of bad use of \labelstyle.<br>Because I think that the \scriptstyle in the Xy-pic do rather not benefit for the linguistic syntactic trees, I did simply set it to be \hbox globally.
<br>As you suggested , the better way is to set it locally in \xytree and \yytree.<br>I'll do it soon in the xytree package.<br><br>For the problem of \frac, I think, it would be better to put the entire label in one group as a label, as Mr. Moore slightly hinted.
<br><br>Sincerely,<br><br>Koaunghi Un.<br><br><div><span class="gmail_quote">2007/12/14, Ross Moore <<a href="mailto:ross@ics.mq.edu.au">ross@ics.mq.edu.au</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello Lars,<br><br>On 14/12/2007, at 1:33 AM, Lars Peter Cleary wrote:<br><br>> Dear Ross<br>><br>> For my setup I also needed to add $ to indicate mathematical formulas.<br><br>Strange.<br>Xy-pic was designed to put labels directly into math-mode,
<br>so that there would be no need to insert the delimiters,<br>especially since most diagrams are done in math-displays anyway.<br><br><br>><br>> Below the final code for the tree, it's a Markow-event-tree:<br>
> \xymatrix{<br>> & & & & {\circ} \ar@{-}[dll]_{$\frac{1}{2}$}<br><br><br>> If the following is of any interest:<br>> My setup is Windows XP, MikTex 2.7 (all packages) and GPL<br>> ghostscript
8.61.<br>> My editor is Eclipse (<a href="http://3.3.1.1">3.3.1.1</a>) with the TeXlipse plugin (1.2.1).<br>> This setup works very well, by the way.<br>><br>> For the math I use following packages:<br>> \usepackage{amsmath}
<br>> \usepackage{amsthm}<br>> \usepackage{amsfonts}<br>> \usepackage[all]{xy}<br>> \usepackage{xytree}<br><br>Ahah. Here's the culprit.<br><br> xytree.sty has a very unfriendly line of coding:<br><br> \def\labelstyle{\hbox}
<br><br>This globally overrides the Xy-pic default setting of:<br><br> \xylet@\labelstyle=\scriptstyle<br><br><br>It also has an effect on parsing, since \hbox requires<br>a parameter.<br>Note that this gives a good explanation of your original
<br>problem:<br> \ar@{-}[dll]_\frac{1}{2}<br><br>would result in trying to set the label using \hbox{\frac}<br>and the numbers {1}{2} would just become part of the<br>current cell's contents.<br><br><br>
The author of xytree.sty should have implemented a better way<br>to apply his desired change to \labelstyle by restricting it<br>to the commands, defined within his own package, such as<br> \xytree and \yytree .<br>
<br>Otherwise it affects usage within Xy-pic diagrams that have<br>no relation whatsoever to his tree-like layouts.<br>It means that such diagrams cannot be copied and reused<br>within documents that do not load his xytree package,
<br>without the risk of encountering problems, whose solution<br>is not documented anywhere (until now!).<br><br><br><br>BTW, xtree.sty also changes \objectstyle to \hbox ,<br>but this is limited to the argument of the \xytext command.
<br>I'm very surprised that people haven't encountered problems<br>in examples using this.<br><br><br><br>><br>> Thanks a lot for the pointer, Ross, that was very helpful!<br><br>Thank you for reporting it,<br>
and the subsequent incompatibility that your latest<br>message has revealed.<br><br><br>><br>> Kind regards<br>> Lars<br>><br>> On 12/13/07, Ross Moore <<a href="mailto:ross@ics.mq.edu.au">ross@ics.mq.edu.au
</a>> wrote:<br>>> Hello Lars,<br>>><br>>> On 12/12/2007, at 10:20 PM, Lars Peter Cleary wrote:<br>>><br>>>> Hi all<br>>>><br>>>> I have some trouble compiling this bit of added code (without it it
<br>>>> works):<br>>>><br>>>> \xymatrix{<br>>>> & & & & & & & {\circ} \ar@{-}[dl]_\frac{1}{2} \ar@{-}[dr]^\frac<br>>>> {1}{2}<br>>><br>>> You cannot set a complicated object, such as a fraction,
<br>>> as a label in this way. It has to be:<br>>><br>>> \ar@{-}[dl]_{\frac{1}{2}} \ar@{-}[dr]^{\frac{1}{2}}<br>>><br>>> using extra braces.<br>>> Otherwise the \frac will end up being used in a place
<br>>> quite apart from its arguments, thus triggering the kind<br>>> of messages that you are seeing.<br>>><br>>><br>>>> & & & & & & & \\<br>>>> & & & *+[F]\txt{L1} \ar@{-}[dl]_\frac{1}{2} \ar@{-}[dr]^\frac{1}
<br>>>> {2} &<br>>>> & & & & & & & *+[F]\txt{L2} \ar@{-}[dl]_\frac{1}{4}<br>>>> \ar@{-}[dr]^\frac{3}{4} & & & \\<br>>>> & & *+[o][F-]\txt{G} \ar@{-}[dl]_1 \ar@{-}[dr]^1 & & *+[o][F-]
<br>>>> \txt{V}<br>>>> \ar@{-}[dl]_1 \ar@{-}[dr]^1 & & & & & &<br>>>> *+[o][F-]\txt{G} \ar@{-}[dl]_1 \ar@{-}[dr]^1 & & *+[o][F-]\txt{V}<br>>>> \ar@{-}[dl]_1 \ar@{-}[dr]^1 & & \\ & *+[F]\txt{L1}
<br>>>> \ar@{-}[dl]_\frac{1}{2} \ar@{-}[dr]^\frac{1}{2} & & & &<br>>>> *+[F]\txt{L2} \ar@{-}[dl]_\frac{1}{4} \ar@{-}[dr]^\frac{3}{4} & & &<br>>>> *+[F]\txt{L2} \ar@{-}[dl]_\frac{1}{4}
<br>>>> \ar@{-}[dr]^\frac{3}{4} & & & & *+[F]\txt{L1} \ar@{-}[dl]_\frac<br>>>> {1}{2}<br>>>> \ar@{-}[dr]^\frac{1}{2} & \\<br>>>> *+[o][F-]\txt{G} & & *+[o][F-]\txt{V} & & *+[o][F-]\txt{G} &
<br>>>> *+[o][F-]\txt{V} & & *+[o][F-]\txt{G} & & *+[o][F-]\txt{V}<br>>>> & & *+[o][F-]\txt{G} & & *+[o][F-]\txt{V}<br>>>> }<br>>><br>>> Put braces around all the \frac constructions, and it all
<br>>> compiles just fine --- though the resulting tree diagram makes<br>>> no sense to me, presumably because it is incomplete at this stage.<br>>><br>>><br>>> Hope this helps,<br>>><br>
>> Ross Moore<br>>><br>>><br>>>><br>>>> The error messages I get from the console:<br>>>> Argument of \frac has an extra }. } (followed by: )<br>>>> Paragraph ended before \frac was complete. } (followed by: )
<br>>>><br>>>> The lines indicated are the ones of the last bracket closing<br>>>> '\xymatrix{}'.<br>>>><br>>>><br>>>><br>>>> I tried omitting the fractions, then it compiles (some formatting
<br>>>> corrections are needed though, I'll sort that later.).<br>>>><br>>>><br>>>><br>>>> Does anybody see an obvious error in my code?<br>>>><br>>>> Thanks and kind regards
<br>>>> Lars<br>>>> _______________________________________________<br>>>> xy-pic mailing list<br>>>> <a href="http://tug.org/mailman/listinfo/xy-pic">http://tug.org/mailman/listinfo/xy-pic
</a><br>>><br>>> ---------------------------------------------------------------------<br>>> ---<br>>> Ross Moore<br>>> <a href="mailto:ross@maths.mq.edu.au">ross@maths.mq.edu.au</a><br>>> Mathematics Department office: E7A-419
<br>>> Macquarie University tel: +61 +2<br>>> 9850 8955<br>>> Sydney, Australia 2109 fax: +61 +2<br>>> 9850 8114<br>>> ---------------------------------------------------------------------
<br>>> ---<br>>><br>>><br>>><br>> _______________________________________________<br>> xy-pic mailing list<br>> <a href="http://tug.org/mailman/listinfo/xy-pic">http://tug.org/mailman/listinfo/xy-pic
</a><br><br>------------------------------------------------------------------------<br>Ross Moore <a href="mailto:ross@maths.mq.edu.au">ross@maths.mq.edu.au</a><br>Mathematics Department office: E7A-419
<br>Macquarie University tel: +61 +2 9850 8955<br>Sydney, Australia 2109 fax: +61 +2 9850 8114<br>------------------------------------------------------------------------
<br><br><br><br><br><br></blockquote></div><br>