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

Mike Reeks mike.reeks at yahoo.com
Thu Jun 11 20:12:17 UTC 2020


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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20200611/6c0ba94a/attachment.html>


More information about the lyx-users mailing list