Installation

Failed to convert TeX to PDF with command -- Problem with carat character

Failed to convert TeX to PDF with command -- Problem with carat character

by Kurt O'Hearn -
Number of replies: 11
Hi,

I've finished installing trunk release of WeBWorK on Fedora 15. All of the demo problems I've tested work, but when I attempt to generate a hardcopy I get the following TeX error:

Failed to convert TeX to PDF with command 'cd /opt/webwork/courses/myTestCourse/html/tmp/hardcopy/work.3lz_MtIN && /usr/bin/pdflatex --shell-escape >pdflatex.stdout 2>pdflatex.stderr hardcopy' (exit=70 signal=0 core=0).

I have pdfTeX version 3.1415926-1.40.11-2.2 (TeX Live 2010) installed. The first relevant TeX error in the log is:

! Missing $ inserted. <inserted text> $ l.326 sqrt(2.1^ 2 + 7.3^2) m or 7.60 m or 759.61 cm or ... I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed.

Also, pdflatex.stderr contains nothing. I've seen similar errors to this one on a few older threads. The subroutine in the PGbasicmacros.pl file is defined as:

sub CARET { MODES( TeX => '\\verb+^+', Latex2HTML => '\\verb+^+', HTML => '^' ); };

I've made no changes to PGbasicmacros.pl. Any ideas?

-Kurt
In reply to Kurt O'Hearn

Re: Failed to convert TeX to PDF with command -- Problem with carat character

by Jason Aubrey -
Hi Kurt,

Where do those caret characters occur? If they are inside of a BEGIN_TEXT/END_TEXT then they should probably be replaced by $CARET, as in

...sqrt(2.1${CARET}2 + 7.3${CARET}2) m...

(The braces are because $CARET2 would be interpreted as a new undefined variable and $CARET 2 might introduce a space character where we don't want one when the text is rendered.)

Hope this helps,
Jason
In reply to Jason Aubrey

Re: Failed to convert TeX to PDF with command -- Problem with carat character

by Kurt O'Hearn -
Hi Jason,

It doesn't appear that this is the case (unless the hint section assumes the same properties as the text section). The following is the PG source of Problem 5 of the demo homework set that shipped with WeBWorK v2.5.0 build 7019.

DOCUMENT();
loadMacros( "PGbasicmacros.pl",
"PGauxiliaryFunctions.pl",
"PGchoicemacros.pl",
"PGanswermacros.pl",
);

TEXT(beginproblem());

$showPartialCorrectAnswers = 1;
$showHint =0;

$fx = random( 2.1, 6.0 , 0.1) ;
$fy = random( 3.1, 8.0 , 0.1) ;
$ansxy = sqrt($fx * $fx + $fy * $fy);
$anscm = $ansxy*100;

BEGIN_TEXT
This problem demonstrates how WeBWorK handles
numerical answers involving units. WeBWorK can handle all units that
are used in elementary physics courses.
See \{ htmlLink("http://webwork.math.rochester.edu/spring00-phy121/help_units.html","answers with units") \}
for more details. $PAR

Two perpendicular sides of a triangle are $fx m and
$fy m long respectively.
What is the length of the third side of the triangle? $BR$BR
You can answer this in terms of m's, cm's, km's, in's, ft, etc. but you must enter the units. $BR$BR
Check "Show Hint" and then "Submit Answer" if you don't remember the Pythagorean theorem.
END_TEXT

HINT(EV3(<<'EOT'));
Remembering the Pythagorean theorem \( A^2 +B^2 = C^2 \), you can enter
sqrt($fx^2 + $fy^2) m or \{spf($ansxy, "%0.2f" )\} m or \{spf($anscm, "%0.2f" )\} cm or ...
EOT

BEGIN_TEXT
\{ans_rule(40) \}
END_TEXT
ANS(num_cmp("$ansxy", units => 'm'));
ENDDOCUMENT()

This carat character problem is actually of lesser concern to me. I get the following error why I attempt to generate .pdf files for any other homework assignment:

  • Failed to convert TeX to PDF with command 'cd /opt/webwork/courses/myTestCourse/html/tmp/hardcopy/work.KtLYEEQf && /usr/bin/pdflatex --shell-escape >pdflatex.stdout 2>pdflatex.stderr hardcopy' (exit=70 signal=0 core=0).
  • No errors encoundered in TeX log.
  • Failed to rename 'hardcopy.pdf' to 'myTestCourse.practice1.Assignment1.pdf' in directory '/opt/webwork/courses/myTestCourse/html/tmp/hardcopy/work.KtLYEEQf':
    /bin/mv: cannot stat `/opt/webwork/courses/myTestCourse/html/tmp/hardcopy/work.KtLYEEQf/hardcopy.pdf': No such file or directory
    
  • Final hardcopy file '/opt/webwork/courses/myTestCourse/html/tmp/hardcopy/work.KtLYEEQf/hardcopy.pdf' not found after calling 'generate_hardcopy_pdf': No such file or directory
I've attached the error log file. Interestingly, pdflatex.stderr is empty, and hardcopy.log reports a few missing fonts (but I'm fairly certain these are installed - I'm running LaTeX2E through rpms on Fedora 15). Could this be a permission issue?

Thank a lot!
-Kurt
In reply to Kurt O'Hearn

Re: Failed to convert TeX to PDF with command -- Problem with carat character

by Arnold Pizer -
Hi Kurt,

Regarding the carat bug, I think you have an old version of problem 5. My version reads:

HINT(EV3(<<'EOT'));
Remembering the Pythagorean theorem \( A^2 +B^2 = C^2 \), you can enter
sqrt(${fx}${CARET}2 + ${fy}${CARET}2) m or  \{spf($ansxy, "%0.2f" )\} m or  \{spf($anscm, "%0.2f" )\} cm or ...
EOT

Arnie
In reply to Arnold Pizer

Re: Failed to convert TeX to PDF with command -- Problem with carat character

by Kurt O'Hearn -
Hi Arnold,

Thanks for the information! I've updated that problem, and that error is gone. But, this still leaves the errors in the second part of the above post:

  • Failed to convert TeX to PDF with command 'cd /opt/webwork/courses/myTestCourse/html/tmp/hardcopy/work.UOyTLkpf && /usr/bin/pdflatex --shell-escape >pdflatex.stdout 2>pdflatex.stderr hardcopy' (exit=70 signal=0 core=0).
  • No errors encoundered in TeX log.
  • Failed to rename 'hardcopy.pdf' to 'myTestCourse.practice2.Demo.pdf' in directory '/opt/webwork/courses/myTestCourse/html/tmp/hardcopy/work.UOyTLkpf':
    /bin/mv: cannot stat `/opt/webwork/courses/myTestCourse/html/tmp/hardcopy/work.UOyTLkpf/hardcopy.pdf': No such file or directory
    
  • Final hardcopy file '/opt/webwork/courses/myTestCourse/

Right now, I have no new information about these errors. I still suspect this might be a permissions error, as pdflatex works on other documents. Additional help would be very much appreciated.

-Kurt
In reply to Kurt O'Hearn

Re: Failed to convert TeX to PDF with command -- Problem with carat character

by Arnold Pizer -
Look at 
http://webwork.maa.org/wiki/Installation_Manual_for_2.4_on_Ubuntu_10.04#Test_that_Things_are_Working_Properly

In particular change 

# If true, don't delete temporary files
#
$WeBWorK::ContentGenerator::Hardcopy::PreserveTempFiles = 0;

and look at the log files, etc.

Arnie
In reply to Arnold Pizer

Re: Failed to convert TeX to PDF with command -- Problem with carat character

by Kurt O'Hearn -
According to the error logs, it appears I'm missing some fonts:

!pdfTeX error: /usr/bin/pdflatex (file cmsy10): Font cmsy10 at 360 not found
 ==> Fatal error occurred, no output PDF file produced!
However, it appears to be installed (but I could be wrong):

locate cmsy10
/usr/share/fonts/lyx/cmsy10.ttf
/usr/share/fonts/texlive-amsfonts/cmsy10.pfb
/usr/share/texlive/texmf-dist/fonts/afm/public/amsfonts/cm/cmsy10.afm
/usr/share/texlive/texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmsy10.pk
/usr/share/texlive/texmf-dist/fonts/source/public/cm/cmsy10.mf
/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm
/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb
/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pf

I would venture a guess that some path is wrong in my TeX installation, but I'm not well enough versed in TeX to know where this is set. I'm running Fedora 15, and I've been installing via rpm's (LaTeX2e).

-Kurt
In reply to Kurt O'Hearn

Re: Failed to convert TeX to PDF with command -- Problem with carat character

by Arnold Pizer -
Hi,

Googling e.g. "cmsy10 at 360 texlive" brings up some errors with the texlive 10 and AMS fonts.  That may be your problem.  I didn't find a good solution but you could install an older or newer version of texlive.   See e.g. http://fedoraproject.org/wiki/Features/TeXLive

But first I think first I would do more searching and/or try to get in contact with some people running WeBWorK on Fedora.  I intend to write up details instructions for running WeBWorK on Fedora 15 but it may be awhile before I get to that.

Arnie
In reply to Arnold Pizer

Re: Failed to convert TeX to PDF with command -- Problem with carat character

by Kurt O'Hearn -
Update: I uninstalled the Fedora texlive 2010 installation via rpm, and installed texlive 2011 from source. But, the errors still persist.

-Kurt
In reply to Kurt O'Hearn

Re: Failed to convert TeX to PDF with command -- Problem with carat character

by Kurt O'Hearn -
Update: the solution was to set the correct paths to pdflatex, etc. in {WWroot}/webwork2/conf/global.conf. Another consequence of this problem (which is now resolved) was: http://webwork.maa.org/moodle/mod/forum/discuss.php?d=2556

-Kurt
In reply to Kurt O'Hearn

Re: Failed to convert TeX to PDF with command -- Problem with carat character

by Jason Aubrey -
Kurt,

Did you look into the permissions error? It does sound like a permissions problem. To test this, you might try running this command as root:

cd /opt/webwork/courses/myTestCourse/html/tmp/hardcopy/work.KtLYEEQf && /usr/bin/pdflatex --shell-escape >pdflatex.stdout 2>pdflatex.stderr hardcopy

If you are able to properly generate the hardcopy runing this command as root, then it must be a permissions error. If this still fails, even as root, then at least we know it's some other problem.

Jason
In reply to Jason Aubrey

Re: Failed to convert TeX to PDF with command -- Problem with carat character

by Kurt O'Hearn -
Jason,

Yes, I tried typesetting with the above command, and it works fine. I also tried typesetting from a few student accounts, and those work too. Interestingly, it seems all my issues have all been resolved by setting the correct path. I would like to know more about the usage of the function ioctl( ) and how it could have been generated by the path problem (to further convince myself that all issues are resolved). I'll look into it, and see if I can provide a good explanation as to how exactly that error was generated.

Thanks to all for helping!
-Kurt