Instantly share code, notes, and snippets.

@drcjar /
Last active Aug 15, 2016

What would you like to do?

Title: Pandoc Pelican Practice Date: 2016-04-10 Modified: 2016-04-10 Category: Tags: meta, colophon, workflow Slug: workflow Authors: Carl Reynolds Summary: Carl's Pandoc Pelican Practice Image:

bibliography: /home/sam/Dropbox/Documents/myblog/content/computers/IPFAEA.bib csl: /home/sam/Dropbox/Documents/myblog/content/computers/the-new-england-journal-of-medicine.csl

This is written in a thingy called markdown It's good because in addition to letting you do links and being easy to read and type you can do lists and things. (it's then made into a blog by running pelican on the content and pushing it to my githubs...)

  1. Like this
  2. List of things
  3. blah blah

Or you can do points

  • point one
  • point two

And you can include pictures from the interweb

It's a dog

And stress things lots etc etc. I haven't really yet learnt all the markdown things one can do but what really makes it ace is there is then a thingy called pandoc that converts this thingy into all the other things.

Yup. And footers are a thing too[^fn2]

[^fn2]: totally a supported thing.

For example if we save this as we can then run the command

'pandoc -o Cppp.doc'

to make a word doc. Just change the '.doc' for '.pdf' or '.html' etc and you can have that too. Examples attached. I think it's quite good anyway....Note that actually to get a .doc/.pdf/.html with citations the command is different (see below).

Not sold yet? It can also do smaller headings too (like this) and other things like referencing

A major feature in support for inline html and referencing using whatever you like [@Albin1999]. Here I'm using my asbestos researches bibliography file 'IPFAEA.bib' specified above in the metadata and specifying that it be formatted for the nejm.

To make a pdf the command becomes:

'pandoc --filter pandoc-citeproc -o Cppp.pdf'

To make a doc the command becomes:

'pandoc --filter pandoc-citeproc -o Cppp.docx'

And it can make tables using a variety of input formats (that you'd automagically generate using a tool) e.g grid table

+---------------+---------------+--------------------+ | Fruit | Price | Advantages | +===============+===============+====================+ | Bananas | $1.34 | - built-in wrapper | | | | - bright color | +---------------+---------------+--------------------+ | Oranges | $2.10 | - cures scurvy | | | | - tasty | +---------------+---------------+--------------------+

It's even useful for making slides. Just need to stick reveal.js folder in the same directory as the markdown then run e.g pandoc -t revealjs --self-contained -s -o Cppp.html

Note that a thing which isn't quite right (yet) is that the metadata needs to be structured as above for pelican but for pandoc all the things need to be enclosed between ---


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment