LyX --> markdown
slitt at troubleshooters.com
Sat Aug 15 09:38:56 UTC 2020
On Tue, 11 Aug 2020 14:50:10 +0200
Saša Janiška <gour at atmarama.com> wrote:
> More than 20 yrs ago I did a 2-part full-fledged books using
> LyX/LaTeX/xindy and akthough in the meantime I was experimenting with
> several light markups (Asciidoc, rst, markdown..) now I'd čike to
> write all my study notes, articels, blog posts, slide-show
> presentations...using LyX editor, but for the web part I use Tiki CMS
> where I can copy & paste markdown code for the content, so wonder what
> would be recommended way to get from LyX to markdown?
I wouldn't. You'd lose a heck of a lot of semantics going from LyX,
which allows all the arbitrary paragraph and character styles you need,
to Markdown, whose motto is "my way or the highway."
The real problem is that, as far as I know, after more than 10 years,
LyX' html and xhtml exports change a lot of styles to appearances
prematurely. When I asked about making a truly semantic (x)html export,
the response I received was basically "hey, we're just interested in
making our master theses, so you book authors just have to wait." Or
"do it yourself", which I probably would have except LyX's code is,
shall I say, hairy.
It's really too bad, because all LyX needs to do is export *text
within styles*, and have the author sort out the appearance with CSS.
One export, I don't know if it's still alive, had two normal paragraph
styles, one for the first paragraph not to indent, and the other for
succeeding paragraphs that should be indented. This needless
complication is unnecessary, the indent-on-succeeding-paragraphs can be
done quite well in CSS.
It's not even necessary for LyX to write the CSS because most likely
you won't want the same appearance in HTML that you wanted in PDF. All
that's necessary is a list of all styles in the document so the author
can create the CSS for each.
Things like indexing, references and bibliographies will present more of
a challenge, but geez, it's been ten years.
From what I've seen of Markdown, anything from Markdown is going to be
pretty cookie-cutter. You might be better writing Asciidoctor with an
You haven't said why you want HTML and PDF from the same document. If
your intent is to create content for mobile devices, another
possibility is a 5.5" x 3.5" PDF made from LyX. It's kinda sorta
readable on a mobile device for those with good vision: I've been
selling them for years.
It wouldn't even be too difficult to create a shellscript to convert
the 8.5"x11" or A4 to 5.5x3.5", so you maintain one source and run
several places. It won't wrap on the fly like ePub, and it's not hip
like ePub, but it's readable, and IMHO a lot less pain than trying to
make high quality ePubs with LyX in any part of the stack.
Autumn 2020 featured book: Thriving in Tough Times
More information about the lyx-users