我怎样才能使最后两列水平均匀分布?
以下是代码:
\documentclass{article}
\usepackage{array,multirow,amsmath}
\providecommand\legend[1]{#1} % ??
\begin{document}
\begin{table}[!h]
\caption{Análise de Sensibilidade dos parâmetros $\overline{N u}_{L_{p}}$
e $R a_{L_{P}}$, em função das respectivas incertezas de medição
de influência.}
\begin{tabular}{c|c|c|c|c|c|c|c}
\hline
\multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}%
Variação Percentual da\\
Incerteza de Medição
\end{tabular}} &
\multicolumn{5}{c|}{Variação Percentual do $\delta_{\overline{N u}_{L_{p}}}$, conforme
variações nas incertezas:}
& \multicolumn{2}{c}{Variação Percentual do $\delta_{R a_{L_{p}}}$,
conforme variações nas incertezas:}
\\
\cline{2-8}
& $\delta _{C_{t}}$
& $\delta _{m_{P}}$
& $\delta _{L_{P}}$
& $\delta _{\epsilon}$
& $\delta _{\overline{T}_{\text {inicial}}} =
\delta _{\overline{T}_{\text {final}}} =
\delta _{\overline{T}_{\infty}}$
& $\delta _{L_{P}}$
& $\delta _{\overline{T}_{\text {inicial}}} =
\delta _{\overline{T}_{\text {final}}} =
\delta _{\overline{T}_{\infty}}$
\\ \hline
-90\% & -0,1058\% & -0,0797\% & -0,0029\% & -88,0945\% & -0,0204\% & -0,0879\% & -89,1567\%
\\ \hline
-75\% & -0,1002\% & -0,0755\% & -0,0028\% & -74,2216\% & -0,0193\% & -0,0833\% & -74,6693\%
\\ \hline
-50\% & -0,0801\% & -0,0604\% & -0,0022\% & -49,6848\% & -0,0154\% & -0,0666\% & -49,8670\%
\\ \hline
-25\% & -0,0467\% & -0,0352\% & -0,0013\% & -24,8771\% & -0,0090\% & -0,0388\% & -24,9482\%
\\ \hline
+25\% & 0,0601\% & 0,0453\% & 0,0017\% & 24,9051\% & 0,0116\% & +0,0499\% & +24,9600\%
\\ \hline
+50\% & 0,1334\% & 0,1006\% & 0,0037\% & 49,8242\% & 0,0257\% & +0,1109\% & +49,9260\%
\\ \hline
+75\% & 0,2200\% & 0,1659\% & 0,0061\% & 74,7514\% & 0,0424\% & +0,1829\% & +74,8953\%
\\ \hline
+90\% & 0,2784\% & 0,2099\% & 0,0077\% & 89,7102\% & 0,0537\% & +0,2314\% & +89,8780\%
\\ \hline
+100\%& 0,3199\% & 0,2412\% & 0,0088\% & 99,6835\% & 0,0617\% & +0,2660\% & +99,8668\%
\\ \hline
\end{tabular}
\label{tab:sensib}
\legend{Fonte: Próprio Autor.}
\end{table}
%\FloatBarrier % ??
\end{document}
答案1
表格中的文字太多了。只有换行或简单地减少单词数量才有用。
以下解决方案仅供参考。我猜我把单词划分错了,所以你必须自己解决。我还添加了booktabs
和,siunitx
以便更好地呈现。
编辑。我在第一种方法中遗漏了两个细节。第一个是关于所有数字的注释,这些数字代表百分比。另一个是作者注释。
\documentclass{article}
\usepackage{geometry}
\usepackage{array,multirow,amsmath}
\usepackage{makecell} % for \makecell and \cellalign
\usepackage{booktabs} % for improved rules
\usepackage{siunitx} % for number formatting in tables
% \providecommand\legend[1]{#1} % ??
\begin{document}
\begin{table}[tbh]
\centering
\small
\renewcommand{\arraystretch}{1.25}
\renewcommand{\tabcolsep}{0pt}
\renewcommand{\cellalign}{t}
\caption{Análise de Sensibilidade dos parâmetros $\overline{N u}_{L_{p}}$
e $R a_{L_{P}}$, em função das respectivas incertezas de medição
de influência.}
\begin{tabular*}{\linewidth}{
@{}
@{\extracolsep{\fill}}
S[table-format=-3]
*3{S[table-format=-1.4]}
S[table-format=-2.4]
*2{S[table-format=-1.4]}
S[table-format=-2.4]
@{}
}
\addlinespace\toprule
{\multirow[t]{2}*{\makecell{
Variação\\
Percentual\\
da\\
Incerteza\\
de\\
Medição}}}
& \multicolumn{5}{c}{%
\makecell{%
Variação Percentual do \smash{\(\delta_{\overline{N u}_{L_{p}}}\)}\\
conforme variações nas incertezas:}}
& \multicolumn{2}{c}{%
\makecell{%
Variação Percentual\\do \smash{\(\delta_{R a_{L_{p}}}\)} conforme\\
variações nas incertezas:}} \\
\cmidrule{2-6}\cmidrule{7-8}
& {\(\delta _{C_{t}}\)}
& {\(\delta _{m_{P}}\)}
& {\(\delta _{L_{P}}\)}
& {\(\delta _{\epsilon}\)}
& {\makecell[t]{%
\(\delta _{\overline{T}_{\text {inicial}}}\)\\
\(\delta _{\overline{T}_{\text {final}}}\)\\
\(\delta _{\overline{T}_{\infty}}\)}}
& {$\delta _{L_{P}}$}
& {\makecell[t]{%
\(\delta _{\overline{T}_{\text {inicial}}}\)\\
\(\delta _{\overline{T}_{\text {final}}}\)\\
\(\delta _{\overline{T}_{\infty}}\)}} \\
\addlinespace\midrule
-90 & -0,1058 & -0,0797 & -0,0029 & -88,0945 & -0,0204 & -0,0879 & -89,1567 \\
-75 & -0,1002 & -0,0755 & -0,0028 & -74,2216 & -0,0193 & -0,0833 & -74,6693 \\
-50 & -0,0801 & -0,0604 & -0,0022 & -49,6848 & -0,0154 & -0,0666 & -49,8670 \\
-25 & -0,0467 & -0,0352 & -0,0013 & -24,8771 & -0,0090 & -0,0388 & -24,9482 \\
+25 & 0,0601 & 0,0453 & 0,0017 & 24,9051 & 0,0116 & +0,0499 & +24,9600 \\
+50 & 0,1334 & 0,1006 & 0,0037 & 49,8242 & 0,0257 & +0,1109 & +49,9260 \\
+75 & 0,2200 & 0,1659 & 0,0061 & 74,7514 & 0,0424 & +0,1829 & +74,8953 \\
+90 & 0,2784 & 0,2099 & 0,0077 & 89,7102 & 0,0537 & +0,2314 & +89,8780 \\
+100& 0,3199 & 0,2412 & 0,0088 & 99,6835 & 0,0617 & +0,2660 & +99,8668 \\
\bottomrule
\multicolumn{8}{c}{Note: a note that all quantities are in (\%)} \\
\multicolumn{8}{@{}l}{Fonte: Próprio Autor.}
\end{tabular*}
\label{tab:sensib}%\legend{Fonte: Próprio Autor.}
\end{table}
%\FloatBarrier % ??
\end{document}
答案2
主要问题是标题中的长文本会将列拉得太宽。我已将最后两列的标题文本替换为
\multicolumn{2}{c}{
\parbox{16em}{
\centering\smallskip
Variação Percentual do $\delta_{R a_{L_{p}}}$,
conforme variações nas incertezas:
\smallskip
}
}
将文本限制为 16em(大约 20 个大写字母的宽度)。
(请注意,它缺少图例。我不知道您为此使用了什么软件包。)
此外,我已将列设置为等宽(长$delta ... = delta ... = delta ...$
列除外)。这是通过在\begin{document}
代码前添加
\usepackage{array}
\newcolumntype{P}{>{\centering\arraybackslash}p{6em}}
现在,除了c
列对齐,我们还可以使用P
。这也是一个居中的列,但6em
宽度恰好。我{c|c|...|c}
用替换了您的{c|P|P|P|P|c|P|c}
。这将给出所示的结果。
该图片背后的完整代码(也在 pastebin 上):https://pastebin.com/8StLqGUm):
% Source: https://tex.stackexchange.com/questions/598089/columns-horizontal-alignment/598091#598091
\documentclass[a4paper,landscape]{article}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{amsmath,amssymb}
\usepackage[margin=2.5cm]{geometry}
\usepackage{array}
\newcolumntype{P}{>{\centering\arraybackslash}p{6em}}
\begin{document}
\begin{table}[!h]
\caption{Análise de Sensibilidade dos parâmetros $\overline{N u}_{L_{p}}$ e $R a_{L_{P}}$, em função das respectivas incertezas de medição de influência.}
%
\begin{tabular}{c*{4}{|P}|c*{1}{|P}|c}
\hline
\multirow{2}{*}{
\begin{tabular}[c]{@{}c@{}}Variação Percentual da\\ Incerteza de Medição\end{tabular}} &
\multicolumn{5}{c|}{
Variação Percentual do $\delta_{\overline{N u}_{L_{p}}}$, conforme variações nas incertezas:
}
&
\multicolumn{2}{c}{
\parbox{16em}{
\centering\smallskip
Variação Percentual do $\delta_{R a_{L_{p}}}$,
conforme variações nas incertezas:
\smallskip
}
}
\\ \cline{2-8}
& $\delta _{C_{t}}$ & $\delta _{m_{P}}$ & $\delta _{L_{P}}$ & $\delta _{\epsilon}$ & $\delta _{\overline{T}_{\text {inicial}}} = \delta _{\overline{T}_{\text {final}}} = \delta _{\overline{T}_{\infty}}$ & $\delta _{L_{P}}$ & $\delta _{\overline{T}_{\text {inicial}}} = \delta _{\overline{T}_{\text {final}}} = \delta _{\overline{T}_{\infty}}$ \\ \hline
-90\% & -0,1058\% & -0,0797\% & -0,0029\% & -88,0945\% & -0,0204\% & -0,0879\% & -89,1567\% \\ \hline
-75\% & -0,1002\% & -0,0755\% & -0,0028\% & -74,2216\% & -0,0193\% & -0,0833\% & -74,6693\% \\ \hline
-50\% & -0,0801\% & -0,0604\% & -0,0022\% & -49,6848\% & -0,0154\% & -0,0666\% & -49,8670\% \\ \hline
-25\% & -0,0467\% & -0,0352\% & -0,0013\% & -24,8771\% & -0,0090\% & -0,0388\% & -24,9482\% \\ \hline
+25\% & 0,0601\% & 0,0453\% & 0,0017\% & 24,9051\% & 0,0116\% & +0,0499\% & +24,9600\% \\ \hline
+50\% & 0,1334\% & 0,1006\% & 0,0037\% & 49,8242\% & 0,0257\% & +0,1109\% & +49,9260\% \\ \hline
+75\% & 0,2200\% & 0,1659\% & 0,0061\% & 74,7514\% & 0,0424\% & +0,1829\% & +74,8953\% \\ \hline
+90\% & 0,2784\% & 0,2099\% & 0,0077\% & 89,7102\% & 0,0537\% & +0,2314\% & +89,8780\% \\ \hline
+100\% & 0,3199\% & 0,2412\% & 0,0088\% & 99,6835\% & 0,0617\% & +0,2660\% & +99,8668\% \\ \hline
\end{tabular}
\label{tab:sensib}
%\legend{Fonte: Próprio Autor.}
\end{table}
\end{document}