26

是否有 LaTeX 样式、标题或其他东西,例如markdown2pdfpandoc 会产生一个 PDF,其中每个 H1/markdown 标题都有一个新页面?干杯

4

5 回答 5

38

使用最新版本的 pandoc,您可以执行以下操作:

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

您将获得格式精美的 PDF 幻灯片放映。有关详细说明,请参阅pandoc 用户指南

于 2012-06-09T04:39:23.053 回答
3

这应该是类似于 jleedev 的评论,其中提到了使用 markdown 进行投影仪演示的帖子,无论如何,这似乎更简单(并且有更好的文档记录!)。我打算在 bitbucket 上提到一些 pandoc 的“过滤器”,https: //bitbucket.org/mpastell/pandoc-filters ,包括一个用于 beamer 的过滤器。它提供了普通的 pandoc 图像导入语法,这是值得的。

他们通过我不太了解的 Pandoc 的 json 机制以及http://johnmacfarlane.net/pandoc/scripting.html中解释的那种转换来工作。我不确定为什么使用通过 json 的路由。效果与上面帖子中使用的 perl 替换没有什么不同。无论如何,这个命令:

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

似乎在一个非常简单的文本上工作正常,分为一级部分。- 有一个附带条件,即\begin{document}紧随其后的是\end {frame}. 鉴于文件https://bitbucket.org/mpastell/pandoc-filters/src/6cd7b8522cf5/beamer.hs非常简单,这可能是不可避免的,这很像“使用 Pandoc 编写脚本”页面上的第一个示例 Behead.hs . 在任何情况下,很明显,您应该使用一些 LaTeX 开始您的降价文件,大概是特定于投影仪的。如果你坚持像

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

在您的降价文件的开头,一切正常,但我认为更具体的投影仪是有意的。它可以做更多的文档!

中间过程,runhaskell beamer.hs很慢,但是编译运行是瞬间的

pandoc -r markdown -w json deg.txt | ./beamer | pandoc -r json -w latex -s --template=templates/beamer.template > deg.tex
于 2011-06-11T14:17:26.223 回答
2

您可能想看看 MMD2PDF,一个命令行实用程序,将 MultiMarkDown 文本文件转换为 PDF 文档,添加一些额外的选项来包含网页和支持分页符。它是一个便携式实用程序,它不会在注册表或文件系统上留下任何痕迹。

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

于 2011-11-13T19:19:54.743 回答
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.

于 2012-02-05T08:24:43.037 回答
1

我无法让任何 pandoc 解决方案发挥作用。(虽然我没有花任何时间试图找出原因。)

假设您正在使用像 Slidify of Slidy 之类的东西来获取 HTML 幻灯片,您可以尝试这种对我来说效果非常好的解决方法:

我只是从 Chrome 中打印到 PDF。将布局设置为横向,将选项设置为背景颜色和图像给了我所有的好处。

于 2013-10-01T22:30:01.297 回答