2

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}
\begin{equation}
G_{1}(s) = \dfrac{k_{c}} {\tau_{c} * s + 1} \label{REF1}
\end{equation}
\begin{equation}
G_{2}(s) = \dfrac{\omega_{n}^2} {s^2 + 2*\zeta*\omega_{n}*s + \omega_{n}^2} \label{REF2}
\end{equation}
\end{multicols}

\end{document}

This produces the following output:

Almost

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:

Weird_hyperref

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. – MaestroGlanz Jan 5 at 12:25
  • 2
    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. – Skillmon Jan 5 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 at 12:44
  • 1
    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. – David Carlisle Jan 5 at 13:00
1

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}
\begin{equation}
G_{1}(s) = \dfrac{k_{c}} {\tau_{c} * s + 1} \label{REF1}
\end{equation}
\begin{equation}
G_{2}(s) = \dfrac{\omega_{n}^2} {s^2 + 2*\zeta*\omega_{n}*s + \omega_{n}^2} \label{REF2}
\end{equation}
\end{multicols}

\end{document}

Output:

Output

0

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
   }
   \begin{equation}\seq_item:Nn \l__saiz_doubleeq_seq { 1 }\end{equation}
  \end{minipage}
  \begin{minipage}
   {
    \fp_eval:n
     {
      \l__saiz_doubleeq_r_fp / ( \l__saiz_doubleeq_l_fp + \l__saiz_doubleeq_r_fp )
     }
    \displaywidth
   }
   \begin{equation}\seq_item:Nn \l__saiz_doubleeq_seq { 2 }\end{equation}
  \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]
\begin{equation}
G_{3}(s)=s^2
\end{equation}
\lipsum[5]

\end{document}

enter image description here

0

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

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

result

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

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.