Copy link to clipboard
Copied
Hello,
I'm writing a text with a lot of inline math equations and references to variables.
Inserting a MathML object works, where it automatically adjusts the offset from the baseline. However, if I edit the object again, the offset doesn't update according to the new elements.
The same also happens if I copy an object (say a variable) to a different part of the text, the offset resets to zero. I have to go into edit MathML on the object I want to copy, copy the MathML, go to the part of the text I want, insert MathML. And it's really tedious.
Is this just because the feature is in its infancy? Is it a bug? Or is there something I'm missing? Perhaps there's a hotkey to automatically adjust offset?
Copy link to clipboard
Copied
When you insert MathML object in InDesign - it doesn't correctly "level" itself:
Its bottom edge will always be leveled with the baseline - there is no automatic equation's baseline recognition / calculation.
Maybe you've had your equations imported from MathType or MathMagic - as EPS/WMF files - then repositioned by an extra script - but InDesign's Equations implementation is very basic.
Here is an example of importing bunch of equations - from WORD - with automatic conversion from WORD's MathML notation to native MathML objects in InDesign:
They are all bottom aligned to the baseline of the text.
Copy link to clipboard
Copied
That cannot be correct.
The first one is when I write x₂ using "Insert MathML". Here you can see the subscript is below the baseline. Second one, I take x² and use "edit MathML" and convert it to x₂, the subscript is on the baseline. Third one, I take the first x₂ and copy it, the subscript is below the baseline. Fourth I take the first x₂, copy it to a different text frame and copy that back.
There's clearly something inconsistent happening.
Copy link to clipboard
Copied
Yeah, strange.
For me - either manually or through scripting - it's always "wrong".
What version of InDesign are you using?
I'm still on 20.0
Copy link to clipboard
Copied
I don't remember, but I updated to the most recent one.
I write in latex, and use an online converter to make it into MathML. If I copy it from the converter, it always works. Any changes I do in InDesign makes it wrong.
Copy link to clipboard
Copied
Can you post a sample in MathML?
Or INDD file with a "good" equation?
I'll run it through my tool.
Copy link to clipboard
Copied
Not by my computer now. But this is the code I ran above
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<msub>
<mi>x</mi>
<mn>2</mn>
</msub>
</math>Changing msub to msup makes it a superscript.
Or was it something else you had in mind?
Copy link to clipboard
Copied
Adobe's implementation is EXTREMELY fussy...
Looks like it only places correctly VERY simple equations - like:
but nothing else...
Copy link to clipboard
Copied
I wouldn't expect it to work on anything. Inline math equations are notoriously hard to implement. But fractions, super and subscript should be a minimum.
At least I would have it so that if you copied something that does work, to also copy the offset.
Copy link to clipboard
Copied
In my experience InDesign places the equation correctly relastive to the baseline, but the type is too big. When you reduce the type size, the equation is misaligned. So the thing to do is to determine (once) the correct type size (it'll be about half the textt's type size) and use that value while you place the equation. That works.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
The ones I tried worked fine, e.g.
ID doesn't add enough space before and no space at all after the line with the equation, but the alignment of the eqn in the line is ok.
Copy link to clipboard
Copied
But there is one BIG problem - and it could be classed as a bug - when I try to add equation through scripting - InDesign creates a separate object on the page - that needs to be "moved" back to the text...
It's not possible to create equation directly in the text - like when you do manually...
Copy link to clipboard
Copied
If I remember correctly, I have a font size of 11, and use 7pt on the MathML part. So I guess I'm doing that correctly (I still wonder why they use "about half" rather than the same font size as the text).
But that still doesn't work when updating the MathML. As I showed in a reply, if you change from msup to msub, it doesn't update the offset to the baseline. Not when you copy from a different text frame either.
Copy link to clipboard
Copied
> (I still wonder why they use "about half" rather than the same font size as the text).
It's something that should be fixed by Adobe. There's a lot to fix still.
> But that still doesn't work when updating the MathML.
For now the situation seems to be that to update an eqn, you have to delete the image and place & generate it again.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more