1

MWE:

% Xe-/LuaLaTeX
\documentclass{article}
\usepackage{unicode-math}
\setmathfont[math-style=literal]{Latin Modern Math}

\begin{document}

$\dot b, \dot  𝑏, \dot{\rm b}$

\end{document}

enter image description here

The accent placement seems to be wrong, in my opinion. The \dot{\rm b} example seems to be right. How to get this as the default behaviour?

OK, in LuaTeX we can change the top_accent values of the OTF table, as Marcel Krüger has done: Fixing the position of math accents when using unicode-math in lualatex with a text font for letters and digits

But is there a simpler solution? In this answer a faked math font is used, but I would like to patch a real math font. So some lines of code can be omitted, can't they?

What about XeTeX? Is there a solution, too? Are the top_accent values represented by a \fontdimen?

9
  • \rm hasn't been defined in latex by default since 1993, surprising to see it in a lualatex document. Jul 10, 2021 at 10:22
  • OK, I use Plain TeX, but the MWE is much shorter in LaTeX. ;) Jul 10, 2021 at 10:23
  • I saw this comment after I had posted a latex answer. Jul 10, 2021 at 10:32
  • No problem. What I mean is that I would like the dot to be placed in the middle over the b, not on the left side. And this happens in the "forbidden" \rm solution. Jul 10, 2021 at 10:35
  • oh actually I misread your question, the placement over the Roman d looked so obviously wrong I posted a solution with the standard placement over that. I didn't notice you were asking to have that placement over the italic d as well. Jul 10, 2021 at 10:39

1 Answer 1

1

enter image description here

The dot is positioned over the stem of the d as specified in the font but if you want it centred over the whole character for some reason then you can make the base be more than a single character and let tex position a centred accent.

\documentclass{article}
\usepackage{unicode-math}
\setmathfont[math-style=literal]{Latin Modern Math}

\begin{document}

$\dot b, \dot  𝑏, \dot{\symrm{b}}$

$\dot{b{}}, \dot {𝑏{}}, \dot{\symrm{b}{}}$

\end{document}

\rm is a legacy command that is not defined by default in latex but defined in some classes for compatibilty with LaTeX2.09 documents.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .