我的长表太宽,并且减少列大小时文本太多,无法以令人愉悦的方式容纳

我的长表太宽,并且减少列大小时文本太多,无法以令人愉悦的方式容纳

我是新手,但我正在使用 LaTeX 来格式化我的硕士论文。我有多个麻烦的表格,我无法让它们在页面上适当地显示。在我当前的表格中,有 6 列,其中许多列包含大量文本。我曾经用代码生成过列大小较小的表格。这不是最好看的表格,因为所有单词都挤在一起,格式很糟糕。但同一行代码不再起作用,我不知道为什么。

我知道有很多关于长表宽度的问题——我已经遇到过几十个,并复制了它们的解决方案。我不知道我到底做错了什么!

这是我最近一次尝试制作表格,不考虑宽度(即使这样也不起作用——它一直说我有一个额外的对齐选项卡,但我看不到它)。

\usepackage{setspace}
\usepackage
[
        letterpaper,
        left=3.81cm,
        right=2.56cm,
        top=2.56cm,
        bottom=2.56cm
]
{geometry}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
%\usepackage[parfill]{parskip}
\usepackage{times}
\frenchspacing
\usepackage{rotating}
\usepackage{longtable}
\usepackage[skip=0.5\baselineskip]{caption}


\begin{center}
\begin{longtable}{llllll}
\caption{Example of Measuring Complexity Using Attribute Recording} \label{tab-Example of Measuring Complexity Using Attribute Recording}
Variable & Sector 1 & Sector 2 & Sector 3 & Sector 4 & ECS\\
\hline
Rim Tool & CWS & CWS & CWS & CWS & 0.25\\
Rim Technique & Stamped & Stamped & Stamped & Stamped & 0.25\\
Rim Configuration & Right Oblique & Right Oblique & Right Oblique & Right Oblique & 0.25\\
Lip Element Placement & Top & Top & Top & Top & 0.25\\
Lip Tool & CWS & CWS & CWS & CWS & 0.25\\
Lip Technique & Stamped & Stamped & Stamped & Stamped & 0.25\\
Lip Configuration & Right Oblique & Right Oblique & Right Oblique & Right Oblique & 0.25\\
Decorative Element 1 Placement  & Rim to Base & Rim to Base & Rim to Base & Rim to Base & 0.25\\
Decorative Element 1Tool & CWS & CWS & CWS & CWS & 0.25\\
Decorative Element 1 Technique & Stamped & Stamped & Stamped & Stamped & 0.25\\
Decorative Element 1 Configuration & Right Oblique & Right Oblique & Right Oblique & Right Oblique & 0.25\\
Rim Interior Design Tool & Plain & Plain & Plain & Plain & 0.25\\
Rim Interior Design Technique & Plain & Plain & Plain & Plain & 0.25\\
Rim Interior Design Configuration & Plain & Plain & Plain & Plain & 0.25\\
Interior Decorative Element 1 Placement & Rim to Base & Rim to Base & Rim to Base & Rim to Base & 0.25\\
Interior Decorative Element 1 Tool & Plain & Plain & Plain & Plain & 0.25\\
Interior Decorative Element 1 Technique & Plain & Plain & Plain & Plain & 0.25\\
Interior Decorative Element 1 Configuration & Plain & Plain & Plain & Plain & 0.25\\
Rim Type & Non-Collared & Non-Collared & Non-Collared & Non-Collared & 0.25\\
Rim Orientation & Outflaring & Outflaring & Outflaring & Outflaring & 0.25\\
Exterior Rim Profile & Concave & Concave & Concave & Concave & 0.25\\
Interior Rim Profile & Convex & Convex & Convex & Convex & 0.25\\
Rim Shape & Non-Collared Straight & Non-Collared Straight & Non-Collared Straight & Non-Collared Straight & 0.25\\
Lip Shape & Flat & Flat & Flat & Flat & 0.25\\
Lip Angle & Right Angle & Right Angle & Right Angle & Right Angle & 0.25\\
Exterior Surface Treatment 1 Placement & Plain & Plain & Plain & Plain & 0.25\\
Exterior Surface Treatment 1 Type & Plain & Plain & Plain & Plain & 0.25\\
Interior Surface Treatment 1 Placement & Plain & Plain & Plain & Plain & 0.25\\
Interior Surface Treatment 1 Type & Plain & Plain & Plain & Plain & 0.25\\
Base Morphology & Conoidal & Conoidal & Conoidal & Conoidal & 0.25\\
Neck Morphology & Slightly Constricted & Slightly Constricted & Slightly Constricted & Slightly Constricted & 0.25\\
Castellations & Not Castellated & Not Castellated & Not Castellated & Not Castellated & 0.25\\
Decorative Complexity Score &  &  &  &  8\\
\hline
\end{longtable} 
\end{center}
\end{document}```

答案1

表格将以横向显示,并设置列宽。此处前五列的宽度相同。(使用包array)。

注意如何将 a 添加caption到 a longtable

X

\documentclass[12pt,a4paper]{article}

\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage[letterpaper,
left=3.81cm,
right=2.56cm,
top=2.56cm,
bottom=2.56cm
]
{geometry}
\usepackage{rotating}
\usepackage{longtable}
\usepackage{caption}
\usepackage{pdflscape} % landscape
    
\usepackage{array}
\renewcommand{\arraystretch}{1.7} % stretch the cells vertically
\newcolumntype{C}{>{\arraybackslash}m{0.22\textwidth}}

\begin{document}
    
\begin{landscape}
        \pagestyle{empty}
\begin{longtable}{CCC CCc}
    \caption{Example of Measuring Complexity Using Attribute Recording} \label{tab-Example}
    \endfirsthead
    \endhead
    \hline
    Variable & Sector 1 & Sector 2 & Sector 3 & Sector 4 & ECS \\
    \hline
    Rim Tool & CWS & CWS & CWS & CWS & 0.25\\
    Rim Technique & Stamped & Stamped & Stamped & Stamped & 0.25\\
    Rim Configuration & Right Oblique & Right Oblique & Right Oblique & Right Oblique & 0.25\\
    Lip Element Placement & Top & Top & Top & Top & 0.25\\
    Lip Tool & CWS & CWS & CWS & CWS & 0.25\\
    Lip Technique & Stamped & Stamped & Stamped & Stamped & 0.25\\
    Lip Configuration & Right Oblique & Right Oblique & Right Oblique & Right Oblique & 0.25\\
    Decorative Element 1 Placement  & Rim to Base & Rim to Base & Rim to Base & Rim to Base & 0.25\\
    Decorative Element 1 Tool & CWS & CWS & CWS & CWS & 0.25\\
    Decorative Element 1 Technique & Stamped & Stamped & Stamped & Stamped & 0.25\\
    Decorative Element 1 Configuration & Right Oblique & Right Oblique & Right Oblique & Right Oblique & 0.25\\
    Rim Interior Design Tool & Plain & Plain & Plain & Plain & 0.25\\
    Rim Interior Design Technique & Plain & Plain & Plain & Plain & 0.25\\
    Rim Interior Design Configuration & Plain & Plain & Plain & Plain & 0.25\\
    Interior Decorative Element 1 Placement & Rim to Base & Rim to Base & Rim to Base & Rim to Base & 0.25\\
    Interior Decorative Element 1 Tool & Plain & Plain & Plain & Plain & 0.25\\
    Interior Decorative Element 1 Technique & Plain & Plain & Plain & Plain & 0.25\\
    Interior Decorative Element 1 Configuration & Plain & Plain & Plain & Plain & 0.25\\
    Rim Type & Non-Collared & Non-Collared & Non-Collared & Non-Collared & 0.25\\
    Rim Orientation & Outflaring & Outflaring & Outflaring & Outflaring & 0.25\\
    Exterior Rim Profile & Concave & Concave & Concave & Concave & 0.25\\
    Interior Rim Profile & Convex & Convex & Convex & Convex & 0.25\\
    Rim Shape & Non-Collared Straight & Non-Collared Straight & Non-Collared Straight & Non-Collared Straight & 0.25\\
    Lip Shape & Flat & Flat & Flat & Flat & 0.25\\
    Lip Angle & Right Angle & Right Angle & Right Angle & Right Angle & 0.25\\
    Exterior Surface Treatment 1 Placement & Plain & Plain & Plain & Plain & 0.25\\
    Exterior Surface Treatment 1 Type & Plain & Plain & Plain & Plain & 0.25\\
    Interior Surface Treatment 1 Placement & Plain & Plain & Plain & Plain & 0.25\\
    Interior Surface Treatment 1 Type & Plain & Plain & Plain & Plain & 0.25\\
    Base Morphology & Conoidal & Conoidal & Conoidal & Conoidal & 0.25\\
    Neck Morphology & Slightly Constricted & Slightly Constricted & Slightly Constricted & Slightly Constricted & 0.25\\
    Castellations & Not Castellated & Not Castellated & Not Castellated & Not Castellated & 0.25\\
    Decorative Complexity Score &  &  &  &  8\\
    \hline
\end{longtable}     
    
\end{landscape}     
    
\end{document

改进longtable运输标题和添加基础

Z Z

替换开头longtable

\begin{longtable}{CCC CCc}
        \caption{Example of Measuring Complexity Using Attribute Recording} \\ \hline \label{tab-Example}%
            Variable & Sector 1 & Sector 2 & Sector 3 & Sector 4 & ECS \\
        \hline
        \endfirsthead
        \hline
            Variable & Sector 1 & Sector 2 & Sector 3 & Sector 4 & ECS \\
        \hline
        \endhead
        \hline
        \multicolumn{6}{r@{}}{to be continued \ldots}\\
        \endfoot        
        Rim Tool & CWS & CWS & CWS & CWS & 0.25\\
        Rim Technique & Stamped & Stamped & Stamped & Stamped & 0.25\\

相关内容