Hi
My goal -> allow a user to enter the content of a section in LaTeX markup in the body of a book
node. When its saved, using nodeapi in my module, I want to create a file in /tmp/ with the LaTeX
body, then run LaTeX on it, and eventually upload a created ps or pdf file to the site.
My problem is the backslash.
My module has settings, two textareas which take the LaTeX header and footer,
\documentclass{article}
\begin{document}
and
\end{document}
respectively.
These are stored correctly and show up as I expect in the textarea. Then I added a call in nodeapi to my function:
case 'insert':
db_query('DELETE FROM {fhsstadmin}_syllabus WHERE nid = %d', $node->nid);
db_query("INSERT INTO {fhsstadmin}_syllabus (nid, syllabus) VALUES (%d, '%s')",$node->nid,$node->fhsstadmin_syllabus);
_prepare_ps_file($node->body);
break;
case 'update':
db_query('DELETE FROM {fhsstadmin}_syllabus WHERE nid = %d', $node->nid);
db_query("INSERT INTO {fhsstadmin}_syllabus (nid, syllabus) VALUES (%d, '%s')",$node->nid,$node->fhsstadmin_syllabus);
_prepare_ps_file($node->body);
and my function looks like this:
function _prepare_ps_file($body)
{
$longtext = variable_get("fhsstadmin_bookheader","");
$longtext .= $body;
$longtext .= variable_get("fhsstadmin_bookfooter","");