I want to create a "minus-sign" in a superscript of a letter in math mode using \rule{width}{height} to get control over the look of it. In principle, I get something to my liking, but I fail to make the width and height adjust to when I use it in the power of an expression.
I tried:
\newlength{\charheight}
\newlength{\charwidth}
\newcommand{\supmin}[1]{%
\settoheight{\charheight}{#1}
\settowidth{\charwidth}{#1}
#1^{\rule{\charwidth}{\charheight}}
}
and
\newcommand{\supmin}[1]{%
#1^{\rule{1ex}{1em}}
}
both failed to adjust the box in the superscript when used in the power:
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath, amssymb, amsthm}
\begin{document}
\begin{align}
k \binom{N}{k} - \supmin{k} p^{\supmin{k}} > 0
\end{align}
\end{document}


\settoheight{...}{k}and\settowidth{...}{k}effectively measure how large akwould be in the main text. They do not take into account the fact that you are using them in math mode (or in a superscript). You could measure e.g. the height of a script stylekwith\settoheight{...}{$\scriptstyle k$}. – Circumscribe Nov 04 '18 at 13:01\mathpaletteis used to automatically insert\displaystyle,\textstyle,\scriptstyleor\scriptscriptstyle(whichever is appropriate) as#1to\sup@min(and the original argument as#2).) – Circumscribe Nov 04 '18 at 13:02