如何在 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。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}

相關內容