I know nothing of lyx2lyx but have a question that recently came up.

Is it common when exporting to older LyX formats to convert some insets
to ERT? It seems common, e.g., when adding a feature in a new version of
LyX that does not exist in an older version of LyX.

If it is common, from what I understand the current way for lyx2lyx to
export to ERT is to essentially rewrite the LaTeX export routine in
Python in lyx2lyx.  In many cases I imagine this is simple, but I can
also imagine that it could be more complicated. In this case, wouldn't
it be nice to just ask LyX "hey, can you export this chunk to LaTeX so I
can stick it in an ERT box?"

I can imagine 2 ways to have lyx2lyx communicate with LyX. One would be
to have a command-line argument where we could feed the LyX code to LyX
and ask LyX to return the exported LaTeX code corresponding to a
specific chunk.

An alternative way would be to link lyx2lyx to LyX. For example,
pybind11 seems relevant here
(https://stackoverflow.com/a/38542539/1376404).

Doing this would introduce a huge dependency to the (from what I
understand) standalone lyx2lyx. I imagine there are disadvantages to
this.

By the way, when grepping for ERT in lyx2lyx, I found a comment that was
interesting:

  ERT insert are hidden feature of lyx 1.1.6. This might be removed in
  the future.

I had no idea that ERT was at some point an experimental hidden feature.
Interesting! I guess it's hear to stay now.

Scott

Attachment: signature.asc
Description: PGP signature

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

Reply via email to