本文是Beamer presentations using pandoc, markdown, LaTeX, and a makefile的學習筆記。html
本文主要講如何使用上述工具製做slides.git
本文假設讀者對LaTeX, Beamer, markdown有基本的瞭解。github
Pandoc是轉換markup語言的「瑞士軍刀」。詳見Pandoc主頁。本文中,Pandoc用來將markdown轉換爲TeX.markdown
LaTeX+Beamer製做簡單slides的一個缺點是效率低下。比方說,我想實現ide
test工具
test學習
我須要輸入\{itemize}
5 次,不斷調整成對括號的位置。十分麻煩。LaTeX+Beamer,在製做簡單slides時,顯得過於強大。code
Markdown正好解決了這個問題。實現上圖,我只須要輸入htm
- test - test - test - test - test
本文所述方法正好結合了二者的優勢。blog
這一節用一個例子介紹如何使用Pandoc+LaTeX+Beamer+Markdown製做slides。
這種方法和以往直接敲LaTeX的區別在哪兒呢?區別在於:
slides正文部分用Markdown寫做,而設置部分仍有LaTeX完成。
Markdown部分由Pandoc轉換爲LaTeX後,被LaTeX調用。
比方說,我前些天須要製做slides。我須要以下幾個文件:
main.tex
\documentclass[t]{beamer} \usetheme{Hannover} \usecolortheme{whale} \setbeamertemplate{navigation symbols}{} \usepackage{tikz} \usetikzlibrary{scopes} \newcommand{\tmmathbf}[1]{\ensuremath{\boldsymbol{#1}}} \title{A Quantum Algorithm for Integer Factorization}
pre.md
# Motivation ## What is Shor’s algorithm? ### A quantum algorithm for integer factorization - Quantum algorithm - An algorithm that runs on quantum computers - Integer factorization
make
pandoc pre.md --slide-level 2 -t beamer -o pre.tex pdflatex main.tex pdflatex main.tex okular main.pdf rm -rf main.aux main.log main.nav main.out main.snm main.toc main.vrb
其他細節部分,如如何在Markdown中插入LaTeX圖片、公式,能夠經過看代碼瞭解。
https://github.com/tengpeng/Pandoc-LaTeX-Beamer-Markdown
原文地址: http://tengpeng.github.io/blog/2014/05/22/pandoc-plus-markdown/