Multimarkdown -> LaTeX Compile time > 1 hour (hangs?)

Update: found the culprit. This might be a bug in Scrivener or a bizarre thing in my file. I have a TOC with Edit > Copy Special > Copy Documents as TOC. If I remove this, compilation takes seconds. Might help to investigate further.

I have a 60k document with a number of internal Links, BIBTex Literature references and roughly 10 images in the draft linked from documents in the Research folder.

It compiles to Word (5 minutes), but not to Multimarkdown -> LaTeX

I have copied the (Modern Custom Latex) Style, assigned the Section Layouts and pressed Compile.
After an hour nothing has happened. I can cancel the compile window.

When I select only 1 document to compile and do the same, the compile works.

I am on a 2018 Macbook Pro, 8 GB RAM, latest Mojave, Scrivener 3,1,3,

Is it possible to see where the problem is coming from?

Thanks for the report. Unfortunately it does not appear to be a universal problem with the combination of these features. I tried a simple test and, while the output is quite understandably not useful for MMD and LaTeX, it at least still worked in the sense that there was text there in the file that looks a bit like a copied and pasted ToC from a PDF or something.

But I suspect there may be more to the equation than simply these two ingredients, since you mention compiling to Word. Does that mean using Scrivener’s own .docx output, or Pandoc’s? If the former, in what direction are you writing from—with Markdown and converting that to RTF, or the other way around? Can you think of any other settings you might have changed, or customisation made to the “Modern” format?

Ultimately it might be easiest to post a sample project to our support address. You can create a version that is stripped down to the ToC section and whatever else is necessary.

The compile to word route was Scrivener’s own .docx output. I just mentioned it because it produced some output after 5 minutes while the MMD → LaTeX compilation hung “forever”. I needed to do the LaTeX.

The culprit was definitely the TOC because after I deleted it - and did no other changes - the compile worked fine and compilation to Latex now takes a few seconds.

I just tested a TOC with a small document and indeed it works fine. Therefore I suspect a memory problem as I saw something in that regard in the Mac logfile output. That means it could be a matter of project size and maybe number of internal links, images etc.

I can’t share my document right now I am afraid but might be able to do so later.

Okay, so which direction are you converting from in that case?

It could also be content related, perhaps a Unicode character (even an invisible one that slipped in inadvertantly). I’m not sure if there is much in how this works that would be a burden on processing, based on size. In both cases what Scrivener does would be about the same—it’s the outcome that differs. But again, it might make a huge difference if you’re converting from MMD to RTF, or from RTF to MMD.

No worries, on the bright side, as I mentioned it’s not really something you’d ever want to actually do anyway—so it’s a pretty low priority bug. LaTeX already has a perfectly suitable and far superior ToC generation system. Even if you did wish to forgo using that and handle the ToC yourself, it would be better done without the <$p> codes, since those don’t map to anything useful via MMD/LaTeX.