For the Love of God, somebody figure out Equations with Scrivener

It’s not unusual for open source software to have extremely limited help.

I’ve found LaTeXiT fairly intuitive, but my equation needs are pretty simple.

It’s intuitive enough after finding useful Help. I used LaTeX briefly in 1988-89, but I ended up finishing my dissertation in 1993 with Word and MathType. That file doesn’t work at all today. I’d have to typeset it from scratch. Who knows, I could be insane enough to do that. (Not likely, though.)

Ouch. Your assumptions about how to add an equation to a Scrivener document based on their “General Non-Fiction (LaTeX)” template don’t seem to be as described in their “About this Template” concise instructions, screen shotted here. If this doesn’t meet your needs, find another way using Scrivener or not.

As for how to set up LaTeXiT to work with text editing Mac-wide, including Scrivener, this post has some tips. Do note that this post was written for someone who was composing a .tex file in Scrivener, and so everything below the Better Compile Output heading should be ignored. That specifically describes a technique of using LaTeXiT to give an author a visual copy of an equation in the editor that doesn’t end up in the output.

As @kewms notes above, LaTeXiT—as a simple utility for embedding typeset equations into documents in a way that the equation can be edited later—is something that works with almost every text editor on the Mac. Anything that can store an image in the text can work with it, and it is very simple to use. With a little setup, putting some keyboard shortcuts on Services, it can also be very efficient; almost as much so as MathType was.

It makes a picture of an equation—exactly what MathType did, only unlike MathType the typesetting is very good—and a picture of an equation can be used in almost any workflow, from ePub to PDF to Markdown to ODT. That is why there are no instructions for using LaTeXiT with the template for people writing using LaTeX. LaTeXiT, it is safe to say, has a goal of bringing the quality of LaTeX equations to people not writing in that system. :slight_smile:

@asteckley : Scrivener developers – I know it’s not your highest priority, but hope you can get to actually solving this deficiency in what is otherwise a GREAT tool.

So to be clear, we don’t really consider there to be a solvable deficiency here. Adding an embedded image is one hotkey away. Editing it is another hotkey away. There would only be marginal gains in making that any more seamless, but really that’s not the point. The point is that we would not want to stop making writing software for the years it would take to reinvent this stuff—again solely for the purpose of a marginal improvement in workflow. That just doesn’t make any sense, and we’re never going to reach the output quality of LaTeX anyway.

2 Likes

This is not what the workflow suggests, as @rms has helpfully detailed above. For the LaTeX template and for any of the markdown workflows, the text remains text, no intermediate images are needed at all. It is the job of the downstream layout tool (either TeX or HTML) to convert the text-based equations to their visual rendered form. This workflow is simple and requires no fiddling.

I think your wishlist item regards clickable “links” to directly open an equation from the Scrivener editor in some sort of GUI, and this is a valid request, though I suspect, given how all it is saving is a couple of extra keypresses, the Scrivener developers would not be inclined to integrate this…

3 Likes

@kewms I think you are misunderstanding our MathType “integration.” MathType was always an external tool as well.

I think you are misunderstanding both “integration” and “external tool”. MathType was an external application that was integrated into Scrivener (so that it did not need to be an external tool). An external tool is one that requires the user to switch between applications and manually transfer data between them.

@AmberV : Adding an embedded image is one hotkey away. Editing it is another hotkey away. There would only be marginal gains in making that any more seamless

You apparently do not have any experience in actually using this Scrivener-LatexIt solution except for perhaps simple insertions of math expression. In no way do any of the solutions suggested through this post compare to the previous integration that was provided with MathType!

LaTex is a very powerful, and really not too difficult to learn, for composing mathematical documents (and formatting entire documents), but it is not practical to compose and revise equations by looking at raw LaTex markup. (I know because I have authored large mathematical documents using it.) One needs to render it continually to see how it appears and how it appears in the context of the document that you are putting it into. It is possible to do that, but it is an entirely different process than what Scrivener is, otherwise, so powerful in facilitating.

The current solutions here that don’t require one to continually imagine what the rendered LaTex will look like as one works on it, instead require iteratively switching to an external editor (whether it is LatexIt or several others which are actually much better) to compose the math, and then exporting a rendered image (which is no longer editable) so that one can then import that into Scrivener. For this you must also maintain in an organized way all the math expressions that you require for your document so that you can return to each one for revising without having to compose it all over again from scratch. (And FormulaSheet seems to be a better external editor since it helps to do some of that maintenance as well.)

The LaTexIT solution as described in the external post and using the Scrivener Template seems to be slightly better (although I have had no luck in reproducing anything as described in the posts or the Scrivener template instructions). But it still in no way compares to the Scrivener-MathType integration.

@AmberV: The point is that we would not want to stop making writing software for the years it would take to reinvent this stuff—again solely for the purpose of a marginal improvement in workflow. That just doesn’t make any sense, and we’re never going to reach the output quality of LaTeX anyway.

Now you’re just being silly! First it is not just a marginal improvement. It is a huge impact on the creative process to fiddle around with images or to read raw LaTex markup.
Second, I have architected and developed software systems and products for almost almost 40 years.
MathType was not “reinvented” when it was integrated into Scrivener. MathType just happened to provide a GUI editor with an API that allowed it to be integrated into the Scrivener application (and not with “years” of development time.) Another such equation editor would have to be employed (whether it is based on LaTex or something else) and then integrated into Scrivener in the same way – including it in the menu system and facilitating the exchange into and out of the Scrivener editor window.

Now all that being said, we all understand that a math editing feature is not the highest priority for the Scrivener application. Scrivener’s great strength and primary purpose is to assist in the process of writing novels, screenplays, and such, and that process is pretty different than what is required for writing technical documents with a lot of math content. The overlap of users wanting to do these is probably pretty small.

Nevertheless, Scrivener had a perfectly good solution when MathType was used. The loss of it is a (rare) deficiency with the Scrivener product. But not Scrivener’s fault either. Unfortunately MathType seems to have chosen to no longer support their product on Mac (probably related to the switch to 64bit from 32bit OS), and that decision is is a signal that that product is headed for obsolescence. So dropping it from one’s product is a good move. But it does mean that Scrivener will have to find an alternative product with GUI editing capabilities that that can be integrated into the application and I hope there is enough request for an integrated solution that they look into doing so.

1 Like

What are these better solutions? Please share.

1 Like

I have used TexStudio in the past as it is a full featured editor for Tex/LaTex docs.
But more recently, I just use Google Docs with the MathType extension installed. With that approach, by the way, you can simply cut and paste the math expression from the Google Doc directly into Scrivener. But it is still an image, so you cannot revise it within Scrivener – you have to go back to the Google Doc and edit there if you maintained it, or recreate it afresh if you did not.
(Even without the MathType extension, Google Docs’ native Equation editor is more user friendly than LaTexIt, but it won’t support simple cut-and-paste; you have to capture and image and drop the image manually into Scrivener.)

As LaTex GUI editors go, LaTexIt is probably the least user friendly that I have seen… but that’s not unusual for a free open source tool though.

If you are willing to use Markdown, then you can use the excellent app Marked 2 which supports visualising Scrivener’s documents “live”. This renders to HTML and allows TeX maths to be visualised using MathJaX, every edit in Scrivener triggers a [re]rendering so you can see your equations in the preview window.

4 Likes

@notroppo That sounds like a pretty good work-around solution! Thanks. Ill try it out.

Could you give more information how to set this up and the workflow. It would be appreciated.

@nontroppo I agree with @Orpheus …not seeing how to achieve the scrivener rendering as you show in your screen shot. If you can provide some setup info on this, it would be much appreciated.

I don’t know the “best” (as I haven’t tested more than one), and I don’t know what the “cool” kids use. I use Texmaker and have done so for years.

Using the Scrivener template means I don’t have to mess with Texmaker or any other LaTeX tool/editor (GUI or not) other than to compile the TEX file into PDF. Scrivener occupies about 95% of my time, and Texmaker 2% (or less), and 3% for Preview to see the result. That’s the point of Scrivener.

Edit: Forgot. I do spent some time outside Scrivener making/editing graphics. As my tools for that are “too many”, all are part of the Mac ecosystem and all is well.

I mostly agree with you, but equations specifically are an edge case where layout and content are very closely intertwined.

Change the “but” to “and” and I completely agree!! :wink:

I think I did equations once or twice, and like any other app in the Mac EcoSystem, the equation editor sits in a window on the right upper and Scrivener on the left half. Don’t see the big deal. But I accept that others see a big deal.

Edit: If nothing else, creating/editing the equation in the LaTeXiT edit (which is easy), while doing so Scrivener will take the opportunity to do an automatic “save” due to more than 2-seconds of inactivity (default). Good.

I use Marked 2: https://marked2app.com — direct download. I write all my work in markdown, though in my main workflow I use Scrivener styles to “inject” markdown markup it doesn’t work natively for Marked 2 so for anything you want to visualise you should stick to actual markup for equations (as my screenshot shows). I open the same Scrivener project in Marked 2 (it supports the scrivener project format), and it reads the project and renders the contents.

Marked 2 uses a MultiMarkDown renderer by default and you need to use Marked 2 preferences to “enable” MathJaX (or KaTeX which is faster but with less features), then refresh and equations get rendered.

I personally set up Marked 2 to use pandoc as a custom preprocessor, but it is not necessary for maths display.

1 Like

I’d been hoping there was something like this (i.e. Marked 2), and now I’ve found it. This is so awesome. Thanks!!