Hi! I'd like to start contributing to drutex. I've installed it on my server and guess what? It didn't work. So I'm asking myself: Why doesn't it work? I've added a couple of useful debugging features to my own drutex_render.inc, one which is related to an issue posted a while ago, stating that the message TeX Embedding failed! was not enough (http://drupal.org/node/71218). The other one was trying to access the latex error log. Both were quite simple.
The first one, about line 242 of drutex_render.inc, i added
<?php
$res = '<br/>'.
'<em class="error">TeX Embedding failed!<br/>'; //error message, useful for debug, remove for production
$res.='[HASH]='.$hash.'<br/>'.
'[TMP_DIR]='. $temporary_dir.'<br/>'.
'[IMG_FILE]='.$image_file.'<br/>'.
'[IMG_DIR]='.$image_dir.'<br/>'.
'[IMG_TYPE]='.$image_type.'<br/>'.
'[DPI]='.$dpi.'<br/>'.
'[DRUTEX_DIR]='. drutex_var_get('drutex_dir').'<br/>';
$res.='</em>';
?>the second one, around line 231, I commented out the _drutex_delete_dir, so the temporary dir is no longer deleted. In that dir, the original log file is stored. If it is automatically deleted, no info can be obtained about the error. Looking at my log file i discovered that file amsmath.sty was missing, so I now have more info to solve my problem with latex.
Maybe it could be useful to display this log file below the error message, I don't know.
Sorry I didn't post a patch, I don't know if it's useful. It's kinda hard to contribute to this module since there are no pending pathces or available tasks (http://drupal.org/project/issues/drutex?categories=task). I think it's because it's pretty new... great work anyway!!
[edit] i don't know why but this post is causing the whole group page to display wrong! for my problem it was solved, i was missing the tetex-extra package. tell me if you want me to write a howto for installing drutex.
Comments
Thanks
Thank you for your contribution. Instead of writing the debug to the node's content we better log it with drupals logging facilities (this isn't difficult).
The amsmath problem is new to me. The amsmath package should be included in tetex. Maybe you have a very old version of tetex, or some strange linux distribution :)
A howto for installing DruTeX will be available soon. Stay tuned. But there will always be problems on some machines because LaTeX isn't set up correctly.