# How to left align equation numbering within multicolum?

I have the following code:

\documentclass[11pt, spanish]{article}
%\usepackage{babel}
\usepackage[latin1]{inputenc}
\usepackage{geometry}
\geometry{legalpaper,
a4paper,
%top=25mm,
%bottom=25mm,
left=30mm,
right=30mm}

\usepackage{multicol}

\usepackage{hyperref}

\usepackage[fleqn]{mathtools}
%\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{relsize}
\usepackage{mathrsfs}
\numberwithin{equation}{section}
%\setlength{\jot}{1.5ex}%10pt}
\renewcommand{\theequation}{IV.\thesection.\arabic{equation}}

\title{Control discreto}

\begin{document}

\section{Asignación de especificaciones}\label{SPECS}
\vspace{-12mm}
\begin{multicols}{2}
$$G_{1}(s) = \dfrac{k_{c}} {\tau_{c} * s + 1} \label{REF1}$$
$$G_{2}(s) = \dfrac{\omega_{n}^2} {s^2 + 2*\zeta*\omega_{n}*s + \omega_{n}^2} \label{REF2}$$
\end{multicols}

\end{document}


This produces the following output:

Is almost OK, but:

• I'd like equation numbering to have same spacing for both equations (doesn't matter automatic spacing o specifying it)
• I'd like to know if there is another approach to get rid of the blank space before the multicolumns without \vspace{-12mm}, maybe something more 'rigorous'?.

On the other hand, i dont really understand why not including hyperref package produces this output:

Hope anyone find this question easy to answer and help me, is the final touch i need for my thesis.
Thanks in advance.

• My first idea would be to suppress the numbering in the equation environment and add it as \numref. All in 4 column table (eq, num, eq, num). If \vspace does not the job, you should check for \vskip Xpt [plus Mpt] [minus Npt] \relax. The plus and minus is optional and allows the stretching, when shipping out the page. Jan 5 '19 at 12:25
• Regarding your 2nd point (the space above multicols). \multicolsep is the space added. You could set this to 0pt (\setlength\multicolsep{0pt}) to suppress it, or do a \vspace{-\multicolsep} instead. Jan 5 '19 at 12:34
• Have you tried using minipages instead of a multicollumn like it is outlined in this answer: tex.stackexchange.com/a/32702/23775 You also might want to read the comments to the question about vertical alignment.
– Dave
Jan 5 '19 at 12:44
• It is not clear what you mean by getting the same spacing for the numbering. You have specified that the equations are set left aligned, and the equation numbers are on the right, so naturally the space between the equation and the number depends on the length of the equation, It is hard to see how that could be avoided, other than specify leqno so that equation numbers are on the left. Jan 5 '19 at 13:00

## 3 Answers

First, your two questions don't fit the title, so I'm answering all three.

1. Title: How to left align the question numbers: simply add the option leqno to \documentclass[…]{article}

2. Same spacing for both equations: This happens automatically then.

3. No vertical space above the multicolumn: Just as Skillmon pointed out in his comment: add \setlength{\multicolsep}{0pt} before the multicolumn.

So, the corrected code would be:

\documentclass[leqno,11pt, spanish]{article}
%\usepackage{babel}
\usepackage[latin1]{inputenc}
\usepackage{geometry}
\geometry{legalpaper,
a4paper,
%top=25mm,
%bottom=25mm,
left=30mm,
right=30mm}

\usepackage{multicol}

\usepackage{hyperref}

\usepackage[fleqn]{mathtools}
%\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{relsize}
\usepackage{mathrsfs}
\numberwithin{equation}{section}
%\setlength{\jot}{1.5ex}%10pt}
\renewcommand{\theequation}{IV.\thesection.\arabic{equation}}

\title{Control discreto}
\setlength{\multicolsep}{0pt}
\begin{document}

\section{Asignación de especificaciones}\label{SPECS}
\vspace{-12mm}
\begin{multicols}{2}
$$G_{1}(s) = \dfrac{k_{c}} {\tau_{c} * s + 1} \label{REF1}$$
$$G_{2}(s) = \dfrac{\omega_{n}^2} {s^2 + 2*\zeta*\omega_{n}*s + \omega_{n}^2} \label{REF2}$$
\end{multicols}

\end{document}


Output:

This reserves to each equation a space proportional to its width.

\documentclass[11pt, spanish]{book}
\usepackage{babel}
%\usepackage[latin1]{inputenc}
\usepackage{geometry}
\geometry{
a4paper,
%top=25mm,
%bottom=25mm,
left=30mm,
right=30mm,
}

\usepackage[fleqn,leqno]{mathtools}
\usepackage{amsfonts}
\usepackage{environ,xparse}

\usepackage{lipsum} % for context

\usepackage{hyperref}

\renewcommand{\thechapter}{\Roman{chapter}}

\numberwithin{equation}{section}

\ExplSyntaxOn
\NewEnviron{doubleequation}
{
\saiz_doubleeq:V \BODY
}

\seq_new:N \l__saiz_doubleeq_seq
\box_new:N \l__saiz_doubleeq_box
\fp_new:N \l__saiz_doubleeq_l_fp
\fp_new:N \l__saiz_doubleeq_r_fp

\cs_new_protected:Nn \saiz_doubleeq:n
{
\seq_set_split:Nnn \l__saiz_doubleeq_seq { \\ } { #1 }
% measure the left equation
\hbox_set:Nn \l__saiz_doubleeq_box
{
\cs_set_eq:NN \label \use_none:n
$\displaystyle$$\seq_item:Nn \l__saiz_doubleeq_seq { 1 }$$$
}
\fp_set:Nn \l__saiz_doubleeq_l_fp
{ \dim_to_fp:n { \box_wd:N \l__saiz_doubleeq_box } }
% measure the right equation
\hbox_set:Nn \l__saiz_doubleeq_box
{
\cs_set_eq:NN \label \use_none:n
$\displaystyle$$\seq_item:Nn \l__saiz_doubleeq_seq { 2 }$$$
}
\fp_set:Nn \l__saiz_doubleeq_r_fp
{ \dim_to_fp:n { \box_wd:N \l__saiz_doubleeq_box } }
%
$\setlength{\abovedisplayskip}{0pt} \begin{minipage} { \fp_eval:n { \l__saiz_doubleeq_l_fp / ( \l__saiz_doubleeq_l_fp + \l__saiz_doubleeq_r_fp ) } \displaywidth } $$\seq_item:Nn \l__saiz_doubleeq_seq { 1 }$$ \end{minipage} \begin{minipage} { \fp_eval:n { \l__saiz_doubleeq_r_fp / ( \l__saiz_doubleeq_l_fp + \l__saiz_doubleeq_r_fp ) } \displaywidth } $$\seq_item:Nn \l__saiz_doubleeq_seq { 2 }$$ \end{minipage}$
}
\cs_generate_variant:Nn \saiz_doubleeq:n { V }
\ExplSyntaxOff

\begin{document}

\setcounter{chapter}{3}

\chapter{Control discreto}

\section{Asignación de especificaciones}\label{SPECS}

\lipsum*[3]
\begin{doubleequation}
G_{1}(s) = \frac{k_{c}} {\tau_{c}s + 1} \label{REF1}
\\
G_{2}(s) = \frac{\omega_{n}^2} {s^2 + 2\zeta\omega_{n}s + \omega_{n}^2} \label{REF2}
\end{doubleequation}
\lipsum*[4]
$$G_{3}(s)=s^2$$
\lipsum[5]

\end{document}


As Dave sugest, minipage is the proper option for this case:

\begin{minipage}{0.4\linewidth}
$$G_{1}(s) = \dfrac{k_{c}} {\tau_{c} * s + 1} \label{REF1}$$
\end{minipage}
\begin{minipage}{0.55\linewidth}
$$G_{2}(s) = \dfrac{\omega_{n}^2} {s^2 + 2*\zeta*\omega_{n}*s + \omega_{n}^2} \label{REF2}$$
\end{minipage}


As you can see, the spacing between each equation and its numbering is almost the same. What i wanted to avoid was having the multicolumn space badly distributed (as shown in the first example i posted).

The problem was quite simple actually, multicolumn environment splits the linewidth in two, making second equation be almost overlapped with it's numbering.
To solve this the easier way i found is to manually adjust the "column" width, not really a rigorous way but worked for me (as i only have few of this cases).

On the other hand, \setlength\multicolsep{0pt} trick does the job when using multicolumn enviroment.

Thanks everyone for your help