Re: Forest beyond basics

2021-12-20 Thread Jürgen Spitzmüller via lyx-users
Am Montag, dem 20.12.2021 um 15:56 -0500 schrieb Steve Litt via lyx-
users:
> And I'm pretty sure that just drawing it in Inkscape is a faster
> workflow than repeatedly changing a number, compiling, and looking at
> the result. 

No. Not if you are used to tikz. I usually need much longer time in
inkscape (if I need to use it) to get proper placement and alignment.

> I think the text based trial and error method would take an
> awful lot of time for the following diagram:
> 
> http://troubleshooters.com/linux/presentations/golug_runit/images/runsv_supervision.svg

It's not trial and error. If you select the proper tikzlibrary, tikz
will automate a lot. And the result would definitely look nicer.

But as I said, everybody should chose the tool that suits them.

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Forest beyond basics

2021-12-20 Thread Steve Litt via lyx-users
Herbert Voss via lyx-users said on Mon, 20 Dec 2021 09:30:54 +0100

>Am 19.12.21 um 22:24 schrieb Steve Litt via lyx-users:

>> LyX and LaTeX were never intended to make drawings or diagrams. Not
>> really.  
>
>That is not true! From the beginning of LaTeX there was the picture
>environment with, of course, limited capability. But it was good enough
>for simple diagrams/graphics.

 ^^

And I'm pretty sure that just drawing it in Inkscape is a faster
workflow than repeatedly changing a number, compiling, and looking at
the result. I think the text based trial and error method would take an
awful lot of time for the following diagram:

http://troubleshooters.com/linux/presentations/golug_runit/images/runsv_supervision.svg

SteveT

Steve Litt 
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Forest beyond basics

2021-12-20 Thread Maria Gouskova via lyx-users
On Mon, Dec 20, 2021 at 3:53 AM Baris Erkus via lyx-users <
lyx-users@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@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
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Forest beyond basics

2021-12-20 Thread Baris Erkus via lyx-users


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):

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:


fig01.pdf
Description: Adobe PDF document
\documentclass[]{standalone}

\input{figs_opts.tex}

\begin{document}

\begin{tikzpicture}[line join=round]

\draw[anchor=mid]
  (0,0) node (a) {a}
  (1,0) node (b) {b}
  (0,-1) node (c) {c}
  (1,-1) node (d) {d};
\node (e) at (1,-2) {e};
\node (f) at (1,-3) {f};
\draw (a) -- (c);
\draw (a.south) -- (d.north);
\draw (c.north) -- (b.south);
\draw (b) -- (d);
\draw (d) -- (e);
\draw (e) -- (f);

\end{tikzpicture}


\end{document}
%\usepackage{mathptmx}
%\renewcommand{\familydefault}{\rmdefault}
%\usepackage[T1]{fontenc}
%\usepackage[latin9]{inputenc}
\usepackage{siunitx}
\usepackage{array}
\usepackage{amsmath}
\usepackage{ifthen}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}
\usepackage{titling, graphicx}
\usepackage{tikz}
\usepackage{upgreek}
\usepackage{amsmath,amsthm}
\usepackage{strtikz}
\usetikzlibrary{shapes,arrows.meta,intersections,graphs,graphs.standard}
\usetikzlibrary{math,fit}
\usetikzlibrary{calc,intersections,through,backgrounds,decorations.pathmorphing}
\usetikzlibrary{patterns}

-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Forest beyond basics

2021-12-20 Thread Herbert Voss via lyx-users



Am 19.12.21 um 22:24 schrieb Steve Litt via lyx-users:

Maria Gouskova via lyx-users said on Sun, 19 Dec 2021 12:20:15 -0500


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


LyX and LaTeX were never intended to make drawings or diagrams. Not
really.


That is not true! From the beginning of LaTeX there was the picture
environment with, of course, limited capability. But it was good enough
for simple diagrams/graphics.

Herbert







it in your LyX document just like you'd put any old .png or more to the
point .svg. LyX automatically recompiles your Inscape-produced .svg
into a PDF suitable for LyX/LaTeX upon finding that the .svg has
changed.

You know what it's supposed to look like, so you can draw it yourself.
For new work where you need a new "forest", whatever this "forest"
thing is, find a forest making software that can export to .svg,
and then you can either use that .svg, or modify it a little in
Inkscape.

SteveT

Steve Litt
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques


--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Forest beyond basics

2021-12-19 Thread Jürgen Spitzmüller via lyx-users
Am Sonntag, dem 19.12.2021 um 16:24 -0500 schrieb Steve Litt via lyx-
users:
> LyX and LaTeX were never intended to make drawings or diagrams. 

But tikz and xy (and some other packages) were.

> Not really. Just take 20 minutes to make your drawing in Inkscape,
> then put it in your LyX document just like you'd put any old .png or
> more to the point .svg. LyX automatically recompiles your Inscape-
> produced .svg into a PDF suitable for LyX/LaTeX upon finding that the
> .svg has changed.

Everybody to their taste. Personally, I think tikz is excellent, and I
prefer it a lot over inkscape for most diagrams, and certainly for
linguistic trees.

Tikz might be a challenge to newcomers as it does not have a GUI
(natively) but it is way superior in some regards (overlays, different
output formats). I also very much prefer it typographic quality over
inkscape's (at least what is provided without much intervention).


Jürgen


signature.asc
Description: This is a digitally signed message part
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Forest beyond basics

2021-12-19 Thread Maria Gouskova via lyx-users
On Sun, Dec 19, 2021 at 12:36 PM Jürgen Spitzmüller via lyx-users <
lyx-users@lists.lyx.org> wrote:

> Am Sonntag, dem 19.12.2021 um 12:20 -0500 schrieb Maria Gouskova via
> lyx-users:
> > 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...)
>
> I suppose things went wrong on pasting into the ERT (paste into ERT
> with Paste Special > Plain Text to avoid this).
>
> Try the attached.
>

Ah damn, the whitespace will get you every time! Thanks, Jürgen. Your
example works here.

And thanks for the tikz tip--I was actually thinking of using xypic if all
else failed, which would also do what I need. The Government Phonology
thing in forest comes so close...

Maria







>
> Best,
> Jürgen
>
> --
> lyx-users mailing list
> lyx-users@lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-users
>
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Forest beyond basics

2021-12-19 Thread Steve Litt via lyx-users
Maria Gouskova via lyx-users said on Sun, 19 Dec 2021 12:20:15 -0500

>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 

Hi Maria,

LyX and LaTeX were never intended to make drawings or diagrams. Not
really. Just take 20 minutes to make your drawing in Inkscape, then put
it in your LyX document just like you'd put any old .png or more to the
point .svg. LyX automatically recompiles your Inscape-produced .svg
into a PDF suitable for LyX/LaTeX upon finding that the .svg has
changed.

You know what it's supposed to look like, so you can draw it yourself.
For new work where you need a new "forest", whatever this "forest"
thing is, find a forest making software that can export to .svg,
and then you can either use that .svg, or modify it a little in
Inkscape.

SteveT

Steve Litt 
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Forest beyond basics

2021-12-19 Thread Jürgen Spitzmüller via lyx-users
Am Sonntag, dem 19.12.2021 um 18:36 +0100 schrieb Jürgen Spitzmüller
via lyx-users:
> I suppose things went wrong on pasting into the ERT (paste into ERT
> with Paste Special > Plain Text to avoid this).

BTW as for your diagram, I would probably go with tikz directly rather
than with forest. Like this (polishing needed):

\usepackage{tikz}

...

\begin{tikzpicture}
\draw[anchor=mid]
  (0,0) node (a) {a}
  (1,0) node (b) {b}
  (0,-1) node (c) {c}
  (1,-1) node (d) {d};
\node (e) at (1,-2) {e};
\node (f) at (1,-3) {f};
\draw (a) -- (c);
\draw (a.south) -- (d.north);
\draw (c.north) -- (b.south);
\draw (b) -- (d);
\draw (d) -- (e);
\draw (e) -- (f);
\end{tikzpicture}

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Forest beyond basics

2021-12-19 Thread Jürgen Spitzmüller via lyx-users
Am Sonntag, dem 19.12.2021 um 12:20 -0500 schrieb Maria Gouskova via
lyx-users:
> 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...)

I suppose things went wrong on pasting into the ERT (paste into ERT
with Paste Special > Plain Text to avoid this).

Try the attached.

Best,
Jürgen



forest_eg.lyx
Description: application/lyx


signature.asc
Description: This is a digitally signed message part
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users