kwhite / pandoc-templates

Templates for pandoc

Home Page:https://voleking.github.io/pandoc-templates/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pandoc Template

Templates for pandoc.

Many templates based on others'. You can find most of them from pandoc wiki page--User contributed templates.

I change some details for my own use, make disrepair templates work again and add chinese support. If there is a breach of copyright or licence, please contact me.

TODO

  • orange-toc 移动端目录样式不对,参考 blue-toc
  • articles 公式什么的都不支持
  • lecture note 封面
  • makefile转换
  • pandoc-resume

Markdown to PDF

install BasicTeX: brew cask install basictex install package: sudo tlmgr install titling lastpage

articles

modified from tzengyuxio's pages

pandoc markdown/pandoc.markdown -o pdf/pandoc-zhtw.pdf --toc --smart --template article --latex-engine=xelatex -V mainfont='PingFang SC'

beamer slide

pandoc -t SLIDES -o example.pdf

lecture notes

pandoc-latex-template

Add Chinese support.

pandoc markdown/example.md -o pdf/example.pdf --from markdown --template eisvogel --latex-engine=xelatex -N --listings -V mainfont='PingFang SC'

preview

example

options

Numbered Sections

For PDFs with numbered sections use the --number-sections or -N option.

pandoc example.md -o example.pdf --template eisvogel --number-sections
Syntax Highlighting with Listings

You can get syntax highlighting of delimited code blocks by using the LaTeX package listings with the option --listings. This example will produce the same syntax highlighting as in the example PDF.

pandoc example.md -o example.pdf --template eisvogel --listings
Syntax Highlighting Without Listings

The following examples show syntax highlighting of delimited code blocks without using listings. To see a list of all the supported highlight styles, type pandoc --list-highlight-styles.

pandoc example.md -o example.pdf --template eisvogel --highlight-style pygments
pandoc example.md -o example.pdf --template eisvogel --highlight-style kate
pandoc example.md -o example.pdf --template eisvogel --highlight-style espresso
pandoc example.md -o example.pdf --template eisvogel --highlight-style tango
Standalone LaTeX Document

To produce a standalone LaTeX document for compiling with any LaTeX editor use .tex as an output file extension.

pandoc example.md -o example.tex --template eisvogel
Changing the Document Language

The default language of this template is German. The lang variable identifies the main language of the document, using a code according to BCP 47 (e.g. en or en-GB). For an incomplete list of the supported language code see the documentation for the hyph-utf8 package (Section 2). The following example changes the language to British English:

pandoc example.md -o example.pdf --template eisvogel -V lang=en-GB

The following example changes the language to American English:

pandoc example.md -o example.pdf --template eisvogel -V lang=en-US

Markdown to Html5

github style

pandoc-goodies

demo

README

command

pandoc -t html5 -f markdown -s -S --toc --toc-depth 3 --template github.html5 --css html/css/github.css README.md -o index.html

blue-toc & orange-toc

tzengyuxio's pages

demo

Pandoc’s Markdown 語法中文翻譯

如何提高生產力

command

# stylesheets/blue-toc.css needed
pandoc -t html5 -f markdown -s -S --toc --toc-depth 2 --template blue-toc markdown/pandoc.markdown -o pandoc.html
# stylesheets/orange-toc.css needed
pandoc -t html5 -f markdown -s -S --toc --toc-depth 2 --template orange-toc markdown/how-to-be-more-productive.markdown -o productive.html

uikit

pandoc-uikit

the toc can float, and I like this style

demo

manual

command

# js/uikit stylesheets/uikit.css needed
pandoc -t html5 -f markdown -s -S --toc --toc-depth 2 --template uikit https://raw.githubusercontent.com/jgm/pandoc/master/MANUAL.txt -o html/uikit.html

bootstrap style

pandoc-bootstrap-template

demo

如何提高生產力

command

pandoc -t html5 -f markdown -s -S --toc --toc-depth 2 --template bootstrap --css css/bootstrap.css markdown/how-to-be-more-productive.markdown -o html/productive.html

bootstrap adaptive

pandoc-bootstrap-adaptive-template

demo

manual

command

pandoc -t html5 -f markdown -s -S --toc --toc-depth 2 --template bootstrap-adaptive.html5 --css css/bootstrap-adaptive.css https://raw.githubusercontent.com/jgm/pandoc/master/MANUAL.txt -o html/bootstrap-adaptive.html

More

add style to table sed -i '' 's/<table>/<table class="table table-bordered table-condensed">/' index.html

About

Templates for pandoc

https://voleking.github.io/pandoc-templates/


Languages

Language:HTML 70.5%Language:JavaScript 17.5%Language:CSS 12.0%Language:Makefile 0.0%