8

I defined a command by

\newcommand{\antishriek}{\mbox{\footnotesize{\rotatebox[origin=c]{180}{$!$}}}},

which gives a small, upside-down exclamation mark. I always use it as an exponent for other symbols, such as

which is given by $\mathscr{P}^{\antishriek}$. My problem is when I try to put the whole thing as a subscript, in which case my symbol doesn't scale. For example, writing $\Delta_{\mathscr{P}^{\antishriek}}$ gives

with the symbol exactly of the same size. Is there a way to make my symbol scale when I put it as the superscript of a subscript without having to define a second symbol giving the same output, but smaller?

  • i'm not in a situation where i can test anything, but the symbol is prevented from sizing because you've given it a fixed size when you pack it in the \mbox{\footnotesize{...}}. try removing just the sizing instruction, and see what that does. – barbara beeton Jan 27 '17 at 1:07
  • @barbarabeeton I just tried, and nothing changes. The symbol as a superscript or as a superscript of a subscript has the same dimension. – Daniel Robert-Nicoud Jan 27 '17 at 1:22
10

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):

enter image description here

\[
  \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

enter image description here

\[
  \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:

enter image description here

\[
  {\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:

  • Thank you for your answer! I learned a lot by reading it. – Daniel Robert-Nicoud Jan 27 '17 at 1:31
5

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} 

enter image description here

3

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} 

enter image description here

  • This is a nice solution, however, I also use an exclamation mark in the same way, and if I do that for both (by defining the exclamation mark by \text{!}) they are not placed in the same way. Also, simply using $!$ and \rotatebox[origin=c]{180}{$!$} (without putting it in an \mbox and resizing), the symbols are too big. – Daniel Robert-Nicoud Jan 27 '17 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.