WeBWorK Problems

Using LaTeX packages in problem code

Using LaTeX packages in problem code

by Chris Wingard -
Number of replies: 1

Hello,

I have a few precalc problems on polynomial long division, and I'd like to set up a solutions section for instructors and TAs showing detail.  This is easily accomplished using the polynom package (http://ctan.org/pkg/polynom).  Our department's IT guy put the package in the appropriate subdirectory of the TeX installation on our WeBWorK server (I don't know any more details than that) but it still doesn't seem to be working in the code.  Is there something else that needs to be done?  Is something like this possible?  Thanks!

-- C

In reply to Chris Wingard

Re: Using LaTeX packages in problem code

by Danny Glin -
I suspect that you won't have any luck getting extra packages to work with the jsMath display mode, since I'm not sure that it has the ability to load packages.

In theory this should be possible with the images display mode and the hardcopy generator, though you will have to load the package in the right place for each.

If you want this to show up in the hardcopy, you will have to load the package in the hardcopy preamble. This would mean editing conf/snippets/hardcopyPreamble.tex and adding a line like
\usepackage{polynom}

For the images display mode, I believe that this is handled in lib/WeBWorK/Constants.pm.
Somewhere after the line $WeBWorK::PG::ImageGenerator::TexPreamble = <<'EOF';
add
\usepackage{polynom}
(probably with the other usepackage commands).

In theory these two changes should make the polynom package available to the hardcopy generator and images display mode respectively (assuming that the package is properly installed on the server. Have you tried it from the command line?).

I haven't tested any of this. Let me know if you have any success.

Danny