使用pandoc制作幻灯片

示例Md

% Habits
% John Doe
% March 22, 2005

# In the morning

## Getting up

- Turn off alarm
- Get out of bed

## Breakfast

- Eat eggs
- Drink coffee

# In the evening

## Dinner

- Eat spaghetti
- Drink wine

------------------

![UML attribute text](http://readus-org.qiniudn.com/img/uml-class-diagram/attribute-text.png)

## Going to sleep

- Get in bed
- Count sheep

  

pandoc 命令行:

pandoc -t beamer class2.md -o class2.pdf --slide-level=2 --pdf-engine=xelatex -V CJKmainfont='WenQuanYi Micro Hei Mono'

     

 pandoc -t revealjs -s -o class2.html class2.md  -V revealjs-url=./reveal.js-master --slide-level=2 

  

pandoc habits.txt -o habits.pptx --slide-level=2

  

使用pandoc转换pptx的时候会出现一个问题,就是图片和表格的行为会很奇怪,这一点是和转换pdf和reveal.js是不一样的

在使用pandoc转化pptx的时候表格和图片会单独的出现在一页ppt里面,这个时候如何增加文字描述结合图片在一页ppt呢

参考:https://bookdown.org/yihui/rmarkdown/powerpoint-presentation.html

解决方案是:

最好把想要描述的文字写在表格或者图片的标题里面。图片的标题可以包含两部分。标题。然后解释和finding等。

pandoc是支持多列的slider的,该输出可以是任意格式的ppt

利用pandoc可以生成比较复杂一点的PPT,其生产规则可以参考:https://pandoc.org/MANUAL.html

其中有关 

Producing slide shows with pandoc

 章节

此外,如果遇到中文编码错误或者出现了 一些公式功能上的错误。

 sudo apt install texlive-math-extra

  https://tex.stackexchange.com/questions/395625/im-unable-to-install-unicode-math-package-ubuntu-16-04

参考:

https://pandoc.org/MANUAL.html#producing-slide-shows-with-pandoc

http://liumh.com/2014/07/05/pandoc-produce-slide-shows/#

https://github.com/jgm/pandoc/wiki/Using-pandoc-to-produce-reveal.js-slides

使用 pandoc编写一般是 markdown 而它可以转换成 ppt文件以及reveal.js 

对于 reveal.js 也提供了很多的扩展,对着这些扩展可以使其功能更加的强大:

https://github.com/hakimel/reveal.js/wiki/Plugins,-Tools-and-Hardware

对于这里的插件发现一个很不错的mapbox插件:

https://lipov3cz3k.github.io/reveal.js-mapbox-gl-plugin/

比如

https://rajgoel.github.io/reveal.js-demos/chalkboard-demo.html#/1

测试了一下,可以直接修改 reveal.js的源码,这样就可以使用reveal的插件了

此外,对于rmarkdown 来说,可以直接使用这些插件

https://openscience.nuance-r.com/revealjs_presentation_format.html#installation

原文地址:https://www.cnblogs.com/wybert/p/11523311.html