如何在 LaTex 中容纳这么大的表格

如何在 LaTex 中容纳这么大的表格

在此处输入图片描述

如何像长表格一样将 LaTex 缩小到多页?我需要一些帮助

答案1

看一下这个longtabu包,这是一个例子:

\documentclass[a4paper]{article}
\usepackage{tabu}
\usepackage{longtable}
\usepackage{booktabs}

\begin{document}
    \centering \footnotesize
    \begin{longtabu} to \linewidth {X[l .1] X[l .5] X[c .1] X[c .1] X[c .1]}
        \toprule
        \rowfont[c]{\bfseries}
        Number & Requirement & Relation & Value & Unit \\
        \midrule
        \endhead
        \bottomrule
        \multicolumn{5}{c}{\textsl{Continues on the next page}}
        \endfoot
        \bottomrule
        \endlastfoot
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
        1 & asdf & asdf & asdf & asdf \\
    \end{longtabu}

\end{document}

其结果为: 在此处输入图片描述 在此处输入图片描述 在此处输入图片描述

答案2

使用ltablex包装的替代方案。

support to columns' headers formatting is used packagemakecell . for more "professional" and oppen look is usedbooktabs for rules in table where i suggest to replace all rules in table body with additional space provided by\addlinespace`。

进一步关注单元格中长文本的格式化。由于它们很窄,可以通过在新列类型的定义中使用RaggedRight包中的命令来改进它们的格式(请参阅下面的 mwe)。ragged2eL

\documentclass[a4paper]{article}
\usepackage[margin=20mm]{geometry}
\usepackage{ragged2e}
\usepackage{booktabs, makecell, ltablex}
\renewcommand\theadfont{\small\bfseries}
\newcolumntype{L}{>{\RaggedRight}X}
%\keepXColumns  % used in cases when contents of all X columns
                % are shorter than their width which you like to preserve

\usepackage{lipsum}

\begin{document}
    \begingroup
\small
\sffamily
\setlength\tabcolsep{3pt}
\begin{tabularx}{\linewidth} {@{}c >{\hsize=0.7\hsize}L l l
                              *{3}{>{\hsize=1.1\hsize}L}
                              @{}}
    \toprule
\thead{Number}  & \thead{Risk}          & \thead{Likelihood}    & \thead{Severity}
                & \thead{Description}   & \thead{Effect on\\Project}
                                                                & \thead{Solution}\\
    \midrule
\endhead
    \midrule
\multicolumn{7}{r}{\textsl{Continues on the next page}}
\endfoot
    \bottomrule
\endlastfoot
1   & Poor schedule ability & Low           & Hight
    & \lipsum*[11]          & \lipsum*[11]  & \lipsum*[11]  \\
    \addlinespace
2   & Poor ability of using software such as Matlab
                            & Hight         & Hight
    & \lipsum*[11]          & \lipsum*[11]  & \lipsum*[11]  \\
    \addlinespace
3   & Complexity underestimated
                            & Low           & Medium
    & \lipsum*[11]          & \lipsum*[11]  & \lipsum*[11]  \\
1   & Poor schedule ability & Low           & Hight
    & \lipsum*[11]          & \lipsum*[11]  & \lipsum*[11]  \\
    \addlinespace
2   & Poor ability of using software such as Matlab
                            & Hight         & Hight
    & \lipsum*[11]          & \lipsum*[11]  & \lipsum*[11]  \\
    \addlinespace
3   & Complexity underestimated
                            & Low           & Medium
    & \lipsum*[11]          & \lipsum*[11]  & \lipsum*[11]  \\
\end{tabularx}
    \endgroup
\end{document}

第一页顶部:

在此处输入图片描述

第一页的底部和第二页的顶部:

在此处输入图片描述

相关内容