Important question about MMD integration: Version 2 or3?

Dear Scrivener Team,

since I have to use LaTeX Export or plain text Export and MMD to finish my PHD written in Scrivener and I ran into trouble with the different Versions of MMD I’d kindly ask you what version of MMD you’re planning to integrate.

To me this seams important since the handling of formulas/ equations is completely different in the two versions (3.0 is released just a couple of weaks ago):
2.0 uses MathML to parse equations whereas 3.0 uses native LaTeX code

Since Scrivener itself can not handle equations as far as I know it is quite important to know which way to go for all the dudes out there writing scientific papers (including me :wink: ). Otherwise all equations have to be rewritten for proper LaTeX export out of Scrivener.

Just to let you know (I assume you already do):
MMD 2.0 is written in perl being not too easy to install (I think this has been one reason for you to postpone integration.
MMD 3 is written in C and can be installed easily using Fletcher Pennies installer.

Best Regards,

Markus

Right, the main problem with getting MMD2 into Windows was the Perl+xsltproc requirements which would essentially mean dead parts of the interface unless we distributed Perl with the application. Even using a nice compact distribution like Strawberry would bloat the download by an additional 50 or 60mb, so that wasn’t really an option.

MMD3 will be the preferred way to work going forward. It’s not quite as powerful as MMD2 out of the box, but it is a native binary, very fast, and if you do need more customisation and have the necessary scripting tools installed, it’s pretty easy to use the helper scripts that come with MMD3 to fully emulate an MMD2 workflow.

The biggest problems for us will be annotations and HTML commented LaTeX codes. Both use HTML conventions which will not be parsed by MMD3 when going straight to LaTeX. I haven’t yet thought of the best way to address this. Annotations might not seem like a big deal, but they are if you use them functionally to expand MMD’s syntax. Since they are wrapped in and classed as ‘annotation’, it’s easy to set up an XSLT routine to scan for particular types of annotations and emit custom LaTeX (or whatever). Basically it gives you customisable semantic ranges while working in Scrivener. So some kind of solution that makes it possible to seamlessly do stuff like that would be nice as an advanced option.

Equations are a problem, too, but the best way to handle this will probably be to just finish off the project using MMD2 (or MMD3 with the helper scripts), and then switch to the new equation method for the next project, rather than going back and fixing everything. The only drawback to this is a performance hit. The binary is considerably more swift than Perl+XSLT.

So summary to the primary question: You can go ahead and switch to MMD3. You’ll get the benefits of the new system, and can still use the old system too, with the right dependencies installed.

Good news! Thanks a lot. I already switched to MMD 3 on my new laptop to get rid of the perl installation. To be honest the only bad thing about it is that the LaTeX equations are almost unreadable and disturbing. I’d prefer MathML Syntax.

I found using html comments more compact and robust than using the advised

\\[\begin{equation} {x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a} \end{equation} \\]

which then gets

<!-- \begin{equation} {x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a} \end{equation} -->

I (of course) ran into trouble using macros to get rid of the ugly \begin{equation} because (I guesss) the parser strips the inline math part if it finds \begin{equation} but doesn’t as soon as he doesn’t find \begin{equation} which is needed to get equation numbering. The latter works fine.

Best Regards,

Markus