Defining a symbol that scales when used as a subscript
Instead of creating your own symbol, LaTeX has a predefined \textexclamdown
that one can use. So, technically, you can do:
\usepackage{amsmath}
\newcommand{\antishriek}{\text{\raisebox{\depth}{\textexclamdown}}}
amsmath
's \text
will ensure that the correct size is used, while \raisebox
puts the inverted exclamation at the baseline (if you want it that way; similar to what \rotatebox[origin=c]{180}
would do for !
).
In general, if you wish to have a command vary in its presentation depending on the location where it's used in math mode, then you can consider using \mathchoice
(or the wrapper \mathpalette
). \mathchoice
has the following format:
\mathchoice{<material for display style>}
{<material for text style>}
{<material for script style>}
{<material for scriptscript style>}
So, in your case, you could supply the formatting (sizing and rotation or whatever) to suit your needs. Here's an example of what that means: Consider the hypothetical \somesymbol
:
\newcommand{\somesymbol}{\mathchoice
{a}% \displaystyle
{b}% \textstyle
{c}% \scriptstyle
{d}% \scriptscriptstyle
}
The above "symbol" definition displays (left is in default \displaystyle
, while the right is in forced \textstyle
, for comparison):
\[
\somesymbol^{\somesymbol^{\somesymbol^{\somesymbol}}}
\quad
\somesymbol_{\somesymbol_{\somesymbol_{\somesymbol}}}
\qquad\textstyle
\somesymbol^{\somesymbol^{\somesymbol^{\somesymbol}}}
\quad
\somesymbol_{\somesymbol_{\somesymbol_{\somesymbol}}}
\]
Specific to your symbol, you may then use (as an example):
\newcommand{\antishriek}{\mathchoice
{\rotatebox[origin=c]{180}{!}}% \displaystyle
{\rotatebox[origin=c]{180}{!}}% \textstyle
{\rotatebox[origin=c]{180}{\scalebox{.7}{!}}}% \scriptstyle
{\rotatebox[origin=c]{180}{\scalebox{.5}{!}}}% \scriptscriptstyle
}
which displays as
\[
\somesymbol^{\somesymbol^{\somesymbol^{\somesymbol}}}
\antishriek^{\antishriek^{\antishriek^{\antishriek}}}
\quad
\somesymbol_{\somesymbol_{\somesymbol_{\somesymbol}}}
\antishriek_{\antishriek_{\antishriek_{\antishriek}}}
\qquad\textstyle
\somesymbol^{\somesymbol^{\somesymbol^{\somesymbol}}}
\antishriek^{\antishriek^{\antishriek^{\antishriek}}}
\quad
\somesymbol_{\somesymbol_{\somesymbol_{\somesymbol}}}
\antishriek_{\antishriek_{\antishriek_{\antishriek}}}
\]
Here they are together, to show the relative sizing:
\[
{\somesymbol\antishriek}^{{\somesymbol\antishriek}^{{\somesymbol\antishriek}^{{\somesymbol\antishriek}}}}
\quad
{\somesymbol\antishriek}_{{\somesymbol\antishriek}_{{\somesymbol\antishriek}_{{\somesymbol\antishriek}}}}
\qquad\textstyle
{\somesymbol\antishriek}^{{\somesymbol\antishriek}^{{\somesymbol\antishriek}^{{\somesymbol\antishriek}}}}
\quad
{\somesymbol\antishriek}_{{\somesymbol\antishriek}_{{\somesymbol\antishriek}_{{\somesymbol\antishriek}}}}
\]
Relevant:
What is
\mathchoice
?The mysteries of
\mathpalette
Here is a scalerel
solution in which ¡
is scaled to the vertical footprint of the !
in the appropriate math style.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsmath, mathrsfs,scalerel}%
\newcommand{\antishriek}{\scalerel*{$¡$}{!}}
\begin{document}
\[\mathscr{P}^{\antishriek}\mathscr{P}^{!}\quad
\Delta_{\mathscr{P}^{\antishriek}}\Delta_{\mathscr{P}^{!}}\quad
\antishriek !\]%
\end{document}
Why make things more comples than they are?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsmath, mathrsfs}%
\newcommand{\antishriek}{\text{¡}}
\begin{document}
\[\mathscr{P}^{\antishriek}\quad \Delta_{\mathscr{P}^{\antishriek}}\quad \antishriek \]%
\end{document}