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:
|
options:
|
||||||
-html create html (default)
|
-html create html (default)
|
||||||
-latex create LaTeX
|
-latex create LaTeX
|
||||||
|
-pdflatex create pdf via pdflatex
|
||||||
|
|
||||||
* Batch process emacs org-mode files to create html/LaTeX etc.
|
* Batch process emacs org-mode files to create html/LaTeX etc.
|
||||||
|
|
||||||
@ -49,8 +50,14 @@ USAGE
|
|||||||
|
|
||||||
# default is html export:
|
# default is html export:
|
||||||
mode=html
|
mode=html
|
||||||
|
unset makePDF
|
||||||
|
|
||||||
|
echo "have $Script"
|
||||||
case $Script in
|
case $Script in
|
||||||
|
*pdflatex)
|
||||||
|
mode=latex
|
||||||
|
makePDF=pdflatex
|
||||||
|
;;
|
||||||
*latex)
|
*latex)
|
||||||
mode=latex
|
mode=latex
|
||||||
;;
|
;;
|
||||||
@ -59,7 +66,6 @@ case $Script in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
# parse options
|
# parse options
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
do
|
do
|
||||||
@ -75,6 +81,11 @@ do
|
|||||||
mode=latex
|
mode=latex
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-pdflatex)
|
||||||
|
mode=latex
|
||||||
|
makePDF=pdflatex
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-*)
|
-*)
|
||||||
usage "unknown option: '$*'"
|
usage "unknown option: '$*'"
|
||||||
;;
|
;;
|
||||||
@ -98,6 +109,21 @@ do
|
|||||||
then
|
then
|
||||||
emacs --batch -l org --visit=$org \
|
emacs --batch -l org --visit=$org \
|
||||||
--funcall org-export-as-$mode-batch
|
--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
|
else
|
||||||
echo "File not found"
|
echo "File not found"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user