I use the division sign, together with an underscore and smash:
$\underline{\smash{X/P}}$
The result is the following:
How can I reduce the lower part of the slash, so it does not suppress the horizontal line?
Without the $\smash$
command there is too much padding: