How to center text under math symbols

I was looking for a way to center text underneath math symbols such as constraints or regions. More specifically, from vector calculus, if we were to have a double integral bounded by some region D, then we would have the two integral signs with a D underneath. It looks like the D_1 and D_2 as seen below.

-
I leave this to the math-experts here, but it sounds after a job of \stackrel[below]{main}{above} (stackrel package) in the general case and a simple \iint_{D} or \iint\limits_{D} for the double integral (with the amsmath package). –  Martin Scharrer Jun 30 '11 at 7:03
@Martin: Thanks. The \iint\limits_{D} did the trick. It was the \limits I believe that was needed. I have a question about the \stackrel[below]{main}{above}, what type of text or math code would actually goes in the "below" ,"main", and "above" fields? –  night owl Jun 30 '11 at 7:16
about \stackrel: Most likely any math code as well as text inside \mbox{..} or better \text{..}. –  Martin Scharrer Jun 30 '11 at 7:32
@Martin: with all respect due to Heiko Oberdiek, I don't think that \stackrel or \stackbin are the answer (they build relations and binary operations). First of all one should consider \overset and \underset from amsmath (which already do a good job of recognizing automatically the math kind of the main object). –  egreg Jun 30 '11 at 8:23
@egreg: Thanks, as stated above I'm not an expert with math. The \stack... just sounded good for this case. :-) –  Martin Scharrer Jun 30 '11 at 8:29

1 Answer

I cannot see this:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

$\iint\limits_{D_1} f(x,y)\mathrm{d}A$

\end{document}


-
@Herbet: What do you mean by you cannot see the code? The output? –  night owl Jun 30 '11 at 7:33
@night owl: I cannot see that the D1 is not centered below the double integral –  Herbert Jun 30 '11 at 7:49