# Choose location of annotation by angle

Normally a superscript goes in the top-right corner, a subscript goes in the bottom-right corner. Instead of restricting annotations to just those two locations, can I chose the angle more flexibly? For example, is it possible to locate the super/sub/over/under-script at any of 24 or 360 different locations relative to the main glyph?

• Welcome to TeX.SX! Do you need this to work in math mode? Please tell us a bit more of what you would like to achieve. – Jasper Habicht Apr 8 at 9:13
• @JasperHabicht Math mode is what I had in mind. I hadn't thought of just doing it as an image, I suppose an inline image isn't so different from a math expression. – andi Apr 8 at 19:37
• Could you maybe provide a better example then how this should look like? I cannot really imagine what you want by looking on these two circular graphics. Math mode is actually quite special in TeX and also of course it adheres to certain conventions that should be taken into consideration. In math, a superscript is not just some kind of annotation for example, but indicates an exponent. – Jasper Habicht Apr 8 at 19:40
• Maybe the images I included were more misleading than helpful. I was thinking of a math command where I could put (something like) $\xsups[A][x,45][y,315]$ that would have an output similar to that of $A^x_y$. – andi Apr 8 at 20:00

Welcome to TeX.SX! I don't know what exactly you want to achieve, but you could do something like the following using TikZ. It is a very basic approach, of couse, which does not take into account a lot of stuff, TeX typically would do when placing super- or subscripts. One result of this is that the spacing is not too nice.

\documentclass{article}
\usepackage{tikz}

\newcommand{\xsup}[3][60]{%
\tikz[baseline, anchor=base]{\node[inner sep=0pt, text depth=0pt, label={[inner sep=0pt, text depth=0pt]#1:{\scriptsize #3}}] {#2};}%
}

\begin{document}

Lorem ipsum dolor si\xsup{t}{2} ame\xsup[-60]{t}{3}, consetetur sadipscing elitr.

$$\xsup[120]{x}{n} = 2y^n$$

\begin{tikzpicture}
\foreach \i in {10,20,...,360} {
\node at (\i:3) {\xsup[\i]{A}{x}};
}
\end{tikzpicture}

\end{document}