I want to achieve a table like this:

enter image description here

I tried as:

    \caption{Optimization Problem Formalization Equations}
            max(profit - expenditure)


But it reporte a error: you can't use `\eqno in restricted horizontal mode?

  • Please always provide a full but minimal example that others can copy and test as is. Here, there is no document class or preamble
    – daleif
    Commented Apr 21, 2022 at 12:30
  • Why exactly are you placing numbered equations inside a floating table? That seems to be asking for trouble.
    – daleif
    Commented Apr 21, 2022 at 12:32
  • As has already been requested, please complete your code. E.g. from the preamble we learn more about what you use and perhaps miss using. Thanks
    – MS-SPO
    Commented Apr 21, 2022 at 12:34
  • Sorry, I have re-edited my example
    – Acbogu
    Commented Apr 21, 2022 at 13:09

1 Answer 1


I would like to suggest that you not employ a tabular environment. Instead, use (i) a couple of \hrule directives to draw lines that span the width of a column and (b) multline and alignat display math environments that are provided by the amsmath package.

enter image description here

% for '\DeclareMathOperator*' macro and 'multline' and 'alignat' environments:

\stepcounter{table} % just for this example

    \caption{Optimization Problem Formalization Equations}
    \hrule % draw a full-width horizontal line 
    \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} 
    subject to:
    \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
    \hrule % draw another full-width horizontal line

  • But if that floating table moves, how do you get around the problem of proper numbering (assuming that there are other numbered equations in the man text)? Commented Apr 21, 2022 at 14:13
  • 1
    @barbarabeeton - Thanks. To be honest, I can't say I understand why the OP wants to place the equation and the three inequalities in a table environment. It may well be preferable to place the material in a non-floating minipage environment and to use a \tableof instruction to create the equivalent of a table-type caption. Hopefully, the OP will weigh in with some more information.
    – Mico
    Commented Apr 21, 2022 at 14:52
  • Thank you Mico, It's works!
    – Acbogu
    Commented Apr 22, 2022 at 2:12

You must log in to answer this question.

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