# Please make LyX native language well formed and valid XML

Dr Eberhard W Lisse nospam at lisse.NA
Sat Jan 23 16:22:29 UTC 2021

Steve,

I do not agree that your patience is relevant.

This is an Open Source project and unless one contributes one takes what
one gets.  Which is a fantastic product.

Personalizing can be easily done with templating for example something
from my prescription writer

\begin_layout Plain Layout
\noindent

\series bold
\size small
Ms $$FIRSTNAME$$ $$SURNAME$$
\end_layout

(which is inside a table cell) and a bit of Perl code looking something
like

use File::Slurp;
my $FILENAME = 'prescription.lyx'; my$FIRSTNAME = 'Jane';
my $SURNAME = 'Doe';$lyxtext = read_file($FILENAME);$lyxtext =~ s/\$\$FIRSTNAME\$\$/$FIRSTNAME/g;$lyxtext =~ s/\$\$SURNAME\$\$/$SURNAME/g; write_file($FILENAME, \$lyxtext);

I have no idea about VimOutliner but if you can get it to export to
MarkDown it's rather simple to make pandoc export LaTeX code which
imports cleanly into LyX, without having to mess with the LyX file.

I NEVER, EVER, number entities myself but let LyX/LaTeX do that for me
(stuff like enumerate/enumerate-resume).

el

On 2021-01-23 10:17 , Steve Litt wrote:
> On Thu, 21 Jan 2021 00:48:43 +0200
> Dr Eberhard W Lisse <nospam at lisse.NA> wrote:
>
>> While,
>>
>> I like XML out of principle, but besides that I find the tone of the
>> request a bit over the top, especially for such a huge undertaking, it
>> is rare to require LyX documents to be both manually and
>> programmatically editable.
>
> You're right, the tone was over the top. That being said:
>
> 1) The initial reason for complexifying the LyX native format back
>    around 2012 was to make it XML. I was opposed to the complexity at
>    the time. Now they have the complexity, but because it's not real
>    XML, you can't even parse it.
>
> 2) For a decade, LyX has all but ignored exporting **semantic**
>    HTML that can be used to create an realistically sized ePub with a
>    reasonable appearance and the ability of the author to change that
>    ePub with styles.
>
> I'd say I've been pretty patient.
>
>> Messing with the LyX file is admittedly difficult, why do it in the
>> first place?
>
> * Personalizing books I sell.
>
> * VimOutliner to LyX converter.
>
> * Renumbering of entities using Python scripts.
>
> Another thing: The first 9 years I worked with LyX, altering a LyX
> file programmatically was the simplest thing in the world.
>
> SteveT
>
> Steve Litt
> Autumn 2020 featured book: Thriving in Tough Times
> http://www.troubleshooters.com/thrive
>