Question
I'm trying to install the
LatexModePlugin following the installation guide. But I keep getting the error "Latex rendering error!! dvi file was not created.". It seems that Latex can't find the latex.fmt.
Here is what I did: By switching config on and the trace in Sandbox.pm, I've been able to pin down the issue to the following:
- twiki_math.tex is created correctly in /tmp/xxx
- I can run latex, dvips, etc. by hand in this directory correctly
- But latex when called from the LatexModePlugin does not produce a dvi file. The error message recorded in the apache log is:
[Sat Dec 09 23:30:07 2006] [error] [client 127.0.0.1] /usr/bin/latex '-interaction=nonstopmode' 'twiki_math.tex' -> This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4), referer: http://localhost/twiki/bin/edit/Sandbox/DiesIstEinAnderesTopic?t=1165705935
[Sat Dec 09 23:30:07 2006] [error] [client 127.0.0.1] I can't find the format file `latex.fmt'!, referer: http://localhost/twiki/bin/edit/Sandbox/DiesIstEinAnderesTopic?t=1165705935
As mentioned, latex works perfectly when called by hand. What is going on, and what could I try to get to the bottom of it? Thanks
Environment
--
TWikiGuest - 09 Dec 2006
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
This will likely be traced to a user (i.e.
uid) config error. For latex to find the format files, it needs to find the
ls-R files.
kpsewhich is one tool that can do this. I suspect if you type
kpsewhich latex.fmt in the shell that can run latex, it will report a valid location. Yet running the same command from the web server will report nothing. If this is the case, the
uid running the web server needs to have the latex path environment variables added to the environment.
adding lines such as
SetEnv TEXNPUTS /usr/share/texmf//:/usr/share/texmf-var//:/home/nobody/texmf//
to the apache httpd.conf should resolve the problem. Note that the paths above are for a slackware tetex install. They may be slightly different for Fedora, and should list directories that hold
ls-R files.
--
ScottHoge - 11 Dec 2006
p.s.
ls-R files can be generated for custom directories using
texhash
--
ScottHoge - 11 Dec 2006
Thanks, that's avery useful hint. Unfortunately I'm still stuck... To test what the web server sees, I've written a script that I call instead of latex, and it writes the output of
set,
kpsewhich,
kpsepath and
textconfig confall into a file.
But the results don't make sense. As you say,
ksewhich latex.fmt returns nothing, but
kpsepath fmt returns the correct path (that has
latex.fmt in it), so shouldn't
kpsewhich find it, then?
I've tried all sorts of settings for
TEXINPUTS,
TEXFORMATS (restarting the apache server every time), and they do change the output of
kpsepath, but whatever I do I can't get
kpsewhich latex.fmt to return anything.
The output of
texconfig confall also contains all the paths in the
tetex tree.
I tried searching for info on tex installation, but couldn't find anything useful. At the moment I'm out of ideas...
--
TWikiGuest - 11 Dec 2006
Well, that is strange.
Your output at the very top claims to be running
pdfeTeX. Could the difference be between running
latex or
pdflatex? That is, it appears that
pdfeTeX (or pdflatex) can't find
latex.fmt. Have you tested both
latex and
pdflatex in the shell? The latest version of the plugin can use either, so maybe the bug is in the new dynamic rendering pieces?
--
ScottHoge - 11 Dec 2006
Take a look here:
http://www.mail-archive.com/tetex@dbs.uni-hannover.de/msg01108.html
It appears that in (at least one version of) Fedora Core 5, the
ls-R files are out-of-sync. Check to see if
latex.fmt is listed in your ls-R files.
--
ScottHoge - 11 Dec 2006
Thanks again for your sugggestion. Yes,
latex.fmt is listed in the
ls-R, and
latex and
pdflatex are both sympolic links to
pdfetex.
I don't believe it's the
tetex installation. It works fine even when I do a
sudo -u apache latex twiki_math.tex from command line, but just not when it is called by the webserver.
I'm completely guessing, but could it be the apache permissions, or SELinux, or the Twiki Sandbox mechanism which prevents it from finding the file? I don't know much about these, my apache and SELinus are standard Fedora and I haven't really modified anything there.
I will keep looking...
--
TWikiGuest - 12 Dec 2006
There is a permission problem I don't understand.
kpsewhich has a debug option, so I do a
kpsewhich --debug=32 latex.fmt and in the output I get
kdebug:db:match(/usr/share/texmf-var/web2c/latex.fmt,/usr/share/texmf-var/web2c//) = 1
/usr/share/texmf-var/web2c/latex.fmt: Permission denied
kdebug:search([latex.fmt]) =>
But what permission is the problem here? Looks ok to me:
-rw-r--r-- 1 root root 1979578 26. Sep 11:21 latex.fmt
--
TWikiGuest - 12 Dec 2006
It is an SELinux problem. If I disable SELinux for the httpd daemon, it finds
latex.fmt and
latex runs. Uff!
--
TWikiGuest - 12 Dec 2006
I'm glad to hear you found the problem.
--
ScottHoge - 13 Dec 2006
Thanks again for your help.
Just a quick additional note for the benefit of other readers: Disabling the SELinux for the httpd daemon was of course only a temporary workaround for finding out what was going in. It's better to set the SELinux context correctly for Latex and enable SELinux again.
Perhaps it is useful to mention in the Installation Section of the
LatexModePlugin that one may have to adjust the SELinux context?
Last but not least:
LatexModePlugin really a very useful plugin and gives a very good impression. Scott, thanks a lot for your work!
--
StephanMatthiesen - 14 Dec 2006