I’m using Scrivener to write my PhD thesis, which I am trying to get to final draft before Christmas. I have been using the 1.7-series Linux build quite happily to compile my thesis content to .tex via .mmd for several years. I have been including images with Scrivener Links, and each time I compiled the linked images would get exported into the same folder as the .tex file.
Last week, my Linux laptop died. I moved to Windows temporarily, and as only the 1.9-series was available I migrated my Scrivener repo to the new file format, and continued working. I have now reinstated my Linux system, and upgraded it to 1.9 so I can edit my upgraded thesis repo. But now when I compile my thesis (to .tex via .mmd), the images now are not compiled into the same folder - or at all. I have checked and the same behaviour is exhibited on Windows 1.9, which leads me to believe there was some change from 1.7 to 1.9 that is causing this, but I cannot find any mention of it in the changelogs. The only reason I didn’t notice this earlier was because I hadn’t added any new images in the intervening week, and the old copies for the section I was working on were still exported.
Does anyone know what is going on? I have hunted around in these forums and can’t find anything recent that appears to be relevant. I do have a copy of my thesis repo from before the upgrade, but it lacks the extensive work I have done since then, and migrating back is going to be slow. But if the alternative is manually exporting every image individually, that would be be incredibly painful, because I have hundreds of them carefully sorted in my Research tree…
Unfortunately, this is a bug in 1.9, which is ignoring the Scrivener links used for the images, so the text is compiling exactly as it appears in the editor, rather than updating the image name. If your linked text always uses the name of the image as it appears in the binder, you might be able to take a few extra steps to work around the bug for now, by exporting all the images into the folder alongside the compiled MMD document; that can be done simply by selecting the images in the binder and dragging them into the folder in File Explorer.
You’ll need to then use some RegEx replacements to add the file extensions for the images into the text in the compiled document. If all the images use the same format, e.g. they’re all PNGs, that’s pretty easily done. If it’s a mix, that won’t be so simple unless you have a nomenclature that would let you distinguish one from the other for your replacements. Otherwise you might need to do that part one by one, sorting the image files by type in File Explorer and then first using the replacements to add the most common extension to everything, and going back to then replace individual filenames with their correct extension.
For the RegEx, this works in Notepad++ to replace “![My test caption](Link To Graphic)” with “![My test caption](Link To Graphic.png)”; if you’re using a different program, the backreference might be written differently:
You’d want to use whatever your most common image extension is in place of the “png” in the replacement.
Whether that is easier than reverting to 1.8.6 for the time being, you’ll have to judge based on how your project is set up. I’m very sorry for the trouble, and I’m hopeful we’ll be able to get this fixed and have a build for you (and others working with images in MMD) available after the holidays.