SCM

Forum: support

Monitor Forum | Start New Thread Start New Thread
RE: include_supplement [ reply ]
By: Achim Zeileis on 2017-05-23 20:27
[forum:45152]
You're very welcome :-)

In principle it should also work without height/width specified. In that case either the dimensions of the figure itself or the template should control how the figure is included. With the default plain.tex template it should be width=0.8\textwidth.

But in any case: Glad that it works now...

RE: include_supplement [ reply ]
By: michael schulte on 2017-05-23 17:32
[forum:45151]
I did this - but without width/height specified ... :(
thanks achim - you rock!

RE: include_supplement [ reply ]
By: Achim Zeileis on 2017-05-23 15:50
[forum:45150]
You still need to put the \includegraphics{pic.png} into the {question}.

The include_supplement() function just flags the file as being a supplement so that it is copied around and stored along with the exercise itself. For embedding it into the question you still need to include a \includegraphics{} for a figure or a \url{} for a data file etc.

See Rlogo.Rnw inside the exams package for a worked example.

include_supplement [ reply ]
By: michael schulte on 2017-05-23 13:55
[forum:45149]
Achim helped me with the following code, pointing me to the useful include_supplement() function that enables one to add static pics in a question.

after some fiddling I manager to get everything out fine, but the pic does not show up in the exam - any hints what I am doing wrong?

### CODE

<<echo=FALSE, results=hide, results=tex>>=

questions <- character(4)
solutions <- logical(4)

questions[1] <- '1'
questions[2] <- '2'
questions[3] <- '3'
questions[4] <- '4'

solutions[1] <- TRUE
solutions[2] <- FALSE
solutions[3] <- FALSE
solutions[4] <- FALSE

include_supplement("pic.png", recursive = TRUE)
@

\begin{question}
Question - really nicer with pic

<<echo=FALSE, results=hide, results=tex>>=
answerlist(questions)
@
\end{question}

%%\exname{SomeTopic}
%%\extype{mchoice}
%%\exshuffle{TRUE}
%%\exsolution{1000}

#### Code

Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge