SCM

Forum: support

Monitor Forum | Start New Thread Start New Thread
RE: Annotate pdf file using tikz package [ Reply ]
By: Robbie . on 2019-05-17 06:53
[forum:46738]

example_spss.Rmd (3) downloads
Hi Achim,

Attached to this message is an example of using SPSS-style tables. The steps in a nutshell:

1. Generate data in R
2. Save data such that it can be loaded in SPSS
3. There is a general syntax ("syntax_cor_gen.sps") that basically loads the data in SPSS, computes a correlation in SPSS, and exports the SPSS table to a .pdf file. This syntax is modified in R using regular expressions to change the default variable names "x" and "y".
4. Create a job in SPSS (file "job_cor.spj") in order to be able to run the syntax file via the command line
5. Run the job created in 4 via R
6. Include the SPSS output using \includegraphics in the question

I changed the default layout of SPSS output to make sure that for instance the syntax in the output is hidden. This is, of course, optional.

Hopefully this helps others and please let me know if you think that some steps can be improved!

Best,
Robbie

RE: Annotate pdf file using tikz package [ Reply ]
By: Achim Zeileis on 2019-05-17 00:06
[forum:46737]
Robbie, thanks for this!

When you have put together a full exercise with SPSS-style tables, it would be great if you could send it along. I would be interested in taking a look. This might be something other R/exams users are interested in.

RE: Annotate pdf file using tikz package [ Reply ]
By: Robbie . on 2019-05-16 07:51
[forum:46727]

test.Rmd (6) downloads
Hi Achim,

Thanks for your response. When creating a MWE, I was able to get this working in combination with the exams package. I could not figure out why I was not able to do this in my first try.

Nevertheless, you can find the .Rmd file for doing this attached to this message. Hopefully, it is useful for others if they want to do something similar.

RE: Annotate pdf file using tikz package [ Reply ]
By: Achim Zeileis on 2019-05-16 00:49
[forum:46726]
Robbie, thanks for your interest. This is a good question.

When you are only rendering to PDF (which goes through LaTeX internally) then it should be ok to just include the LaTeX code directly in the question. Even if this is an .Rmd file this should work, I think.

The hoops that automaton jumps through are a bit more complicated because the exercise renders the LaTeX code to a suitable graphics file if necessary. Without a reproducible example it's difficult to say, though, what exactly goes wrong for you.

Maybe you could post a reproducible example - as simple as possible while still showing the problem you encounter.

Annotate pdf file using tikz package [ Reply ]
By: Robbie . on 2019-05-15 15:13
[forum:46724]

output_indepttest.pdf (4) downloads
Hi all,
First of all, thanks for the exams package. It is very useful!

However, there is something that I do not get to work. I need to have SPSS tables in my exam and I would like to mask some statistics of these tables such that students have to compute the missing statistics. See the attached document for an example.

I know how to do this in LaTeX with the tikz package, but I cannot get it working via the exams package. I generally work with .Rmd file and rendering a pdf is sufficient for me, so I use the function exams2pdf().

The problem might be caused by my machine as well, because the tikz graphic of the exercise template automaton.Rmd is extremely stretched over an entire page if I run exams2pdf(“automaton.Rmd”). However, I did install PDFTk Free, ImageMagick, and Ghostscript as suggested in the installation tutorial (http://www.r-exams.org/tutorials/installation/).

Hopefully, someone experienced this problem before and can help me out.

Thank you in advance,
Robbie

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