使用 xtabular 跨越多列和多页的表格

使用 xtabular 跨越多列和多页的表格

我想要一个时间线,如果长度大于页面,它将首先作为同一页面的第二列继续,如果需要,将继续到下一页的第一列,依此类推......

以下是解决方案基于答案,但这个解决方案并不完全符合我的要求。在第一个链接中,有人建议可以使用 xtabular 来实现这一点。

以下是我目前所取得的成就:

\documentclass[a4paper,twoside,twocolumn,11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{xtab}
\usepackage[TS1,T1]{fontenc}
\usepackage{fourier, heuristica}
\usepackage{array, booktabs}
\usepackage{graphicx}
\usepackage[x11names,table]{xcolor}
\usepackage{caption}
\DeclareCaptionFont{blue}{\color{LightSteelBlue3}}

\newcommand{\foo}{\color{LightSteelBlue3}\makebox[0pt]{\textbullet}\hskip-0.5pt\vrule width 1pt\hspace{\labelsep}}

\begin{document}


\renewcommand\arraystretch{1.4}\arrayrulecolor{LightSteelBlue3}
\captionsetup{font=blue, labelfont=sc, labelsep=quad,
              skip=0.5\baselineskip}
\topcaption{My List}
\xentrystretch{-0.15} % height of table in each page
\begin{xtabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{6cm}}
% header and footer information
%\addlinespace[1.5ex]

\bottomrule
% body of table
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
\end{xtabular}
\end{document}

我不能做的是:

  1. 将表格的两列对齐到顶部
  2. 使表格两列的高度相等(或几乎相等)
  3. 在表格的后续延续中添加(或从顶部移除)顶部水平边框。

感谢您的帮助。

答案1

一些建议:

  • 除 之外,还提供\tablefirsthead\tablehead和说明。\tablelasttail\topcaption

  • 特别是,用于\tablehead为除第一列之外的所有文本列创建准标题。

在此处输入图片描述

\documentclass[a4paper,twoside,twocolumn,11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{xtab}
\usepackage[TS1,T1]{fontenc}
\usepackage{fourier, heuristica}
\usepackage{array, booktabs, caption, ragged2e}
\usepackage[x11names,table]{xcolor}
\DeclareCaptionFont{blue}{\color{LightSteelBlue3}}

\newcommand{\foo}{\color{LightSteelBlue3}\makebox[0pt]{\textbullet}\hskip-0.5pt\vrule width 1pt\hspace{\labelsep}}

\begin{document}

\renewcommand\arraystretch{1.4}\arrayrulecolor{LightSteelBlue3}
\captionsetup{font=blue, labelfont=sc, labelsep=quad,
              skip=0.5\baselineskip}
% header and footer information
\topcaption{My List} \label{tab:timeline}
\tablefirsthead{\toprule}
\tablehead{\multicolumn{2}{c}{\color{LightSteelBlue3}\textsc{Table \ref{tab:timeline}}, cont'd}\\[0.6ex]
        \toprule}
\tablelasttail{\bottomrule}
\xentrystretch{-0.15} 

\begin{xtabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\RaggedRight\arraybackslash}p{5cm}}
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
\end{xtabular}

\end{document}

相关内容