Raw LaTeX, Scrivener 3 and compile process

Hello AmberV,
is there any chance to get this template another way?

I am using Scrivener on Windows and Scrivener 3 for Windows is still a little bit away and I am writing my master thesis now :wink:

Unfortunately that template is going to be of no use to you at all on Windows, sorry to say. It depends heavily upon 3.0 level features, not all of which are yet implemented in even the beta version of Windows.

Your best bet right now will be to use the MultiMarkdown based approach in your current version, or to simply compose LaTeX directly into the editor, as many have done, and compile to plain .txt, changing the extension.

Thank you for your quick answer. I’ll try it “the old way” again.

Hi there,

The General Non-Fiction (LaTeX) template in Scrivener 3 is super helpful. Thank you for that.

Would you be able to share the project for the version you used to create the Sample PDF embedded therein? I’m new to Scrivener and even that little bit more detail would be helpful.

And, do you have some directions on the basics? E.g.: I’m familiar with LaTeX but how do you create the equation that gets inserted into the binder? Then how do you add that within the text? Can you view/edit the LaTeX code for an equation from within Scrivener?

With thanks.

Alex.

Glad to hear you’re finding it useful!

The project comes with a few example document templates that are set up to work with compile out of the box. To create an equation item in the binder, use the Project ▸ New from Template ▸ submenu to select one of the equation options. The difference between the two is that the standard “Equation” type comes with a LaTeX label. You can reference the equation from elsewhere in the text by dragging the binder item into the editor, causing Scrivener to create a hyperlink to the equation. It will generate the autoref and match the label for you.

Not sure what you mean—but in case it isn’t clear, it’s just a text file in the binder. Granted, it’s a type of text item, set up to format the contents as an equation, but what you type into it will be printed into the output like all of the other text items you add to the binder. This is perhaps a little more straightforward than you may be thinking.

Put it this way, if you type “2 + 2 = 5” into an equation binder item, and it is between two chunks of text, then if you select those three items in the binder and view them as Scrivenings, you’d see:

[size=80][/size]

That’s what you see and what you work with while writing. The “Test” hyperlink by the way is pointing to the equation binder item (called “Test” in the binder). However when this is all compiled, you get:

[code]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.

\begin{equation} \label{scrivauto:7}
2 + 2 = 5
\end{equation}

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur see Test (\autoref{scrivauto:7}). Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.[/code]

The Section Layout assigned to “Equation” binder items will insert the stuff around the equation itself, including the automatic label, which will be used by the link to create an autoref.

Thank you for the quick reply. Together with having done some homework in the meantime, this answered almost everything for me.

One quick one though. How do I change how the “Test” hyperlink would output in the resulting compiled document?

E.g. For equations I’m getting Equation Title (Equation #) in the output, and for figures it’s Figure Title (Figure #). But I would want just Equation # and Figure #.

Also, the default numbering for the figures seems to start at Figure 11. Is there a way to adjust this, e.g. to start at Figure 1?

Thanks!

Alex.

If you check earlier in this thread, you will find discussion on how to modify the functioning and form of hyperlinks.

As to what you are attempting specifically, with the understanding that this will impact how all cross-references work, including section and chapter references, you could achieve what you are looking for with a bit of a LaTeX-based workaround. The problem is that Scrivener is always going to export the name of the item you link to—that’s just how it is programmed to work, and in keeping with how hyperlinks work in general, where the text that is linked is not meant to be wholly transformed or erased by the output engine. So we can’t actually get rid of the “Name of Equation” text, but thanks to LaTeX’s commenting syntaxing, we can certainly hide it.

Prefix:

%

Suffix:

[code]

\autoref{scrivauto:<$linkID>}[/code]

The removal of the parentheses from the default settings aside, the carriage return at the top of the suffix is most important. The result in LaTeX will be a bit ugly, which is why I would consider it a workaround, but it works. It places a comment indicator directly in front of the text of the hyperlink, then the carriage return that leads off the suffix starts a new line in the file, which won’t be commenting, leaving the autoref visible, as well as any subsequent text in the paragraph.

And of course if you do want the name of the thing you’re referencing, you would now have to type it in separately from the hyperlink like so, “Refer to Processing Photographs in Raw Format (Processing Photographs in Raw Format), for further information.”

I don’t know how to answer that without more context, but generally speaking that isn’t something Scrivener has anything to do with; it might be something odd in your preamble.