[TxMt] A pandoc .txt to .pdf command in markdown bundle
Gildas Hamel
gweltaz at ucsc.edu
Wed Dec 24 07:54:06 UTC 2014
I made a simple shell script and a similar system service via automator to turn .txt files into .pdf via xelatex. They work well but require a couple steps outside TextMate. It would be a great convenience to have a command in the markdown bundle that would add this capacity. I tried it but failed even when giving full path to pandoc and pandoc-citeproc which are in /usr/local/bin, or to xelatex. I have little knowledge in these matters and would appreciate any help.
Here is my little shell script:
#!/bin/sh
pandoc -S --filter pandoc-citeproc --latex-engine=xelatex "${1}" -o "${1}".pdf
My similar automator service:
PATH=$HOME/.cabal/bin:/usr/local/bin:/usr/texbin:$PATH
for file in "$@"
do
output=${file%%.*}.pdf
pandoc -S --filter pandoc-citeproc --latex-engine=xelatex "$file" -o "$output"
done
The metadata at the head of my .md or .txt files give extra info, such as title, font, bibliography, as in:
---
title: My title
author: My Name
date: \today
mainfont: Hoefler Text
bibliography: /Users/me/Library/texmf/bibtex/bib/data.bib
---
Any pointers towards making a markdown bundle command that accomplishes what the scripts above do would be great.
--Gildas
More information about the textmate
mailing list