I want to use \underline for tensors (please don't question) but, for example, I don't like how $\underline{K}$ looks. Why?
\documentclass{article}
\begin{document}
$$\underline{K}~\underline{\mathrm{K}}$$
\end{document}
Very simply, I would expect that the "base" of the character be underlined, not the whole character. That is, get rid of the red part of the underlining. In other words, I would like to underline first and then italicize, instead of italicizing first and then underlining. Can this be achieved? \mathit{\underline{\mathrm{K}}} did not work, of course.
Edit: Since I want to stay in math mode, here's another detail: let's make it work for $\mathit{\Pi}$.




$$...$$.\underlineuses the full with of the character box which is wider for italics than for upright shape – Oct 15 '15 at 00:48soulworks for text, taking account of italic correction, I assume, but not\ul{$K$}. – cfr Oct 15 '15 at 00:58$$, but thanks! @cfr: Thanks! I like how you spend five lines on explaining why it cannot work, just to present a solution in the last line :) [which does not work in math mode, but does in text mode]. – bers Oct 15 '15 at 01:28\underline{\textit{K}}~\ul{\textit{K}}.soul's\uldoes provide an advantage here in terms of italic correction (even though I don't like the distance of that underlining). – bers Oct 15 '15 at 01:44soulworks but either it approximates using the non-italic font or it somehow else corrects for the italic. What it definitely is not doing is underline the text and then make that text italic. – cfr Oct 15 '15 at 02:07\mathit{\Pi}. – Steven B. Segletes Oct 15 '15 at 02:08