Inlined MathType equations not inlined in epub, low in docx

I’ve started work on a math book, using MathType. I love how well it works with Scrivener.

I have a problem with inline equations, though. They look great in Scrivener, but when I compile to epub, each “inline” equation is put on a line by itself. When I compile to docx, the equations are inlined, but very low, in fact by about the x-height too low.

For very simple equations I can fake it by entering them directly into Scrivener, rather than as an equation. This is more effort, and doesn’t always work, for example if a square root is involved (no overbar in Scrivener).

Am I doing something wrong? How do I get around this?

Hi David,

After two months buried in Mojave Dark Mode code, I have just seen this - I’m sorry you haven’t received any replies. (I looked in our support system to see if you had emailed us too, but it seems not.)

I can’t reproduce the problem with baselines being off in .docx files, I’m afraid, although it might depend on the app in which you are opening the .docx file. For instance, if I open a .docx containing equations in Apple’s Pages, the equations do indeed appear a little low - it looks as though Pages is ignoring the baseline setting. The same .docx file opened in Microsoft Word looks perfect, though. Could it be that you are opening your files in something other than Word?

As for ePub files, I’ve investigated this and it turns out that the MathML generated by MathType contains “display=‘block’” which causes the equations to sit on their own line when contained in HTML/ebooks. For the next update, I have addressed this by examining equations during the Compile process and changing “block” to “inline” if the equations sits in a paragraph with other text. Thanks for bringing this to my attention.

All the best,

I just came across this issue (inlined MathType equations) as well. Any workaround? Is it going to be fixed?

I don’t particularly like to reply to myself, but I’ve found a fix to the issue of the MathType equations. I just added a custom CSS line to the project format:

p img {display:inline; height:20pt; margin: 0em 0em 0em 0em}
All images within a paragraph are now inlined, which doesn’t seem to be an issue. Only problem left is the image files from MathType have too much margin, so I’ll probably edit the files down to size.

You might also like to look at AmberV’s posts in
which is in answer to a different but related problem.



Yep, very similar solution approach!