# Multicols: How to center two cols?

1,976

## Solution 1

The tasks environment is done for that, as the numbering will be from left to right first, then vertical, whereas multicol does the converse. I took the opportunity to correct your code: nowadays, the language option from babel should be loaded as an option of the document class. Note amscd should be replaced with tikz-cd, as it yields better results.

\documentclass[a4paper, brazil, 12pt]{report}
\usepackage{amsmath, amsfonts, amscd, bezier}
\usepackage{amssymb}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[dvips]{graphicx}
%\usepackage{pdfsync}
\usepackage{color}
\usepackage{hyperref}

\newcommand{\ds}{\displaystyle}
\newcommand{\pr}{\hspace*{1.5cm}}

\DeclareMathOperator{\sen}{sen}
\DeclareMathOperator{\senh}{senh}
\DeclareMathOperator{\arcsen}{arcsen}
\DeclareMathOperator{\tg}{tg}
\DeclareMathOperator{\arctg}{arctg}
\DeclareMathOperator{\cotg}{cotg}
\DeclareMathOperator{\arccotg}{arccotg}
\DeclareMathOperator{\arcsec}{arcsec}
\DeclareMathOperator{\cossec}{cossec}
\DeclareMathOperator{\arccossec}{arccossec}

\begin{document}

\task $f (x) = \begin{cases} \ds x\sen\dfrac{1}{x}, & \hbox{ se } x \neq 0\\ 0, & \hbox{ se } x = 0 \end{cases}$ %\quad \quad
\task $f (x) = \begin{cases} \ds x^2\sen\dfrac{1}{x}, & \hbox{ se } x \neq 0\\ 0, & \hbox{ se } x = 0 \end{cases}$

\end{document}


## Solution 2

Now that you have provided the real setup with used packages, I can confirm that the real cause of this white space above the first column is due to the pdfsync package. It somehow conflicts with the column balancing routines of multicol. As @egreg once said: "don't use pdfsync for any reason whatsoever". Also, \quad \quad is meaningless here, just remove it.

\documentclass[a4paper,12pt]{report}
\usepackage{amsmath,amsfonts,amscd,bezier}
\usepackage{amssymb}
\usepackage[brazil]{babel}
\usepackage[latin1]{inputenc}
\usepackage[dvips]{graphicx}
%\usepackage{pdfsync}
\usepackage{color}
\usepackage{hyperref}
\usepackage{enumerate}
\usepackage{multicol}

\newcommand{\ds}{\displaystyle}
\newcommand{\pr}{\hspace*{1.5cm}}
\newcommand{\sen}{{\mbox{sen\,}}}

\DeclareMathOperator{\senh}{senh}
\DeclareMathOperator{\arcsen}{arcsen}
\DeclareMathOperator{\tg}{tg}
\DeclareMathOperator{\arctg}{arctg}
\DeclareMathOperator{\cotg}{cotg}
\DeclareMathOperator{\arccotg}{arccotg}
\DeclareMathOperator{\arcsec}{arcsec}
\DeclareMathOperator{\cossec}{cossec}
\DeclareMathOperator{\arccossec}{arccossec}

\begin{document}

\begin{multicols}{2}
\begin{enumerate}[(a)]
\item $f (x) = \begin{cases} \ds x\sen\dfrac{1}{x}, & \hbox{ se } x \neq 0\\ 0, & \hbox{ se } x = 0 \end{cases}$ %\quad \quad
\item $f (x) = \begin{cases} \ds x^2\sen\dfrac{1}{x}, & \hbox{ se } x \neq 0\\ 0, & \hbox{ se } x = 0 \end{cases}$
\end{enumerate}
\end{multicols}

\end{document}


Share:
1,976

Author by

### Moura

Updated on October 21, 2020

I'm sorry by my poor English. Thanks for any help. Here is my question:

I would like to center two expressions by using the multicols and enumerate commands, just like this:

Unfortunately the command I am using is producing this:

Here is my commands:

\documentclass[a4paper,12pt]{report}
\usepackage{amsmath,amsfonts,amscd,bezier}
\usepackage{amssymb}
\usepackage[brazil]{babel}
\usepackage[latin1]{inputenc}
\usepackage[dvips]{graphicx}
\usepackage{pdfsync}
\usepackage{color}
\usepackage{hyperref}
\usepackage{enumerate}
\usepackage{multicol}

\newcommand{\ds}{\displaystyle}
\newcommand{\pr}{\hspace*{1.5cm}}
\newcommand{\sen}{{\mbox{sen\,}}}

\DeclareMathOperator{\senh}{senh}
\DeclareMathOperator{\arcsen}{arcsen}
\DeclareMathOperator{\tg}{tg}
\DeclareMathOperator{\arctg}{arctg}
\DeclareMathOperator{\cotg}{cotg}
\DeclareMathOperator{\arccotg}{arccotg}
\DeclareMathOperator{\arcsec}{arcsec}
\DeclareMathOperator{\cossec}{cossec}
\DeclareMathOperator{\arccossec}{arccossec}

\begin{document}

\begin{multicols}{2}
\begin{enumerate}[(a)]
\item $f (x) = \begin{cases} \ds x\sen\dfrac{1}{x}, & \hbox{ se } x \neq 0\\ 0, & \hbox{ se } x = 0 \end{cases}$ \quad \quad
\item $f (x) = \begin{cases} \ds x^2\sen\dfrac{1}{x}, & \hbox{ se } x \neq 0\\ 0, & \hbox{ se } x = 0 \end{cases}$
\end{enumerate}
\end{multicols}

\end{document}


I'm sorry, I could not explain it right. Items (a) and (b) I would like to be centered and aligned horizontally on the same line, like that de first figure. Item (b) is higher than item (a) (the second figure).

Could you show a complete example and not only some fragment? What class are you using? how is \ds defined? ...