Added support for latexmk shell escape in chertex.sh. Added clean-up option.

master
Taha Ahmed 14 years ago
parent b0b46e1879
commit 710955d247

@ -16,10 +16,23 @@ echo "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
echo "MMX -- taha.ahmed@mkem.uu.se -- CHEPEC doctoral degree project" echo "MMX -- taha.ahmed@mkem.uu.se -- CHEPEC doctoral degree project"
echo "---------------------------------------------------------------" echo "---------------------------------------------------------------"
## If the file ltxmkshellescape.rc exists in the current directory,
## set the flag useshellescape=TRUE
useshellescape=false
echo "--- Looking for ltxmkshellescape.rc"
if [ -e ltxmkshellescape.rc ]; then
useshellescape=true
echo "+++ Shell escape activated"
else
echo "--- This job does not require shell escape"
fi
Rfiletype="R" Rfiletype="R"
TeXfiletype="tex" TeXfiletype="tex"
tikzfiles="*.tikz" tikzfiles="*.tikz"
Rnwfiles="*.Rnw" Rnwfiles="*.Rnw"
auxfiles="*.aux *.bbl *.bcf *.blg *.fdb* *.figlist *.log *.lox *.makefile *.map *.out *.run* *.toc *.dep *.dpth"
if [ $# -eq 1 ]; then if [ $# -eq 1 ]; then
# Check if the argument contains a filetype # Check if the argument contains a filetype
@ -58,7 +71,7 @@ if [ $# -eq 1 ]; then
echo "<cheRTeX> -------------------------" echo "<cheRTeX> -------------------------"
echo "<cheRTeX> R CMD pgfsweave completed" echo "<cheRTeX> R CMD pgfsweave completed"
echo "<cheRTeX> -------------------------" echo "<cheRTeX> -------------------------"
simpledelay.sh 5 simpledelay.sh 4
# Run vc script if vc exists in working directory # Run vc script if vc exists in working directory
echo "<cheRTeX> Running vc script" echo "<cheRTeX> Running vc script"
@ -67,8 +80,15 @@ if [ $# -eq 1 ]; then
fi fi
# Run pdflatex, bibtex, and company # Run pdflatex, bibtex, and company
echo "<cheRTeX> Calling LaTeXMK" if $useshellescape; then
latexmk $jobname -pdf -bibtex echo "<cheRTeX> Calling LaTeXMK with shell escape"
simpledelay.sh 2
latexmk -r ltxmkshellescape.rc -pdf -bibtex $jobname
else
echo "<cheRTeX> Calling LaTeXMK"
simpledelay.sh 2
latexmk -pdf -bibtex $jobname
fi
#echo "<cheRTeX> Calling texi2dvi()" #echo "<cheRTeX> Calling texi2dvi()"
#R CMD texi2dvi --pdf --verbose $jobname.tex #R CMD texi2dvi --pdf --verbose $jobname.tex
### Perhaps the choice should be dictated from a command-line argument? ### Perhaps the choice should be dictated from a command-line argument?
@ -86,7 +106,8 @@ else
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
# Zero arguments. Present a menu of choices # Zero arguments. Present a menu of choices
echo "This is cheRTeX POST-PROCESSING" # only one choice for now echo "This is cheRTeX POST-PROCESSING" # only one choice for now
echo "<1> 'pdf-all' -- Process all .tikz files to pdf graphics" echo "<1> 'pdf-all' -- Process all .tikz files to pdf graphics"
echo "<2> 'clean-up' -- Remove all auxiliary files"
echo "Any other input exits the program" echo "Any other input exits the program"
read usrchoice read usrchoice
@ -132,13 +153,15 @@ else
done done
echo "Completed TikZ file processing" echo "Completed TikZ file processing"
fi fi
if [[ $usrchoice == "clean-up" || $usrchoice == "2" ]]; then
echo "<2> 'clean-up' chosen"
rm $auxfiles
# Still a rather crude way of cleaning up...
fi
echo "Terminating..." echo "Terminating..."
#mv $jobname-*.pdf tikz-pdfs
#mv *.aux logs
#mv *.log logs
#mv *.out logs
exit 1 exit 1
fi fi

@ -0,0 +1,2 @@
$latex = "latex --shell-escape";
$pdflatex = "pdflatex --shell-escape";
Loading…
Cancel
Save