Outputting a file during compile

Ro
RobertG
Posts: 15
Joined: Fri May 26, 2017 3:30 am
Platform: Windows

Thu Aug 10, 2017 1:58 pm Post

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.

User avatar
nontroppo
Posts: 761
Joined: Mon Mar 05, 2007 5:22 pm
Platform: Mac
Location: Airstrip One

Thu Aug 10, 2017 2:32 pm Post

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 ![](file) 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...

Ro
RobertG
Posts: 15
Joined: Fri May 26, 2017 3:30 am
Platform: Windows

Fri Aug 11, 2017 1:26 pm Post

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.


nontroppo wrote: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 ![](file) 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...

cd
cdhutch
Posts: 1
Joined: Mon Dec 11, 2017 3:01 pm
Platform: Mac

Mon Dec 11, 2017 3:14 pm Post

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,

Craig

wh
whaynes
Posts: 19
Joined: Sat Dec 27, 2008 5:53 pm

Tue Dec 12, 2017 2:49 am Post

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.

User avatar
AmberV
Posts: 20613
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Tue Dec 12, 2017 11:45 am Post

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).
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

User avatar
nontroppo
Posts: 761
Joined: Mon Mar 05, 2007 5:22 pm
Platform: Mac
Location: Airstrip One

Mon Dec 18, 2017 4:03 am Post

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...