Generic Nonfiction (Latex) compile behaviour

hh
hhi
Posts: 1
Joined: Sun Jun 30, 2019 10:43 am
Platform: Mac

Sun Jun 30, 2019 12:31 pm Post

Preparing a scientific document I decided to give the General nonfiction Latex a try.
But I soon stumble upon the nasty behaviour that as soon as I refer to images in the document, which leads to multiple file output, Scrivener then introduces the nasty habit to create an superfluous compile folder.

I call it nasty because in the first place I don't want an extra subdir to be created since I have created a designated directory already for the sole purpose to bundle all files including pre-generated latex class files in it.
Furthermore, the folder being created inherits the .tex extension, under MacOs this leads to a package folder structure. From the point of view of Finder and applications the directory resembles a single file, which as soon as I want to postprocess the resulting file, it leads to error that the so-called file cannot be edited because of readonly file permissions.

Compile as .txt efficiently is simply useless for me this way. My suggestion would be that compile folder creation should be an explicit choice. MMD->Latex neighter is an option, since it interprets my latex and rendering it all with backslashes.

User avatar
AmberV
Posts: 24267
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Mon Jul 01, 2019 11:03 am Post

I call it nasty because in the first place I don’t want an extra subdir to be created since I have created a designated directory already for the sole purpose to bundle all files including pre-generated latex class files in it.


That is unavoidable Scrivener behaviour (the template cannot make such decisions), as in most cases that will be the desirable outcome. It would instead be “nasty” I think to spray thousands of files into the designated output folder when that may not be what you expect. :) A subfolder keeps things tidy and easy to delete in case of mistakes. You’ll get the same exact thing for example if you compile to HTML.

Are you handy with the shell? If so, open up the compile Format by double-clicking on it in the compile overview screen, and visit the Processing pane. If you enable post-processing and click the Edit Script button, you’ll see I’ve supplied a simple latexmk command as an example—but using that you could control just about everything about the compile process, including making it so that the compile target is a specific folder on your system rather than wherever you select after pressing the Compile button.

Furthermore, the folder being created inherits the .tex extension, under MacOs this leads to a package folder structure.


That’s not a Mac behaviour, or at least I have no such result on my system. You must have some tool installed that is declaring “.tex” folders to be treated as packages that for some reason.

MMD->Latex neighter is an option, since it interprets my latex and rendering it all with backslashes.


Well that’s more of a MultiMarkdown question than a Scrivener one, per se, but what you’re looking for is:

Code: Select all

`\raw{syntax}`{=latex}


The user manual project is a demonstration of MMD → LaTeX, which makes heavy use of raw LaTeX syntax where needed. I use a combination of styles and section layouts to generate the backtick syntax shown above, but this is Markdown, you can just type it into the editor, too.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

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

Mon Jul 01, 2019 11:38 am Post

You could also just make sure your compile folder name has -mmd at the end, e.g. "compile-mmd" and then multiple images are all compiled into the same folder level without removing any existing files like latex templates etc. (§21.5.1 user manual).

User avatar
AmberV
Posts: 24267
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Mon Jul 01, 2019 11:47 am Post

That is an approach one can take with the Markdown-based formats, but plain-text, which the native LaTeX template uses, does not observe that convention.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

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

Tue Jul 02, 2019 12:45 am Post

Ah, :oops: OK! So if the OP can solve the bundle problem with foldername.tex, that would be the simplest solution?

User avatar
AmberV
Posts: 24267
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Tue Jul 02, 2019 10:29 am Post

The simplest, yes (and to the OP, check TeXStudio—I think I recall that being the culprit). The not simplest but most efficient would be to build a deployment script into the post-processing pane that merges compiled updates with an established master LaTeX folder, and then cleans up the compile folder (potentially trashing the whole thing).
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

Al
Almidec
Posts: 2
Joined: Mon Jul 08, 2019 6:51 pm
Platform: iOS

Fri Jul 31, 2020 9:24 pm Post

I am using the iPad and the Windows versions. Where do I find the Generic Nonfiction Latex template?

User avatar
AmberV
Posts: 24267
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Sat Aug 01, 2020 1:02 pm Post

On Windows, if you haven’t already, you will need to upgrade to the v3 release candidate to work with the template (you will find it in the Non-Fiction template category). There are a few finishing touches that need to be done to the template, but last I checked, it works well at this point.

Once you do have a project built, using it, you could work with it on the iPad, just for the writing part of course. The iOS version of Scrivener, with the exception of the basic capability of exporting text into a file, does not have 99% of the features necessary to make this template work!
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles