如何在 Latex 中制作更长(3-4 页)和更宽的表格

如何在 Latex 中制作更长(3-4 页)和更宽的表格

我有以下数据

Shahrawat, R., and Rao, K. D. & 2012&   Insured yet vulnerable: Out-of-pocket payments and India’s poor&    All ages&   2004-05&    124644& All Diseases&   Health& 5.1\\
Raban et al.,&  2013&   Variations in catastrophic health expenditure estimates from household surveys in India&    All Ages&   2004-05&    124644& All Diseases&   Consumption &   14\\
Raban et al.,&  2013&   Variations in catastrophic health expenditure estimates from household surveys in India&    All Ages&   2009-10&    100855& All Diseases&   Consumption &   13.9\\

同样,43 行数据有不同的标题。我想在 Latex 的横向页面中放入一个长表和更宽的表,以便完成我的论文。有人能在这方面提供帮助吗?谢谢

答案1

我建议使用一个环境,它结合了和环境xltabular的功能。我还建议合并前两列中包含的信息;如果您接受此建议,则此表的总列数将为 8。根据您提供的示例行,自动换行对于第 1 列和第 2 列似乎是可取的。我不会对此表使用垂直规则。longtabletabularx

由于您没有提供有关表格标题行应包含的内容的信息,因此生成的表格的整体外观必然会有些简朴:

在此处输入图片描述

\documentclass{article} % or some other suitable document class

\usepackage{iftex}
\ifpdftex % pdfLaTeX is being used
  \usepackage[T1]{fontenc}
\else % either XeLaTeX or LuaLaTeX is being used
  \usepackage{fontspec}
\fi

\usepackage[english]{babel}
\usepackage[a4paper,margin=2.5cm]{geometry} % set page parameters suitably

\usepackage{xltabular} % combine capabilities of longtable and tabularx
\usepackage{ragged2e} % for '\RaggedRight' macro
\newcolumntype{P}[1]{>{\RaggedRight}p{#1}} % suppress full justification
\newcolumntype{L}{>{\RaggedRight}X} % suppress full justification
\usepackage{pdflscape} % for 'landscape' env.
\usepackage{booktabs} % for well-spaced horizontal rules

\begin{document}

\begin{landscape} % switch to landscape mode
\setlength\tabcolsep{4pt} % default: 6pt
\begin{xltabular}{\textwidth}{@{} P{1.9cm} L llllll @{}}

%% headers and footers
\toprule
\endhead

\bottomrule
\endfoot

%% body of table

Shahrawat, R. and Rao, K. D., 2012
  & Insured yet vulnerable: Out-of-pocket payments and India’s poor
  & All ages& 2004--05& 124644& All Diseases& Health& 5.1\\
\addlinespace
Raban et al., 2013
  & Variations in catastrophic health expenditure estimates from household surveys in India
  & All ages& 2004--05& 124644& All Diseases& Consumption & 14\\
\addlinespace
Raban et al., 2013
  & Variations in catastrophic health expenditure estimates from household surveys in India
  & All ages& 2009--10& 100855& All Diseases& Consumption & 13.9\\
\end{xltabular}
\end{landscape}

\end{document}

相关内容