mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add org-pdflatex to create pdf files
This commit is contained in:
1
bin/org-pdflatex
Symbolic link
1
bin/org-pdflatex
Symbolic link
@ -0,0 +1 @@
|
||||
tools/org-batch
|
||||
@ -39,6 +39,7 @@ Usage: ${0##*/} [OPTIONS] file1 [.. fileN]
|
||||
options:
|
||||
-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
|
||||
|
||||
Reference in New Issue
Block a user