1

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: enter image description here

Unfortunately the command I am using is producing this: enter image description here

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}
\pagestyle{myheadings} \thispagestyle{empty}

\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).

4
  • 1
    You want to centre each expression w.r.t. what?
    – Bernard
    Oct 20, 2017 at 11:32
  • 3
    Could you show a complete example and not only some fragment? What class are you using? how is \ds defined? ...
    – Ignasi
    Oct 20, 2017 at 11:34
  • 1
    \ds is \displaystyle and \sen is \sin (in portuguese)
    – Moura
    Oct 20, 2017 at 12:05
  • 2
    ,@Moura - The problem can be solved at a glance, but without giving the required information about your real document setup (class, single/double column, commands before/after ...) you are unlikely to get any good answer.
    – AboAmmar
    Oct 20, 2017 at 12:06

2 Answers 2

2

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}
\usepackage{tasks}

\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}

\pagestyle{myheadings} \thispagestyle{empty}
    \begin{tasks}(2)
        \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{tasks}

\end{document} 

enter image description here

4

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}
\pagestyle{myheadings} \thispagestyle{empty}

\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}

enter image description here

1
  • 1
    Is the problem \usepackage{pdfsync} ? It is working now. Thanks a lot
    – Moura
    Oct 20, 2017 at 12:27

You must log in to answer this question.

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