Latex underline not working

What I’m trying to do

Writing \underline{n} to get an underlined n in LaTeX

Things I’ve tried

What I said above, and it didn’t work. I also tried looking for alternative LaTeX commands, and didn’t find any.
Finally, I tried surrounding the LaTeX with <u></u> tags, but then it won’t parse.

Maybe it’s just me, but how do you get the text to LaTeX? What is the surrounding markdown, or how do you get the entire markdown document to LaTeX?

What is your workflow before/when this doesn’t work?

I just write my expression between “$”, that makes it go latex.
Right now, I just added a footnote near the expression that is supposed to have the underline to point it out.

I am having the same problem, but I notice that it only applies to some text. For example, $\underline{b} \underline{h}$ will underline the letter b, but not h. This seems consistent based on the letters themselves, not their position. Further, any piece of text longer than a single character fails to underline. $\underline{a} \underline{b} \underline{ab}$ will show an underlined a, an underlined b, and then ab not underlined.

From the English alphabet, hmnuwx are all the lowercase letters that fail to underline, and I is the only uppercase letter that can successfully be underlined. Some symbols that fail to underline are @-+=<> and three that require escaping \#\%\&. All numeric digits seem to underline correctly, but again, only when it is a single digit.

It might be related to the font rendering somehow? But I do not know which fonts are used for LaTeX rendering in Obsidian, and it naturally does not seem affected by the Text font setting in Appearance settings. I am on Windows; maybe other systems will use a slightly different font file or font rendering?

Or maybe the bounding box of the text is not computed correctly and thus the rendering sometimes cuts off the underline at the bottom?

I don’t know why, but I tested some of the cases you referred to, and all show with an underline. See image below

So the question then becomes, what do you two guys have in common which makes this break? And could either of you produce a similar screenshot with source on left, and reading view on right, to display what you see?

This issue may be related to:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.