Skip to main content
\( \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)



If your project has <webwork> tags, then when you execute xsltproc, pass a webwork.server string parameter to it specifying where the server is that will do your processing. Example:

$ xsltproc --stringparam webwork.server <xsl> <xml>

If your webwork.server is running version 2.11 (the first version which can be used with MBX), then you should additionally pass --stringparam webwork.version 2.11.

For HTML output, this is all that is needed. For , you may need to do more first. See Subsection 9.3.2.

Subsection9.3.2 output

If your project uses PG files that live on the WeBWorK server, or if you have <webwork> tags that have image creation code in their <pg-code> tag, then you will need to retrieve chunks from the server before you use xsltproc. The mbx script handles this, but only for WeBWorK 2.12 and later:

$ mbx -c webwork-tex -s -d <storage location> <xml>

The storage location would typically be a folder called webwork-tex/ located inside wherever you are having xsltproc put your output. Then when you run xsltproc, tell it where to access this content:

$ xsltproc --stringparam webwork.server.latex <storage location> <xsl> <xml>

Subsection9.3.3Creating Files for Uploading to WeBWorK

All of the <webwork> that you have written into your project can be “harvested” and put into their own .pg files by the mbx script (this excludes <webwork> tags where you gave a @source attribute.) These files are created with a folder structure that follows the chunking scheme you specify. This process also creates set definition files (.def) for each chunk. For example, you might specify to chunk by section, and then you will have a .def file for each section, listing all of the .pg files associated with that section. For <webwork> tags that used a @source attribute, the .def file will include them as well. Lastly, this archiving process creates .pg files to be used as set header files to go along with each set definition.

$ xsltproc --stringparam chunk.level 2 <path to mathbook-webwork-archive.xsl> <xml>

This creates a folder called local/ that will have a subfolder corresponding to your project, which in turn has a folder tree with all of the .pg and .def files laid out according to your chunk level. You can tarball this local/ folder (compress it into a .tgz file and upload it into an active WeBWorK course where you may then assign the sets to your students (and modify, as you like).