Forest beyond basics

Maria Gouskova gouskova at gmail.com
Mon Dec 20 13:01:02 UTC 2021


On Mon, Dec 20, 2021 at 3:53 AM Baris Erkus via lyx-users <
lyx-users at lists.lyx.org> wrote:

>
> On 19-Dec-21 8:20 PM, Maria Gouskova via lyx-users wrote:
>
> Dear LyX users,
>
> (Actually, I suspect this is a question for Jürgen S., but on the off
> chance that someone else knows the answer...)
>
> I need to produce a diagram with the structure shown here. It was produced
> using the obsolete xyling package (see the attached xyling_test files):
> [image: tree_i_want.png]
> All the nodes will have a lot of linguist-specific bells and whistles,
> like IPA fonts and small caps and other stuff. XYling has not been updated
> in 15 years; I barely got the doc to compile. So, xyling is no good for
> what I need.
>
> In the process of trying to work out how to make that tree happen in
> forest, the package that LyX's linguistics module directly supports, I
> concluded that I will need to use the "draw" functionality. But I can't
> work out how to make the \draw commands work inside the tree insets. I
> tried to follow an example from the forest manual (number (21) on p. 9 of
> this, http://mirrors.ctan.org/graphics/pgf/contrib/forest/forest-doc.pdf,
> and realized that there is no obvious way to pass options in the
> \begin{forest}  ... \end{forest} space beyond those that pertain to nodes
> (i.e., appear inside the [ ] brackets). The options just get ignored, or
> else prevent the PDF from being compiled.
>
> Things I've tried:
>
> 1) Declaring forest overtly in the preamble and passing the whole
> \begin{forest} ...\end{forest} block as ERT. That throws errors.
>
> 2) Using the native LyX forest support, and passing options as ERT inside
> the Tree inset. I noticed in the code preview pane that the \draw backslash
> is replaced with \textbackslash. I tried replacing the $s$ stuff with ERT,
> too. The code pane preview looks correct, but the file does not compile,
> throwing a bunch of errors along the lines of "Package pgfkeys Error:",
> etc. (I assume people can reproduce these...)
>
> Oh, also, I tried the example from the manual in TeXMaker to verify it
> wasn't some oddity of my TeX installation, and it compiled okay (except for
> the "background tree" option). It looked a lot more like what's in the
> manual than anything LyX produced (attached).
>
> So, yeah, I have a workaround in case it can't work--I could produce the
> doc in LyX, then export to TeX and finish the lattice thing there. I was
> just hoping there was an easier way.
>
> Linux Mint 19.1
> texlive ~2017
> LyX 2.3.6.1
>
> Maria
>
> Hello,
>
> I think you should do this in TikZ. You would not regret.
>
> Attached is a simple setup for you get started. Compile the LaTeX file
> Fig01.tex and get the PDF of your figure first. Then, you can insert the
> PDF into your LyX file. If you want to change your figure, just compile the
> file again and LyX will do the job automatically for you.
>
> My recommendation is: do not insert your code for figures (whether TikZ or
> not) into LyX as ERT box. Compile them separately and generate the figure
> PDF first. Then, insert the figure PDF into LyX. This will help you find
> errors and change the figures more easily without compiling whole LyX file.
> Also, it would be easier for LyX to compile the document.
>
> Baris
>
>
> --
> ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
> Please bottom-post. Start your reply here:
>
> --
> lyx-users mailing list
> lyx-users at lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-users
>


Thanks, but Jürgen's example was sufficient.

The example I attached was extremely simplified compared to what I actually
need to make--as I said in my original post, there are various typographic
bells and whistles that need to go into the node labels, including IPA,
small caps, Greek letter subscripts, and other things. So I am going to
have to fine-tune node positioning.

I prefer to have everything in one document whenever possible, for visual
consistency and for passing the paper to the's journal proof people. The
disadvantage of the method you suggested is that one has to tweak the image
size so that the fonts look like they came from the same universe. And then
if anything changes in the diagram, you have to redo it in multiple places.

Steve, both linguists and mathematicians use LaTeX for lattices, trees, and
various other graphical diagrams. The reason to do so is the one I alluded
to above: they mix text with graphics, and often they have to include text
with math typesetting. We've been doing this for decades.

Maria
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20211220/5a70e076/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tree_i_want.png
Type: image/png
Size: 3542 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20211220/5a70e076/attachment.png>


More information about the lyx-users mailing list