Troubleshooting Hardcopy

From WeBWorK_wiki
Revision as of 12:55, 18 September 2017 by Wburr (talk | contribs)
Jump to navigation Jump to search

If the hardcopy generator detects that an error has occurred in the generation process, temporary files are automatically preserved and the error message provides links to the various temporary log files.

WeBWorK comes with a test LaTeX file which you should test to ensure that your installation completed correctly, and that latex (and pdflatex) are actually working properly. The file is check_latex.tex, and is located in /opt/webwork/webwork2/bin/. Test compiling this file using the Apache user as well as your default (and root) users as necessary. For CentOS (and some other Linux distributions), the default install of texlive is somewhat poor, and it is recommended that you manually install the full TUG package set (see CentOS forums for more details). The header files for WeBWorK require the path package from texlive, which doesn't install nicely via yum or dnf on CentOS, hence the necessary manual install.

Once installed, you can use the which pdflatex command to see which version of pdflatex is being automatically used. Then check site.conf for your WeBWorK install and make sure it points to the newly installed pdflatex, latex and dvipng binaries. Once you are sure your installation is working properly, and that check_latex.tex is compiling completely, move on to the steps below.

If an error is more subtle, you may need to preserve temporary files manually. Set $WeBWorK::PG::ImageGenerator::PreserveTempFiles to 1 (in webwork2/lib/WeBWorK/Constants.pm). After that, you should see directories like work.xxxxxx accumulating under html/tmp/hardcopy/ in your course directory. These contain files that the hardcopy generator uses in generating each PDF:

  • hardcopy.tex - Source file to be fed to pdfLaTeX.
  • hardcopy.log - Log file written by pdfLaTeX.
  • pdflatex.stdout - Messages written to STDOUT by pdfLaTeX.
  • pdflatex.stderr - Messages written to STDERR by pdfLaTeX.

If pdflatex.out and pdflatex.err don't exist, this indicates that pdfLaTeX was never invoked. I'm not sure what would cause this.

If hardcopy.log doesn't exist, then pdfLaTeX was invoked, but probably never ran. Check for a properly installed pdflatex and make sure that the path to pdflatex in global.conf is correct.

Check hardcopy.log, pdflatex.out, and pdflatex.err for errors. These might indicate problems in the TeX code being sent to pdfLaTeX for processing. The errors might be in the PG file, or in one of the header/footer snippets which are included to separate problems, sets, and users. The path to each file included in hardcopy.tex is noted in a comment.