Transferring Markdown Documents to LibreOffice

I know nothing about Markdown, but simply reading Wikipedia tells me it can be used to produce HTML - indeed, that this is its primary function. HTML can be opened by LibreOffice Writer and you can save as .odt from there.

I trust this helps.

Brian Barker

I've used quite a few Markdown editors. I know nothing about CentOS, so
I can't recommend anything for that OS. On Windows, I like WriteMonkey.
In Linux, the best I've seen is ReText, but last I checked, it's
developer was no longer supporting an Ubuntu PPA for the program making
installation less smooth on Ubuntu.

Since Markdown is a pure text file with formatting marks inserted, you
could easily edit such a file with LO. It sounds like what you're asking
is a way to convert the Markdown file to a LO format. I'm not sure of a
direct way of doing that. You might try Pandoc, an online file converter.

My greatest frustration with Markdown, aside from its many different
flavors, is that there doesn't seem to be a complete Markdown solution
anywhere. At best, there are add-on tools to some existing products
(like your Geany), but I've not found anything (at least in the
free-software realm) that actually includes everything you need.

I've found myself using LaTeX to create HTML files. It's htlatex
converter does a nice job and creates an easily editable .CSS file. And,
after nearly 40 years of development, it's really complete.

Virgil

Pandoc can be installed on any system, but only recent versions support ODT, so you need to look with version if offered by CentOS

http://pandoc.org/

Regards,
Ricardo

Tried it but it does not work very well. I exported one of my markdown documents to HTML from Markdownpad 2 but the export filter inserted lots of extraneous style information that I do not want. I am looking for the minimal information for OO/LO to understand Heading1, lists, tables etc. without adding any extra information.

Also, I would expect reverting to markdown format from OO/LO to be quite a mess.

I am looking for seamless interchange between OO/LO and markdown... I understand there is a plugin for Word, Writage, that allows one to convert between the different formats. However, since I do not use Word I am not able to try it. I have not found any such plugin for OO/LO - yet - but that would seem to be the perfect approach.

I do have Pandoc installed, have not tested it yet, but I would much prefer a seamless way of moving between OO/LO and markdown format. Either the native ability to read/save in markdown format, or a plugin doing the same.

H wrote:

I am looking for seamless interchange between OO/LO and markdown...

I don't see how this would be possible. Any modern word processor has features not found in markdown, therefore each of those features would be impossible to seamlessly convert to markdown.

I should have been clearer. If you read my previous message you will see that I am not looking for what you are describing, rather the ability to read/write document and presentation files in markdown format.

The Multimarkdown editor supposedly can create OO files but since it does not run on my systems I have not been able to give it a try.

H wrote:

I should have been clearer. If you read my previous message you will see
that I am not looking for what you are describing, rather the ability to
read/write document and presentation files in markdown format.

This runs into the same problem -- a modern presentation program (such as LibreOffice's) is capable of recording many things in ODF files that can't be converted into markdown.

The nature of your problem is that you seek to go from a very capable modern format (such as ODF) to a simple format which, by design, can "only addresses issues that can be conveyed in plain text" (per https://daringfireball.net/projects/markdown/syntax).

The Multimarkdown editor supposedly can create OO files but since it does
not run on my systems I have not been able to give it a try.

Going from markdown to ODF should be fine, going the other way is naturally going to be lossy.

To divert a little, but not talking about Markdown.

We were looking for a simple way of of producing documents in html,
thought we were on the right track until some of the potential users
asked for pdf too. We now use Lyx for the authoring, it produces
formatted text, without formatting marks having to be typed in.

From the Lyx master, we output in pdf and html, with DVI and xhtml
available as options. Where Open Document format is needed, the html
can be directly pasted in to .odt, but with one failing. A Table of Contents
in Lyx loses the page links in the paste function . There is an easy
work-around, just create a new ToC in Libre Office - about 4 clicks,
and delete the original ToC.

Gordon Cooper

MX-Linux Documentation Team
Tauranga N.Z.

You can do much the same with LO itself.

I've always loved the PDF output from LO's PDF converter. For some
reason I've never been able to figure out, its PDF output seems sharper
and crisper than the PDF output created by other programs, including
LaTeX or LyX. It may just be me.

I've also been impressed with LO's HTML output. It has a couple
different options, either of which which will produce a fairly simple
HTML file which can easily be edited further with any text editor.

And, where an OpenDocument file is needed, you have it without any need
for further conversion.

I confess I'm fairly OCD when it comes to my endless search for the
perfect document creation tool (which of course doesn't exist). In the
FOSS world, I've tried everything from LO to LaTeX, LyX, Markdown, and
ReStructuredText, but I almost always come back to LO.

I usually try one of the other alternatives when I need to do something
LO won't do only to learn later that LO would have done it quite well if
I had only taken the time to learn it.

Virgil

Interesting but I want to emphasize that this is not a solution for what I seek to accomplish.

Again, this is not what I am trying to do and of course I am aware that any OO/LO document has lots of formatting and options that markdown lacks that would be lost going from OO/LO, that's the reason for using markdown.

My focus - which the other users understood - is to focus on the content of the document, using OO/LO later to polish the presentation of the content.

Although I did not mention it, there are also several markdown editors running on Android phones and tablets allowing me to work on document content on the go.

I will confess my denseness, but I've read your explanation of what you
want several times, and I'm not sure I understand what you want. My
response below was to another user who was talking about using LyX. It
was not intended to address your original post as I don't understand
your desire.

What I *think* you're saying is that you want to write in Markdown, with
all the #Headings and *italics* code and then have LO automatically
convert that to its own formatted Headings and italics, etc. I don't
know of any converter (other than, perhaps, Pandoc) that can do that.

I have used a converter to go from ReStructuredText (a markup language
similar to Markdown) to .ODT, but it doesn't work very elegantly. One
reason is there are so many different way of formatting something in LO,
the converter doesn't know which way you might prefer. For example, LO
can format a heading directly or through paragraph styles with or
without automatic numbering. If you try to convert a Markdown #Heading
to LO, your converter won't know if you want direct formatting or
formatting with a paragraph style. My experience is that most converters
convert to direct formatting, which then means I have to go back and
change it all to styles, which sort of defeats the purpose of the
conversion.

You then mention wanting to create presentations from your Markdown.
There again I'm confused. Markdown's purpose is to be a front end to
HTML which is a continuous stream of content formatted for a web
browser. When I hear the word "presentation," I think in terms of LO
Impress or MS Powerpoint. Those formatted documents are *very* different
from what you get with HTML.

So, if you're trying to write in Markdown and end up with a document
that looks like a Powerpoint presentation, I think what you're asking
for is very ambitious, especially since Markdown wasn't intended for
that type of document. But, if you're using "presentation" in a
different sense, then I go back to my original comment, I don't
understand what you want.

Good luck with your efforts

Virgil

I have installed pandoc and tried to converted two markdown documents to ODT opening them in LibreOffice 4.3.7 under CentOS 6.8.

It seems Pandoc modifies the LO styles, setting fonts to Arial, Times Roman etc. which are not available in LO. Pandoc also did not assign the default list style to lists, nor did it handle tables at all. Although tables are not part of the core markdown they are part of a common extension.

I would have preferred pandoc to use whatever the style settings are in LO, not trying to change anything.

Hello,

H. @ 2016-11-27 19:00 GMT:

<snip>

Since Markdown is a pure text file with formatting marks inserted, you
could easily edit such a file with LO. It sounds like what you're asking
is a way to convert the Markdown file to a LO format. I'm not sure of a
direct way of doing that. You might try Pandoc, an online file converter.

<snip>

Pandoc can be installed on any system, but only recent versions support ODT, so you need to look with version if offered by CentOS

http://pandoc.org/

Regards,
Ricardo

I have installed pandoc and tried to converted two markdown documents to ODT opening them in LibreOffice 4.3.7 under CentOS 6.8.

It seems Pandoc modifies the LO styles, setting fonts to Arial, Times Roman etc. which are not available in LO. Pandoc also did not assign the default list style to lists, nor did it handle tables at all. Although tables are not part of the core markdown they are part of a common extension.

I would have preferred pandoc to use whatever the style settings are in LO,
not trying to change anything.

Actually it does not work that way; pandoc cannot guess what styles are used
by LibreOffice. If you have written your two documents using markdown they
simply cannot use LibreOffice styles "in advance". I think that what's really
going on with Pandoc is that it has default settings for each type of export
filters. Arial and Times Roman are fairly common fonts and by default
LibreOffice can use them with no problem.

On the other hand, using Markdown in my experience does not really make me
expect to have nicely laid out documents (like with LibreOffice or LATEX for
instance). Markdown is fundamentally a web and transitional format, made to
process text on websites or online documentation. If you are looking for rich
and complex styles I suggest to stick to LibreOffice or other kinds of tools
such as LATEX.

Best,

Hello,

H. @ 2016-11-27 19:00 GMT:

<snip>

Since Markdown is a pure text file with formatting marks inserted, you
could easily edit such a file with LO. It sounds like what you're asking
is a way to convert the Markdown file to a LO format. I'm not sure of a
direct way of doing that. You might try Pandoc, an online file converter.

<snip>

Pandoc can be installed on any system, but only recent versions support ODT, so you need to look with version if offered by CentOS

http://pandoc.org/

Regards,
Ricardo

I have installed pandoc and tried to converted two markdown documents to ODT opening them in LibreOffice 4.3.7 under CentOS 6.8.

It seems Pandoc modifies the LO styles, setting fonts to Arial, Times Roman etc. which are not available in LO. Pandoc also did not assign the default list style to lists, nor did it handle tables at all. Although tables are not part of the core markdown they are part of a common extension.

Does CentOS 6.8 have access to the "ttf-mscorefonts-installer" package?

This package includes Arial and Times New Roman and many of the core fonts you get with a Windows install. I use the DEB package, but hopefully there is a RPM package as well.

On my main laptop, I have Arial in "normal" style, monospaced, condensed, narrow, and rounded font sets.

Actually, I have over 180 fonts in my ".font"folder, and have over 14GB of font files on my "file server".

Hi Tim

Does CentOS 6.8 have access to the "ttf-mscorefonts-installer" package?

This package includes Arial and Times New Roman and many of the core
fonts you get with a Windows install. I use the DEB package, but
hopefully there is a RPM package as well.

On my main laptop, I have Arial in "normal" style, monospaced,
condensed, narrow, and rounded font sets.

Actually, I have over 180 fonts in my ".font"folder, and have over 14GB
of font files on my "file server".

No need to add fonts, LibreOffice will substitute quite easily with the Liberation family of fonts which are pretty well identical to Arial, the same with Times font. No need to install any MS fonts if you don't need to. The fonts shipped with LibreOffice are such that they will offer the largest success with respect to interoperability with fonts.

Marc

My point exactly: pandoc knows that I am converting from markdown format to LO format. It should not define new fonts or font sizes for the various parts of the markdown document, only make anything tagged Header Level 1 in the markdown document become Header 1 in LO accepting whatever font, font size and other style information I have defined in LO. It should not convert Header Level 1 in markdown to Times, Arial or any other font at all, this has nothing to do with whether LO has compatible fonts or not.

I have never tried to use my markdown editor for defining "rich and complex styles" and I thought I had made that clear several times.

I think there are frequent misunderstandings on list why and how some users want to use a markdown editor to create document content leaving the formatting to LO, OO or whatever their word processor - or slide presentation package - is.

I would like to add that I have pandoc 1.9.4.1 on my computer running CentOS 6.8, apparently pandoc 1.10 has expanded support for markdown to also include tables and other features.

Thank you for the information but irrelevant. Pandoc should not define any font information at all when exporting from markdown to LO.