MMD > LaTeX: All of a sudden issues with footnotes

Hey,

I’m writing my master thesis in Scrivener using MultiMarkDown with LaTeX export for month now and it worked perfectly. But two days ago, all of a sudden footnotes somehow stopped working.

[code]Maecenas sed diam eget[^footnote1] risus varius blandit sit amet non magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed posuere consectetur est at lobortis. Etiam porta sem malesuada
magna mollis euismod.

[^footnote1]: [This is a citation][#citekey]
[/code]
used to look like this after export:

Maecenas sed diam eget\footnote{~\citep{…}} risus varius blandit sit amet non magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed posuere consectetur est at lobortis. Etiam porta sem \textbf{malesuada} magna mollis euismod.

But right now it looks like this:

[code]Maecenas sed diam eget\footnote{footnote1} risus varius blandit sit amet non magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed posuere consectetur est at lobortis. Etiam porta sem \textbf{malesuada} magna mollis euismod.

\footnote{footnote1}: ~\citep{…}
[/code]

I’m using Scrivener 2.7 (26106) on OS X El Capitan. Same issues with MultiMarkdown 4.5 (which I used all the time) or MultiMarkdown version 5 (which I installed yesterday).

Has anyone see this before? I’m pretty clueless what changes have caused this behavior, so I’m thankful for any hints to track that down.

Thanks!

Is this change affecting previously entered text, or just new text?

Can you post a real example of the misbehaving text?

The first thing I try when Scriv->MMD->FormatX doesn’t seem to be doing what I expected, is to break down that sequence of steps into something you can examine rather than automating the entire process. The best way to do this is to compile from Scrivener not using any automation, but just have it create a plain-text file using the MultiMarkdown compile option. Open that in a text editor and examine the footnotes that are not functioning as expected. Is the syntax correct? Using an editor that can displaying non-printing control characters, are there any junk characters within the syntax that might be messing things up, such as a NUL (ASCII 0) character? If the syntax is different than how you typed it in, are there settings in Compile that might be changing text, such as in Replacements?

If everything looks as expected, then try processing the file yourself to .tex by using MultiMarkdown (there are some helper tools if you aren’t comfortable using the command-line) and see if the results are different.

Thanks for your suggestions guys. In the meanwhile I had time to debug the issue in more detail and also use Multimarkdown manually as suggested by AmberV.

The issue was caused by missing blank lines. For example, if one of the documents look like this (note the missing blank line between paragraph and footnote reference):

Maecenas sed diam eget[^footnote1] risus varius blandit sit amet non magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed posuere consectetur est at lobortis. Etiam porta sem **malesuada** magna mollis euismod. [^footnote1]: [This is a citation][#citekey]

All subsequent footnotes are broken. The issue happened because I enabled plain text sync and edited some files externally. When synced, Scrivener removes all blank lines per default.

Thanks again!

Ah, yes, that option should be off whenever writing text where literal spacing matters. It is meant more for those that use rich text formatting, where the best practice there is to not have a clean line of space between paragraphs, which conversely looks ugly in plain-text. So the engine can spread paragraphs out with empty lines on sync, then fold them out on the way back in. Good if you need that, bad if the spaces you put in are important to the document. :slight_smile:

As an aside, are you aware that Scrivener can turn its footnotes into MultiMarkdown syntax upon compile? With an option in the Import tab of the Import/Export preference pane, “Convert text inside (( )) and {{ }} to inline notes…”, you can take advantage of this capability from a plain-text authoring environment as well.