## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ xypic xytree "fancy line" Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
Linguist
Posts: 41
Joined: Mon Nov 07, 2011 12:07 pm

### xypic xytree "fancy line"

Hello,

I'm using the xytree package to draw autosegmental diagrams. The xytree package utilizes xypic for its functions.

What I want to do is place labels on the linking lines between different tiers. This is described in sections 1.4 and/or 2.9 of the xypic docmentation (specifically I want to be able to "delink" tiers as described in section 4.4 here: http://wiki.lyx.org/LyX/LinguistLyX#toc10).

Using the code in the above link I can do this in an xymatrix, but can't figure out how to transfer this to to the xytree autosegmental diagram.

The nub of the problem is I don't know how xytree uses xypic to make autosegmental diagrams; I just copied example code and extrapolated.

\documentclass[a4paper,12pt]{report}\usepackage{xytree} \begin{document} {\xy<0pt,0pt>*\asrnode{k}="k",<1em,0pt>*\asrnode{a}="a",<2em,0pt>*\asrnode{t}="t",<0pt,1cm>*\asrnode{$\times$}="x1",<1em,1cm>*\asrnode{$\times$}="x2",<2em,1cm>*\asrnode{$\times$}="x3",<.5em,2cm>*\asrnode{$\mu$}="m1",<2em,2cm>*\asrnode{$\mu$}="m2","k"+U;"x1"+D**\dir{-};"a"+U;"x2"+D**\dir{-};"t"+U;"x3"+D**\dir{-};"x1"+U;"m1"+D**\dir{-};"x2"+U;"m1"+D**\dir{-};"x3"+U;"m2"+D**\dir{-};\endxy} %The vertical line on the right of this diagram has a = %which I want to be able to put on the diagram above.\xymatrix{V\ar@{-}[d]& C & V\ar@{--}[dll]\ar@{-}[d]|=\\H & & L} \end{document}

Linguist
Posts: 41
Joined: Mon Nov 07, 2011 12:07 pm
Looks like I keep solving my own probelms.

The key here is to use "arrows" instead of "directionals", as is done in the xytree autosegmental example code.

So to delink (read: place label which is an equals sign) the k from its timing slot in the previous example replace:

"k"+U;"x1"+D**\dir{-};

with

{\ar@{-}|="k"+U;"x1"+D};

In principle the equals sign could be replaced with an arbitrary string (within {}) that you wish to place over the linking line/arrow.

RossMoore
Posts: 3
Joined: Sun Jan 11, 2015 10:34 pm
Using an "=" sign for the break is not really the best, as it relies on the font character, including its height, depth width, and thickness of its line strokes.
viz.

Notice the gap below, and how it is wider and clunkier than other elements in the graphic.

Better is to specify separate breaks for the individual bars and the gap between them.
{\ar@{-}|-(.425)*@{|} |-{\hole} |-(.575)*@{|} "k"+U;"x1"+D};

resulting in

Note how |- is used, to locate the break in the middle of the arrow/line, taking into account the size and any margins on the initial and terminal objects that it connects.
Similarly |-(factor) locates the point at factor along the line itself,
whereas |(factor) locates the point at factor between the basepoints of the initial and terminal objects.

To vertically align the "delinks" of several consecutive lines, between objects of different sizes say, you would probably find |(factor) to be easier than |-(factor),
though some trial-and-error may be needed to get the best value for the factor.

Linguist
Posts: 41
Joined: Mon Nov 07, 2011 12:07 pm
Great, thanks! This is a much more elegant solution!

And, being a linguist, I like elegant solutions!

Return to “Graphics, Figures & Tables”

### Who is online

Users browsing this forum: No registered users and 12 guests