Intermediate .tex file during 'Convert' differs from manual export,causes problems

Alexander lyx at jalsti.de
Thu Jun 11 21:20:10 UTC 2020


Hi Mike,

I am sorry if you misunderstood something. These files are only related
to my problem I described below and which got solved by Jürgens
suggestions.
I do not know anything about any problems you might have posted to the
public lyx-user list.

Sorry again,
Best,
Alexander

Mike Reeks <mike.reeks at yahoo.com> 
am Donnerstag, 11. Juni 2020, 21:12:17:

> Alex
> Could you please explain to me in simple English what these files
> represent.  How do they relate to my problem. Mike
> 
> Sent from Mail for Windows 10
> 
> From: Alexander
> Sent: 11 June 2020 11:10
> To: lyx-users at lists.lyx.org
> Subject: Intermediate .tex file during 'Convert' differs from manual
> export,causes problems
> 
> Hi all,
> 
> during creation of a Markdown converter in LyX I noticed some
> behavior, which messes up the final output.
> 
> - created a new File Format 'Markdown' (as 'Document format' and 'With
>   TeX fonts:' = 'PDF (XeTex)' <-- side note: using 'PDF (pdflatex)'
>   would result in UTF-8 encoding errors during later conversion with
>   pandoc error "pandoc: Cannot decode byte…")
> 
> - created a new Converter Definition 'LaTeX (XeTeX) -> Markdown', with
>   converter command 'pandoc --wrap=none -f latex -t markdown -o $$o
> $$i' (results below are also the same when using 'LaTeX (plain) ->
>   Markdown' as Converter)
> 
> - used this converter to export as Markdown
> 
> 
> This basically works, and when I have an algorithm included in the LyX
> file, the export still finishes, but has a fault in the output.
> 
> The intermediate .tex temp file created by LyX, during exporting to
> markdown, has the two lines
> --
> \begin{lstlisting}%
> [language=Python]
> --
> which in the final markdown file look like
> --
>     %
>     [language=Python]
> --
> This causes problems when people receiving the Markdown file then try
> to convert them to PDF, as the code is like that not correctly
> rendered as program code.
> 
> When manually exporting the .lyx as 'PDF (XeTex)' the resulting file
> does not have the problem, the output is one line
> --
> \begin{lstlisting}[language=Python]
> --
> which in the markdown file (generated using same command as in my new
> LyX Converter: "pandoc --wrap=none -f latex -t markdown -o
> "minimal-example.md" "minimal-example.tex") results in the correct
> output, which gets handled as code:
> --
> ``` {.python language="Python"}
> --
> 
> This is Lyx 2.3.2 on Debian Linux and I would be happy if someone
> could tell me how to get this generator running with the expected
> output of algorithms.
> [Attached example files, hoping the file names are self-explanatory]
> 
> TYVM,
> Alexander
> 
> 



Vielen Dank und Grüße,
Alexander Stiebing


More information about the lyx-users mailing list