I would like to define a command that puts a sequence of symbols above the x
th symbol of another sequence of symbols.
It seems nicer without a separator, but for higher usability a separator may be necessary. I am not sure.
That means, in the example below the command \putAbove
should be redefined to produce the output shown behind becomes
.
The questions seems to be related to e.g. this, but I am not able to put it into use here.
\documentclass{article}
\usepackage{amsmath}
\newcommand{\putAbove}[3]{\backslash putAbove\{#1\}\{#2\}\{#3\}}
\begin{document}
$\putAbove{q_0}{1}{||\phi}$ becomes $\overset{q_0}||\phi$
$\putAbove{q}{1}{||\phi}$ becomes $\overset{q}||\phi$
$\putAbove{q}{3}{|||}$ becomes $||\overset{q}|$
\end{document}