2

This is my code

\begin{enumerate}[(i)]
\item  $\frac{1}{2}$  \text{VS}  \displaystyle \frac{1}{2}\\
\item $\sum_{k=0}^{n} f(k)$ \text{ VS }  \displaystyle \sum_{k=0}^{n} f(k) \\
 \item  $\int_{1}^{2} f(x)dx$ \text{ VS } \displaystyle \int_{1}^{2} f(x)dx
 \end{enumerate}

And it ends up like this enter image description here

How can I fix it?

Zarko
  • 296,517
user97659
  • 23
  • 2
  • 3
    Hello, could you provide us a MWE ? please – flav Feb 06 '16 at 07:08
  • 1
    A full minimal working example that starts with a \documentclass command, has a minimal preamble and then \begin{document}...\end{document}. Unless the problem is a compilation error, the code should compile and be as small as possible to demonstrate your problem. This makes it much easier for people to help you --- and much ore likely that they will! –  Feb 06 '16 at 07:30
  • 2
    Double backlashes at the ends of items are not a correct way of using enumerate. Removing the should give a better result. – Przemysław Scherwentke Feb 06 '16 at 08:18
  • In your code is error: Your right $ is on wrong place. Move it on the end of row! – Zarko Feb 06 '16 at 11:07

2 Answers2

3

Please make sure to include a full minimal working example as stated in the comments. It makes it much more rapid and easy for people to help you.

However I think your code can be improved. \text{} is used to include text into math-mode. But you've beforehand left math-mode by "closing" the formula block with $. Therefore you don't need it. That is what caused an error message by the way. Also, as stated in the comments you don't need \\ in enumerations.

I think the following code should give you the desired output:

\documentclass[11pt,a4paper,twoside]{article}
\usepackage{enumerate}
\begin{document}
    \begin{enumerate}[(i)]
         \item  $\frac{1}{2}$  VS  $\displaystyle \frac{1}{2}$
         \item  $\sum_{k=0}^{n} f(k)$ VS $\displaystyle \sum_{k=0}^{n} f(k)$ 
         \item  $\int_{1}^{2} f(x)dx$ VS $\displaystyle  \int_{1}^{2} f(x)dx$ 
    \end{enumerate}
\end{document}

Which looks like the following:

Aligned enumeration

Edi: I've just noticed that they're not really truly aligned. The enumeration type (i) (ii) etc. might be also a problem since it's progressively getting larger and therefore shifting the alignment. Anyways i've found a question on here, which is actually quite similar to yours: Sharing alignment between equations in two different items

So i think this question might be a duplicate.

Octopus
  • 575
0
\documentclass{article}
\usepackage{amsmath}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=(\roman*)]
\item $\frac{1}{2}$  VS  $\dfrac{1}{2}$
\item $\sum_{k=0}^{n} f(k)$ VS $\displaystyle\sum_{k=0}^{n} f(k)$ 
\item $\int_{1}^{2} f(x)\,\mathrm{d}x$ VS $\displaystyle\int\limits_{1}^{2} 
f(x)\,\mathrm{d}x$ 
\end{enumerate}
\end{document}

enter image description here