表格列自动跨页动态拆分

表格列自动跨页动态拆分

我有一个包含许多列的表格。它们无法放在 PDF 文件的一页中。我想找到一些软件包来自动将此表格打印成几页。每页应具有相同的表格列标题和表格标题。列继续动态溢出到接下来的几页(可能是几页)。这取决于指定的日期范围。

我的问题与重复评论中提到的问题不同:表格和多页一本书只能打印两页。

这是我的 MWV:

%!TEX TS-Program = xelatex
%!TEX encoding = UTF-8 Unicode

\documentclass{article}
\usepackage{graphics}
\usepackage{fancyhdr}
\usepackage{ctable}
\usepackage{tabularx}
\usepackage[margin=2.5cm]{geometry}

\setlength\parindent{0pt}

\newcommand{\sectionheader}[1] {
\textbf{#1}

\rule{\textwidth}{6pt}
}

\setlength{\heavyrulewidth}{0.12em}

\pagenumbering{arabic}
\pagestyle{fancy}
\lhead{Patient Name: Claire  Roberts}
\rhead{\thepage}
\cfoot{}

\begin{document}
\thispagestyle{empty}
\textbf{Patient Information for Claire  Roberts}

Last updated on February 19, 2016

\sectionheader{SYMPTOMS}
\begin{tabularx}{\textwidth}{l*{16}X}
    \textbf{PERCEPTION}
     & {6/2/16} & {6/3/16} & {6/4/16} & {6/5/16} & {6/6/16} & {6/7/16} & {6/8/16} & {6/9/16} & {6/10/16} & {6/11/16} & {6/12/16} & {6/13/16} & {6/14/16} & {6/15/16} & {6/16/16} & {6/17/16}\\
{SATISFACTION}
            & -
            & -
            & -
            & 2
            & -
            & 2
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
    \\
\hline
    \textbf{VOID}
     & {6/2/16} & {6/3/16} & {6/4/16} & {6/5/16} & {6/6/16} & {6/7/16} & {6/8/16} & {6/9/16} & {6/10/16} & {6/11/16} & {6/12/16} & {6/13/16} & {6/14/16} & {6/15/16} & {6/16/16} & {6/17/16}\\
{AWAKE}
            & -
            & 5
            & -
            & -
            & 2
            & 1
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
    \\{SLEEPING}
            & 5
            & -
            & -
            & 1
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
    \\{URGENCY}
            & -
            & -
            & 2
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
    \\
\hline
    \textbf{UR}
     & {6/2/16} & {6/3/16} & {6/4/16} & {6/5/16} & {6/6/16} & {6/7/16} & {6/8/16} & {6/9/16} & {6/10/16} & {6/11/16} & {6/12/16} & {6/13/16} & {6/14/16} & {6/15/16} & {6/16/16} & {6/17/16}\\
{UR\_LEAK\_AMOUNT}
            & -
            & -
            & -
            & -
            & Moderate
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
    \\{TOTAL}
            & -
            & -
            & -
            & 1
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
    \\
\hline
    \textbf{BM}
     & {6/2/16} & {6/3/16} & {6/4/16} & {6/5/16} & {6/6/16} & {6/7/16} & {6/8/16} & {6/9/16} & {6/10/16} & {6/11/16} & {6/12/16} & {6/13/16} & {6/14/16} & {6/15/16} & {6/16/16} & {6/17/16}\\
{AWAKE}
            & -
            & -
            & -
            & -
            & -
            & 3
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
    \\{SLEEPING}
            & -
            & -
            & -
            & -
            & 5
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
    \\{SOIL\_AMOUNT}
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
    \\
\hline
    \textbf{BOWEL}
     & {6/2/16} & {6/3/16} & {6/4/16} & {6/5/16} & {6/6/16} & {6/7/16} & {6/8/16} & {6/9/16} & {6/10/16} & {6/11/16} & {6/12/16} & {6/13/16} & {6/14/16} & {6/15/16} & {6/16/16} & {6/17/16}\\
{AMOUNT}
            & -
            & -
            & 6
            & -
            & 5
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
    \\{TOTAL}
            & -
            & -
            & -
            & 8
            & -
            & 9
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
    \\
\hline
    \textbf{PADS}
     & {6/2/16} & {6/3/16} & {6/4/16} & {6/5/16} & {6/6/16} & {6/7/16} & {6/8/16} & {6/9/16} & {6/10/16} & {6/11/16} & {6/12/16} & {6/13/16} & {6/14/16} & {6/15/16} & {6/16/16} & {6/17/16}\\
{TOTAL}
            & -
            & -
            & -
            & 9
            & -
            & 8
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
    \\
\hline
\end{tabularx}
\newpage

\bigskip
\newpage

\end{document}

这是我现在所拥有的,额外的列不会打印到下一页,而只是打印在其他日期列的顶部: 在此处输入图片描述

答案1

我建议你把所有日期(旋转 90 度)放在一个新的单独标题行中。通过这种更改,在一页上排版整个表格就不太困难了。

在此处输入图片描述

%!TEX TS-Program = xelatex
%!TEX encoding = UTF-8 Unicode

\documentclass{article}
\usepackage{graphicx,booktabs,fancyhdr}
\usepackage[margin=2.5cm]{geometry}

\setlength\parindent{0pt}

\newcommand{\sectionheader}[1] {\textbf{#1}\par
\rule{\textwidth}{4pt}}

\setlength{\heavyrulewidth}{0.12em}

\pagenumbering{arabic}
\pagestyle{fancy}
\lhead{Patient Name: Claire  Roberts}
\rhead{\thepage}
\cfoot{}

\begin{document}
\thispagestyle{empty}

\textbf{Patient Information for Claire  Roberts}

Last updated on June 19, 2016

\sectionheader{SYMPTOMS}

\begin{tabular}{@{}l*{16}{c}@{}}
\addlinespace
& \rotatebox{90}{6/2/16}  & \rotatebox{90}{6/3/16} 
& \rotatebox{90}{6/4/16}  & \rotatebox{90}{6/5/16} 
& \rotatebox{90}{6/6/16}  & \rotatebox{90}{6/7/16} 
& \rotatebox{90}{6/8/16}  & \rotatebox{90}{6/9/16} 
& \rotatebox{90}{6/10/16} & \rotatebox{90}{6/11/16} 
& \rotatebox{90}{6/12/16} & \rotatebox{90}{6/13/16} 
& \rotatebox{90}{6/14/16} & \rotatebox{90}{6/15/16} 
& \rotatebox{90}{6/16/16} & \rotatebox{90}{6/17/16}\\
\addlinespace
\textbf{PERCEPTION}\\
SATISFACTION
            & -
            & -
            & -
            & 2
            & -
            & 2
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & - \\
\addlinespace
\textbf{VOID}\\
AWAKE
            & -
            & 5
            & -
            & -
            & 2
            & 1
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -\\
SLEEPING
            & 5
            & -
            & -
            & 1
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -\\
URGENCY
            & -
            & -
            & 2
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -\\
\addlinespace
\textbf{UR}\\
UR\_LEAK\_AMOUNT
            & -
            & -
            & -
            & -
            & Mod.
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -\\
TOTAL
            & -
            & -
            & -
            & 1
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -\\
\addlinespace
\textbf{BM}\\
AWAKE
            & -
            & -
            & -
            & -
            & -
            & 3
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -\\
SLEEPING
            & -
            & -
            & -
            & -
            & 5
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -\\
SOIL\_AMOUNT
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -\\
\addlinespace
\textbf{BOWEL}\\
AMOUNT
            & -
            & -
            & 6
            & -
            & 5
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -\\
TOTAL
            & -
            & -
            & -
            & 8
            & -
            & 9
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -\\
\addlinespace
\textbf{PADS}\\
TOTAL
            & -
            & -
            & -
            & 9
            & -
            & 8
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -
            & -\\
\bottomrule
\end{tabular}

\end{document}

答案2

最后,我找到了解决方案,但我必须手动将日期范围分成不同的段,然后将每个段打印在不同的页面上。

相关内容