larstvei / ox-gfm

Github Flavored Markdown Back-End for Org Export Engine
230 stars 44 forks source link

Line break exports error #38

Closed Ynjxsjmh closed 5 years ago

Ynjxsjmh commented 5 years ago

I have some equations in org like

Predict(F \rightarrow i)  \\
= First(i)   \\
= { i } 

Exporting it into HTML will render like:

image

However if I use M-x org-gfm-export-to-markdown to export it into markdown, it becomes

[8] Predict(F → i) = First(i) = { i }
khinshankhan commented 5 years ago

Do you have any meta data in the org file? I believe ox-gfm's template is broken (since the melpa package it's based on doesn't work either). Refer to this reddit post about the finer details. I use the default org template and edit it from there. There's an option that respects line breaks (I use it for latex exports).

You can try the adding the following meta tag:

#+OPTIONS: \n:t

Predict(F \rightarrow i)  \\
= First(i)   \\
= { i }

and it'll respect the new lines.

Or you can try the following change:

Predict(F \rightarrow i)  \\

= First(i)   \\

= { i }

and it should export somewhat properly, even without changing the meta tags.

It may be worth noting that the \\ don't contribute to the new lines for markdown exports afaik.

Ynjxsjmh commented 5 years ago

Thanks, your advice works.