1

I'm using multicols environment inside the enumerate one like this:

\begin{enumerate}
\begin{multicols}{2}

  \item Se o $\tri ABC$ é isósceles de base $\ov{BC}$, determine $x$.
  \begin{center}
    \begin{minipage}{\linewidth}
      \centering
      \includegraphics[scale=1]{m5c4exf2}
    \end{minipage}
  \end{center}

  \vspace{.5cm}

  \item O triângulo $ABC$ é equilátero. Determine $x$ e $y$.
  \begin{center}
    \begin{minipage}{\linewidth}
      \centering
      \includegraphics[scale=1]{m5c4exf3}
    \end{minipage}
  \end{center}

  \end{multicols}
\end{enumerate}

then I get this: enter image description here

So there's a problem in the exercise number. How can I fix it?

Thanks :)

7
  • 2
    Shouldn't multicols be outside and enumerate inside?
    – egreg
    Jul 6 '14 at 22:20
  • But then all the exercises would be written in two columns and I don't wanna this. Just for some exercises.
    – mvfs314
    Jul 6 '14 at 22:21
  • 1
    I wonder that this works at all, apart from the wrong number there
    – user31729
    Jul 6 '14 at 22:22
  • \begin{center} \begin{minipage}{\linewidth} is just a strange way of adding vertical space, it doesn't centre anything as the inner minipage is \linewidth wide so center or flush left or right has no visible effect. Jul 6 '14 at 22:25
  • 1
    You could increase \columnsep just before \begin{multicols}, by using something like \setlength\columnsep{30pt} Jul 6 '14 at 22:25
4

If you use enumitem you can get the correct numbering without nesting multicols inside enumerate. The idea is to use the series key provided by enumitem to tag the first occurrence of the enumerate environment. Subsequent instances then use resume to continue the numbering in sequence:

\documentclass{article}
\usepackage{enumitem,multicol}
\usepackage[utf8]{inputenc}
\begin{document}
  \begin{enumerate}[series=mine]
    \item first item
    \item second item
  \end{enumerate}
\begin{multicols}{2}
  \begin{enumerate}[resume*=mine]
    \item third item
    \item fourth item
  \end{enumerate}
\end{multicols}
\begin{enumerate}[resume*=mine]
    \item fifth item
\end{enumerate}
\end{document}

Continuous numbering with <code>enumitem</code>

To make clear this also solves the spacing issue:

\documentclass{article}
\usepackage{enumitem,multicol}
\usepackage[utf8]{inputenc}
\begin{document}
  \begin{enumerate}[series=mine]
    \item first item
    \item second item
  \end{enumerate}
\begin{multicols}{2}
  \begin{enumerate}[resume=mine]
    \item third item here is some text just to fill up the space, of course
    \item fourth item here is some text just to fill up the space, of course
  \end{enumerate}
\end{multicols}
\begin{enumerate}[resume=mine]
    \item fifth item
\end{enumerate}
\end{document}

Longer items with space between

2
  • I didn't know about it. Thank you so much for helping :)
    – mvfs314
    Jul 7 '14 at 0:11
  • 1
    @mvfs314 You're welcome. I rely so heavily on enumitem that I sometimes forget it isn't part of LaTeX itself! (And it seemed perfect for this.)
    – cfr
    Jul 7 '14 at 2:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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