So I have been trying to make a command to display my very particular notation for restriction, but I believe parts of it involve text commands and other parts involve math commands, I thoght I had properly considered each but I still get errors about the parameters not being in math mode:
The command:
\usepackage{amssymb}
\DeclareRobustCommand{\rest}[1]{\text{\raisebox{-5.8pt}{\scalebox{1}[2.6]{$\upharpoonright$}_{\ensuremath{#1}}}\hspace{-7pt}}}
Would work but I still get error messages about lacking the $ $ in the arguments (even if I do put them in there).
The result that I wanted to get from this command was to be the same as if I wrote:
$$\pi\raisebox{-5.8pt}{\scalebox{1}[2.6]{$\upharpoonright$}}_{H}\hspace{-7pt}(a)$$
when i write
$$\pi\rest{H}(a)$$
And that should look like:
