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 "---------------------------------------------------------------"
## 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"
TeXfiletype="tex"
tikzfiles="*.tikz"
Rnwfiles="*.Rnw"
auxfiles="*.aux *.bbl *.bcf *.blg *.fdb* *.figlist *.log *.lox *.makefile *.map *.out *.run* *.toc *.dep *.dpth"
if [ $# -eq 1 ]; then
# Check if the argument contains a filetype
@ -58,7 +71,7 @@ if [ $# -eq 1 ]; then
echo "<cheRTeX> -------------------------"
echo "<cheRTeX> R CMD pgfsweave completed"
echo "<cheRTeX> -------------------------"
simpledelay.sh 5
simpledelay.sh 4
# Run vc script if vc exists in working directory
echo "<cheRTeX> Running vc script"
@ -67,8 +80,15 @@ if [ $# -eq 1 ]; then
fi
# Run pdflatex, bibtex, and company
if $useshellescape; then
echo "<cheRTeX> Calling LaTeXMK with shell escape"
simpledelay.sh 2
latexmk -r ltxmkshellescape.rc -pdf -bibtex $jobname
else
echo "<cheRTeX> Calling LaTeXMK"
latexmk $jobname -pdf -bibtex
simpledelay.sh 2
latexmk -pdf -bibtex $jobname
fi
#echo "<cheRTeX> Calling texi2dvi()"
#R CMD texi2dvi --pdf --verbose $jobname.tex
### Perhaps the choice should be dictated from a command-line argument?
@ -87,6 +107,7 @@ else
# Zero arguments. Present a menu of choices
echo "This is cheRTeX POST-PROCESSING" # only one choice for now
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"
read usrchoice
@ -132,12 +153,14 @@ else
done
echo "Completed TikZ file processing"
fi
echo "Terminating..."
#mv $jobname-*.pdf tikz-pdfs
#mv *.aux logs
#mv *.log logs
#mv *.out logs
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..."
exit 1
fi

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