不使用 \resizebox 将大表格放入页面

不使用 \resizebox 将大表格放入页面

我试图将下表放入一页,但\resizebox字体大小发生了变化,导致其与文档的其余部分相比太小。

以下是我使用的代码\resizebox

\begin{table}
\centering
\resizebox{\textwidth}{!}{%
    \begin{tabular}{llcl}
        \toprule
        \multicolumn{1}{c}{\textbf{Region}} & \multicolumn{1}{c}{\textbf{\begin{tabular}[c]{@{}c@{}}Inferred by experiment\end{tabular}}}                                         & Protein1                                                              & \multicolumn{1}{c} protein2                            \\ \midrule
        &                                                                                                                                       & \multicolumn{2}{c}{\textbf{Structure at T0}}                                                                                                                               \\ \cline{3-4}
        &                                                                                                                                       & \multicolumn{1}{l}{{\color[HTML]{333333} \begin{tabular}[c]{@{}l@{}}F74, T75, E76, D77, M79, \textbf{\textcolor{red}{V80}}, P81, \textbf{\textcolor{red}{G83}}, L84, \\ T86, G87, Q88, A90, L91\end{tabular}}}                                                                                                                                                                   & \begin{tabular}[c]{@{}l@{}}V6, P7, G10, L11, L13, V14, L17, G18,\\ F20, M21, Y24 V26, R27, M79,\textbf{\textcolor{red}{V80}},\\ L82, \textbf{\textcolor{red}{G83}}, L84, Y85, T86, G87, A90  \end{tabular}                                                                        \\ \cline{3-4}
        &                                                                                                                                       & \multicolumn{2}{c}{\textbf{Equilibrated structures}}                                                                                                                                               \\ \cline{3-4}
        \multirow{-10}{*}{Protein interface}   & \multirow{-10}{*}{\begin{tabular}[c]{@{}l@{}}V80, G83, Q88, N92,\\ W93, W95, I98,\\ F100, G101, A102,\\ D111, V118\end{tabular}} & \multicolumn{1}{l}{\begin{tabular}[c]{@{}l@{}}M1, P2, S4, W5, P7, A8, G10, L11, T12,L13, V14, \\ P15, L17, G18, M21, G22, F25,V26, E29, Y34, \\ L37, K39, P40, R46, V67,W68, E70, L71, D77, \\ A78, M79, \textbf{\textcolor{red}{V80}}, P81,L82, \textbf{\textcolor{red}{G83}}, Y85, T86, G87, \end{tabular}} & \begin{tabular}[c]{@{}l@{}}S4, V6, P7, V9, G10, L11, T12, L13, V14,\\ P15, L17, G18, F20, M21, G22, Y24,\\ F25, V26, R27, G28, E29, G30, L31, R32  \end{tabular} 
        \\ \bottomrule
    \end{tabular}
}
\caption{Table} \end{table}

该表如下所示:

在此处输入图片描述

我也尝试过使用\begin{adjustbox}{width=\textwidth},但没有得到想要的输出。还有其他建议吗?非常感谢您的帮助。

答案1

像这样?

在此处输入图片描述

  • 您没有提供 MWE(最小工作示例),这是一份包含表格的小型但完整的文档。因此您的页面布局未知。
  • 为了演示如何设置表格,我使用articledocumentclass 并使用包确定页面布局geometry
  • tabular*您可以使用、、xtabular包等确定表格宽度tabularray……
  • 在下面使用的 MWEtabularray包。
  • 目前还不完全清楚表格应该是什么样子,所以 MWE 只是猜测你可能喜欢展示表格设计。
\documentclass{article}
\usepackage{geometry}
\usepackage[skip=0.33\baselineskip]{caption}
\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\newcommand\bfc[1]{\textbf{\textcolor{red}{#1}}}

\usepackage{lipsum}


\begin{document}
    \begin{table}
    \caption{Table}
    \label{tab:?}
\begin{tblr}{colspec={@{} X[0.3,l] X[0.7, l] X[j] X[j] @{}},
             row{1}={font=\bfseries,c,m}
             }
    \toprule
Region  &   Inferred by experiment  
            & Protein 1     
                &   Protein 2   \\ 
    \midrule
\SetCell[r=4]{l} Protein interface
        &   \SetCell[r=4]{l}    V80, G83, Q88, N92,
                                W93, W95, I98,
                                F100, G101, A102,
                                D111, V118
            &   \SetCell[c=2]{c, font=\bfseries}    Structure at T0
                &               \\ 
    \midrule
        &   &   F74, T75, E76, D77, M79, \bfc{V80}, P81,
                \bfc{G83}, L84, T86, G87, Q88, A90, L91                                                                                                                                                                 &   V6, P7, G10, L11, L13, V14, L17, G18,
                    F20, M21, Y24 V26, R27, M79, \bfc{V80},
                    L82, \bfc{G83}, L84, Y85, T86, G87, A90
                                \\ 
    \midrule[dashed]
       &   &   \SetCell[c=2]{c, font=\bfseries} Equilibrated 
                &               \\ 
    \midrule
        &   &   M1, P2, S4, W5, P7, A8, G10, L11, T12,L13, V14,
                P15, L17, G18, M21, G22, F25,V26, E29, Y34,
                37, K39, P40, R46, V67,W68, E70, L71, D77,
                A78, M79, \bfc{V80}, P81,L82, \bfc{G83}, Y85, T86, G87,
                &   S4, V6, P7, V9, G10, L11, T12, L13, V14,
                    P15, L17, G18, F20, M21, G22, Y24,
                    F25, V26, R27, G28, E29, G30, L31, R32
                                \\
    \bottomrule
    \end{tblr}
\end{table}
\end{document}

相关内容