I have been successfully compiling to LaTex via MMD for a little while now, and just today am now having problems. Usually, it exports into a folder, and inside the folder is my .tex document and the images. I add my own footer and header, and we’re off to the races. Today, it started only exporting a .tex file, but which I can’t even open with my tex editor (TexShop). This file is tiny (2.1mb) No images, no folder with everything in it, just a file I can’t open.

Some related things of interest:

  1. Right before this, I decided to export my scrivener file as a template, since I liked all the settings I have in it for Latex export. Then the crazy started happening, both on the original document, and on the new document I was trying to make from it in the template.

  2. I’m all updated on everything, working on a mac.

  3. When Scrivener finishes compiling, it sits with the Compile window open, and the progress bar all the way full. I’ve never really paid attention before, but it seems that the compile window always closed when it was finished. Could it be that Scrivener isn’t actually finished with the compile?

please help. I have a report due to tomorrow, and at the moment I am not able to produce it.



I tried using a back up from a couple days ago, same problem. But if I start a new document, it works fine. If i start a new document from the template I created, and compile, I get the same problem.

This is maddening. My document has tons of internal scrivener links in it, so I am really not interested in moving everything over to a new document…that breaks all the links. And there are hundreds in here. Please, help!!!

Some more updates:

I’ve tried other compiling options besides MMD->LaTex. Here’s what works:

pdf: works
rtf word compatible: works
rtf w attachments: works
word: works
plain txt: works
multimarkdown: compiles only some images, compile window doesn’t go away, but text file is created w text in it.
mmd->rtf: works, no images, not sure if there’s supposed to be or not. But compile window closes.
mmd->html: works for text and some images, but not all. compile window does not close.
mmd-flat xml: no idea what this is, can’t open the file it produces. compile window does not close. again, only a few images.

Alright, that’s what I’ve got. I’ve tried just about everything here…clearly there is a pattern with the mmd transfer that is causing a problem.

Are you using the Mac App Store version of Scrivener? If so, Apple yanked support for sandboxed applications using external utilities a while back. It could be you’ve recently applied an update that included that unfortunate decision.

If that is the problem, it is pretty easy to solve. Since the issue is that Scrivener is trying to execute a utility from /usr/local/bin, remove the MultiMarkdown installation from that location, and Scrivener will use its own built-in copy of MMD instead.

That doesn’t entirely explain why plain MultiMarkdown doesn’t seem to be working right. I can’t really say what is going on there, that isn’t a typical bug or problem and would require a little troubleshooting.

The best way to do that is to enable error reporting: check the internal alerts option at the bottom of the General preferences pane, and then load Console to the side. Now try compiling to MMD plain and paste any error messages you get in a response.

By the way if you haven’t done so, definitely restart Scrivener.

Thank you so much for responding!!! I am pretty confident I’m using a non-app store Scrivener…I have restarted the app many times, restarted my machine, actually redownloaded Scrivener from your website just in case, and tried running backups of this particular file from a few days ago (when I know I ran a successful compile). I went ahead and enabled error reporting. Here is the kickback on the MMD->LaTex compile. The one for MMD Plain is below that. Thank you so much for your help!!

Exception Name: NSInvalidArgumentException

Exception Reason: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil

0 CoreFoundation 0x9bf31f79 __raiseError + 201
1 libobjc.A.dylib 0x9d313fd1 objc_exception_throw + 276
2 CoreFoundation 0x9bdb94b9 -[__NSArrayM insertObject:atIndex:] + 889
3 CoreFoundation 0x9bdb9121 -[__NSArrayM addObject:] + 65
4 Scrivener 0x001e09a6 Scrivener + 1964454
5 Scrivener 0x001e17fa Scrivener + 1968122
6 Scrivener 0x001e0b60 Scrivener + 1964896
7 Scrivener 0x001a3432 Scrivener + 1713202
8 Scrivener 0x001a200d Scrivener + 1708045
9 Scrivener 0x001a131d Scrivener + 1704733
10 libobjc.A.dylib 0x9d3113ee -[NSObject performSelector:withObject:] + 70
11 AppKit 0x9867a235 __36-[NSApplication sendAction:to:from:]_block_invoke + 51
12 libsystem_trace.dylib 0x94ad03c1 _os_activity_initiate + 85
13 AppKit 0x9867a156 -[NSApplication sendAction:to:from:] + 610
14 AppKit 0x98690a85 -[NSControl sendAction:to:] + 102
15 AppKit 0x98690979 __26-[NSCell _sendActionFrom:]_block_invoke + 176
16 libsystem_trace.dylib 0x94ad03c1 _os_activity_initiate + 85
17 AppKit 0x986908a8 -[NSCell _sendActionFrom:] + 161
18 AppKit 0x9892fed9 __48-[NSCell trackMouse:inRect:ofView:untilMouseUp:]_block_invoke1010 + 43
19 libsystem_trace.dylib 0x94ad03c1 _os_activity_initiate + 85
20 AppKit 0x9868ec55 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2744
21 AppKit 0x986e842f -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 809
22 AppKit 0x9868d284 -[NSControl mouseDown:] + 693
23 AppKit 0x98ce05b7 -[NSWindow _handleMouseDownEvent:isDelayedEvent:] + 6266
24 AppKit 0x98ce20ea -[NSWindow _reallySendEvent:isDelayedEvent:] + 2303
25 AppKit 0x98585927 -[NSWindow sendEvent:] + 567
26 AppKit 0x98581942 -[NSApplication sendEvent:] + 2919
27 Scrivener 0x00051a3a Scrivener + 330298
28 AppKit 0x984ac18f -[NSApplication run] + 1159
29 AppKit 0x98427025 NSApplicationMain + 1630
30 Scrivener 0x000027b5 Scrivener + 6069

Exception Name: NSInvalidArgumentException

Exception Reason: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil

0 CoreFoundation 0x9bf31f79 __raiseError + 201
1 libobjc.A.dylib 0x9d313fd1 objc_exception_throw + 276
2 CoreFoundation 0x9bdb94b9 -[__NSArrayM insertObject:atIndex:] + 889
3 CoreFoundation 0x9bdb9121 -[__NSArrayM addObject:] + 65
4 Scrivener 0x001df90a Scrivener + 1960202
5 Scrivener 0x001a3432 Scrivener + 1713202
6 Scrivener 0x001a200d Scrivener + 1708045
7 Scrivener 0x001a131d Scrivener + 1704733
8 libobjc.A.dylib 0x9d3113ee -[NSObject performSelector:withObject:] + 70
9 AppKit 0x9867a235 __36-[NSApplication sendAction:to:from:]_block_invoke + 51
10 libsystem_trace.dylib 0x94ad03c1 _os_activity_initiate + 85
11 AppKit 0x9867a156 -[NSApplication sendAction:to:from:] + 610
12 AppKit 0x98690a85 -[NSControl sendAction:to:] + 102
13 AppKit 0x98690979 __26-[NSCell _sendActionFrom:]_block_invoke + 176
14 libsystem_trace.dylib 0x94ad03c1 _os_activity_initiate + 85
15 AppKit 0x986908a8 -[NSCell _sendActionFrom:] + 161
16 AppKit 0x9892fed9 __48-[NSCell trackMouse:inRect:ofView:untilMouseUp:]_block_invoke1010 + 43
17 libsystem_trace.dylib 0x94ad03c1 _os_activity_initiate + 85
18 AppKit 0x9868ec55 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2744
19 AppKit 0x986e842f -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 809
20 AppKit 0x9868d284 -[NSControl mouseDown:] + 693
21 AppKit 0x98ce05b7 -[NSWindow _handleMouseDownEvent:isDelayedEvent:] + 6266
22 AppKit 0x98ce20ea -[NSWindow _reallySendEvent:isDelayedEvent:] + 2303
23 AppKit 0x98585927 -[NSWindow sendEvent:] + 567
24 AppKit 0x98581942 -[NSApplication sendEvent:] + 2919
25 Scrivener 0x00051a3a Scrivener + 330298
26 AppKit 0x984ac18f -[NSApplication run] + 1159
27 AppKit 0x98427025 NSApplicationMain + 1630
28 Scrivener 0x000027b5 Scrivener + 6069

Also worth noting that it appears to only be this particular Scrivener file I am having the issue with. I set up a previous report, just as big, same idea, and with the same latex settings, and it worked just fine. So, its something specific to this file. I assume that if it was an issue with the App itself, or its ability to talk to MMD, then it would effect all compiles on all files.


With this in mind, there is a possible work around, but I’d still need your help to make it possible. I could start a new document, and drag all of the files and stuff into it. The problem here is that this appears to kill all of the Scrivener links, which are numerous throughout the document, and kind of critical to the whole system. It would take me a very long time to go through and re-link everything…is there any way to preserve these links when moving content from one document to another? I tried importing the scrivener document into a new one, and that doesn’t seem to work.


Okay, the first thing I would take a look at is the plain MultiMarkdown text file output in an editor like TextWranger, which has a handy “Zap gremlins” command that will look for oddball characters and convert them to something else you can then search for and track down in the original project. I suggest that route because the sorts of characters (like a NULL control) are invisible in the regular text engine. Stuff like that might also mess up MultiMarkdown.

You’ve been mentioning moving the project over to a different .scriv shell though, does that mean if you drag all of your files from one draft over to another, it compiles fine (without the images in the project it should just ignore them)? That would pretty much rule out the text gremlin component, which is why I ask.

If switching to a different project works, I would more immediately suspect something is awry with the compile settings—and a problem like that can usually be solved by fixing the original project. Just set the “format as” to “original”, switch back to .tex, and see if that works with vanilla settings. If that’s fine, then you could go through and recreate your settings from that base (note you might want to save your current compile settings to a format-as preset before resetting them).

But if a project swap is the only thing that works right now, I can’t really suggest a better route other than File/Import/Scrivener Project…. That won’t retain internal linking either however.

thanks for getting back to me. I downloaded TextWrangler. I had to do a compile in plain text…its worth mentioning here that I have over 100 text docs in this report…large appendices that I need to reference throughout (why I’m dreading losing all the links)…So, i did a compile in plain text of the whole document and put it into Text Wrangler. Only came up with about 10 gremlins, none of them NULL characters, pretty much all quotation marks. Did a MMD>latex compile, and still no dice.

As for resetting the compile settings, that does not work within the original document. I can compile if I export it all into a new scriv file, but again, lose all the links. I’m beginning to think my weekend will be redoing a lot of Scrivener links.

thanks again for all your help! Let me know if you have any other ideas!