Suppose I have an operation on a set X which I want to denote with something like $X^\prime$
, $X^\bullet$
, or $X^\circ$
, except with a different symbol. I found out that some of the diacritics available in math mode (see here) make a decent candidate when used “standalone”, for instance as $X \: \tilde{}$
or $X \: \hat{}$
. This might not be the intended use for these characters, but the result looks very nice IMHO (certainly much nicer than, say, $X^\sim$
or $X^\wedge$
).
However, in doing so, I will inevitably run into problems. One of these is easy to solve: a bit of extra space should be inserted before the standalone diacritic to make it look nice (a small space like \:
seems to do the trick). However, if the diacritic is preceded by a subscript, I would like it to behave like a superscript, so it starts above the subscript, not after it. This is illustrated by the following MWE:
\documentclass[margin=2mm]{standalone}
\usepackage{amsmath}
\newcommand{\myhat}{\ensuremath{\:\hat{}}}
\newcommand{\mytilde}{\ensuremath{\:\tilde{}}}
\newcommand{\mybreve}{\ensuremath{\:\breve{}}}
\newcommand{\mycheck}{\ensuremath{\:\check{}}}
\begin{document}
\renewcommand{\arraystretch}{1.3}
\begin{tabular}{|c|c|c|c|}
\hline
command & no subscript & short subscript & long subscript \\
\hline
hat & $X\myhat$ & $X_1\myhat$ & $X_{\omega(k)}\myhat$ \\
tilde & $X\mytilde$ & $X_1\mytilde$ & $X_{\omega(k)}\mytilde$ \\
breve & $X\mybreve$ & $X_1\mybreve$ & $X_{\omega(k)}\mybreve$ \\
check & $X\mycheck$ & $X_1\mycheck$ & $X_{\omega(k)}\mycheck$ \\
\hline
\end{tabular}
\end{document}
My question is this: how can I make these “standalone” diacritics behave more like superscripts, without having to resort to adding negative horizontal space manually for each occurrence? Alternatively, can identical symbols also be generated in a different way, so that they may be used simply as $X^\standalonetilde$
, $X^\standalonehat$
, $X^\standalonebreve$
, and $X^\standalonecheck$
?