Is there any command to get the width of math in math mode and give the result in math unit of the used font?
I am using \settowidth{\myl}{$M$}\the\myl but the result is in pt and in would like to get the value in mu directly.

  • The TeXBook mentions "There are 18 mu to an em..." – Werner Dec 18 '13 at 14:46
  • what do you need it for? \kern does not need math units and works just fine in math mode – daleif Dec 18 '13 at 14:50

Math units are transient things that make sense in the math list before TeX has committed that part of the list to being in text or script/script size. At the end of a math expression TeX converts a math list into a horizontal list, raising and lowering boxes as needed, and assigning characters from the 16 font families. So there is no command to do this. You could measure the width in pt and divide by \fontdimen6\textfont2 (em of the main math font) and then multiply by 18 to get something you might think of as the length in math units, but it doesn't really relate to anything that TeX uses, as the width of 1mu changes at different points within the expression.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.