pandoc
Basics
pandoc -o output.html input.txt
- By default, pandoc produces a document fragment.
pandoc -s -o output.html input.txt
- for standalone file
- you can add options as
-theme
flags or you can add them in the front matter
- front matter is added to the head of the document and is like this
---
title: pandoc-help
author: totoro
---
- there are pandoc templates which can be used to change the look of the document
- filters can also be used to change some structure
- to add tabes of contents add this to the option
--toc
markdown to pdf
markdown to css
- apply css template -
pandoc i.md -o o.html --css=somecss.css
- include the css in the html file -
pandoc i.md -o -o.html --self-contained --css=somecss.css
cheatsheet
pandoc assignment1.md -o assignment1.pdf
- convert
assignment.md
to assignment.pdf
pandoc --version
- get pandoc version
pandoc first.md -o first.pdf --template eisvogel
pandoc first.md --pdf-engine=xelatex -o first.pdf
pandoc scala.md -o scala.pdf --toc
- create a table of contents too
pandoc hi.md --toc -o hi.html --css pandoc.css --template=./template.html
- use a custom template and custom css together for a webpage
- convert
README.md
to readme.pdf
with custom title, author, fontsize.
This can be included in the front matter too.
pandoc README.md -o readme.pdf --toc \
-v title:"Scala" \
-v author:"Shivanshi" \
-v geometry:"left=2cm,right=2cm,top=1cm,bottom=2cm" \
-v fontsize:"12pt"
color highlighting theme
<style>
$styles.html()$
</style>
templates