pd — Print Draft
pd instantly prints your draft in a well-set layout. A great companion to a
red Fineliner pen.
pd is a small wrapper script around
combines filters and templates to set a print layout that's perfect for editing
the old fashioned way.
At minimum, you might need these requirements:
tlmgr install hyphenat \ newunicodechar \ blindtext \ fancyhdr \ lastpage \ filemod
Instantly print your draft in a well-set layout. pd [OPTIONS] [FILE] -h show this message -r print a hash of the file contents -d Don't print, just export to PDF -p A print range for lp. See lp manual for format Examples: pd first-draft.md pf -p 1-2 first-draft.md pf -d first-draft.md && open first-draft.pdf
You can optionally include Pandoc filters by
exporting an environment variable called
PD_PANDOC_FILTERS with a
space-separated list of your filter names. The most common way to set
environment variables is by including something like this in your
export PD_PANDOC_FILTERS="filter1 filter2"
Use with vim
pd from vim for the current file you're editing, include this
snippet in your
" Print markdown draft using pandoc function! PrintDraft(...) let l:filename = expand('%:p') " If bang! save to file if a:0 > 0 && a:1 == 1 "do not print exec "!pd -d " . l:filename elseif exists('a:2') exec "!pd -p " . a:2 l:filename else exec "!pd " . l:filename endif endfunction command! -nargs=* -bang PrintDraft call PrintDraft(<bang>0, <f-args>)
With this, you can call
pd with commands like