## Forum archive 2000-2006

### Arnold K. Pizer - Using italic in pg problems

by Arnold Pizer -
Number of replies: 0
 Using italic in pg problems topic started 10/28/2005; 11:54:09 AMlast post 10/28/2005; 12:02:16 PM
 Arnold K. Pizer - Using italic in pg problems  10/28/2005; 11:54:09 AM (reads: 437, responses: 2) The University of Utah recently switched form LaTeX2html to dvipng for processing images in pg problems. This has raised the following issue communicated by Peter Alfeld: Arnie, We did follow your advice and switched to png. It works, with the execption of one minor glitch. The "images" mode ignores LaTeX constructs like {it italic text} in the *.pg files. In the browser that instruction would show up as ordinary text as in this message. Of course, the problem goes away if we replace that text with italic text. But we have hundreds of problems here that we have written and that involve the LaTeX construction. It's a little daunting to convert all those files without introducing new errors. Do you have any recommendations in this context? Thanks again for taking the time to respond to inquires like this! Peter <| Post or View Comments |>

 Arnold K. Pizer - Re: Using italic in pg problems  10/28/2005; 11:54:56 AM (reads: 540, responses: 0) Hi Peter, If the code is in math mode, e.g. $$\hbox {it italic text}$$, it works (at least in my test) and in a pg problem all the LaTeX code should be in math mode. If you want italic elsewhere you should put it between $BITALIC and$EITALIC, e.g. $BITALIC italic text$EITALIC so that it works in any mode (html, pdf, etc). It doesn't sound like your problems are written this way. Can you send me a sample? I don't remember exactly but maybe latex2html processed the whole problem so that things works that were not supposed to work. There are editors that allow you to make global changes in thousands of files at once (we have done this in the past to update pg problems) but obviously you have to be very careful, e.g. you want to keep {\it italic text} in math mode but change it to $BITALIC italic text$EITALIC outside of math mode. Maybe Pieter (or some other expert) could write a perl script that would make the replacements in the correct places. I'm going to post this on the WeBWorK Bulletin Board and maybe someone else has a suggestion. Arnie <| Post or View Comments |>

 Arnold K. Pizer - Re: Using italic in pg problems  10/28/2005; 12:02:16 PM (reads: 564, responses: 0) Arnie, Thanks for checking into this. There won't be an issue when writing new problems, and I appreciate what you are saying about writing a script to convert files wholesale, or use a suitable editor. I've done that sort of stuff in the past and can do it again. But the project is a little open ended, and of course error prone and time consuming. When I first started writing ww problems I used LaTeX Constructions outside of math mode freely because l2h conversion handled it very well. By now I must have written probably close to a thousand. Below is an example file. There is a \bf statement that students need to get everything right, and the solution uses the LaTeX \item construction. If you look at that problem through ww in png mode you'll see the LaTeX control codes. In particular, look at the solution and the hint. Compare it with l2h mode, where it looks just fine. Thanks for posting the query. If it's a problem of general interest, and we do come up with some sort of script here, we'd of course be happy to make it generally available. Peter --------------------------------------------------------------------- ##KEYWORDS('true-false')DOCUMENT(); # This should be the first executable line in the problem.install_problem_grader(~~&std_problem_grader);TEXT(&beginproblem);$showPartialCorrectAnswers = 0;$showPartialCredit = 0;TEXT(EV2(<