SCM

Forum: support

Monitor Forum | Start New Thread Start New Thread
RE: Help for formatting the test on two columns [ Reply ]
By: Achim Zeileis on 2018-01-17 00:09
[forum:45573]
OK, good, thanks for the follow-up. This might be useful for others as well.

As for my suggestion with the horizontal layout. One could add

\renewenvironment{answerlist}{\renewcommand{\labelenumi}{(\alph{enumi})}\begin{multicols}{5}\begin{enumerate}}{\end{enumerate}\end{multicols}}

in the intro of the exam. If all answer options are numbers (e.g., as produced by num_to_schoice), then this saves some space. As an example:

multicol <- "\\renewenvironment{answerlist}{\\renewcommand{\\labelenumi}{(\\alph{enumi})}\\begin{multicols}{5}\\begin{enumerate}}{\\end{enumerate}\\end{multicols}}"
exams2nops(c("tstat2", "deriv2"), intro = multicol)

And as you correctly point out: This is not useful if you have longer answerlist items as in your case. I thought I'd mention the possibility nevertheless in case someone else looks for this.

RE: Help for formatting the test on two columns [ Reply ]
By: Domenico Vistocco on 2018-01-16 08:32
[forum:45570]
Hi Achim,
using the final .tex you attached, I solved the problem adding two more lines to the file I used for the intro argument. They allow to set the width of the columns:

----------------------------------------------------
\setlength{\columnwidth}{10.5cm}
\setlength{\linewidth}{9.5cm}
----------------------------------------------------

Thanks again for your quick and effective support
domenico

PS: the horizontal solution does not work for me since some answers contain long text

RE: Help for formatting the test on two columns [ Reply ]
By: Achim Zeileis on 2018-01-15 22:55
[forum:45569]

exam-1.tex (11) downloads
Domenico,

thanks for your interest. The large padding is surely some interaction between your \addtolength{} settings and the somewhat non-standard page layout that NOPS uses internally. I attach the final .tex file that is being compiled with your command. Hopefully, this helps you to debug which settings are responsible. (I didn't see it right away...)

A different option might be to present the answers (a) to (e) horizontally in five columns instead of vertically in five rows. Would that also solve your problem? (This has been asked before in this forum for exams2pdf() but I think we should be able to incorporate it into exams2pdf() as well.)

Best wishes,
Z

Help for formatting the test on two columns [ Reply ]
By: Domenico Vistocco on 2018-01-15 18:01
[forum:45568]

instruction-students.tex (5) downloads
Dear all,
I would like to ask for an help for better formatting my exams using two columns. My problem is the following: I would like to exploit all the page, i.e. reducing the margins at the minimum for the pages containing the exercises.

I have prepared a small tex file to use as second page with instructions to the students (here enclosed as instruction-students.tex). Then I pass this file as input for the intro argument of the exam2nops function.

As you can read, I insert the following LaTeX instructions at the end of the intro file, to "enlarge the page":

----------------------------------------------------------------------------------------
\addtolength{\textwidth}{3.8cm}
\addtolength{\hoffset}{-2.1cm}

\addtolength{\textheight}{3cm}
\addtolength{\voffset}{-1.5cm}
----------------------------------------------------------------------------------------

Even if they works, there is a large padding at the center of the page. You can test using the following R code :

----------------------------------------------------------------------------------------
exams_skeleton() # to generate the demos

# to obtain the exam using the enclosed tex file as intro argument
ex1 <- exams2nops(c(rep("tstat2.Rmd", 12)),
n = 1,
duplex = TRUE,
blank = 0,
replacement = FALSE,
dir = "nops_pdf",
edir = "tutorial-exams-esercizi/",
name = "exam-",
date = "2018-01-15",
intro = "instruction-students.tex",
twocolumn = TRUE)
----------------------------------------------------------------------------------------

If I place the same instructions in a LaTeX file, they works as expected, I mean without adding the large padding at the center of the page.

Please, do you have suggestions at this regard? Maybe there is a better way to accomplish my aim.

Thanks
domenico

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