pandoc格式转换示例

To see the output created by each of the commands below, click on the name of the output file:

HTML fragment:

pandoc README -o example1.html

Standalone HTML file:

pandoc -s README -o example2.html

HTML with smart quotes, table of contents, CSS, and custom footer:

pandoc -s -S --toc -c pandoc.css -A footer.html README -o example3.html

LaTeX:

pandoc -s README -o example4.tex

From LaTeX to markdown:

pandoc -s example4.tex -o example5.text

reStructuredText:

pandoc -s -t rst --toc README -o example6.text

Rich text format (RTF):

pandoc -s README -o example7.rtf

Beamer slide show:

pandoc -t beamer SLIDES -o example8.pdf

DocBook XML:

pandoc -s -S -t docbook README -o example9.db

Chunked XHTML via DocBook and xmlto:

xmlto xhtml -m config.xsl example9.db -o example9/

Man page:

pandoc -s -t man pandoc.1.md -o example10.1

ConTeXt:

pandoc -s -t context README -o example11.tex

Converting a web page to markdown:

pandoc -s -r html http://www.gnu.org/software/make/ -o example12.text

From markdown to PDF:

pandoc README --latex-engine=xelatex -o example13.pdf

PDF with numbered sections and a custom LaTeX header:

pandoc -N --template=mytemplate.tex --variable mainfont=Georgia --variable sansfont=Arial --variable monofont="Bitstream Vera Sans Mono" --variable fontsize=12pt --variable version=1.14 README --latex-engine=xelatex --toc -o example14.pdf

A wiki program using Happstack and pandoc: gitit

HTML slide shows:

pandoc -s --mathml -i -t dzslides SLIDES -o example16a.html

pandoc -s --webtex -i -t slidy SLIDES -o example16b.html

pandoc -s --mathjax -i -t revealjs SLIDES -o example16d.html

TeX math in HTML:

pandoc math.text -s -o mathDefault.html

pandoc math.text -s --mathml -o mathMathML.html

pandoc math.text -s --webtex -o mathWebTeX.html

pandoc math.text -s --mathjax -o mathMathJax.html

pandoc math.text -s --latexmathml -o mathLaTeXMathML.html

Syntax highlighting of delimited code blocks:

pandoc code.text -s --highlight-style pygments -o example18a.html

pandoc code.text -s --highlight-style kate -o example18b.html

pandoc code.text -s --highlight-style monochrome -o example18c.html

pandoc code.text -s --highlight-style espresso -o example18d.html

pandoc code.text -s --highlight-style haddock -o example18e.html

pandoc code.text -s --highlight-style tango -o example18f.html

pandoc code.text -s --highlight-style zenburn -o example18g.html

GNU Texinfo, converted to info, HTML, and PDF formats:

pandoc README -s -o example19.texi

makeinfo --no-validate --force example19.texi -o example19.info

makeinfo --no-validate --force example19.texi --html -o example19

texi2pdf example19.texi  # produces example19.pdf

OpenDocument XML:

pandoc README -s -t opendocument -o example20.xml

ODT (OpenDocument Text, readable by OpenOffice):

pandoc README -o example21.odt

MediaWiki markup:

pandoc -s -S -t mediawiki --toc README -o example22.wiki

EPUB ebook:

pandoc -S README -o README.epub

Markdown citations:

pandoc -s -S --biblio biblio.bib --csl chicago-author-date.csl CITATIONS -o example24a.html

pandoc -s -S --biblio biblio.json --csl chicago-fullnote-bibliography.csl CITATIONS -o example24b.html

pandoc -s -S --biblio biblio.yaml --csl ieee.csl CITATIONS -t man -o example24c.1

Textile writer:

pandoc -s -S README -t textile -o example25.textile

Textile reader:

pandoc -s -S example25.textile -f textile -t html -o example26.html

Org-mode:

pandoc -s -S README -o example27.org

AsciiDoc:

pandoc -s -S README -t asciidoc -o example28.txt

Word docx:

pandoc -s -S README -o example29.docx

LaTeX math to docx:

pandoc -s math.tex -o example30.docx

DocBook to markdown:

pandoc -f docbook -t markdown -s howto.xml -o example31.text

MediaWiki to html5:

pandoc -f mediawiki -t html5 -s haskell.wiki -o example32.html

Custom writer:

pandoc -t sample.lua example33.text -o example33.html

Docx with a reference docx:

pandoc -S --reference-docx twocolumns.docx -o UsersGuide.docx README

Docx to markdown, including math:

pandoc -s example30.docx -t markdown -o example35.md

EPUB to plain text:

pandoc README.epub -t plain -o example36.text
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
pandoc: 如果您需要将文件从一种标记格式转换为另一种标记格式,那么pandoc就是您的瑞士军刀。Pandoc可以转换文件(几种方言)Markdown,reStructuredText,纺织品,HTML,DocBook,LaTeX,MediaWiki标记,TWiki标记,TikiWiki标记,Creole 1.0,Vimwiki标记,OPML,Emacs 组织模式,Emacs Muse,txt2tags,Microsoft Word docx,LibreOffice ODT,EPUB或黑线鳕标记到 HTML格式 使用Slidy,reveal.js,Slideous,S5或DZSlides的 XHTML,HTML5和HTML幻灯片演示 字处理器格式 Mi crosoft Word docx,OpenOffice / LibreOffice ODT,OpenDocument XML,Microsoft PowerPoint。 电子书 EPUB版本2或3,FictionBook2 文档格式 DocBook版本4或5,TEI Simple,GNU TexInfo,Groff man,Groff ms,Haddock标记 档案格式 JATS 页面布局格式 InDesign ICML 大纲格式 OPML TeX格式 LaTeX,ConTeXt,LaTeX Beamer幻灯片 PDF 通过pdflatex,xelatex,lualatex,pdfroff,wkhtml2pdf,prince,或weasyprint。 轻量级标记格式 Markdown(包括CommonMark和GitHub风格的Markdown),reStructuredText,AsciiDoc,Emacs Org-Mode,Emacs Muse,Textile,txt2tags,MediaWiki标记,DokuWiki标记,TikiWiki标记,TWiki标记,Vimwiki标记和ZimWiki标记。 自定义格式 自定义编写器可以用lua编写。 Pandoc了解许多有用的markdown语法扩展,包括文档元数据(标题,作者,日期); 脚注; 表; 定义清单; 上标和下标; 三振出局; 增强的有序列表(起始编号和编号样式很重要); 运行示例列表; 带语法高亮的分隔代码块; 聪明的引号,短划线和椭圆; HTML块内的markdown; 和内联LaTeX。如果需要严格的降价兼容性,则可以关闭所有这些扩展。 LaTeX数学(甚至宏)可用于降价文档。提供了几种不同的HTML渲染数学方法,包括MathJax和MathML的翻译。LaTeX数学被转换(根据输出格式的需要)到unicode,本机Word方程对象,MathML或groff eqn。 Pandoc包含一个强大的系统,用于自动引用和参考书目,使用pandoc-citeproc(源自Andrea Rossato的citeproc-hs)。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值