Skip to content
Snippets Groups Projects
Commit 824df2c3 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: add org-pdflatex to create pdf files

parent 7e9adc7b
Branches
Tags
No related merge requests found
tools/org-batch
\ No newline at end of file
......@@ -37,8 +37,9 @@ usage() {
Usage: ${0##*/} [OPTIONS] file1 [.. fileN]
options:
-html create html (default)
-latex create LaTeX
-html create html (default)
-latex create LaTeX
-pdflatex create pdf via pdflatex
* Batch process emacs org-mode files to create html/LaTeX etc.
......@@ -49,8 +50,14 @@ USAGE
# default is html export:
mode=html
unset makePDF
echo "have $Script"
case $Script in
*pdflatex)
mode=latex
makePDF=pdflatex
;;
*latex)
mode=latex
;;
......@@ -59,7 +66,6 @@ case $Script in
;;
esac
# parse options
while [ "$#" -gt 0 ]
do
......@@ -75,6 +81,11 @@ do
mode=latex
shift
;;
-pdflatex)
mode=latex
makePDF=pdflatex
shift
;;
-*)
usage "unknown option: '$*'"
;;
......@@ -98,6 +109,21 @@ do
then
emacs --batch -l org --visit=$org \
--funcall org-export-as-$mode-batch
# post-processing step to create pdf
case "$makePDF" in
pdflatex)
input="${org%.org}.tex"
if [ -f "$input" ]
then
pdflatex "$input"
else
echo "No $input to convert to pdf"
fi
;;
esac
else
echo "File not found"
fi
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment