By scatteredbrainV on
I have Drutex installed on my website. Unfortunately, when I try to insert a formula, it reports "TeX embedding failed!"
What could I do to fix it?
In the DruTeX settings I set my IPs as allowed to post TeX; the Temporary directory is set to /tmp, the template is default.tex, the conversion method is custom with these settings:
cd [tmp]; TEXINPUTS="[/public_html/sites/all/modules/drutex]//:" latex -interaction=batchmode [formula].tex
dvipng -o [druimg.png] -D [300] -T tight [tmp]/[formula].dvi
Can anybody help me, please? I do need to post math contents and I read that this should be the best module to do that.
Thanks a lot!
Comments
...
Why are you using a custom command? What's wrong with the default one?
You shouldn't leave the square brackets there. I.e., don't write
-D [300]etc. Write only-D 300.But how did you pick this command? You should use the module's placeholders --not "druimg.png" and "formula.dvi"-- because these values aren't fixed. I suggest you switch back to using the default command.
The module provides some debugging aids. It can record in the log the commands finally issued. And I assume Latex and dvipng are indeed installed on the server.
You may get more help at the module's support queue.
I used the custom command
I used the custom command because the default one wasn't working.
Thank you anyhow.
...
Oh, did you give up? :-(
This module uses an external program, Latex, to do the actual work. Perhaps this program isn't installed. At the bottom of the filter's settings page you'll find the results of some diagnostics.
There other solutions to showing math on the web.
You may also want to visit the http://groups.drupal.org/drupaled-distro group.
I have LaTeX installed on my
I have LaTeX installed on my server. I have also ImageMagik, so I switched to that instead of dvipng. But it still isn't working.
:(
...
First I shall explain that the math image is produced in three steps:
So I assume you don't have 'dvipng' inatalled.
But note that ImageMagick itself doesn't understand the DVI format, so in its turn it makes use of another program, 'dvips'. Do you have this 'dvips' installed?
Do you have shell access to the server? (aka 'ssh')
Can you ask the tech support to install 'dvipng'?
(Interestingly, there's another method to invoke Latex: remotely, using mimeTeX. With this method you don't have to have Latex et al installed on you own server. A while ago a user pasted here the snippet he uses.)
And don't forget about the http://groups.drupal.org/drupaled-distro group, perhaps they can help you.
summary
I am trying DruTeX on the 4.7.2 Drupal installation I have on the university I'm working for server.
I have SSH.
In the DruTeX toolbox I get this message:
And I still get the message "TeX embedding failed!".
I signed the DruTeX group mailing list, but I don't know if I can post on their page a request for help. I just don't want to make mistakes in posting help requests.
Sorry and thank you a heap for your help!
...
Let's first try the easiest solution. It is to contact the administrator and ask her to install the 'dvipng' package. She'll know what it is, you won't have to explain. It takes no more than a minute nowadays to install such software.
Yes, that's because you don't have 'dvipng' or other suitable program.
Then there are a couple of things you may want to try. For example, to check for the existance of the 'dvips' command --which will make it possible for you to use ImageMagick's 'convert'. But first let me know if the "easiest solution" works for you.
I have dvips but...
The administrator said that we have dvips installed, but not divpng. I had already select ImageMagick as conversion method.
I'm in debugging mode now, and when I try to create a page with a LaTeX formula, it always display TeX embedding failed.
When I go on my server. under the tmp directory, I see that it has creadet a .AUX file, a latex file, a .dvi file and .log file. So, it seems to me like it arrives till where it has to convert the dvi into a ps file but it can't.
Could it be a path problem? Or is there a setting in Drutex that I am missing?
Thanks again.
...
I'll soon reply.
But first I must warn you against one very significant feature of Drupal:
Drupal caches the output of filters.
Imagine the following scenario:
1. you type some formula into a node.
2. you click 'submit'.
3. you see this dreadful 'TeX embedding failed' message.
4. you change DruTex settings, hoping it will work this time.
5. you return to the node --you may even click 'submit' again.
6. you see the same dreadful 'TeX embedding failed' message.
Problem is, in step 5 the filter didn't run again. The body of the node hasn't changed, so Drupal shows us the old, cached result.
You have to change the body of the node a bit whenever you change DruTex settings if you want to see any change. (Another possibility is to clear Drupal's cache, but an out-of-the-box Drupal doesn't have this option.)
It is possible that this was the problem all along. You switched from 'dvipng' to ImageMagick, but, because you viewed the same, cached node, you saw no difference.
That's why the way I work is as follows:
- I click the 'preview button.
- If the result isn't to my liking, I change the filter settings, then I type one or two random characters into the body, and click 'preview' again.
...
(Note that in this message I assume you didn't fell victim to the cache feature I described above. If you did, then this message I'm typing now might be unneeded.)
Good.
Excellent, so you know how to do this stuff! :)
Let's find out why ImageMagick fails.
There are two ways to find this out. The first is to look in Apache's error log. It's a simple text file where apache writes out all the error messages. This log will also include the error message that ImageMagick possibly emitted.
So, if that method worked for you, that's fine --and you can stop reading right here.
===
But there's another method to finding out where's the problem: it's to use your shell acount (the 'ssh'). I assume you know how to log in, beause it's probably what you've just done.
So log in. You'll arrive at the "command line".
Type:
and hit Enter. If you see a copyright notice then you know the program is installed and can be found.
ImageMagick's 'convert' simply uses this 'dvips' program.
We now want to see if 'convert' can do its work. We are going to find a DVI file and ask 'convert' to convert it to a PNG file.
You already have some DVI files in your /tmp directory. But you may find it easier to just download one such file to your current directory:
('wget' is a command to fetch files. If it doesn't work, try
GET http://blue.live4all.co.il/~mooffie/tmp/quad.dvi > quad.dviinstead.)You now have a 'quad.dvi' file in your current directory.
Ask 'convert' to convert it to PNG:
If everything went fine, you'll see nothing printed. If some error occured, some message will be printed.