表格中的公式超出了页面的范围

表格中的公式超出了页面的范围

我查看了几个有关超出页面的表格的主题。我添加到前面主题的问题是,我使用的是方程式而不是文本。当我尝试缩短下标时,它会将方程式向前移动到边缘而不是将其置于内部中心。有没有办法规范化表格中的内容以使其适合页面?

\begin{table}[h]
    \centering
    \begin{tabular} {SS, |1|p{0.8\linewidth}|}   
    \toprule 
    Node & Thermal balance equation \\ 
    \midrule
   1           &$-\frac{k_{glass}~N_{sub}}{D_{glass}} \cdot     (T_1-T_2)-h_{Conv-top}(T_1-T_{Ambient})-h_{Rad-top-sky}(T_1-T_{sky})-h_{Rad-top-ground} (T_1-T_{ground})=0$ \\
   2       & $Q_{glass}+\frac{k_{glass}N_{sub}}{D_{glass}} (T_1-T_2)-\frac{k_{glass}N_{sub}}{D_{glass}} (T_2-T_3)=0$    \\
    3      & $Q_{glass}+\frac{k_{glass}N_{sub}}{D_{glass}} (T_2-T_3)-\frac{k_{glass}N_{sub}}{D_{glass}} (T_3-T_4)=0$   \\
    4-10    & \vdots    \\ 
    11       & $-\frac{k_{Backsheet}~N_{sub}}{D_{Backsheet}} \cdot     (T_{10}-T_{11})-h_{Conv-bottom}(T_{11}-T_{Ambient})-h_{Rad-bottom-sky}(T_{11}-T_{sky})-h_{Rad-bottom-ground} (T_{11}-T_{ground})=0$    \\ 
    \bottomrule
\end{tabular}
    \caption{Thermal properties of each layers}
    \label{tab: 3-1}
\end{table}

这是我所看到的: 在此处输入图片描述

答案1

我建议您采用tabularx占据文本块整个宽度并允许自动换行的环境。

在此处输入图片描述

\documentclass{article}
\usepackage{tabularx,array,booktabs}
\newcolumntype{Q}{>{\raggedright\arraybackslash$\displaystyle}X<{$}}
\newcommand{\vn}[1]{\mathrm{#1}}
\begin{document}
\begin{table}[h]
    %\centering
    \begin{tabularx}{\textwidth}{@{} l Q @{}}
    \toprule
    Node & $Thermal balance equation$ \\
    \midrule
    1&-\frac{k_{\vn{glass}}~N_{\vn{sub}}}{D_{\vn{glass}}} \cdot (T_1-T_2)-h_{\vn{Conv}-\vn{top}}
    (T_1-T_{\vn{Ambient}})
    -h_{\vn{Rad}-\vn{top}-\vn{sky}}(T_1-T_{\vn{sky}})
    -h_{\vn{Rad}-\vn{top}-\vn{ground}} (T_1-T_{\vn{ground}})=0 \\
    2 & Q_{\vn{glass}}+\frac{k_{\vn{glass}}N_{\vn{sub}}}{D_{\vn{glass}}} (T_1-T_2)
        -\frac{k_{\vn{glass}}N_{\vn{sub}}}{D_{\vn{glass}}} (T_2-T_3)=0    \\
    3 & Q_{\vn{glass}}+\frac{k_{\vn{glass}}N_{\vn{sub}}}{D_{\vn{glass}}} (T_2-T_3)
        -\frac{k_{\vn{glass}}N_{\vn{sub}}}{D_{\vn{glass}}} (T_3-T_4)=0   \\
    4--10 & \vdots    \\
    11 & -\frac{k_{\vn{Backsheet}}~N_{\vn{sub}}}{D_{\vn{Backsheet}}} 
         \cdot (T_{10}-T_{11})-h_{\vn{Conv}-\vn{bottom}}(T_{11}-T_{\vn{Ambient}})
         -h_{\vn{Rad}-\vn{bottom}-\vn{sky}}(T_{11}-T_{\vn{sky}})
         -h_{\vn{Rad}-\vn{bottom}-\vn{ground}} (T_{11}-T_{\vn{ground}})=0    \\
    \bottomrule
\end{tabularx}
    \caption{Thermal properties of each layers}
    \label{tab:3-1}
\end{table}
\end{document}

答案2

在您的代码片段中,您有奇怪的列类型:SS,。如果我用以下方法替换它们,c我会得到:

在此处输入图片描述

(红线表示页面布局)

\documentclass{article}
\usepackage{amsmath}
\usepackage{array, booktabs}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
\begin{table}[h]
    \centering
    \setlength\tabcolsep{4pt}
    \begin{tabular} {@{} c >{\raggedright\arraybackslash$\displaystyle}p{0.91\linewidth}<{$} @{}}
    \toprule
    Node & \text{Thermal balance equation} \\
    \midrule
1       &   -\frac{k_{\text{glass}} N_{\text{sub}}}{D_{\text{glass}}}     (T_1-T_2)-h_{\text{Conv-top}}(T_1-T_{\text{Ambient}}) - h_{\text{Rad-top-sky}}(T_1-T_{\text{sky}}) - h_{\text{Rad-top-ground}} (T_1-T_{\text{ground}})=0                  
        \\  \addlinespace[9pt]
2       &  Q_{\text{glass}} + \frac{k_{\text{glass}}N_{\text{sub}}}{D_{\text{glass}}} (T_1-T_2)-\frac{k_{\text{glass}}N_{\text{sub}}}{D_{\text{glass}}} (T_2-T_3)=0                         
        \\  \addlinespace[9pt]
3       &   Q_{\text{glass}}+\frac{k_{\text{glass}}N_{\text{sub}}}{D_{\text{glass}}} (T_2-T_3)-\frac{k_{\text{glass}}N_{\text{sub}}}{D_{\text{glass}}} (T_3-T_4)=0                         
        \\[12pt]
4-10    &   \qquad\vdots              
        \\  \addlinespace[9pt]
11      & -\frac{k_{\text{Backsheet}} N_{\text{sub}}}{D_{\text{Backsheet}}}     (T_{10}-T_{11})-h_{\text{Conv-bottom}}(T_{11}-T_{\text{Ambient}})-h_{\text{Rad-bottom-sky}}(T_{11} - T_{\text{sky}}) - h_{\text{Rad-bottom-ground}} (T_{11}-T_{\text{ground}})=0    \\
    \bottomrule
\end{tabular}
    \caption{Thermal properties of each layers}
    \label{tab: 3-1}
\end{table}
\end{document}

注意:对于变量索引中的文本,我使用\textamsmath package. Also some more vertical space betwee rows in table is introduced by\makegapedcells from the packagemakecells` 中的命令。

相关内容