If you need to convert files from one markup format into another, pandoc is your swiss-army knife. Pandoc can convert between the following formats:
(← = conversion from; → = conversion to; ↔︎ = conversion from and to)
pdflatex
, lualatex
, xelatex
, latexmk
, tectonic
, wkhtmltopdf
, weasyprint
, prince
, context
, or pdfroff
.Source: Pandoc – About pandoc
I have been looking for an easy way to generate presentations or slide decks. I am pretty happy with the system I have now, which combines These tools make it possible to create well organized. News and feature lists of Linux and BSD distributions.
We at Data In Motion Consulting GmbH are currently working at the preparation of a course, so we came across to the need of making some presentations.
I, personally, as coming from an academic environment, was used to prepare my slides using LaTeX. Its beamer package, in particular, is quite famous for making presentations, as it comes with a lot of different and elegant styles.
The only problem I had with LaTeX is that sometimes the syntax can be quite hard to master, and you could end up spending a lot of time rendering things exactly how you wanted to.
In these two years as a software developer, I became quite familiar with Markdown, instead, which has, on the contrary, a pretty straightforward syntax and allows you to easily document your code and prepare notes. I am quite found of Typora as Markdown editor, as it is very intuitive to use, and provides a lot of cool functionalities.
Among them, one over all grabbed my attention: the possibility to directly convert Markdown into LaTeX!
So I started experimenting a bit, and I wanted to share with you what I found out, in the hope that it could be useful to someone else as well.
First of all, to be able to use some of the Typora exports functionalities, including the LaTeX one, you need Pandoc. This is the tool which does the actual conversion work under the hood. It allows you to convert a wide variety of formats into other ones.
Once you have Pandoc installed, you can simply write your markdown document in Typora, and then export it in LaTeX.
This will result in a .tex
file, that you can easily convert to a PDF with tools like pdflatex
. However, this does not produce a slide-like document, but rather a standard LaTeX one.
What I needed, instead, was to be able to convert my markdown document into a .tex
file yes, but a .tex
file which made use of the beamer
package. I went a bit through the Pandoc documentation and I found out that there is actually the possibility to convert markdown to beamer. The only thing that you need to do is to specify the target format when invoking Pandoc from the command line.
And that's it! This takes your markdown input file (test.md
), convert it to LaTeX beamer, and produces a PDF output file (out.pdf
).
If you want to have more control over the output, Pandoc also offers the possibility to produce the intermediate .tex
file first, so you can add customizations of your choice before actually convert it to a PDF. Just use, instead: