Hardcopy Themes

From WeBWorK_wiki
Jump to navigation Jump to search

Starting with version 2.18, it is relatively easy to customize a theme for PDF hardcopies. A hardcopy theme controls the layout of problems, the set header, and page headers and footers.

Theme Files

A hardcopy them file is an XML file, as described in the README file in the webwork2/assets/tex/hardcopyThemes/ folder of a WeBWorK distribution (starting with version 2.18). It provides LaTeX code for various parts of a complete .tex file for a PDF hardcopy of an asssignment. Several of these theme files come with the distribution. Also, a course can have more of them in its templates/hardcopyThemes/ folder.

Distribution Hardcopy Themes

The 2.18 distribution comes with the following themes:

  • Basic This theme produces hardcopies with minimal page headers displaying the set title and username, and minimal problem numbering.
  • Basic-Two Column Like "Basic", but with two columns.
  • Boxed This theme uses the tcolorbox package to put each exercise in a box.
  • Boxed-Rows Like "Boxed", but exercises progress row by row, with two exercises per row. Exercises in this theme will not break across pages, so this theme is better suited for sets with short exercises.
  • Boxed-Two Column Like "Boxed", but with two columns where exercises progress vertically.
  • Classic This theme produces hardcopies styled as hardcopies were styled prior to version 2.18.
  • Classic-Two Column Like "Classic", but with two columns.
  • Empty This theme is meant for rendering problems with no metadata or styling beyond the LaTeX defaults for the article class. Each problem (including the PG set header) gets its own page.
  • Hebrew This theme is like "One Column" but with some necessary components to include Hebrew script. This theme should only be used if xelatex is the latex engine.
  • Hebrew-Two Column Like "Hebrew", but with two columns.
  • One Column This theme uses the LaTeX exam class to manage page headers and footers, as well as question enumeration.
  • Two Column Like "One Column", but with two columns.

Users with high enough permission can choose which hardcopy theme they would like to use when building a hardcopy. They choose from the list that includes enabled hardcopy themes from the distribution, plus themes that are local to the course (see below). Visit Course Config, General tab, to select which of the distribution hardcopy themes you would like enabled. All themes except the Hebrew themes are enabled by default. You must save your selections and then reload the page for the new selections to be reflected in the Course Config page.

Users without enough permission must use the default hardcopy theme. This is also selected in the Course Config page from among the distribution hardcopy themes and the course hardcopy themes.

Course Hardcopy Themes

A course has a templates/hardcopyThemes folder that may contain additional hardcopy theme files. You can place new theme files there, or edit an existing theme and save it in this folder. To edit an existing hardcopy theme, visit the Problem Editor, Generate Hardcopy tab. Select a hardcopy theme, and click Edit Selected Theme. Make sure to edit the "label" of your new theme so that it will appear as a distinct option among hardcopy themes. Or if you intend to override one of the distribution themes, leave the label alone and save the them file with the same name as its distribution theme counterpart.