表格中的行太宽!

表格中的行太宽!

我有下面的表格。但第 11 行和第 20 行太宽了,所以我想把它们分成两行,这样看起来仍然很美观。这样最终的结果看起来就像

11  Crude petroleum and natural gas; services incidental
    to oil and gas extraction excluding surveying



\begin{table}[H]
\centering
\caption{Industries}
\label{industries}
\begin{tabular}{ll}
1  & Products of agriculture, hunting, and related services                                             \\
2  & Products of forestry, logging, and related services                                                \\
5  & Fish and other fishing products; services incidental of fishing                                    \\
10 & Coal and lignite;
peat                                                                             \\
11 & Crude petroleum and natural gas; services incidental to oil and gas extraction excluding surveying \\
12 & Uranium and thorium ores                                                                           \\
13 & Metal ores                                                                                         \\
14 & Other mining and quarrying products                                                                \\
15 & Food products and beverages                                                                        \\
16 & Tobacco products                                                                                   \\
17 & Textiles                                                                                           \\
18 & Wearing apparel; furs                                                                              \\
19 & Leather and leather products                                                                       \\
20 & Wood and products of wood and cork (except furniture); articles of straw and plaiting materials    \\
21 & Pulp, paper, and paper products                                                                    \\
22 & Printed matter and recorded media                                                                  \\
23 & Coke, refined petroleum products, and nuclear fuels                                                \\
24 & Chemicals, chemical products, and man-made fibers                                                  \\
25 & Rubber and plastic products                                                                        \\
26 & Other non-metallic mineral products                                                                \\
27 & Basic metals                                                                                       \\
28 & Fabricated metal products, except machinery and equipment                                          \\
29 & Machinery and equipment n.e.c.                                                                     \\
30 & Office machinery and computers                                                                     \\
31 & Electrical machinery and apparatus n.e.c.                                                         \\
32    & Radio, television, and communication equipment and apparatus \\
33    & Medical, precision and optical instruments, watches, and clocks \\
34    & Motor vehicles, trailers, and semi-trailers \\
35    & Other transport equipment \\
36    & Furniture; other manufactured goods n.e.c.\\
37    & Secondary raw materials

\end{tabular}
\end{table}

答案1

tabularx我想,这是一个很好的例子:

% arara: pdflatex

\documentclass{article}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{float}
\usepackage{tabularx}
\usepackage{caption}
\usepackage{microtype}
\usepackage{showframe} % just for demo, get rid of it.

\begin{document}
11 Crude petroleum and natural gas; services incidental
to oil and gas extraction excluding surveying

\begin{table}[H]
    \centering
    \caption{Industries}
    \label{industries}
    \begin{tabularx}{\linewidth}{rX} % or even \begin{tabularx}{\linewidth}{@{}rX@{}} if you want to save horizontal space.
        1  & Products of agriculture, hunting, and related services                                             \\
        2  & Products of forestry, logging, and related services                                                \\
        5  & Fish and other fishing products; services incidental of fishing                                    \\
        10 & Coal and lignite; peat                                                                             \\
        11 & Crude petroleum and natural gas; services incidental to oil and gas extraction excluding surveying \\
        12 & Uranium and thorium ores                                                                           \\
        13 & Metal ores                                                                                         \\
        14 & Other mining and quarrying products                                                                \\
        15 & Food products and beverages                                                                        \\
        16 & Tobacco products                                                                                   \\
        17 & Textiles                                                                                           \\
        18 & Wearing apparel; furs                                                                              \\
        19 & Leather and leather products                                                                       \\
        20 & Wood and products of wood and cork (except furniture); articles of straw and plaiting materials    \\
        21 & Pulp, paper, and paper products                                                                    \\
        22 & Printed matter and recorded media                                                                  \\
        23 & Coke, refined petroleum products, and nuclear fuels                                                \\
        24 & Chemicals, chemical products, and man-made fibers                                                  \\
        25 & Rubber and plastic products                                                                        \\
        26 & Other non-metallic mineral products                                                                \\
        27 & Basic metals                                                                                       \\
        28 & Fabricated metal products, except machinery and equipment                                          \\
        29 & Machinery and equipment n.e.c.                                                                     \\
        30 & Office machinery and computers                                                                     \\
        31 & Electrical machinery and apparatus n.e.c.                                                          \\
        32 & Radio, television, and communication equipment and apparatus                                       \\
        33 & Medical, precision and optical instruments, watches, and clocks                                    \\
        34 & Motor vehicles, trailers, and semi-trailers                                                        \\
        35 & Other transport equipment                                                                          \\
        36 & Furniture; other manufactured goods n.e.c.                                                         \\
        37 & Secondary raw materials        
    \end{tabularx}
\end{table}
\end{document}

答案2

这是一种替代方法,使用enumerate这主要是因为您的表格仅包含两列,其中第一列只是一个增加的数字,但有两个例外,即数字510

这大大减少了手动书写的数量并提供了更大的灵活性,因为您不需要手动写入所有数字,只需更改您想要手动设置的数字,然后让计数器处理剩下的工作。

当然,您tabular也可以创建自己的计数器以供使用。但使用enumerate确实有一些优势。

在这里,我添加了两个选项,如输出所示。一个用于multicol将列表分布在两列中,另一个则不用于。在代码中,只需取消注释注释行即可在它们之间切换。

输出

有或没有多列

代码

\documentclass[11pt]{article}
%\usepackage{multicol}
\begin{document}
%\begin{multicols}{2}
\begin{enumerate}
\setlength\itemsep{0pt}
  \item Products of agriculture, hunting, and related services                                             
  \item Products of forestry, logging, and related services\setcounter{enumi}{4}                                                
  \item Fish and other fishing products; services incidental of fishing\setcounter{enumi}{9}                                    
  \item Coal and lignite; peat                                                                             
  \item Crude petroleum and natural gas; services incidental to oil and gas extraction excluding surveying 
  \item Uranium and thorium ores                                                                           
  \item Metal ores                                                                                         
  \item Other mining and quarrying products                                                                
  \item Food products and beverages                                                                        
  \item Tobacco products                                                                                   
  \item Textiles                                                                                           
  \item Wearing apparel; furs                                                                              
  \item Leather and leather products                                                                       
  \item Wood and products of wood and cork (except furniture); articles of straw and plaiting materials    
  \item Pulp, paper, and paper products                                                                    
  \item Printed matter and recorded media                                                                  
  \item Coke, refined petroleum products, and nuclear fuels                                                
  \item Chemicals, chemical products, and man-made fibers                                                  
  \item Rubber and plastic products                                                                        
  \item Other non-metallic mineral products                                                                
  \item Basic metals                                                                                       
  \item Fabricated metal products, except machinery and equipment                                          
  \item Machinery and equipment n.e.c.                                                                     
  \item Office machinery and computers                                                                     
  \item Electrical machinery and apparatus n.e.c.                                                         
  \item Radio, television, and communication equipment and apparatus 
  \item Medical, precision and optical instruments, watches, and clocks 
  \item Motor vehicles, trailers, and semi-trailers 
  \item Other transport equipment 
  \item Furniture; other manufactured goods n.e.c.
  \item Secondary raw materials
\end{enumerate}
%\end{multicols}
\end{document}

相关内容