Header Files and Snippets

From WeBWorK
(Difference between revisions)
Jump to: navigation, search
Line 20: Line 20:
 
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.
 
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.
  
{|border="1"
+
'''preamble:''' The preamble is the first thing in the TeX file.
! Name
+
 
! Description
+
$webworkFiles{hardcopySnippets}{preamble}      = "$webworkDirs{conf}/snippets/hardcopyPreamble.tex";
|-
+
 
!colspan="2"| Default in <code>global.conf</code>
+
'''problemDivider:''' The problem divider goes between problems.
|-
+
 
| preamble
+
$webworkFiles{hardcopySnippets}{problemDivider} = "$webworkDirs{conf}/snippets/hardcopyProblemDivider.tex";
| The preamble is the first thing in the TeX file.
+
 
|-
+
'''setFooter:'''The set footer goes after each set. Is is a PG file.
|colspan="2"| $webworkFiles{hardcopySnippets}{preamble}      = "$webworkDirs{conf}/snippets/hardcopyPreamble.tex";
+
 
|-
+
$webworkFiles{hardcopySnippets}{setFooter}      = "$webworkDirs{conf}/snippets/hardcopySetFooter.pg";
| problemDivider
+
 
| The problem divider goes between problems.
+
'''setDivider:''' The set divider goes between sets (in multiset output).
|-
+
 
|colspan="2"| $webworkFiles{hardcopySnippets}{problemDivider} = "$webworkDirs{conf}/snippets/hardcopyProblemDivider.tex";
+
$webworkFiles{hardcopySnippets}{setDivider}    = "$webworkDirs{conf}/snippets/hardcopySetDivider.tex";
|-
+
 
| setFooter
+
'''userDivider:''' The user divider does between users (in multiuser output).
| The set footer goes after each set. Is is a PG file.
+
 
|-
+
$webworkFiles{hardcopySnippets}{userDivider}    = "$webworkDirs{conf}/snippets/hardcopyUserDivider.tex";
|colspan="2"| $webworkFiles{hardcopySnippets}{setFooter}      = "$webworkDirs{conf}/snippets/hardcopySetFooter.pg";
+
 
|-
+
'''postamble:''' The postamble is the last thing in the TeX file.
| setDivider
+
 
| The set divider goes between sets (in multiset output).
+
|-
+
|colspan="2"| $webworkFiles{hardcopySnippets}{setDivider}    = "$webworkDirs{conf}/snippets/hardcopySetDivider.tex";
+
|-
+
| userDivider
+
| The user divider does between users (in multiuser output).
+
|-
+
|colspan="2"| $webworkFiles{hardcopySnippets}{userDivider}    = "$webworkDirs{conf}/snippets/hardcopyUserDivider.tex";
+
|-
+
| postamble
+
| The postabmle is the last thing in the TeX file.
+
|-
+
|colspan="2"|
+
 
  $webworkFiles{hardcopySnippets}{postamble}      = "$webworkDirs{conf}/snippets/hardcopyPostamble.tex";
 
  $webworkFiles{hardcopySnippets}{postamble}      = "$webworkDirs{conf}/snippets/hardcopyPostamble.tex";
|}
 
  
 
[[Category:Instructors]]
 
[[Category:Instructors]]

Revision as of 20:32, 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.

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 postamble is the last thing in the TeX file.

$webworkFiles{hardcopySnippets}{postamble}      = "$webworkDirs{conf}/snippets/hardcopyPostamble.tex";
follow us