From 79c1e7f02cebc8b753c037e465fa3add2d0e5011 Mon Sep 17 00:00:00 2001 From: Nathan Schneider Date: Tue, 6 Aug 2019 04:13:35 +0000 Subject: [PATCH] Upload New File --- .scripts/pandout.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .scripts/pandout.sh diff --git a/.scripts/pandout.sh b/.scripts/pandout.sh new file mode 100644 index 0000000..5790f28 --- /dev/null +++ b/.scripts/pandout.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# pandout, by ntnsndr, v. 20190316 +# Summary: Uses Pandoc to generate a multi-format typeset manuscript in output/ +# Input: One or more source files in current directory +# Live inputs: Filename, .csl from ~/Zotero/styles/ +# Output: A set of pandoc-proceessed output files in the output/ directory +# to specify .csl file for bibliography, use YAML metadata "csl:" command + +# Determine filename $fname +fname="" +input="$@" +fname_default="${input%%.*}" +read -p 'Filename [input_filename.*]: ' fname +if [ -z "$fname" ]; then + fname="$fname_default" +fi + +# Command content (see also ~/.emacs) +cmd="pandoc -s -f markdown+smart --bibliography $HOME/Zotero/lib.bib --variable fontsize=11pt -o ./output/$fname" + +# Create output/ directory +if [ ! -d 'output' ]; then + mkdir output +fi + +# Run conversion commands for each filetype +# Using full output from commands +$cmd.docx $@ +$cmd.epub $@ +$cmd.odt $@ +$cmd.pdf $@