Hi I'm relatively new to drutex and drupal, but I'm getting the following errors.
This shows up on my main page, after installing drutex
warning: Parameter 1 to drutex_pdf_nodeapi() expected to be a reference, value given in /Users/jburk/Sites/modules/drutex/drutex.module on line 830.
The error I get under the config menu is:
The temporary directory is writable.
The image directory (files/tex) isn't writable.
Executing "latex" failed. Either LaTeX isn't installed or the "latex" executable is not in one of the search paths.
You cannot render high-quality images without LaTeX.
Mimetex maybe an alternative for you. Consult the documentation on how to use Mimetex.
Executing "dvipng" failed. Either dvipng isn't installed or the "dvipng" executable is not in one of the search paths.
You cannot use dvipng for rendering images (check the conversion method above).
Executing "convert" (ImageMagick) failed. Either ImageMagick isn't installed or the "convert" executable is not in one of the search paths.
You cannot use ImageMagick for rendering images (check the conversion method above).
I've tried making the /files/tex directory writable to www, but that doesn't seem to help. I've also read about how to make a file accessible to apache by modifying http.conf, but that didn't help either.
If it helps, I'm running MAC OS 10.6, Drupal 6.15, and tex-live 2009—I have no problems using LaTex via texshop and the command line.
Thanks for any suggestions for how to fix this.
-John
Comment | File | Size | Author |
---|---|---|---|
#6 | drutex-730940.patch | 568 bytes | puregin |
Comments
Comment #1
monty_hall CreditAttribution: monty_hall commentedI'm getting the exact same problem.
Comment #2
pmaguniaSame here. `pdflatex' and `latex' work on my webserver to create dvi's and pdf's from the command line, but I still get the above mentioned error message.
Comment #3
pmaguniaI got DruTeX working. The path variables needed to be adjusted in exec. When exec is run the $PATH variable is not defined so you have to define it yourself.
Comment #4
physcied CreditAttribution: physcied commentedCan you please tell me where "exec" is and what path variables need to be adjusted to what?
Comment #5
pmaguniaAround line 86 in drutex_tools.inc I changed the original code to:
You adjust the absolute paths to suit your installation.
Also, in the Input Formats section of Site Configuration in LaTeX Rendering I changed the conversion method to custom with the following code:
The paths in your .bash_profile and .bashrc in your home directory are not used when calling exec. That's why you have to redefine. I'm not sure this is the best method, but I got DruTeX working with this customization
Comment #6
puregin CreditAttribution: puregin commentedThis error is caused by new behaviour in PHP 5.3 vs. 5.2 - see http://php.net/manual/en/migration53.deprecated.php "call time pass by reference".
Here's a patch for the one-character change required to drutex.module, relative to drutex-6.x-1.x-dev.
The other messages about directories not being writable are configuration/installation issues. These should be resolved by adjusting the exec path for Apache /PHP, NOT by adjusting the code as suggested above. See http://php.net/manual/en/function.exec.php.
Comment #7
pmagunia@puregin
I did install LaTeX in my home directory of my shared hosting account which is why I was setting those variables. I think it is necessary anytime when an install is outside the usual paramaters. I should have mentioned that in my post earlier.
I was getting the message LaTeX executable not found and setting the environment variables solved the problem.
Comment #8
ShaunDychko CreditAttribution: ShaunDychko commentedWhile I can confirm that the patch in #6 gets rid of the error message, I'm not so sure about the approach. I tested the following code:
and it returns the following:
which says to me that you can't put an ampersand in front of the parameter array to solve the "pass by reference" issue. However, since the patch in #6 did make the error message go away, I took this question to Stack Overflow: http://stackoverflow.com/questions/8864241/can-we-pass-the-parameter-arr... and consensus is that you can't put ampersands in front of the parameter array of call_user_func_array(). Also, doing an informal search through Drupal and lots of contrib modules didn't find any instances of call_user_func_array() used with the parameter array passed by reference.
The offending function in this issue, drutex_pdf_nodeapi, doesn't make any changes to the node, so it doesn't even need the node as a reference. The change I propose is to revert the patch in #6, and change the function declaration on line 282 of drutex_pdf.inc to:
by removing the ampersand in front of $node.
Comment #9
Jhun Vert CreditAttribution: Jhun Vert commentedI also encountered this error with PHP 5.3. The solution of Shaun Dychko works for me. I simly remove the & in line 282 of drutex_pdf.inc so that the &$node will be come &node. Thanks Shaun.
Comment #10
ramdhanh CreditAttribution: ramdhanh commentedI have try this, and work fine..
drutex.module
line 193
$D['drutex_dir_images'] = variable_get('file_directory_path', 'sites/default/files') .'/tex';
line 195
$D['drutex_url_images'] = variable_get('file_directory_path', 'sites/default/files') .'/tex';
drutex_pdf.inc
line 282
function drutex_pdf_nodeapi($node, $op, $teaser = FALSE, $page = FALSE) {
Comment #11
grzesag CreditAttribution: grzesag commentedTrying to set up Drutex in Drupal 7 and I noticed that public path must be set up in variables table if it is not use
drush vset file_public_path sites/default/files
to set it or go to Configuration -> File System -> and save configurationnow error showing that image directory is not writeable should disappear
Comment #12
ShaunDychko CreditAttribution: ShaunDychko as a volunteer commentedhttps://www.drupal.org/project/mathjax is the way to go these days.