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

In older versions, MathType could be integrated with Scrivener on MacOS.
Now it appears that MathType owner has decided to become obsolete by no longer supporting Mac OS versions and so Scrivener cannot use MathType.
But surely, Scrivener it too good an application not to come up with a good solution. I’ve been waiting now a few years for them to do so.
Klunky cut and past methods using other equation tools… really, that’s the best we can hope for here??

If there is a solution, please please post it where it can be found. (Better yet – update the outdated video that still talks about using MathType.)

We are currently recommending LaTeXiT, which works similarly to MathType.

Hi asteckley,

Several years ago, I was faced with a similar dilemma as a Scrivener user when I learned that MathType could NOT be integrated with Scrivener on MacOS. My decision at that time was to go with LaTeX as a way to incorporate equations. I’ve never looked back.

That said, it has taken me years to understand LaTeX, and I am constantly using this forum and StackExchange et al. for tips on how to implement my ideas. Adapting LaTeX to Scrivener quite frankly provides incredible tools for Scrivener, but it is NOT, repeat NOT for the faint of heart.

I offer this as I noticed that your last posting was “8 years ago”. That is a long time to wait for any solution. If it means, however, that you might possibly have the time to devote to learning another language, perhaps LaTeX could be a solution. It all depends on how much you want to include equations in your Scrivener project.

The irony for me was that I adopted and learned LaTeX for the equations that I need to create within my Scrivener project, but the benefit of having done so far outweighed my wildest imagination as to what I could do with Scrivener+LaTeX. Although there are times when I pull my hair out trying to figure out what may be preventing my project from compiling, my project has grown FAR beyond my wildest imagination, to the point that I simply cannot imagine even attempting what I have accomplished without LaTeX.

As for equations, below are two screen shots from my “List of equations” that are scattered throughout my project, but are also automatically compiled in a list by my LaTeX code. I have close to 80 equations (and growing) in total scattered throughout my project.

In the body of my project document, beneath each equation is a short description for each equation. The equations are numbered automatically, as any references to the equations can be created and generated automatically when compiling the LaTeX code. Nice!

FYI, at my last count, LaTeX currently has almost 7,000 packages available as part of the basic LaTeX installation to assist with an amazing array of writing objectives. I’ve only incorporated a couple hundred packages in my current project, but I’m always on the hunt for how others have exercised their creative skillsets to address challenges that I haven’t even dreamed of.

The best part of having invested so much time and energy in building equations, along with a library of code to draw on, is that working with LaTeX is becoming less of an issue when designing what and how to capture and write an idea into my project, leaving me with more cranial bandwidth to focus on the subject matter.

One last point I should make is that Scrivener is a perfect compliment as a front-end for working with LaTeX. I also cannot imagine developing my project without the framework that Scrivener provides. The combination of Scrivener+LaTeX brings together two completely complementary worlds that alone (with one but not the other) I simply would not have been able to accomplish anywhere near what I have done. Although not many Scriveners work with LaTeX, there are several in the community that can help get you started, if you decide to do so. There is also a wonderful, pre-packaged Scrivener+LaTeX project file available to help you get started.

Thanks for reading.

HTH,
scrive
:thinking:

P.S. In case you are wondering, the cm measurement rulers bracketing the outline of the printed pages are there to assist with the layout of the document (one of many nice benefits of using LaTeX), and would be removed prior to any publication.

3 Likes

Note that LaTeXiT specifically does not require a full-on dive into the wilds of LaTeX. Like MathType, it provides palettes to create equations visually and can render the result as an image.

Thanks for the info. Ive actually used LaTex extensively and wrote my phd thesis using it over 30 years ago. Its very powerful and i actually prefer compising equations with it. BUT I havent seen a streamlined way of integrating it with Scrivener. Last I resorted to it several years ago, it required some klunky cut and paste…basically crearing the equation externally, producing an image, and then pasting it into Scrivener. This meant you really couldn’t edit and refine…you had to go recreate the equation again and resnapshot it and repaste…really not “integrated” at all.
Is there a better way now?

There is a LaTeX template provided with Scrivener which works “out of the box”. They also give very clear and concise instructions how to use. I use it for most of what i write now, and of course have made a few tweaks in the Scrivener compile settings over the years. I have not used equations but like the format, TOC, labels on figures, and indexing.

1 Like

Thats great to know. Thanks!

There are also some great online formula editors that can save and organise all your equations. I highly recommend this one, it is great:

I use Scrivener > Markdown > Pandoc with my formulas in text format (no need to render images just use TeX text). I use Scrivener styles for both in-line and block equations, that will add the pandoc markup for equations at compile time. Pandoc can then convert from TeX-Maths to multiple maths outputs, so that in DOCX you get UnicodeMath equations, LibreOffice is (IIRC) MathML, in HTML you get multiple JS engines (mathjax / katex gladtex etc.) or built-in variants (MathML), and TeX maths passes through untouched to LaTeX. This workflow is very flexible…

I realize that I am in unusual situation, one with options and priorities that has led me to proceed down a path that others do not see, but my approach has been heavily influenced by my long term objective.

The story I’d like to tell is a complex one. I knew from the start that I’d have to distill through a seemingly infinite set of data, to refine the issue(s) down to just a few bullet points, or possibly a single point. So after decades of research and considerable years working in the industry, I knew I was in it for the long haul, possibly for the remainder of my years.

To that end, I look at my Scrivener+LaTeX project as itself a database, a collection of code that, after far more time and effort than I cold ever justify to anyone else, I could use as a template for future coding, and a base for yet building and extending to a level I could not even have imagined when I started.

I considered the option of building side Scrivener+LaTeX projects as separate entities to be compiled separately from my main project file, providing image files to then be cut-and-pasted into the main project. But I gave that up on that approach once I realized that it would likely create a version maintenance issue, that for me, with my poor short term memory, would become untenable.

If requested, I’d be open to sharing my code with others here, running the risk of knowing that, given my coding history, my coding style would likely not make sense to others. For example, I use Scrivener styles (similar to nontroppo) in ways that the Scrivener developers have stated is not what they had envisioned.

I use my implementation of Scrivener styles countless times every time I open Scrivener, without which my raw Scrivener+LaTeX code would essentially be unreadable. So any code I might provide to others that incorporates my particular inculcation of Scrivener styles would have to adopt my set of Scrivener styles to compile properly.

For me, such is where I am now with Scrivener+LaTeX.

YMMV,
scrive
:thinking:

P.S. Thank you nontroppo for the link to the Formula Sheet. I look forward to researching what exists in their formulas database.

2 Likes

Hi rms,

Thank you for detailing the General Non-Fiction (LaTex) package for those that might be interested in developing a Scrivener+LaTeX project. I was able to jump-start into Scrivener+LaTeX using the General Non-Fiction (LaTex) package, something that I would not have had a clue of how or what to do to get started with Scrivener+LaTeX.

I have to thank whom ever assembled the General Non-Fiction (LaTex) package together. Without it, I may not have even considered using Scrivener for my particular project. I may have defaulted to using Word (gasp!) with not even a fraction of the capabilities that I now have using Scrivener+LaTeX.

Thanks again!
scrive
:thinking:

1 Like

For most all my writing projects I use this template (with my small tweaks). I really like the TOC and indexing which impresses my clients. No equations though! not yet at least. :wink:

1 Like

Thank you everyone for your replies and tips.
Unfortunately it has confirmed my disappointment with the lack of any decent integration of equation editing with Scrivener.
The Scrivener Latex template seems, if I understand it correctly, to be good if you are trying to essentially compose an entire document using Latex and just want to use Scrivener as a container and organizer of your Latex components-- which is fine if LaTex is your primary target.
But what I am needing is the ability to compose a document in Scrivener, but include mathematical expressions and equations. Editing those mathematical pieces directly in LaTex markup is fine (since I am very familiar with the LaTex markups), but stepping out to some external LaTex editor and then re-exporting an image of the rendered expression and then importing that as an image into Scrivener (and then doing that all over again every time you need to edit the expression) is just plain klunky and inconvenient.
That being said, the least inconvenient solution here seems to be the use or FormulaSheet. It too requires the klunky image export/import process, but at least it provides a convenient organizer to maintain the various LaTex pieces.
Thanks again everyone for your input though.

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.

1 Like

Did you see this recommendation?

Yes. But they are recommending it as an external tool (therefore with the problems I outlined.)
Hopefully they will integrate it in the same way they had integrated MathType before.

Thanks.

I think you are misunderstanding our MathType “integration.” MathType was always an external tool as well. The “Insert MathType Equation” menu command worked similarly to the current “Insert Bibliography/Citations” command, which launches the third party citation manager of your choice.

While it’s possible to use LaTeXiT to create an equation image, you can also use it to generate raw LaTeX markup.

An end-to-end example would help a lot, but I’m assuming we’d write LaTeX code in Scrivener, compile to .txt using the built-in LaTeX format, open in LaTeXiT, and export from there. Correct?

LaTeXiT is a standalone equation markup generator. So you have two possibilities.

If you prefer Word or PDF output, use LaTeXiT’s palettes to create the equation you want, then add it to Scrivener as an image. When I work this way, I put the raw LaTeX markup in a comment or document note to facilitate editing if needed.

If you are using a Markdown/LaTeX workflow, use LaTeXiT to create the equation you want, then drop the resulting LaTeX markup directly into Scrivener. Scrivener can pass it directly through to your LaTeX post-processor. (See Section 24.5.3 in the manual, which explains how to use Styles to protect this sort of markup from the Compile command.)

Katherine

Edit:
More information about LaTeXiT here: LaTeXiT

It is also part of the MacTeX download package, which you can find here:
https://www.tug.org/mactex/

1 Like

Sample LaTeXiT window. Both the image (top) and the markup (bottom) are copy/paste-able.

1 Like

After installing LaTeXiT and MacTex, I’m not a bit surprised that clicking on Help in LaTeXiT does nothing. No help at all. Maybe I have to search for something to get help … but what would I search for?

(Nope. That doesn’t work, either. Searching for sum — which is a thing in LaTeXit — takes me to general Mac help.)

This is useful, though:
https://www.aps.org/meetings/abstract/latex.cfm