我需要您的帮助:我试图并排写出两个方程式,并且我能够做到这一点。但是,这两个方程式是等价的,所以我需要在它们之间添加等价符号,那么我该如何在下面的代码中添加它呢?非常感谢。
\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}
答案1
我会使用小页面,没有明确的垂直间距;只\vphantom
需要一行来平衡右侧的分数。
\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}
一些注释:我将大多数\textrm
命令更改为\mathrm
,定义轨迹和对角线的运算符名称。
最重要的是:永远不要使用eqnarray
。