您的位置:首页 > 其它

用 Markdown 高效地写幻灯片

2015-08-04 15:12 459 查看
转载至:http://www.tinylab.org/use-markdown-to-write-slides/

【背景:笔者用 M$ PowerPoint, Libreoffice Draw, Latex 等写过幻灯,没有一个是令人省心的工具,没有一个能让人专注于内容创作本身。繁杂的格式、字体、以及所谓特效调节让人困惑烦恼,自从有了 Markdown,让思绪自由流畅不受阻,让创作回归内容本身,把那些繁杂的演示效果交给其他专业的人士打理就好。】

目录 [隐藏]

1 准备环境

1.1 安装pandoc

1.2 安装Latex以及中文支持

1.3 安装Beamer

1.4 安装字体

1.5 配置字体

2 编写幻灯

2.1 幻灯首页

2.2 幻灯正文

3 格式转换

3.1 生成pdf

3.2 生成html

4 实例

4.1 以本文稿为例

5 参考资料


准备环境


安装pandoc

以Ubuntu为例

12sudo apt-get install pandoc
其他平台请参考pandoc首页

安装Latex以及中文支持

以Ubuntu为例

1

2

3

4

5

6

7

8

9

$
sudo
apt-get
install
texlive-xetex
\

texlive-latex-recommended
\

texlive-latex-extra
\

latex-cjk-common
latex-cjk-chinese
\

latex-cjk-chinese-arphic-bkai00mp
\

latex-cjk-chinese-arphic-bsmi00lp
\

latex-cjk-chinese-arphic-gbsn00lp
\

latex-cjk-chinese-arphic-gkai00mp
\


安装Beamer

以Ubuntu为例

12sudo apt-get install latex-beamer
相关用法与实例

1

2

3

4

5

$
ls
/usr/share/doc/latex-beamer/

beameruserguide.pdf.gz

examples

solutions


安装字体

12345678$ sudo apt-get install \ fonts-arphic-bkai00mp \ fonts-arphic-bsmi00lp \ fonts-arphic-gbsn00lp \ fonts-arphic-gkai00mp \ ttf-wqy-microhei \ ttf-wqy-zenhei

配置字体

列出可选字体

1

2

$
fc-list
|
egrep
"wqy|AR"

实例配置:需配置zh_template.tex如下:

12\setCJKmainfont{AR PL KaitiM GB} % 中文字体

编写幻灯

幻灯首页

前三行分别对应标题
作者
日期

例如:

1

2

3

4

%
Markdown+Beamer+Pandoc幻灯片模板

%
吴章金
@
泰晓科技
|
TinyLab.org

%
\today


幻灯正文

支持如下语法

Markdown基本语法

Pandoc Markdown语法

Latex语法:1,2

实例

1234567# In the morning ## Getting up - Turn off alarm- Get out of bed

格式转换

生成pdf

利用该模板

1

2

$
make
pdf
&
make
read

原生命令

1234567$ pandoc -t beamer --toc \ -V theme:Darmstadt \ -V fontsize:9pt \ slides.md -o slides.pdf \ --latex-engine=xelatex \ --template=./templates/zh_template.tex

生成html

利用该模板$ make html & make read-html
原始命令

1

2

3

$
pandoc
-t
dzslides
-s
--mathjax
\

slides.md
-o
slides.html


实例


以本文稿为例

下载 Markdown 幻灯模板

12$ git clone https://github.com/tinyclub/markdown-slides.git
编译成 pdf & html

1

2

$
make

浏览

1

2

$
make
read
&
make
read-html


参考资料

Write
Beamer or Html slide using Markdown and Pandoc

Producing slide
shows with pandoc
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: