Hi,
I am having trouble trying to get DruTeX to work. Everytime I try to add an equation to a page I get the following message: "TeX Embedding failed!".
If I go to the input formats and configure the DruTex filter, all the tests at the bottom of the page appear green. I enabled debug mode and got the following error message in the logs:
files/tex/4c0597276a70488fcfe27d7a71a344f950315941.png couldn't be created. Temporary directory was /var/www/virtual/evowebs.co.uk/phptmp/drutex-3adf74d2673f0805dde82726a490ece6-1.
I have chmod both of the phptmp and the files/tex folders to 777, but it still gives this error.
I have tested my latex configuration on my server using the following tex file:
\documentclass[10pt,notitlepage]{article}
% good math support
\usepackage{amsmath, amsfonts, amssymb}
% UTF-8 support
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\pagestyle{empty}
\begin{document}
\( E=mc^{2} \)
\end{document}
I used the following commands:
latex test.tex
dvipng test.dvi
And this produced the png file correctly.
I am stumped. I would appreciate any help anyone can give.
Comments
Comment #1
british.assassin CreditAttribution: british.assassin commentedComment #2
kaw3939 CreditAttribution: kaw3939 commentedI have the same problem. Any help would be appreciated.
Comment #3
kaw3939 CreditAttribution: kaw3939 commentedAfter doing some pulling of hair and teeth. I think that I have the cause of this common module problem. I think that most people run apache as an unprivlaged user that can't call latex and dvipng. This is just a guess.
I run the custom commands manually under my own account and they come through just fine, so I'm thinking it has something to do with how http user is setup on some people's machines. I am setting this up at a university and don't have access to change the permissions for http user, but I may be able to get someone to come up with a workaround.
Any ideas?
Comment #4
Steven Jones CreditAttribution: Steven Jones commentedI was just about to ask if apache had permission to call latex and dvipng, but then these are both called on the status page, so that should fail too.
If you have terminal access you could sudo over to the apache user and try running latex.
Comment #5
kaw3939 CreditAttribution: kaw3939 commentedHi,
I have shell access and can call latex and dvipng from shell. In fact, I can run the exact same commands run by drutex and get output, but when drutex runs the commands it fails.
The sysadmin said that the http user can run both programs too, so i'm stumped. I'd really like to get drutex working because i'm setting up a learning object repository for an engineering school and a lot of faculty use latex, so this would be a great way for them to easily contribute to the repository.
I'm going to give it another shot next monday, since I've had enough of Drupal for the weekend :)
If you have any other suggestions let me know.
Comment #6
ferfong CreditAttribution: ferfong commentedI have the same problem. I've run the commands as the user "apache" and they correctly generate the png with no errors.
However, when actually run from the site, it does not work, no [hash].log/aux/..etc files are ever created. The temp directory only has the tex file.
We found that it was due to selinux; are you all running with selinux enabled as well?
I think the httpd process was not allowed to read the required tex fmt files. Adding a module to allow this:
allow httpd_t tetex_data_t:dir { getattr search };
allow httpd_t tetex_data_t:file { read getattr };
fixed the problem [so far]. Hope this helps anyone else out there, and if anyone else thinks that there is an easier/more secure solution, I would be glad to hear from you.
Thanks!
Comment #7
galbarn CreditAttribution: galbarn commentedI also have the same problem:
after a adding content like $x^2$ and chosing DruTex as the input format
I get "TeX Embedding failed!".
I also get three warning logs after that:
and :
I have windows XP, wamp2 on my own computer and drupal 5.12.
I have all the needed programs (latex etc) installed,
and the configuration tab of the DruTex input format seems fine:
I'm not sure my apache user has the right permissions as kaw3939 (http://drupal.org/node/219979#comment-874332) said, perhaps that's the problem.
any idea?
Comment #8
diegofd CreditAttribution: diegofd commentedI also get "TeX Embedding failed!".
My configuration is IIS, PHP and Miktex 2.7 but I think that it's failing in the same point.
Have you tryed using backslashes instead of slashes in paths?
Comment #9
galbarn CreditAttribution: galbarn commentedhow do I do that?
I've tried changing it in the configuration tab of the drutex input format in the base settings tab
(where you write your paths) but it still using forward slashes.
Comment #10
ferfong CreditAttribution: ferfong commentedHm, galbarn, it does seem like it would be a path/slash issue.
I've noticed my drutex does not actually use the "temporary folder" set in my DruTeX "Base Settings", but instead uses my drupal 'Site Configuration' -> 'File System' temporary directory.
Still, I don't think this is the problem, as my drutex appears to actually have forward slashes / hard-coded in.
In "drutex_render.inc", drutex sets some default variables and it looks like they use a forward slash:
Also, in drutex.module:
I don't know if these change depending on how you install for Windows, though, just thought I'd mention it.
Comment #11
WoodstockBenny CreditAttribution: WoodstockBenny commentedI was having similar problems. I'm using Linux with Drupal 6.8 and a beta port of Drutex. I tried everything else, but the logs kept looking something like:
I needed three things to get this fixed.
1. Create directory where the images would be stored once created (/drupal_root/sites/default/files/tex) with the appropriate permissions.
2. Change the Image Directory/URL Directory to reflect this (as a relative path from /drupal_root/) to sites/default/files/tex
3. Change to LaTeX Render section to custom and put in absolute paths to latex and dvipng, such as /usr/local/bin/latex and /usr/local/bin/dvipng (of course this will depend on how you are converting the images and the location of your latex/dvipng etc.)
It took a while, but I managed to get there in the end.
Cheers,
Ben
Comment #12
nquocbao CreditAttribution: nquocbao commentedI got the same problem, all tex are replace with "Tex embed failed". No log message. I just see some message says that "Folder drupal-xxx was created"
Comment #13
diegofd CreditAttribution: diegofd commentedAnybody has Drutex working with Miktex over IIS6.0? I get the "TeX Embedding failed!" error and I think that it's a permissions or slashes errors.
Comment #14
nobody-2 CreditAttribution: nobody-2 commentedOK, I had the same problems but I can solved following the steps proposed by WoodstockBenny with some modifications
1. Create directory where the images would be stored once created (/drupal_root/sites/default/files/tex) with the appropriate permissions.
2. Change the Image Directory whit the absolute path (/drupal_root/sites/default/files/tex) and the Image URL Directory with the relative path (sites/default/files/tex)
3. Change to LaTeX Render section to custom and put in absolute paths to latex and dvipng, such as /usr/bin/latex and /usr/bin/dvipng
cd [TMP_DIR]; TEXINPUTS="[DRUTEX_DIR]//:"; /usr/bin/latex -interaction=batchmode [HASH].tex
/usr/bin/dvipng -o [IMG_FILE] -D [DPI] -T tight [TMP_DIR]/[HASH].dvi
4. Run the command: fmtutil-sys --missing
The last step was necessary because for some reason the apache user can not find the format files for LaTex and it is not able to create the file .dvi
My system is running Fedora 9, Drupal 6.10, DuTex 6.x-1.0-beta1 abd pdfTeXk Version 3.141592-1.40.3 (Web2C 7.5.6)
It took me more than a while, but now it is working
good luck
Comment #15
imerlin CreditAttribution: imerlin commentedExperiencing the same problem with Drupal 6.12 and the latest 6.x DruTeX version.
I am using 'sites' for all my custom Drupal files (configuration, modules, themes, etc) and for some reason, the DruTeX module is trying to use my 'drupal/files' directory for some stuff (even though it is not listed in any settings).
After creating a symbolic link from drupal/sites/mydomain.net/files to drupal/files everything works fine.
Comment #16
golgobot CreditAttribution: golgobot commentedPlease help. I went through a lot of trouble to install TexLive and dvipng on my server running FedoraCore7. I can run both commands 'latex' and 'dvipng' from root, and any other user, but DruTex continues to say it cannot execute these commands:
I saw something about apache not having the correct permissions, which could be the case, but I wouldn't know how to fix that issue. TexLive might have been installed incorrectly, although I just followed the install guides. The binaries for tex were installed in a strange directory, but I thought I had included that directory in the global PATH.
I also tried putting in the absolute paths to latex, dvipng and pdflatex like this
That also produced the same results.
I'm really stuck. Any help would be much appreciated.
Thanks
Comment #17
jrviorato CreditAttribution: jrviorato commentedI went through an identical problem, drutex couldn't create the png file, and the main reason was because the dvi file wasn't created because the latex command couldn't be run. I did a lot of stuff but i finally made it.
From all the stuff I tried, i think, that the one that works was to run the next two lines of code:
But I am not sure, hope this help.
Note: the lines of code were executed on Linux.
Note2. I also customize the conversion method to use the parameter
TEXMFVAR="/[your home dir]/.texmf-var"
.Comment #18
gershonavi CreditAttribution: gershonavi commentedvmunozp -- solution works for me:
first I run
~$ texconfig init
~$ texconfig confall
from shell.
then the custom string is: (and in Image directory I put pull path)
cd [TMP_DIR]; TEXMFVAR="/YOUR_HOME_DIR/.texmf-var" TEXINPUTS="[DRUTEX_DIR]//:" /usr/bin/latex -interaction=batchmode [HASH].tex
/usr/bin/dvipng -o [IMG_FILE] -D [DPI] -T tight -bg Transparent [TMP_DIR]/[HASH].dvi
Avi.
Comment #19
occam98 CreditAttribution: occam98 commentedAvi,
I've tried all of the commands above and they work perfectly on the command line, but I still get tex embedding fails when I try to run them as a custom string in the preference window of drutex:
Here's my current custom string. Each command between ;'s works perfectly on the command line when I substitute the appropriate variables, however, this command never executes properly in drutex.
cd [TMP_DIR]; TEXMFVAR="~jburk/Sites/sites/default/files/tex/.texmf-var" TEXINPUTS="[DRUTEX_DIR]//:" ; latex -interaction=batchmode [HASH].tex
;dvipng -o [IMG_FILE] -D [DPI] -T tight -bg Transparent [TMP_DIR]/[HASH].dvi
Any ideas as to how to fix this?
Thanks,
-John
Comment #20
jrviorato CreditAttribution: jrviorato commentedHi John:
¿is your home directory "~juburk/"?
If it is, i think you should set
TEXMFVAR="~jburk/.texmf-var"
or preferable, you should use the full home directory path, example:TEXMFVAR="/home/~jburk/.texmf-var".
Regards
Valentina
Comment #21
monty_hall CreditAttribution: monty_hall commentedI'm having similar problems.
NOTE: Wikipedia has no problems with the current latex setup(dvi/latex/convert) and it too uses the tmp directory.
Any help appreciated.
Comment #22
hawksjohnd CreditAttribution: hawksjohnd commented@17: This worked for me, going from a fresh apt-get install of texlive on Ubuntu. Thanks for posting your solution!
Comment #23
boclodoa CreditAttribution: boclodoa commentedI had this problem too.
my system is: centos 5.5, php 5.1.6, Apache/2.2.3
pdfeTeX 3.141592-1.21a-2.2 (Web2C 7.5.4) installed with
and
I did many of the things suggested in this issue, and finally got it working (kind of). Here's a list of the things I think could help:
1- put Drutex in Debugging mode (admin/settings/filters/*/configure) and take a look of the warning messages in admin/reports/dblog
2- use "custom" Conversion Method in DruTeX :: LaTeX Renderer in admin/settings/filters/*/configure
3- catch the output of the commands in a textfile. One way to do it is add > /tmp/log.txt (or >> /tmp/log.txt), for example:
4- insert some new latex content and check the error messages in the log, maybe
5- add informative commands to the "conversion method", for example:
at this point I saw, many times:
This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
I can't find the format file `latex.fmt'!
so after googling a while I added other informative commands
with no result.
I really don't know how much helped me, but I think is a good idea to run
with root but also with the user returned by whoami
after googling again I realized the problem was SELinux, because when I switched to permissive mode
everything worked fine. So, the diagnostic in my case is SELinux is blocking the exec command of PHP, now I'll try to configure SELinux to allow the exec command properly, any help would be verry appreciated.
Note. Other things that can block the exec command (totally or partially) are:
- the disable_functions directive in the php.ini
- the safe mode of PHP
Comment #24
boclodoa CreditAttribution: boclodoa commentedThese commands did the trick
now it's working even with the enforcing mode
Comment #25
dwalker51 CreditAttribution: dwalker51 commentedThanks for the help, I got this error too... here is my install docs , it finally worked when I changed the drutex directory permissions to 755 from 666, that I had set for some reason.
Drupal 7 and 7.x-1.x-dev - 2011-Mar-26
drush dl drutex
drush en drutex
yum install texlive texlive-latex
yum install dvipng
Configuration > text formats
add text format called drutext
Set
temporary directory to /tmp
Image DIR to /var/www/html/noao/sites/default/files/drutex
Image URL to sites/default/files/drutex
Conversion method (put in the /usr/bin/s)
cd [TMP_DIR]; TEXINPUTS="[DRUTEX_DIR]//:" /usr/bin/latex -interaction=batchmode [HASH].tex
/usr/bin/dvipng -o [IMG_FILE] -D [DPI] -T tight [TMP_DIR]/[HASH].dvi
create those dirs and make RW
mkdir /var/www/html/noao/sites/default/files/drutex
chown -R apache.apache drutex/
chmod 755 drutex/
resolution : 107
Save
Go to configuration > CKEditor
clone from full-html a new profile called drutex