Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
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

1 Answer 1

up vote 2 down vote accepted

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}

enter image description here

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.