|
|
|
@ -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
|
|
|
|
|
echo "<cheRTeX> Calling LaTeXMK"
|
|
|
|
|
latexmk $jobname -pdf -bibtex
|
|
|
|
|
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"
|
|
|
|
|
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?
|
|
|
|
@ -86,7 +106,8 @@ else
|
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
|
# 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 "<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,13 +153,15 @@ else
|
|
|
|
|
done
|
|
|
|
|
echo "Completed TikZ file processing"
|
|
|
|
|
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..."
|
|
|
|
|
|
|
|
|
|
#mv $jobname-*.pdf tikz-pdfs
|
|
|
|
|
#mv *.aux logs
|
|
|
|
|
#mv *.log logs
|
|
|
|
|
#mv *.out logs
|
|
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|