LaTeX forum ⇒ Text Formattingxytree enumerate top alignment Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Linguist
Posts: 35
Joined: Mon Nov 07, 2011 12:07 pm

xytree enumerate top alignment

Postby Linguist » Fri Jan 02, 2015 12:32 am

Hello,

I'm now using xytree to make autosegmental diagrams, which is great, However, when I want to enumerate my examples the number appears below the diagram.

So I did what every good LaTeX user should do, and I consulted the xytree documentation in which a solution for this problem involving \leavevmode is given. This solution works...

...but, the number is aligned with the bottom tier of the diagram when I want the number aligned with the top tier of the diagram. How can this be achieved?

Here's a MWE; showing spreading of vowel features in Rotuman. (In case you're wondering.)

  1. \documentclass[a4paper,12pt]{report}
  2. \usepackage{xytree}
  3.  
  4. \begin{document}
  5. \enumerate{
  6. \item{\leavevmode
  7. \xy
  8. <7em,0pt>*\asrnode{\textsc{[+fr]}}="f1",
  9. <0pt,1cm>*\asrnode{s}="p1",
  10. <1em,1cm>*\asrnode{\ae}="p2",
  11. <2em,1cm>*\asrnode{k}="p3",
  12. <3em,1cm>*\asrnode{\ae}="p4",
  13. <4em,1cm>*\asrnode{n}="p5",
  14. <5em,1cm>*\asrnode{\ae}="p6",
  15. <6em,1cm>*\asrnode{v}="p7",
  16. <7em,1cm>*\asrnode{e}="p8",
  17. <0pt,2cm>*\asrnode{C}="c1",
  18. <1em,2cm>*\asrnode{V}="c2",
  19. <2em,2cm>*\asrnode{C}="c3",
  20. <3em,2cm>*\asrnode{V}="c4",
  21. <4em,2cm>*\asrnode{C}="c5",
  22. <5em,2cm>*\asrnode{V}="c6",
  23. <6em,2cm>*\asrnode{C}="c7",
  24. <7em,2cm>*\asrnode{V}="c8",
  25. <0.5em,3cm>*\asrnode{$\sigma$}="s1",
  26. <2.5em,3cm>*\asrnode{$\sigma$}="s2",
  27. <4.5em,3cm>*\asrnode{$\sigma$}="s3",
  28. <6.5em,3cm>*\asrnode{$\sigma$}="s4",
  29. "f1"+U;"p2"+D**\dir{.};
  30. "f1"+U;"p4"+D**\dir{.};
  31. "f1"+U;"p6"+D**\dir{.};
  32. "f1"+U;"p8"+D**\dir{-};
  33. "p1"+U;"c1"+D**\dir{-};
  34. "p2"+U;"c2"+D**\dir{-};
  35. "p3"+U;"c3"+D**\dir{-};
  36. "p4"+U;"c4"+D**\dir{-};
  37. "p5"+U;"c5"+D**\dir{-};
  38. "p6"+U;"c6"+D**\dir{-};
  39. "p7"+U;"c7"+D**\dir{-};
  40. "p8"+U;"c8"+D**\dir{-};
  41. "c1"+U;"s1"+D**\dir{-};
  42. "c2"+U;"s1"+D**\dir{-};
  43. "c3"+U;"s2"+D**\dir{-};
  44. "c4"+U;"s2"+D**\dir{-};
  45. "c5"+U;"s3"+D**\dir{-};
  46. "c6"+U;"s3"+D**\dir{-};
  47. "c7"+U;"s4"+D**\dir{-};
  48. "c8"+U;"s4"+D**\dir{-};
  49. \drop\frm{.}
  50. \endxy}
  51. }
  52. \end{document}


P.S. I found the code used to compile the xytree documentation pdf to see how they got their autosegmental example (29) top aligned, but they used a macro provided by lingmacros; a package I'm not using. The code for this macro can be found by googling "cm-lingmacros" but I couldn't get it to work.

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8460
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Fri Jan 02, 2015 7:49 pm

You can compensate it using \raisebox, such as

\item\raisebox{\dimexpr-\totalheight+3.2ex\relax}{\leavevmode ... }

Stefan
Site admin


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 5 guests