我怎样才能构建这个带有枚举方程的表格?

我怎样才能构建这个带有枚举方程的表格?

我正在尝试建立一个表格,其中左列列出了方程式,但它给出了错误。表格如下:

% Please add the following required packages to your document preamble:
% \usepackage{multirow}
\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{|c|c|}
\hline
\multirow{3}{*}{\begin{tabular}[c]{@{}c@{}}$\displaystyle\\ q=\mu_f h_{fg} {\left[\frac{g\left(\rho_l-\rho_v\right)}{g_c \sigma}\right]}^{1/2} {\left(\frac{c_{pl} \Delta T}{C_{sf} h_{fg} {Pr}^s_l}\right)}^3\\ $\end{tabular}}                                                                                                                                                                                                                                                                           & $\mu$: coeficiente de viscosidad dinámica                  \\ \cline{2-2} 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           & $h_{fg}$: calor latente de vaporización                    \\ \cline{2-2} 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           & $g$: aceleración de la gravedad                            \\ \hline
\multirow{3}{*}{\begin{tabular}[c]{@{}c@{}}$\displaystyle\\ q_{\text{máx}}=\frac{\pi}{24}h_{fg}\rho_v{\left[\frac{\sigma g g_c \left(\rho_l-\rho_v\right)}{\rho^2_v}\right]}^{1/4}{\left(1+\frac{\rho_v}{\rho_l}\right)}^{1/2}\\ $\end{tabular}}                                                                                                                                                                                                                                                           & $\rho$: densidad                                           \\ \cline{2-2} 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           & $g_c$: constante adimensional                              \\ \cline{2-2} 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           & $\sigma$: tensión superficial de la interfaz líquido/vapor \\ \hline
\multirow{5}{*}{\begin{tabular}[c]{@{}c@{}}$\displaystyle\\ Nu_D=\frac{h_bD}{k_v}=0,62{\left[\frac{g\rho_v\left(\rho_l-\rho_v\right)\left(h_{fg}+0,4c_{pv}\Delta T\right)D^3}{\mu_vk_v\Delta T}\right]}^{1/4}$\\ $\\ \\ $\displaystyle\\ q\_r=h\_r\Delta T$\\ $h\_r=\frac\{\sigma\_\{SB\}\epsilon\left(T\textasciicircum 4\_s-T\textasciicircum 4\_\{sat\}\right)\}\{T\_s-T\_\{sat\}\}\\ $\\ \\ $\displaystyle\\ h=h\_r+h\_b\{\left(\frac\{h\_b\}\{h\}\right)\}\textasciicircum \{1/3\}\\ \$\end{tabular}} & $c_{p}$: calor específico a presión constante              \\ \cline{2-2} 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           & $C_{s}$: cantidad empírica                                 \\ \cline{2-2} 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           & $Pr$: número de Prandtl                                    \\ \cline{2-2} 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           & $Nu$: número de Nusselt                                    \\ \cline{2-2} 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           & $D$: diámetro del cilindro                                 \\ \hline
\multirow{3}{*}{\begin{tabular}[c]{@{}c@{}}$\displaystyle\\ q_{\text{mín}}=0,09\rho_vh_{fg}{\left(\frac{\sigmag\left(\rho_l-\rho_v}{{\left(\rho_l+\rho_v}^2}\right)}^{1/4}\\ $\end{tabular}}                                                                                                                                                                                                                                                                                                               & $k$: conductividad térmica                                 \\ \cline{2-2} 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           & $\sigma_{SB}$: constante de Stefan-Boltzmann               \\ \cline{2-2} 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           & $\epsilon$: emisividad radiativa                           \\ \hline
\end{tabular}
\end{table}

有人知道如何修复它吗?

答案1

您的代码中存在大量各种语法错误。很抱歉,没有更直接/更礼貌的方式来告知您这个消息。此外,似乎没有采取任何措施来确保表格适合可用宽度。

以下代码试图纠正示例中包含的许多问题。我建议您逐行比较原始代码和下面的代码,以找出您需要如何调整(和改进)您的 LaTeX 编码实践。我所做的更改包括:(a) 删除不必要的花括号对,(b) 使用更少的\left和指令,(c)当您实际上想要 、 和 时,不要写\right、和,以及( d) 不要在数学模式下使用仅限文本模式的宏,例如。当然,永远不要尝试写;而应该只写。\_\^\{\}_^{}\textasciicircumT\textasciicircum 4T^4

恐怕我无法弄清楚左下角单元格中应该是什么。抱歉。首先,有太多\left指令没有对应的\right指令。

在此处输入图片描述

\documentclass[spanish]{article}
\usepackage{babel,multirow,amsmath,tabularx,ragged2e,geometry}
\newcolumntype{C}{>{$\displaystyle}c<{$}}          % for 1st column of "tabularx"
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X} % for 2nd col. of "tabularx"
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\begin{document}
\begin{table}
\caption{My caption}
\label{my-label}
\setlength\extrarowheight{2pt} % for a less-cramped "look"

\begin{tabularx}{\textwidth}{|c|L|} % use a "tabularx" env., not a "tabular" env.
\hline
\multirow{5}{*}{%
  \begin{tabular}[c]{@{}C@{}} 
  q=\mu_f h_{\mathit{fg}} \left[\frac{g(\rho_l-\rho_v)}{g_c \sigma}\right]^{1/2} 
    \left(\frac{c_{pl} \Delta T}{C_{sf} h_{\mathit{fg}} {\mathit{Pr}}^s_l}\right)^3\\
\end{tabular}}
 & $\mu$: coeficiente de viscosidad dinámica \\ \cline{2-2}
 & $h_{\mathit{fg}}$: calor latente de vaporización   \\ \cline{2-2}
 & $g$: aceleración de la gravedad  \\ 
\hline
\multirow{4}{*}{
  \begin{tabular}[c]{@{}C@{}} q_{\text{máx}}=\frac{\pi}{24}h_{\mathit{fg}}\rho_v
  \left[\frac{\sigma g g_c (\rho_l-\rho_v)}{\rho^2_v}\right]^{1/4}
  \left( 1+\frac{\rho_v}{\rho_l}\right)^{1/2}\\
  \end{tabular}}
  & $\rho$: densidad  \\ \cline{2-2}
  & $g_c$: constante adimensional \\ \cline{2-2}
  & $\sigma$: tensión superficial de la interfaz líquido\slash vapor \\ 
\hline
\multirow{7}{*}{\begin{tabular}[c]{@{}C@{}}
\begin{aligned}
  \mathit{Nu}_D&=\frac{h_bD}{k_v}=0{,}62\biggl[\frac{g\rho_v
  (\rho_l-\rho_v)(h_{\mathit{fg}}+0{,}4c_{pv}\Delta T)D^3}{\mu_vk_v\Delta T}\biggr]^{1/4^{\mathstrut}}\\
  q_r&=h_r\Delta T\\
  h_r&=\frac{\sigma_{SB}\epsilon(T^ 4_s-T^ 4_{\mathit{sat}})}{T_s-T_{\mathit{sat}}} \\ 
  h  &=h_r+h_b\biggl(\frac{h_b}{h}\biggr)^{1/3}
  \end{aligned}
  \end{tabular}}
  & $c_{p}$: calor específico a presión constante              \\ \cline{2-2}
  & $C_{s}$: cantidad empírica                                 \\ \cline{2-2}
  & $\mathit{Pr}$: número de Prandtl                                    \\ \cline{2-2}
  & $\mathit{Nu}$: número de Nusselt                           \\ \cline{2-2}
  & $D$: diámetro del cilindro                                 \\ \cline{2-2} 
  & \\
  & \\
\hline
\multirow{4}{*}{
  \begin{tabular}[c]{@{}C@{}} 
  q_{\text{mín}}=0{,}09\rho_v h_{\mathit{fg}} % sorry, just too many errors to deal with
  %% no idea how to fix the following equation
  %\left(\frac{\sigma_g \left(\rho_l-\rho_v}{{\left(\rho_l+\rho_v}^2}\right)^{1/4}
  \\
  \end{tabular}}
  & $k$: conductividad térmica                                 \\ \cline{2-2}
  & $\sigma_{SB}$: constante de Stefan-Boltzmann               \\ \cline{2-2}
  & $\epsilon$: emisividad radiativa                           \\ \hline
\end{tabularx}
\end{table}
\end{document}

答案2

这是一个可能的实现:

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{booktabs,array}

\newcommand{\eqdesc}[2]{%
  \begin{tabular}{@{}>{\raggedright\arraybackslash}p{#1}@{}}#2\end{tabular}%
}

\begin{document}

\begin{table}[htp]
\centering
\caption{My caption}\label{my-label}

\begin{tabular}{@{} >{$\displaystyle}l<{$} c @{}}
\toprule
q=\mu_f h_{fg} \left(\frac{g(\rho_l-\rho_v)}{g_c \sigma}\right)^{\!1/2}
     \left(\frac{c_{pl} \Delta T}{C_{sf} h_{fg} {Pr}^s_l}\right)^{\!3}
&
\eqdesc{.3\textwidth}{
 $\mu$: coeficiente de viscosidad dinámica \\
 $h_{fg}$: calor latente de vaporización \\
 $g$: aceleración de la gravedad
}
\\
\midrule
q_{\max} = \frac{\pi}{24}h_{fg}\rho_v 
           \left(\frac{\sigma g g_c (\rho_l-\rho_v)}{\rho^2_v}\right)^{\!1/4}
           \left(1+\frac{\rho_v}{\rho_l}\right)^{\!1/2}
&
\eqdesc{.3\textwidth}{
 $\rho$: densidad \\
 $g_c$: constante adimensional \\
 $\sigma$: tensión superficial de la interfaz líquido/vapor
}
\\
\midrule
\begin{aligned}
  \mathit{Nu}_D
    &=\frac{h_bD}{k_v} \\
    &=0{,}62\left(\frac{g\rho_v(\rho_l-\rho_v)(h_{fg}+0{,}4c_{pv}\Delta T)D^3}
                   {\mu_vk_v\Delta T}\right)^{\!1/4}
  \\
  q_r&=h_r\Delta T
  \\
  h_r&=\frac{\sigma_{\mathrm{SB}}\epsilon(T^4_s-T^4_{\mathrm{sat}})}{T_s-T_{\mathrm{sat}}}
  \\
  h&=h_r+h_b\left(\frac{h_b}{h}\right)^{\!1/3}
\end{aligned}
&
\eqdesc{.3\textwidth}{
 $c_{p}$: calor específico a presión constante \\
 $C_{s}$: cantidad empírica \\
 $\mathit{Pr}$: número de Prandtl \\
 $\mathit{Nu}$: número de Nusselt \\
 $D$: diámetro del cilindro
}
\\
\midrule
q_{\min}=0{,}09\rho_vh_{fg}\left(\frac{\sigma g(\rho_l-\rho_v)}{(\rho_l+\rho_v)^2}\right)^{\!1/4}
&
\eqdesc{0.3\textwidth}{
 $k$: conductividad térmica \\
 $\sigma_{\mathrm{SB}}$: constante de Stefan-Boltzmann \\
 $\epsilon$: emisividad radiativa
}
\\
\bottomrule
\end{tabular}

\end{table}

\end{document}

在此处输入图片描述

一种可能的改进,没有中间规则:

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{booktabs,array}

\begin{document}

\begin{table}[htp]
\centering
\caption{My caption}\label{my-label}

\begin{tabular}{@{} c c @{}}
\toprule
$\begin{aligned}
&q=\mu_f h_{fg} \left(\frac{g(\rho_l-\rho_v)}{g_c \sigma}\right)^{\!1/2}
     \left(\frac{c_{pl} \Delta T}{C_{sf} h_{fg} {Pr}^s_l}\right)^{\!3}
\\[1ex]
&q_{\max} = \frac{\pi}{24}h_{fg}\rho_v 
           \left(\frac{\sigma g g_c (\rho_l-\rho_v)}{\rho^2_v}\right)^{\!1/4}
           \left(1+\frac{\rho_v}{\rho_l}\right)^{\!1/2}
\\[1ex]
&\begin{aligned}
  \mathit{Nu}_D
  &=\frac{h_bD}{k_v} \\
  &=0{,}62\left(\frac{g\rho_v(\rho_l-\rho_v)(h_{fg}+0{,}4c_{pv}\Delta T)D^3}
                   {\mu_vk_v\Delta T}\right)^{\!1/4}
  \end{aligned}
\\[1ex]
&q_r=h_r\Delta T
\\[1ex]
&h_r=\frac{\sigma_{\mathrm{SB}}\epsilon(T^4_s-T^4_{\mathrm{sat}})}{T_s-T_{\mathrm{sat}}}
\\[1ex]
&h=h_r+h_b\left(\frac{h_b}{h}\right)^{\!1/3}
\\[1ex]
&q_{\min}=0{,}09\rho_vh_{fg}\left(\frac{\sigma g(\rho_l-\rho_v)}{(\rho_l+\rho_v)^2}\right)^{\!1/4}
\end{aligned}$
&
\begin{tabular}{@{}>{\raggedright\arraybackslash}p{.3\textwidth}@{}}
 $\mu$: coeficiente de viscosidad dinámica \\
 $h_{fg}$: calor latente de vaporización \\
 $g$: aceleración de la gravedad \\
 $\rho$: densidad \\
 $g_c$: constante adimensional \\
 $\sigma$: tensión superficial de la interfaz líquido/vapor \\
 $c_{p}$: calor específico a presión constante \\
 $C_{s}$: cantidad empírica \\
 $\mathit{Pr}$: número de Prandtl \\
 $\mathit{Nu}$: número de Nusselt \\
 $D$: diámetro del cilindro \\
 $k$: conductividad térmica \\
 $\sigma_{\mathrm{SB}}$: constante de Stefan-Boltzmann \\
 $\epsilon$: emisividad radiativa
\end{tabular}
\\
\bottomrule
\end{tabular}

\end{table}

\end{document}

在此处输入图片描述

相关内容