我想要实现这样的表格:
我尝试过:
\documentclass[10pt,conference]{IEEEtran}
\begin{document}
\begin{table}[]
\centering
\caption{Optimization Problem Formalization Equations}
\label{tab:my_label}
\begin{tabular}{c}
\hline
\begin{equation}
max(profit - expenditure)
\end{equation}
\hline
\end{tabular}
\end{table}
\end{document}
但是它报告一个错误:您不能在受限水平模式下使用“\eqno?”
答案1
我想建议你不是使用tabular
环境。相反,使用 (i) 几个\hrule
指令来绘制跨越列宽的线和 (b)multline
并alignat
显示包提供的数学环境amsmath
。
\documentclass[10pt,conference]{IEEEtran}
% for '\DeclareMathOperator*' macro and 'multline' and 'alignat' environments:
\usepackage{amsmath}
\DeclareMathOperator*{\argmin}{arg\,min}
\begin{document}
\stepcounter{table} % just for this example
\begin{table}[h]
\caption{Optimization Problem Formalization Equations}
\label{tab:my_label}
\hrule % draw a full-width horizontal line
\begin{multline}
\argmin_{x\in\Omega} \biggl(\, \sum_{h\in H}
\Bigl[ W^{\mathrm{cpu}}_h\sum_{f\in s} r_{rv} x_{\!fh}
+ W^{\min}_h y_h \Bigr] \\
+ \sum_{i\in L} W_{\mathrm{net}}\sum_f b^s_v x_{\!fh}
\biggl)
\end{multline}
subject to:
\begin{alignat}{2}
\sum_{f\in s} r_{rv}x_{\!fh} &\le y_h a_{rh} & \qquad
& \forall \ h\in H,\ r\in R \\
\sum_{f\in s} b^s_vx_{\!fh} &\le g_ib_i
&& \forall \ i\in L \\
\sum_{h\in H}\sum_{f\in s} l_v x_{\!fh} +
\sum_{i\in L}\sum_{f\in s} p^s_i x_{\!fh} &\le l^s
&& \forall \ h\in H,\ i\in L
\end{alignat}
\hrule % draw another full-width horizontal line
\end{table}
\end{document}