Outputting a file during compile

I am writing an article in markdown, within Scrivener for Windows. I have the multimarkdown compilation figured out pretty well: it stitches the files together, with headings; turns the Scrivener fns into markdown fns (very nice feature); and I have a YAML header which it places at the top. But the one thing I’d also like it to do, is to add to the compile directory the bibtex file I keep within Scrivener (in a folder separate from the main Draft directory, where I also keep the YAML header etc). This is not an rtf file, but an actual bibtex file. When I click on it, it appears as an empty document with a blue link; and when I click on that link, it pops up in emacs (my system default) for editing, with the filename 64.bib.

How can I tell the compiler to include that file in the compile directory - unchanged, though I would like to specify a filename for the file.

As far as I know, I don’t think you can compile arbitrary file formats from the research folder out. Off the top of my head, how about linking to it as if it was an MMD image and see if you can trick Scrivener to export it.

This does seem like it would be a useful feature, allowing accessory files that are part of a project (thus managed by the awesome binder) to be compiled “as-is” in the true sense of copying them verbatim with a given name.

One trick that works on Mac, if you name the folder you compile to *_mmd then you can put any other files into folder and they will be left
alone on compile with scrivener not making any sub directory etc. That means you can put bibtex and metadata files here and scrivener leaves them alone, and script that calls MMD/Pandoc can just use the working path for all files…

Thanks very much. I experimented with using a Scrivener link, but couldn’t trick Scrivener into outputting the file. I’ll try keeping the material in the compile folder.

I notice that when one compiles through mmd to another format, a lot of auxiliary files are written to the compile directory. It would be great if that could be adapted to other formats too.

I am seeking a similar feature, since I’ve implemented a hybrid system using Scrivener 2, MMD, LaTeX, and Python scripts. I have a handful of non-image auxiliary files that would be helpful to be included in the binder and compiled to the target file folder.

Since my employer has not yet upgraded my computer to macOS Sierra, I haven’t had an opportunity to try out Scrivener 3. Is this a current or feasible future feature for Scrivener 3?

Thank you,


I have just been searching the user manual looking for this exact feature. In my case, I would like to keep css and tex files in the binder where I can easily tweek them, and have them exported alongside the main output file when I compile.

Seconding what nontroppo explained above, the intended mechanic here is to establish a folder within which you compile (as described in §21.5.1 of the user manual).

If you need this folder to be disposable or something you can carry around with the project to different machines, then consider the approach of storing it as a folder of files in your binder or as a zip file. When you are ready to compile, select the folder and hit Shift-Cmd-E to export it, then compile into it. It’s one small extra step for pretty niche case. In most cases:

  • Having a static compile folder will be perfectly acceptable. It can be cloud synced using the same technology as the project if that’s the concern.
  • Will not be changing from one compile to the next, and if it does, the sort of changes that would be made to it are unlikely to be of the sort that Scrivener is good at managing in the first place (i.e. if you drop a .tex file into the binder it is either an uneditable object or converted to RTF and thus loses its identity).

If you really wanted this automated, you could also use a pre-processing script that would copy the files from the Scrivener project into the compile folder (you would have to find the paths manually or parsing the project XML). Pandocomatic can then be configured to run pre- and post-processing tools automatically when you compiled in Scrivener…

Thank you nontroppo and AmberV for your workarounds. This should do it for now until I get going with Scrivener 3.