#!/bin/sh # # opml2tex --- MultiMarkdown convenience script # # Copyright (c) 2010-2011 Fletcher T. Penney # # Convert "MMD" styled OPML file to LaTeX # # Be sure to include multimarkdown in our PATH export PATH="/usr/local/bin:$PATH" # Locate XSLT directory xslt_path=`dirname "$0"` if [ $# = 0 ] then # No arguments, so use stdin/stdout # XSLT to convert OPML to MMD, then use MMD to create LaTeX xsltproc -nonet -novalid "$xslt_path/../XSLT/opml2mmd.xslt" - | multimarkdown -t latex shift else until [ "$*" = "" ] do # process each argument separately file_name=`echo "$1" | sed 's/\.[^.]*$//'` # XSLT to convert OPML to MMD, then use MMD to create LaTeX xsltproc -nonet -novalid "$xslt_path/../XSLT/opml2mmd.xslt" "$1" | multimarkdown -t latex > "$file_name.tex" shift done fi