# Integral Limits Placement in LaTeX

I'm using a converter to generate LaTeX codes. The converter gives me the results below for integral and sum. limits are above and below. I want sum and other symbol limits as given in (1) but integral limits as given (2). I don't want to change the code for integrals manually every time. What command should I use?

\documentclass[11pt,a4paper]{exam}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2.00cm, right=2.00cm, top=2.00cm, bottom=2.00cm]{geometry}
\begin{document}
$$\underset{1}{\overset{2}{\mathop \int }}\,{{x}^{2}}dx,\underset{i=1}{\overset{n}{\mathop \sum }}\,i,~\underset{i=1}{\overset{\infty }{\mathop \bigcup }}\,{{B}_{i}}$$

$$\int_{1}^{2} x^2~dx$$
\end{document}


• Why are you using underset? – Sigur Nov 20 '13 at 16:51
• The converter does a very bad work. – egreg Nov 20 '13 at 16:51
• egreg. you are right. if it can't be changed by a command, can you suggest a different converter? Sigur. converter gives that. – mert Nov 20 '13 at 16:54
• What is this converter? – Sigur Nov 20 '13 at 17:02
• mathtype toggletex – mert Nov 20 '13 at 17:29

The converter shouldn't use \overset and \underset: it's just wrong!

Correct code for the examples is

\documentclass[11pt,a4paper]{exam}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[left=2.00cm, right=2.00cm, top=2.00cm, bottom=2.00cm]{geometry}

\begin{document}

$$\int_{1}^{2}x^{2}\,dx,\quad \sum_{i=1}^{n}i,\quad \bigcup_{i=1}^{\infty}B_{i}$$

\end{document}


The converter is doing bad work: it adds really useless constructions (which are wrong in some cases).

• An alternate usage for integral is $\int\limits_{1}^{2}x^{2}\,dx$ – ferahfeza Nov 20 '13 at 17:27
• @ferahfeza I don't think that \limits is what the OP wants. – egreg Nov 20 '13 at 17:41
• you might want to mention that \overset and \underset don't even put the limits in the right position; compare with \int\limits. – barbara beeton Nov 20 '13 at 19:11