On 4/23/19 4:16 PM, Gour wrote:
It is easy to create geometric objects (or parts of them), and for
inclusion in a LyX document you can export either to PNG or EPS or (my
preference) to PGF/TiKZ (requires the PGF LaTeX package).
Any reason why you prefer PGF/TikZ over e.g. PNG? Is it assumed one
should be familiar to draw with them?
PNG is a raster format (array of pixels), so if you resize the image
some distortion will occur. PGF/TiKZ results in vector graphics, so
LaTeX (or PSTricks or something) draws the image to the specified
dimensions when you compile the document. I think EPS might work just as
well, provided that GeoGebra exports it as a vector drawing. (It's
possible to embed a PNG image in an EPS file, and I've been ambushed
once or twice by EPS files that I thought would be vector graphics but
ended up being raster format.)
You do not need to be familiar with PGF or TiKZ to insert an image into
a document. I haven't used the new (?) "classic" version much, but I
think the steps are as follows:
1. Draw the diagram as you want it.
2. In the GeoGebra file menu, select "Download as...", choose the
"PGF/TikZ" option, and save the file. It will be a full document in
LaTeX.
3. Open the exported file in a text editor, copy the body (from
\begin{document} to \end{document}, excluding those lines), and
paste it into a LaTeX (ERT) inset wherever it should go in your LyX
document. That could be in a graphics float. Note that I'm /not/
using Insert > Graphics in LyX.
4. Back in the exported file, copy pretty much everything in the
document preamble and paste it into the LyX document preamble.
5. Cross fingers and compile the LyX document.
Paul