Aperfeiçoa o build.sh.

parent 5c58622a
#-----------------------------------------------------------------------
if [ "$1" = "-h" ]; then
echo 'Usage:'
echo ' $1: filename without extension, e.g. `slides`.'
echo ' if $1 is -h, then shows this message.'
echo ' if $1 is --all, then compiles all Rnw files.'
echo ' $2: {0, 1}, remove LaTeX auxiliary files (.log, .aux, ...).'
else
FILENAME=$1
echo "\nConverting Rnw to tex.\n"
knit $FILENAME.Rnw
echo "\nConverting tex to PDF.\n"
pdflatex $FILENAME.tex
exit 0
fi
#-----------------------------------------------------------------------
if [ "$1" = "--all" ]; then
RNWFILES=$(ls *.Rnw)
echo $RNWFILES
for RNW in $RNWFILES; do
FILE="${RNW%.*}"
echo $FILE
Rscript -e "require(knitr); knit(\"$RNW\")"
pdflatex $FILE
pdflatex $FILE
pdflatex $FILE
rubber --clean $FILE
done
exit 0
fi
#-----------------------------------------------------------------------
RNW=$1
FILE="${RNW%.*}"
echo "\nConverting Rnw to tex.\n"
knit $RNW
echo "\nConverting tex to PDF.\n"
pdflatex $FILE
if [ "$#" -eq 2 ]; then
if [ "$2" -eq 1 ]; then
echo "\nDeleting LaTeX auxiliary files.\n"
rubber --clean $FILENAME
rubber --clean $FILE
fi
fi
exit 0
#-----------------------------------------------------------------------
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment