question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Double tilde/bar has wrong italic correction

See original GitHub issue

\tilde{\tilde d}} sometimes works and sometimes not. two tildes are not horizontally aligned. How can I render a correct double tilde with Katex?

https://tex.stackexchange.com/questions/415659/double-tilde-over-symbol katex

---


15. $$\begin{aligned}\tilde{\tilde d}(x,y)&=max(d_1(x_1,y_1),d_2(x_2,y_2))\\
    &=max(xy1, xy2)\\
    &=max(xz1+zy1,xz2+zy2)=\triangle
    \end{aligned}$$

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ronkokcommented, Jan 3, 2019

I suggest something like: \tilde{\tilde{\kern{-0.3ex}d}}.

In TeX and KaTeX, \tilde makes an automatic horizontal correction for the slant of an individual italic letter. That correction doesn’t apply to the upper stacked tilde, so they don’t align. So you need to avoid applying \tilde to an individual letter. Instead, wrap the letter in braces to make it a group: {d}. Then you can apply double tildes and they will align with each other.

Inside the group, you’ll need to do the italic correction yourself and it will vary from letter to letter. To me, \kern{-0.3ex} looks about right for a “d”, but your taste may differ.

1reaction
edemainecommented, Feb 9, 2019

Ah, I hadn’t realized before that this is a bug. (I thought LaTeX and KaTeX agreed on behavior.) But it is: here’s how

\tilde{\tilde d}} \tilde{\tilde A}}

renders in LaTeX (via quicklatex):

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chktex complains about "no italic correction found", how to fix ...
Though in my case, there should be no characters after the slanted text. So is this just an overreaction of chktex or is...
Read more >
ChkTEX v1.7.8
– Italic correction (“\/”) mistakes (double, missing, unnecessary). – Parenthesis and environment matching. – Ellipsis detection; also checks.
Read more >
New TX font package - TeXDoc
This package is meant to be a replacement for Young Ryu's txfonts. It is a complete text (newtxtext) and math (newtxmath) package with...
Read more >
New TX font package - CTAN
It is a complete text ( newtxtext) and math ( newtxmath) package with roman ... math symbol fonts whose math italic letters are...
Read more >
New TX font package - NTOU IND Mirroring Service
clone, typewriter faces, plus math symbol fonts whose math italic letters ... wide accent glyphs have been corrected (they should have zero ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found