How to make PDF presentations in Markdown [closed]
Asked Answered
M

5

28

Is there a LaTeX style, header, or something so that e.g. markdown2pdf from pandoc would produce a PDF having a new page with each H1/markdown heading? Cheers

Microcopy answered 8/6, 2011 at 19:41 Comment(1)
another tutorial: jeromyanglim.blogspot.com.au/2012/07/…Funest
D
39

Using a recent version of pandoc, you can do this:

pandoc myslides.txt -t beamer -o myslides.pdf

and you will get a nicely formatted PDF slide show. For further instructions, see the pandoc User's Guide.

Despoil answered 9/6, 2012 at 4:39 Comment(0)
E
3

This should be a comment akin jleedev's mentioning the post on using markdown for beamer presentations, which in any case seems a little simpler (and better documented!). I was going to mention some pandoc 'filters' on bitbucket, https://bitbucket.org/mpastell/pandoc-filters, including one for beamer. It provides for ordinary pandoc image import syntax, for what that is worth.

They work through Pandoc's json machinery which I don't know much about, together with the sort of transformation explained in http://johnmacfarlane.net/pandoc/scripting.html. I'm not sure why the route through json is used. The effect is not that different from the perl substitutions used the in post above. In any case, this command:

pandoc -r markdown -w json deg.txt | runhaskell beamer.hs | pandoc -r json -w latex -s --template=templates/beamer.template > deg.tex

seems to work fine on a very simple text divided into level one sections. -- With the one proviso, that \begin{document} is immediately followed by an \end {frame}. This may be inevitable given the extreme simplicity of the file https://bitbucket.org/mpastell/pandoc-filters/src/6cd7b8522cf5/beamer.hs which is much like the first example Behead.hs on the "Scripting with Pandoc" page. In any case, it is clear that you are meant to begin your markdown file with a bit of LaTeX, presumably beamer-specific. If you stick something like

\begin{frame}{\;}
\center{What I did on my summer vacation}
\center{Meredith Alvarez}

at the start of your markdown file, it all works fine, but I assume something more beamer-specific is intended. It could do with a little more documentation!

The middle process, runhaskell beamer.hs is very slow, but it's instantaneous if you compile it and run

pandoc -r markdown -w json deg.txt | ./beamer | pandoc -r json -w latex -s --template=templates/beamer.template > deg.tex
Eatables answered 11/6, 2011 at 14:17 Comment(2)
Its good that someone has found my filters. You can use Pandoc syntax for specifying the title johnmacfarlane.net/pandoc/README.html#title-block instead of Latex. I'm not going document the filters for know, because they are more for my own benefit but the usage is fairly obvious for someone who reads the Pandoc documentation and knows a bit of Haskell.Cartload
The link to using_markdown_for_beamer_presentations is broken. Can someone fix it?Tristis
H
2

You might want to take a look at MMD2PDF, a command line utility, converts MultiMarkDown text files to PDF documents, adding a few extra's like options to include webpages and support for page-breaks. It is a portable utility, it will leave no traces in registry or on your file system.

http://code.google.com/p/mmd2pdf

Hod answered 13/11, 2011 at 19:19 Comment(0)
C
1

There are native beamer support features (along with S5 and many other open PPT-replacements) in Pandoc; read the docs, search the mail list and you'll find lots of details. BTW FFR the pandoc mailing list is very responsive, including getting quick feedback from John M (the lead developer) himself directly.

Regarding the specific content of your question regarding page-breaks on sections, this is a normal feature of LaTeX, therefore fully supported in Pandoc - just use the normal pandocs option to specify a latex stylesheet and stick with the pandocs native markdown input.

Of course, this does require a little latex knowledge, but IMO better that than having to deal with an entirely different package.

Crouch answered 5/2, 2012 at 8:24 Comment(0)
O
1

I couldn't get any of the pandoc solutions to work. (Though I didn't spend any time trying to figure out why.)

Assuming you're using something like Slidify of Slidy to obtain your HTML slides, you could try this workaround that did surprisingly well for me:

I merely printed to PDF from within Chrome. Setting the layout to landscape and options to background colors and images gave me all the goodies.

Oleta answered 1/10, 2013 at 22:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.