这是我的表格,给出错误:未定义控制序列错误

这是我的表格,给出错误:未定义控制序列错误
\begin{table*}
\caption{Possible Cases }
\begin{tabular}{ p{2.5cm} p{2.5cm} p{1.5cm} p{7cm} p{2.5cm}}
\toprule
 \head {Cases} & \head {Power consumption}  & \head {RTEP} & \head {Cost}\\
\midrule
 \rmfamily Min$\varphi(t)$,Min $\varepsilon(t)$& \rmfamily 1.5 & \rmfamily 8.11 & \rmfamily 12.16\\
  \rmfamily Max$\varphi(t)$,Min$\varepsilon(t)$ & \rmfamily 13.84 & \rmfamily 8.11&\rmfamily 112.24\\
  \rmfamily Min$\varphi(t)$,Max$\varepsilon(t)$&\rmfamily 1.5 &\rmfamily 13.84& \rmfamily 112.24\\
  \rmfamily Max$\varphi(t)$,Max$\varepsilon(t)$ &\rmfamily 13.84 & \rmfamily27.35& \rmfamily378.5\\
\bottomrule
  \end{tabular}
\label{table:trade} % is used to refer this table in the text
\end{table*}

答案1

也许这就是你想要的?

\documentclass[twocolumn]{article}

\usepackage{siunitx}
\usepackage{makecell, booktabs, caption}

\renewcommand\theadfont{\normalsize\bfseries}

\usepackage{amsmath}
\DeclareMathOperator{\Min}{Min}
\DeclareMathOperator{\Max}{Max}

\begin{document}

\begin{table*}
  \sisetup{table-format=2.2, table-number-alignment=center}
  \setlength\extrarowheight{3pt}
  \centering
  \caption{Possible Cases }
  \begin{tabular}{lSSS[table-format=3.2]}
    \toprule
    \thead {Cases} & {\thead {Power & & \\ consumption}} & {\thead {RTEP}} & {\thead {Cost}}\\
    \midrule
    $ \Min\varphi (t), \Min\varepsilon (t) $ & 1.5 & 8.11 & 12.16 \\
    $ \Max\varphi (t), \Min\varepsilon (t) $ & 13.84 & 8.11 & 112.24 \\
    $ \Min\varphi (t), \Max\varepsilon (t) $ & 1.5 & 13.84 & 112.24 \\
    $ \Max\varphi (t), \Max\varepsilon (t) $ & 13.84 & 27.35 & 378.5 \\
    \bottomrule
  \end{tabular}
  \label{table:trade} % is used to refer this table in the text
\end{table*}

\end{document}

在此处输入图片描述

答案2

\documentclass[11pt]{article}
% \toprule, \bottomrule, \midrule belong to package. I have removed %them. Just use \hrule as shown here.

\begin{document}

\begin{table*}[h]
\caption{Possible Cases }
\vspace{1cm}

\begin{tabular}{ p{4 cm} p{3 cm} p{3 cm} p{3cm}}\hline
  \bf {Cases} & \bf {Power}  & \bf {RTEP} & \bf {Cost}\\
& \bf{consumption} & \\  
  \hline
%\head is not defined.
&&& \\
  Min$\varphi(t)$,Min $\varepsilon(t)$&  1.5 & 8.11 &  12.16\\
  &&&\\
   Max$\varphi(t)$,Min$\varepsilon(t)$ & 13.84 &  8.11& 112.24\\
   &&&\\
  Min$\varphi(t)$,Max$\varepsilon(t)$& 1.5 &  13.84& 112.24\\
  &&& \\
   Max$\varphi(t)$,Max$\varepsilon(t)$ & 13.84 & 27.35& 378.5\\
\hline
  \end{tabular}
\label{table:trade} % is used to refer this table in the text
\end{table*}
\end{document}
% Since no packages are added here, I have to remove them. I have tested it. If you need a gap between lines just add &&&\\.

相关内容