How to write Latex equations in Scrivener

I see you are using a Mac, which likely means you are using the MacTeX distribution, which means you probably have LaTeXiT installed, which means if you paste in the above into Scrivener, select it and right-click on it, in the Services menu you should see some functions for typesetting the equation to an image. If not, here is where you can grab a copy of LaTeXiT, and here is a very recent discussion on tips for using it.

As far as general previewing goes, there isn’t anything built in with Scrivener, but it’s not too difficult to set up a workflow with the compile settings to do so:

  • For pure LaTeX writing, first check out the LaTeX project template in the Non-Fiction section. If you open Compile in that and double-click on the compile format it uses to edit it, the Processing pane has a basic automation script that is disabled by default that will, when enabled, cause the project to compile directly to PDF.
  • When using Markdown as a “front end”, you should see a Compile for option to compile directly to PDF which works well for simple setups where you don’t need additional scripts to run. If you do, then that is what the Processing pane is for, available to “MultiMarkdown” as a file type.

Either way, you can drop the compiled PDF into your Project Bookmarks list and thus easily load that into one of the split editors for proofing. What I do is compile a quick PDF, refresh the view, and continue proofing. As I say it’s not quite as seamless as something that has a built-in workflow, but it’s honestly not a lot of overhead compared to even dedicated tools like TeXShop. Since each Format can have its own processing workflow set up you can even switch targets on the fly, like having a proofing design that highlights hyperlinks, has margin notes and so on, vs a production output.

Marked 2 does not display this as equation, but maybe I should tweek it too?

Yeah, that would be a matter of consulting its documentation. I’m not sure if it supports live rendering of LaTeX equation syntax.

2 Likes