I know this question has been already discussed but the answer does not seem to work in my case.

I am using the \atop command with the amsmath package to stack two symbols (more specifically $a=x$ and $b=y$) but, as well known, this is foreign to LaTeX.

The standard reply I found (and LaTeX warning suggestion) is to use \frac or \genfrac, but these will insert a line between the two symbols, that I do not want. The other suggestion is to use \overset, but this treats the symbol below as main and prints it bigger than the one above.

How do I obtain the same result as \atop without getting the LaTeX warning?


3 Answers 3


\genfrac won't produce a line if the third argument (which control the thickness of the rule) is set to 0pt; the syntax for \genfrac is


A little example:




enter image description here


The question does not tell the context, where the symbol stacking is used.

  • \genfrac is shown in the other answer(s). It also uses the next smaller math style if available.

  • \substack can be used in limits, because it does not change the math style:

Example using \substack:


   \sum_{a=x \atop b=y}^{\text{atop}}



You can use \underset see the following example

\prod\limits_{\underset{j\ne h}{j = 1}}^{4K} {\Gamma \left( {{a_h} - {a_j}} \right)} 
  • Welcome to TeX.SE. A quick hint: If you indent lines of code by four spaces, the site software will pretty-print them automatically. Separately, I think you should mention in your answer that \underset requires loading of the amsmath package and (even more importantly) that the second argument will be typeset in a smaller font than the first. This behavior is quite different from that of \substack, which does not impose a font size change from the one row to the next.
    – Mico
    Sep 14, 2018 at 10:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .