Header Files and Snippets

From WeBWorK
(Difference between revisions)
Jump to: navigation, search
Sam (Talk | contribs)
(New page: WeBWorK uses several '''header files''' and other '''snippets''' in certain situations. == Header files == There are two PG header files, the '''set header''' and the '''hardcopy header'...)
Newer edit →

Revision as of 20:30, 29 February 2008

WeBWorK uses several header files and other snippets in certain situations.

Header files

There are two PG header files, the set header and the hardcopy header. The set header is displayed on the homework set screen to the right of the problem list. The hardcopy header is included in hardcopy output at the start of the problem set.

In current versions of WeBWorK the same file is used for both headers, webwork2/conf/snippets/setHeader.pg. This file is designed so that is renders in both HTML-based display modes (when used onscreen) and TeX mode (when used in hardcopy).

Either header file can be overridden on a per-homework set basis. To do so, go to the Hmwk Set Editor and click the number of problems to the right of the homework set name.

These two configuration variables control the site-wide defaults:

  • $webworkFiles{hardcopySnippets}{setHeader}
  • $webworkFiles{screenSnippets}{setHeader}

You can change the values of these variables in global.conf or override them in course.conf for a particular course.

Other snippets

Hardcopy generation also uses the following snippets, small TeX files which are included in the TeX file between dynamically-generated content. One snippet, the setFooter, is a PG file.

Name Description
Default in global.conf
preamble The preamble is the first thing in the TeX file.
$webworkFiles{hardcopySnippets}{preamble} = "$webworkDirs{conf}/snippets/hardcopyPreamble.tex";
problemDivider The problem divider goes between problems.
$webworkFiles{hardcopySnippets}{problemDivider} = "$webworkDirs{conf}/snippets/hardcopyProblemDivider.tex";
setFooter The set footer goes after each set. Is is a PG file.
$webworkFiles{hardcopySnippets}{setFooter} = "$webworkDirs{conf}/snippets/hardcopySetFooter.pg";
setDivider The set divider goes between sets (in multiset output).
$webworkFiles{hardcopySnippets}{setDivider} = "$webworkDirs{conf}/snippets/hardcopySetDivider.tex";
userDivider The user divider does between users (in multiuser output).
$webworkFiles{hardcopySnippets}{userDivider} = "$webworkDirs{conf}/snippets/hardcopyUserDivider.tex";
postamble The postabmle is the last thing in the TeX file.
$webworkFiles{hardcopySnippets}{postamble} = "$webworkDirs{conf}/snippets/hardcopyPostamble.tex";
follow us