Problem with compiling to LaTeX

I cannot compile to LaTeX anymore. When I try without xslt post-processing, it freezes. I can cancel but it doesn’t save anything. When try with xslt post-processing I get the error from Scrivener:


The data could not be written at the specified location.
There was a problem writing to the path [mypath]. You may not have the necessary permissions to save to this location - please try saving to a different place."

There is another window giving me an error message. The window is named “MultiMarkdown Export Error” and the shown error:


/Applications/_DISS/Scrivener.app/Contents/Resources/MultiMarkdown/xslt-bin/mmd2tex-xslt: line 24: /usr/local/bin/multimarkdown: Operation not permitted
/Applications/_DISS/Scrivener.app/Contents/Resources/MultiMarkdown/xslt-bin/mmd2tex-xslt: line 29: /usr/local/bin/multimarkdown: Operation not permitted
/Applications/_DISS/Scrivener.app/Contents/Resources/MultiMarkdown/xslt-bin/mmd2tex-xslt: line 65: /usr/local/bin/multimarkdown: Operation not permitted
-:1: parser error : Document is empty

^
-:1: parser error : Start tag expected, ‘<’ not found

^
unable to parse -

I just installed Multimarkdown 5.01 - still I think this is not a MMD-relatated question: when I run MMD from Terminal it compiles without problems.

I checked the permissions of all the folders involved: the mmd- and xslt-folder, the folder where it should compile to… all permissions are set to 755.

Can you help?
Thnx,
don_rolfo

It sounds like it does not have permission to execute the MMD software. Are you using the Mac App Store version of Scrivener by chance? If so, give the direct-sale version a try (it will unlock itself automatically upon detection of a purchased MAS version, so if that works you could use that instead for as long as you want, though you might want to copy your settings over).

If you’d prefer to stick with what you have, or are already using the direct-sale version, what happens if you remove MMD from /usr/local/bin and cause Scrivener to use its built-in copy? I’m assuming that still works fine, but it’s worth a check.

By the way I’m using MMD 5.01 with Scrivener 2.7 (direct-sale), on OS X 10.11.2—and it’s all working fine on my system, so there should be a solution.

THANKS A LOT!!! I installed the direct-sale version and now the compile process is working again.

One thing I am missing after the change:
I defined Formatting Presets in Scrivener and they are not there, anymore. Can I somehow export them from the MAS-Version and import them here?

And it doesn’t recognize my license. At startup it asks me to enter my license… do I have to do something here?

Again… thanks a lot for your help!
Ralf

Ok, in the meanwhile I managed to copy the formatting presets over to the direct sales version.

The problem, that Scrivener doesn’t find any license and is counting down the days, remains. What to do?
Ralf

The “copy your settings over” link in my prior message addresses that. I would go through that just to make sure your backups are all together where you expect them to be.

As for the demo problem, as you heard that’s something we need to fix on the code side it seem. I’ll contact you directly with a solution.

Hello,

I have exactly the same problems. With my Appstore version I cannot compile to LaTex anymore and the direct installation asks me for the reference key despite I have both versions installed.

Is there any solution yet?

kind regards

To anyone else stumbling across this thread that needs help getting the direct-sale version unlocked after switching from the MAS version, please contact tech support directly, thanks!

Hey, it’s me again.

With your help I changed long ago from the Appstore- to the direct-sales-version of the programm. Thanks again!

But now even in this version the error message comes up as well:

“The data could not be written at the specified location.
There was a problem writing to the path [pathname]. You may not have the necessary permissions to save to this location - please try saving to a different place.”

It happened suddenly today, the last time I compiled was… probably yesterday. Then it still worked fine.

I also tried to save it to a different place… same error message.
Can you help?

Don Rolfo

Can you think of anything that might have changed about the Mac? Were updates to OS X run overnight, any installation changes that might be involved (updating MMD manually, etc.)?

I’d also do some cross-checks with other compile formats (not expecting them to look good, just to see if they work at all) and the plain MultiMarkdown option as well (which uses no processing other than what the compiler itself does).

Hi AmberV,

I thought about it again and the last compile must have been just half an hour before the error occured, so I in between I did not make any big changes at the system.

I checked the compiling into other formats:

RTF - works, but strangely exports html-code:

[code]

Einleitung

Die wirtschaftliche Bedeutung ist - wenn nicht das wichtigste - Argument […] in Deutschland anwendbar ist.

Ziel

[/code]

HTML works.

XML works.

LaTeX - same error. I saved it at the same place like the rtf/html files so it is not a permission problem. Maybe something that might be helpful: after the error message it shows still another window with another error message:

"Error parsing MultiMarkdown file
There was an Error parsing the generated MultiMarkdown output. The file could not be created. Please check the standard error output below:
-:3: parser error : Extra content at the end of the document

Die wirtschaftliche Bedeutung ist eins der wichtigsten Zukunftsthemen der Tag ^ unable to parse -"

Now when I read the error message about the end of the document I remember I changed one thing in between: in the compilation options there is an option called End-of-Text-Marker. Here I wrote “%Ends” and checked the box. Compiling ended with an error (but I’m not sure). After compiling once I took it out again but got the error messages since…

Okay it looks like you’re getting an MMD error, I would in that case compile to plain “MultiMarkdown” and then process that file with MultiMarkdown yourself instead of using Scrivener’s automation. If you get an error on the command-line as well then the problem is most likely related to content, rather than any issue with configuration. Opening the compiled file in a plain-text editor like TextWranger would also make it easier to spot any hidden characters that might be messing up MMD in RTF and LaTeX modes, too.

It might still be a setting in the compiler that is causing the content problem, but it’s going to be a lot easier to track down the source of it by handling the procedure in stages.

Thanks a lot for your fast answers. I didn’t have the time to compile the MMD directly yet (actually I first have to get into it…) but I found another way to be able to compile again. I remembered that the last time the errors were connected to the option “Use XSLT post-processing” in the compile menu. So I unchecked it and now I can compile again.
When I have the time I will try to compile it directly through command-line, though.
Ralf

Yeah, I was going to say that the problem appears to be a syntax error in a script, so if you are using XSLT, that may be the underlying problem. That error could also occur if for some reason the HTML file is not being formed properly in the first place. If that’s what is happening, there may be a clue in the original project, but it could also very well be an MMD bug since at this level of operation Scrivener’s contribution to the effort is to sit and wait for MMD to finish everything and return a .tex file.

But yeah, some command-line tests might help:* Compiling a plain MMD file and then attempting to convert it to HTML, then validating the HTML or eyeballing it to see if the content truncates prematurely.

  • Adding a “LaTeX XSLT” meta-data flag back into the meta-data block for the file you compiled, and then running it against the XSLT script found in ~/Library/Application Support/MultiMarkdown/bin.

That right there should test the three principle actions that occur when compiling to .tex in one shot with XSLT enabled. Scrivener creates a plain-text MMD file, MMD takes that and turns it into HTML, then it takes that and runs xsltproc with your provided .xslt file and from that you should finally get the .tex file. It is at that point that Scrivener steps back in, takes the file and renames it, putting it in the location you selected for compile, and assembling any other necessary pieces like images and .tex boilerplates.

Hi AmberV,

I have to reactivate this thread. I did not have the time for testing before but I was forced to have the time now because I need the XSLT-File for compiling my dissertation to LaTeX and alter the ~\citep replacement.
I installed MMD 5.4. After that I got the same error message when I checked the XSLT-option in compiling. So I went through your tests:

  • MMD to HTML works fine, there are no greater errors in the file when I check it
  • when I add a “LaTeX XSLT” meta-data flag into the meta-data block I get no error - and it writes
    \def\latexxslt{
    (null):}
    in the header.
    I actually don’t know what it technically means but maybe you do. Can you narrow it down where the error might occur?
    Thanx,
    Ralf

I don’t know, that’s probably some kind of MultiMarkdown error from the looks of it, you’d have to check on the MMD support board. I get a different result when I run a quick and simple test on the command-line:

[code]$ ~/Library/Application\ Support/MultiMarkdown/bin/mmd2tex-xslt
Title: Test
latex xslt: memoir

Quick test

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
[/code]

I hit Ctrl-D to terminate stdin input:

[code]\def\mytitle{Test}
\def\latexxslt{memoir}
\part{Quick test}
\label{quicktest}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

\end{document}
[/code]

I get the same result if I use the GUI to set up Scrivener to produce identical MMD source, but that’s no surprise.