Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

MathML doesn't update offset from baseline

Community Beginner ,
Feb 22, 2025 Feb 22, 2025

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?

TOPICS
Bug
997
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 22, 2025 Feb 22, 2025

When you insert MathML object in InDesign - it doesn't correctly "level" itself:

 

RobertatIDTasker_0-1740231858045.png

 

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:

 

RobertatIDTasker_0-1740232129553.jpeg

 

They are all bottom aligned to the baseline of the text.

https://community.adobe.com/t5/indesign-discussions/indesign-math-graphics-a-better-way/m-p/15150539...

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 22, 2025 Feb 22, 2025

That cannot be correct. 

Skjermbilde 2025-02-22 172848.png

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 22, 2025 Feb 22, 2025

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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 22, 2025 Feb 22, 2025

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 22, 2025 Feb 22, 2025

Can you post a sample in MathML?

 

Or INDD file with a "good" equation? 

 

I'll run it through my tool. 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 22, 2025 Feb 22, 2025

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 22, 2025 Feb 22, 2025

Adobe's implementation is EXTREMELY fussy...

 

Looks like it only places correctly VERY simple equations - like: 

RobertatIDTasker_1-1740265782778.png

but nothing else...

RobertatIDTasker_0-1740265719684.png

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 23, 2025 Feb 23, 2025

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2025 Feb 24, 2025

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 24, 2025 Feb 24, 2025

@Peter Kahrel

 

Even for things like this? 

 

1000029712.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2025 Feb 24, 2025

The ones I tried worked fine, e.g.

 

PeterKahrel_0-1740415532730.png

 

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.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 24, 2025 Feb 24, 2025

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... 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 24, 2025 Feb 24, 2025

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2025 Feb 24, 2025
LATEST

(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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines