Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walmes Marques Zeviani
ce089
Commits
91706aa2
Commit
91706aa2
authored
Aug 01, 2018
by
Walmes Marques Zeviani
Browse files
Aperfeiçoa o build.sh.
parent
5c58622a
Changes
1
Hide whitespace changes
Inline
Side-by-side
slides/build.sh
View file @
91706aa2
#-----------------------------------------------------------------------
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
"
\n
Converting Rnw to tex.
\n
"
knit
$FILENAME
.Rnw
echo
"
\n
Converting 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
"
\n
Converting Rnw to tex.
\n
"
knit
$RNW
echo
"
\n
Converting tex to PDF.
\n
"
pdflatex
$FILE
if
[
"$#"
-eq
2
]
;
then
if
[
"
$2
"
-eq
1
]
;
then
echo
"
\n
Deleting LaTeX auxiliary files.
\n
"
rubber
--clean
$FILE
NAME
rubber
--clean
$FILE
fi
fi
exit
0
#-----------------------------------------------------------------------
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment