1

I need your help in the following: I was trying to write two equations side by side and I was able to achieve this. However, these 2 eqts are equivalent so I need to add an equivalent sign between them, so how can I add it in the code below? Many thx.

enter image description here

 \begin{subequations}\label{matrix_and_trace}
    \begin{tabularx}{\textwidth}{Xp{2cm}X}
        \begin{eqnarray}
        &\textrm{\textbf{Original \textit{Matrix} Lifting}}\nonumber\\
        [-0.5em]
        & \max_{\bm Y_{\textrm{RS}}} \frac{1}{2} \textrm{Tr} (\bm L \bm Y_{\textrm{RS}}) \nonumber\\ 
        [-0.5em]
        & \textrm{s.t.}~\textrm{diag}(\bm Y_{\textrm{RS}})  = \textcolor{red}{\bm u_n} \nonumber\\
        [-0.5em]
        & k\bm Y_{\textrm{RS}} - \bm J_{n} \succeq 0 \nonumber\\
        [-0.5em]
        &\bm Y_{\textrm{RS}}  \geq 0\nonumber\\
        [-0.5em]
        &\textrm{Tr}(\bm J \bm Y_{\textrm{RS}})= \sum_{i=1}^k m_i^2
        \end{eqnarray}
        & & 
        \begin{eqnarray}
        & \textrm{\textbf{Original \textit{Trace} Formulation}}\nonumber\\ 
        [-0.5em]
        & \max_{\bm Y_{\textrm{FJ}}}  \frac{k-1}{2k} \textrm{Tr} (\bm L \bm Y_{\textrm{FJ}})\nonumber\\
        [-0.5em]
        &\textrm{s.t.}~ \textrm{diag}(\bm Y_{\textrm{FJ}}) = \bm u_n\nonumber\\
        [-0.5em]
        &\textcolor{red}{\bm Y_{\textrm{FJ}} \succeq 0}\nonumber\\
        [-0.5em]
        &(Y_{i,j})_{\textrm{FJ}}\geq \frac{-1}{k-1}, i \neq j \nonumber\\
        [-0.5em]
        &\textrm{Tr}(\bm J \bm Y_{\textrm{FJ}}) = \frac{1}{k-1}(k \sum_{i=1}^k m_i^2 - n^2)
        \end{eqnarray}
    \end{tabularx}
\end{subequations}
4
  • 2
    Could you please make your code compilable by adding the documentclass as well as the relevant packages and definitions?
    – leandriis
    Apr 20, 2019 at 9:35
  • 2
    Hello, and welcome to the site! To get help with this you should try to help any potential helpers by making a minimal, complete, working example. To do so: (1) make a copy of your original document; (2) strip down the copy until it demonstrates the problem/issue (3) post it in your question.
    – cmhughes
    Apr 20, 2019 at 9:41
  • Do you want one on every row? Apr 20, 2019 at 15:24
  • Thank you for your help.
    – salam
    May 21, 2019 at 9:29

1 Answer 1

1

I'd use minipages, with no explicit vertical spacings; just a \vphantom is needed in one row to balance the fraction on the right side.

\documentclass{article}
\usepackage{amsmath,bm}
\usepackage{xcolor}

\DeclareMathOperator{\Tr}{Tr}
\DeclareMathOperator{\diag}{diag}


\begin{document}


\begin{subequations}\label{matrix_and_trace}
\begin{center}
\begin{minipage}{0.35\columnwidth}
\centering
\textbf{Original \textit{Matrix} Lifting}
\begin{gather}
\max_{\bm{Y}_{\mathrm{RS}}} \frac{1}{2} \Tr (\bm{L} \bm{Y}_{\mathrm{RS}}) \nonumber
\\
\text{s.t. }\diag(\bm{Y}_{\mathrm{RS}})  = \textcolor{red}{\bm{u}_n} \nonumber
\\
k\bm{Y}_{\mathrm{RS}} - \bm{J}_{n} \succeq 0 \nonumber
\\
\bm{Y}_{\mathrm{RS}}  \geq 0 \vphantom{\frac{-1}{k-1}}\nonumber
\\
\Tr(\bm{J} \bm{Y}_{\mathrm{RS}})= \sum_{i=1}^k m_i^2
\end{gather}
\end{minipage}\hfill$\iff$\hfill
\begin{minipage}{0.55\columnwidth}
\centering
\textbf{Original \textit{Trace} Formulation}
\begin{gather}
\max_{\bm{Y}_{\mathrm{FJ}}}  \frac{k-1}{2k} \Tr (\bm{L} \bm{Y}_{\mathrm{FJ}})\nonumber
\\
\text{s.t. } \diag(\bm{Y}_{\mathrm{FJ}}) = \bm{u}_n\nonumber
\\
\textcolor{red}{\bm{Y}_{\mathrm{FJ}} \succeq 0}\nonumber
\\
(Y_{i,j})_{\mathrm{FJ}}\geq \frac{-1}{k-1}, i \neq j \nonumber
\\
\Tr(\bm{J} \bm{Y}_{\mathrm{FJ}}) = \frac{1}{k-1}(k \sum_{i=1}^k m_i^2 - n^2)
\end{gather}
\end{minipage}
\end{center}
\end{subequations}

\end{document}

enter image description here

Some notes: I changed most of the \textrm commands to \mathrm, defining operator names for the trace and diagonal.

Most importantly: never use eqnarray.

1
  • Thank you for your useful comment.
    – salam
    May 21, 2019 at 9:29

You must log in to answer this question.

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