2

I use the xyling package to draw tree diagrams. For the text I would like to use the CharisSIL font using the fontspec package. But combining these two gives poor quality tree diagrams: the lines are squiggly rather than straight. The trees are fine without fontspec.

MWE:

\documentclass[12pt]{article}
\usepackage{fontspec}
\setmainfont{CharisSIL}
\let\B\relax %to resolve a conflict in the definition of these commands between xyling and xunicode (the latter called by fontspec)
\let\T\relax
\usepackage{xyling} % for trees


\begin{document}

\Tree{&\K{CP} \V \\
\K{DP} && \K{C$'$} \V \\
& \K{C} && \K{IP}
}


\end{document}

Example tree with CharisSIL

Example tree with standard font

7
  • Have you considered using tikz instead. Lots of tree support.
    – daleif
    Sep 1, 2016 at 19:09
  • 2
    There is no XeTeX driver in Xy-pic, as far as I know, so oblique lines are realized by joining small segments and they look jagged.
    – egreg
    Sep 1, 2016 at 20:00
  • @egreg then why does the OP get a got result by removing fontspec?
    – daleif
    Sep 1, 2016 at 21:36
  • 1
    @daleif Actually, with the OP's code I get no line.
    – egreg
    Sep 1, 2016 at 21:41
  • Also xyling is from 2004, did XeLaTeX even exist back then. The first page of the manual explicitly mentions that xy is called with the dvips option
    – daleif
    Sep 2, 2016 at 11:34

1 Answer 1

2

You could use the forest package, but it's certainly not the only one out there.

Output

enter image description here

Code

\documentclass[margin=10pt]{standalone}
\usepackage{fontspec}
\usepackage[linguistics]{forest}

\newfontfamily\charis{Charis SIL}

\forestset{
    mytree/.style={for tree={font=\charis}}
}


\begin{document}
\begin{forest} mytree,
[CP
    [DP]
    [C'
        [C]
        [IP]
    ]
]
\end{forest}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .