表格内容重叠

表格内容重叠

我的表定义如下:


\documentclass{article}
\usepackage{vcell,caption}

\begin{document}
\begin{table}[ht]
\centering
  \captionsetup{justification=centering}
  \caption{Parameters}
  \label{tab:ParametersErrorRatePrediction}
\begin{tabular}{llll} 
\hline
\begin{tabular}[c]{@{}l@{}}Parametersused \\for prediction of:\end{tabular} & \begin{tabular}[c]{@{}l@{}}Parameter\\type\end{tabular} & Parameter                                                                                                                                                                              & Value                                                                   \\ 
\hline
\vcell{\begin{tabular}[b]{@{}l@{}}High-EnergyProton\\SEU Rate\end{tabular}} & \vcell{Weibull
Fit}                                     & \vcell{\begin{tabular}[b]{@{}l@{}}Saturated upset cross-section $[cm^2/bit]$\\Onset$[MeV]$\\Width $[MeV]$\\Exponent\end{tabular}}                                            & \vcell{\begin{tabular}[b]{@{}l@{}}3.0e-15\\18\\12\\1.5\\\end{tabular}}  \\[-\rowheight]
\printcellmiddle                                                            & \printcellmiddle                                        & \printcelltop                                                                                                                                                                          & \printcellmiddle                                                        \\
\begin{tabular}[c]{@{}l@{}}Heavy Ion\\SEU Rate\end{tabular}                 & Weibull
Fit                                             & \begin{tabular}[c]{@{}l@{}}Saturated upset cross-section $[cm^2/bit]$\\Onset $[MeV-cm^2/mg]$\\Width $[MeV-cm^2/mg]$\\Exponent\end{tabular} & \begin{tabular}[c]{@{}l@{}}2.0e-09\\0.8\\27\\0.88\end{tabular}          \\
\hline
\end{tabular}
\end{table}
\end{document}

结果我得到: 乳胶桌

但我想像这样创建它: 所需表

能否请你帮忙?

答案1

这里有一种使用 来制作该表的方法nicematrix

\documentclass{article}
\usepackage{nicematrix,booktabs}
\usepackage{caption}
\usepackage{siunitx}
\usepackage{lipsum}
\usepackage{geometry}

\begin{document}
\lipsum[1]

\begin{table}[ht]
\centering
  \captionsetup{justification=centering}
  \caption{Parameters}
  \label{tab:ParametersErrorRatePrediction}
\begin{NiceTabular*}{\textwidth}{@{\extracolsep{\fill}}lclc@{}}
\toprule
\Block{}{Parameters used \\for prediction of}
& \Block{}{Parameter\\type}
& Parameter
& Value \\
\midrule
\Block{4-1}{High-EnergyProton\\SEU Rate} & \Block{4-1}{Weibull Fit} 
&   Saturated upset cross-section (\si{cm^2/bit}) & $3.0\cdot 10^{-15}$ \\
&& Onset (\si{MeV}) & 18 \\
&& Width (\si{MeV}) & 12 \\
&& Exponent &  1.5 \\[1ex]
\Block{4-1}{Heavy Ion\\SEU Rate} & \Block{4-1}{Weibull Fit}
&   Saturated upset cross-section (\si{cm^2/bit}) & $2.0\cdot 10^{-9}$ \\
&& Onset (\si{MeV}, \si{cm^2/mg}) & 0.8 \\
&& Width (\si{MeV}, \si{cm^2/mg}) & 27 \\
&& Exponent & 0.88 \\
\bottomrule
\end{NiceTabular*}

\end{table}
\end{document}

您需要进行多次编译(因为nicematrix在后台使用了 PGF/tikz 节点)。

上述代码的输出

答案2

使用最近的 MikTeX 安装我无法重现您的问题,但是您可以考虑为您的表采用以下解决方案:

\documentclass{article}
\usepackage[skip=1ex]{caption}
\usepackage{booktabs, tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcolumntype{M}[1]{>{\raggedright\arraybackslash}m{#1}}
\usepackage{siunitx}


\begin{document}
    \begin{table}[ht]
    \centering
    \small
\caption{Parameters}
\label{tab:ParametersErrorRatePrediction}
    \setlength\tabcolsep{4pt}
    \renewcommand\tabularxcolumn[1]{m{#1}}
\begin{tabularx}{\linewidth}{@{} M{7em} M{5em} L M{3.3em} @{}}
    \toprule
Parametersused for prediction of 
    & Parameter type 
        & Parameter
            & Value                                         \\
    \midrule
High-Energy Proton SEU Rate 
    &  Weibull Fit 
        & Saturated upset cross-section [\si{\centi\metre^2\per bit}]\newline 
          Onset [\si{\mega\electronvolt}]\newline 
          Width [\si{\mega\electronvolt}]\newline 
          Exponent                                         
            & 3.0e-15\newline 18\newline 12\newline 1.5     \\
    \addlinespace
Heavy Ion\newline SEU Rate                
    & Weibull Fit 
        & Saturated upset cross-section [\si{\centi\metre^2\per bit}]\newline 
          Onset [\si{\mega\electronvolt}-\si{\centi\metre^2\per\milli\gram}]\newline
          Width [\si{\mega\electronvolt}-\si{\centi\metre^2\per\milli\gram}]\newline
          Exponent 
            & 2.0e-09\newline 0.8\newline 27\newline 0.88   \\
    \bottomrule
\end{tabularx}
    \end{table}
\end{document}

在此处输入图片描述

相关内容