diff --git a/chertex.sh b/chertex.sh index dd33ef0..917787d 100755 --- a/chertex.sh +++ b/chertex.sh @@ -89,18 +89,17 @@ if [ $# -eq 1 ]; then simpledelay.sh 2 latexmk -pdf -bibtex $jobname fi - #echo " Calling texi2dvi()" - #R CMD texi2dvi --pdf --verbose $jobname.tex - ### Perhaps the choice should be dictated from a command-line argument? - - # Don't bother with this. Let latexmk take care of cleaning up - # Move unnecessary auxiliary files generated - #echo " _________________________" - #echo " =========================" - #echo " Moving auxiliary files..." - #mv *.aux logs - #mv *.log logs - #mv *.out logs + + ## THIS IS A QUICK-AND-DIRTY FIX FOR SAMPLE-MATRIX + # If $jobname is sample-matrix, run knitr and markdown + if [[ $jobname == "sample-matrix" ]]; then + echo " -----------------------------------------------------------" + echo " sample-matrix detected: running knit() and markdownToHTML()" + echo " -----------------------------------------------------------" + Rscript -e "library(knitr); knit(input='$jobname.Rmd', output='$jobname.md')" + Rscript -e "library(markdown); markdownToHTML('$jobname.md', '$jobname.html', stylesheet = 'custom.css')" + fi + else # Either no arguments, or more than one argument if [ $# -eq 0 ]; then @@ -200,6 +199,11 @@ else if [ $Rmdfiles != 0 ]; then cp /home/taha/chepec/tmp/$tmpdirname/*.Rmd . fi + # Return *.css files (css files) [for sample-matrix] + cssfiles=`ls -1 /home/taha/chepec/tmp/$tmpdirname/*.css 2>/dev/null | wc -l` + if [ $cssfiles != 0 ]; then + cp /home/taha/chepec/tmp/$tmpdirname/*.css . + fi fi echo "Terminating..."