You can create your own child processes and thus also start latex processing. By registering with the appropriate listeners, you can detect process termination or failure exit:
var sys = require('sys'), spawn = require('child_process').spawn, pdflatex = spawn('pdflatex', ['-output-directory', '/target/dir/','input.tex']); pdflatex.on('exit', function (code) { console.log('child process exited with code ' + code); });
EDIT: to create an intermediate latex file using the provided data, I would suggest using the node.js template engine, for example mu / mustache.
So, you can pump pieces of the template process as a stdin for your child pdflatex process.
b_erb
source share