Features & Development

Hardcopy Theme Change

Re: Hardcopy Theme Change

by Danny Glin -
Number of replies: 0

The hardcopy generation is a completely separate process than the on-screen display, so it is not affected by the CSS theme.  Instead there are hardcopy themes that can be customized.

In /opt/webwork/webwork2/conf/snippets/hardcopyThemes, make a copy of one of the existing theme folders (twoColumn is the default theme, so you could make a copy of that folder called twoColumnWithWatermark).  You can then make changes to the LaTeX code added to every hardcopy in your new theme.  In particular, you could add the draftwatermark package and set a watermark in hardcopyPreamble.tex (you would need to make sure the package is installed on your WW server).

You would then need to override the available hardcopy themes for your course/server by adding the following to either course.conf (for one course) or localOverrides.conf (for the whole server).

$hardcopyThemeNames = {

        twoColumnWithWatermark => 'Two Columns',

};

# This is needed to enforce an order that the options are presented when making a hardcopy

$hardcopyThemes = [

        'twoColumnWithWatermark',

];

# Change default Hardcopy theme

# Be sure to choose one that is enabled!

$hardcopyTheme = "twoColumnWithWatermark";

I haven't actually tested any of this, so report back if it works for you.