I need to put a symbol over some text, I want to use \hspace{#1} where #1 is the width of the #1 text used.
For example, write \mycommand{p}{b} and the result to be shown like the b over the p, just like the symbol \th, but allowing me to write more than one letter.
For example, \mycommand{text1}{\LaTeX}, placing the word \LaTex over the word text


\hspaceis not what you need. Probably there are better ways. – egreg Jul 29 '14 at 21:53\settowidth{\mylen}{Some text}is what you want (see here). The command as given sets\mylento the width of the 'Some text'. – jon Jul 29 '14 at 22:45