It would be great to have an export function to go directly to PDF through Markdown since in 99% of the case when you’d use the latex option, you’d want to produce a PDF and bringing out the terminal to process the tex file each time is quite tedious.
If you think that processing the runs of pdflatex and bibtex is too complicated and not worth your time, have a look at the “rubber” package in Fink / MacPorts. Not too sure if you’ve come across it but I’ve been using it for quite a while now and it’s great. A simple “rubber -d” runs and reruns the latex and bibtex commands until you get the final pdf you want. You could include it in the app bundle the way you’ve included the MMD perl script, it’s a python script and only weighs about 100KB
The main reason I didn’t really bring this idea up with Keith is that processing a TeX file can sometimes lead to errors, and these errors get silently discarded during Scrivener’s processing.
I agree that it is a convenience to be able to perform a single action to create the PDF, but my concern is trying to avoid “mysterious” errors that make it difficult for users to trouble-shoot. These errors would tend to show up on Keith’s door as problems with Scrivener, which they would generally not be.
Already, if there is an error that occurs in the Scrivener->MMD->XHTML->TeX process, it becomes difficult to figure out what’s happening. The solution, of course, is to export the MMD, and then process it manually in the Terminal where you can follow the error messages. I had a similar issue come up where a user had inadvertently inserted an invisible character in the middle of a word in the middle of a really long document. Manual processing like this made it easy to track down the error, but it would have been impossible otherwise.
My thought is that if Keith were to add something like this (using rubber, or latexmk (my favorite), or whatever) there would need to be a dialog that displayed error messages (leaving it to the user to sort them out), or a warning box suggesting a manual processing if the results are not as expected. I’m sure others will have further suggestions.
Obviously, it’s up to Keith to choose an approach, but I just want to make sure that Keith’s time doesn’t get swamped with fielding support questions for problems that have nothing to do with Scrivener.
Yes, one would definitely want an error output. What about just dumping the results of the .log in the latex processing file to a dialog? Seems like the easiest option to me.