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
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" echo "<cheRTeX> Calling LaTeXMK"
latexmk $jobname -pdf -bibtex 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?
@ -87,6 +107,7 @@ else
# 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,12 +153,14 @@ else
done done
echo "Completed TikZ file processing" echo "Completed TikZ file processing"
fi fi
echo "Terminating..."
#mv $jobname-*.pdf tikz-pdfs if [[ $usrchoice == "clean-up" || $usrchoice == "2" ]]; then
#mv *.aux logs echo "<2> 'clean-up' chosen"
#mv *.log logs rm $auxfiles
#mv *.out logs # Still a rather crude way of cleaning up...
fi
echo "Terminating..."
exit 1 exit 1
fi fi

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