I have recently come up with the idea of putting a slash in a letter to distinguish it from another. I want to do it for the letter p. I've found some elements of answer here in the accepted answer: \hslash with other letter>
So I've adapted the code by changing some bits so that the bar is at the right place:
\newcommand{\hslashslash}{%
\raisebox{.1ex}{%
\scalebox{.85}{%
\rotatebox[origin=c]{18}{$-$}%
}%
}%
}
\newcommand{\ppslash}{%
{%
\vphantom{d}%
\ooalign{\kern-.09em\smash{\hslashslash}\hidewidth\cr$p$\cr}%
\kern.05em
}%
}
[The two packages that seem to be needed (amssymb and graphicx) are included in my .tex]
The thing is, when I try to generate something such as $\vec{\ppslash}$, I get this: https://i.stack.imgur.com/L7aBO.jpg ,i.e an arrow which is too high compared to the normal arrow of $\vec{p}$. I've tried to copy paste the exact same code as the one suggested in the accepted answer of the other question but I get the same thing: an arrow much too high.
What could cause this? (Currently my .tex is quite heavy, with a lot of packages and some might be not needed in all fairness, I should go through them to see which ones are needed or not...)
\vphantom{d}if you want a p? – egreg Apr 24 '20 at 22:09