WeBWorK Main Forum

Kevin O'Bryant - single column hardcopy

Kevin O'Bryant - single column hardcopy

by Arnold Pizer -
Number of replies: 0
inactiveTopicsingle column hardcopy topic started 1/3/2007; 3:19:19 AM
last post 1/3/2007; 6:42:38 AM
userKevin O'Bryant - single column hardcopy  blueArrow
1/3/2007; 3:19:19 AM (reads: 36, responses: 1)
I'd like the hardcopy to come out in a larger font and single column, and maybe even to leave an inch or two between problems. Is there a way to accomplish this on a course-by-course or assignment-by-assignment basis?

I'm comfortable with LaTeX but just starting to learn Perl.

<| Post or View Comments |>

userDavide P. Cervone - Re: single column hardcopy  blueArrow
1/3/2007; 6:42:38 AM (reads: 41, responses: 0)
Look in webwork2/conf/snippets and you will find several .tex files. These are used at the beginning and end of the hardcopy document, and in between problems (the names should tell you which one goes where). You can edit these to suit your needs. You could change 10pt to 12pt in the \documentclass and remove the \begin{multicols}2 in the preamble file and the \end{multicols} in the postamble file, for instance. Spacing between problems could be added to the problem divider file.

These changes would be system-wide. If you want course-by-course control, you could make copies of these files and set the $webworkFiles{hardcopySnippets} variables to point to the modified versions in course.conf. See webwork2/conf/global.conf for the default settings, but something like:

    $webworkFiles{hardcopySnippets}{preamble} = "$webworkDirs{conf}/snippets/hardcopyPreamble-OneColumn.tex";
would do (assuming you made a modified copy of hardcopyPreamble.tex called hardcopyPreamble-OneColumn.tex).

Note, however, that most set header files turn off two-columns for the header and then turn it back on, so you would have to edit the headers to prevent this. This is usually done via the $BEGIN_ONE_COLUMN and $END_ONE_COLUMN macros in the PG language. One solution would be to change the definitions of these in pg/macros/PGbasicmacros.pl, but this would be a global change. If you wanted to be able to change this on a course-by-course basis, a hack would be to add a flag variable to the course's course.conf (via $pg{specialPGEnvironmentVars}, which will set values in the problem's namespace) and have PGbasicmacros.pl look for that flag and set the macros appropriately.

It would be more difficult to change the format on a set-by-set basis. It might be possible to use $BEGIN_ONE_COLUMN in the set header and not include the $END_ONE_COLUMN, but you might get a LaTeX error when the footer tries to end the multicols environment. It might work to insert a \begin{multicols}{1} in the header to balance it, however, in place of the $END_ONE_COLUMN. (This would have to be done in TeX mode only, via the MODES() macro.)

Hope that helps.


<| Post or View Comments |>