# \textsuperimposetilde does not superimpose as \sum subscript

Compiling the document, the tilde and P lie seperately under the \sum operator, but as the command superimpose would suggest, I would like them to be superimposed. Works just fine when using \textsuperimposetilde{P} as subscript for alphabetical characters.

\documentclass[11pt]{article}
\usepackage{geometry}
\geometry{letterpaper}

\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing}
\newcounter{qcounter}
\usepackage{fontenc}
\usepackage{marvosym}
\usepackage{wrapfig}
\usepackage{harpoon}
\usepackage{textcomp}
\usepackage{MnSymbol}
\usepackage{mathtools}
\usepackage{xfrac}
\usepackage[safe]{tipa}

\newcommand\sit[1]{%
\textsuperimposetilde{#1}}

\begin{document}

$\not{\text{S}}_{hkl}\, =\, \sum_{\sit{P}}\, f_{{\sit{P}}_{a}}\, e^{[-i2\pi (hu_{p}+kv_{p}+ lw_{p}]}$

\end{document}

-
You have already two questions here; please consider registering and thus be able to give more easily other contributions to the site. –  egreg Sep 8 '12 at 23:02

There should be some better method than this. \textsuperimposetilde{P} is used in text mode. Try this

\newcommand\sit[1]{%
\text{\textsuperimposetilde{\ensuremath {#1}}}}


for math mode.

Update: As suggested by @egreg, using

\newcommand\sit[1]{%
\text{\smash[b]{\textsuperimposetilde{$#1$}}}}


will give better results in the placement of subscripts (Watch out for the placement of a).

Full code:

\documentclass[11pt]{article}
\usepackage{geometry}
\geometry{letterpaper}

\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing}
\newcounter{qcounter}
\usepackage{fontenc}
\usepackage{marvosym}
\usepackage{wrapfig}
\usepackage{harpoon}
\usepackage{textcomp}
\usepackage{MnSymbol}
\usepackage{mathtools}
\usepackage{xfrac}
\usepackage[safe]{tipa}

\newcommand\sit[1]{%
\text{\smash[b]{\textsuperimposetilde{$#1$}}}}

\begin{document}

$\not{\text{S}}_{hkl}\, =\, \sum_{\sit{P}}\, f_{{\sit{P}}_{a}}\, e^{[-i2\pi (hu_{p}+kv_{p}+ lw_{p}]}$
\end{document}


-
Thank you @Harish. It worked. –  Brazos Wolf Sep 8 '12 at 12:04
@Brazos: If this answer helped you, you may consider upvoting it. Also you may accept it by clicking the green check mark below vote count. This is how we say thanks here in TeX.SX. –  Harish Kumar Sep 8 '12 at 14:00
I'd suggest a modification: \newcommand\sit[1]{% \text{\smash[b]{\textsuperimposetilde{$#1$}}}} as in your example the subscript is far too low. Moreover \ensuremath#1 should at least be \ensuremath{#1}, but $#1$ is surely easier and more efficient. –  egreg Sep 8 '12 at 19:29
@egreg: Thanks Enrico. I have added the modification to the answer. –  Harish Kumar Sep 8 '12 at 22:59