Batch-processing of tikz files now uses tikz2pdf, successfully.

master
Taha Ahmed 14 years ago
parent 91f655e744
commit b0b46e1879

@ -90,32 +90,32 @@ else
echo "Any other input exits the program" echo "Any other input exits the program"
read usrchoice read usrchoice
# Determine number of .Rnw files in current directory ## Determine number of .Rnw files in current directory
Rnwfileno=$(ls -1 $Rnwfiles | wc -l) #Rnwfileno=$(ls -1 $Rnwfiles | wc -l)
echo "No of .Rnw files: $Rnwfileno" #echo "No of .Rnw files: $Rnwfileno"
#
# Check if number of .Rnw files larger than one ## Check if number of .Rnw files larger than one
if [ $Rnwfileno -gt 1 ]; then #if [ $Rnwfileno -gt 1 ]; then
# If larger than one, ask for user input # # If larger than one, ask for user input
# Indicates more than one Rnw file in current directory. # # Indicates more than one Rnw file in current directory.
# This introduces a naming ambiguity. # # This introduces a naming ambiguity.
# Resolve by asking user for current jobname # # Resolve by asking user for current jobname
echo "Found $Rnwfileno .Rnw files in current directory" # echo "Found $Rnwfileno .Rnw files in current directory"
echo "Please specify the jobname" # echo "Please specify the jobname"
read jobname # read jobname
if [ -z "$jobname" ]; then # if [ -z "$jobname" ]; then
# string is null # # string is null
echo "Specified jobname cannot be parsed. Terminating..." # echo "Specified jobname cannot be parsed. Terminating..."
exit 1 # exit 1
fi # fi
else #else
# There is exactly one *.Rnw file is current directory # # There is exactly one *.Rnw file is current directory
# Fetch the jobname from the .Rnw filename by stripping off the file extension # # Fetch the jobname from the .Rnw filename by stripping off the file extension
Rnwfilename=$(ls -1 $Rnwfiles) # Rnwfilename=$(ls -1 $Rnwfiles)
jobname=${Rnwfilename%.*} # jobname=${Rnwfilename%.*}
fi #fi
#
echo "Jobname set to: $jobname" #echo "Jobname set to: $jobname"
if [[ $usrchoice == "pdf-all" || $usrchoice == "1" ]]; then if [[ $usrchoice == "pdf-all" || $usrchoice == "1" ]]; then
echo "<1> 'pdf-all' chosen" echo "<1> 'pdf-all' chosen"
@ -126,11 +126,9 @@ else
simpledelay.sh 2 simpledelay.sh 2
for tikzfilename in $tikzfiles; do for tikzfilename in $tikzfiles; do
# Remove the file extension # Call tikz2pdf
tikzlabel=${tikzfilename%.*} echo "<Executing> tikz2pdf $tikzfilename"
# Call pdfLaTeX with tikz label as jobname # See TiKZ manual section 63 for more details tikz2pdf --once $tikzfilename
echo "Executing <pdflatex --jobname=$tikzlabel $jobname.$TeXfiletype>"
pdflatex --jobname=$tikzlabel $jobname.$TeXfiletype
done done
echo "Completed TikZ file processing" echo "Completed TikZ file processing"
fi fi

Loading…
Cancel
Save