pagebreak 上的 longtabu 和 tabucline 问题

pagebreak 上的 longtabu 和 tabucline 问题

我有一个tabu与包相关的问题。在longtabu环境中使用\hline可以完美运行。但是当我尝试使用时\tabucline[...],却发现pagebreak缺少一行。

根据我的序言,我认为可能相关的信息:

\documentclass[a4paper,12pt,BCOR8mm,DIV=calc,oneside,headings=normal,parskip=half,toc=graduated,bibliography=totocnumbered,draft]{scrreprt}
\pagestyle{headings}
\usepackage[T1]{fontenc}
\usepackage{frutigernext}
\renewcommand{\familydefault}{\sfdefault} 
\usepackage{lscape}
\usepackage{setspace}
\usepackage[left=30mm, right=29mm,top=30mm,bottom=30mm,bindingoffset=8mm]{geometry}
\usepackage[ngerman,english]{babel}
\usepackage[latin1]{inputenc} 
\setcounter{tocdepth}{4} 
\setcounter{secnumdepth}{4}
\usepackage[markuppercase,clines]{scrpage2} 
\clearscrheadfoot
\renewcommand*{\chapterpagestyle}{scrheadings}
\chead[]{}
\automark{chapter}
\ihead[\headmark]{\uppercase{\headmark}}
\ohead[\pagemark]{\pagemark}
\setheadsepline{0.5pt}

% ----- TABELLEN -----
\usepackage{tabu}
\usepackage{longtable}
\usepackage[table]{xcolor}
\usepackage{calc}
\newcommand{\ctabukopf}{\taburowcolors[1]1{gray!100 .. gray!100}\rowfont[c]\bfseries\hline}
...

现在\hline使用longtabu

\scriptsize
\tabulinesep=0.8ex
\begin{longtabu} to \linewidth {|X[ml]X[ml]X[ml2.5]|}
\ctabukopf
\multicolumn{3}{|c|}{Programmaufrufe}\\ \hline
\taburowcolors[1]1{white .. white}              
\textbf{Aufruf} & \textbf{Argument} & \textbf{Bedeutung}\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
\end{longtabu}  
\tabureset
\normalsize

结果(正常):http://homepages-nw.uni-r.de/~ocs23577/a.jpg http://homepages-nw.uni-r.de/~ocs23577/a.jpg

使用\tabucline[...]longtabu

\scriptsize
\tabulinesep=0.8ex
\begin{longtabu} to \linewidth {|X[ml]X[ml]X[ml2.5]|}
\ctabukopf
\multicolumn{3}{|c|}{Programmaufrufe}\\ \hline
\taburowcolors[1]1{white .. white}              
\textbf{Aufruf} & \textbf{Argument} & \textbf{Bedeutung}\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \tabucline[on 2pt gray!100]
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \tabucline[on 2pt gray!100]
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \tabucline[on 2pt gray!100]
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
Example1 & Example2 & Little bit longer example Little bit longer example Little bit longer example Little bit longer example\\ \hline
\end{longtabu}  
\tabureset
\normalsize

结果(崩溃):http://homepages-nw.uni-r.de/~ocs23577/b.jpg http://homepages-nw.uni-r.de/~ocs23577/b.jpg

你知道如何正确解决这个问题吗?谢谢,Simon

答案1

禁忌文档有以下注释(v2.8,第 9 页):

\tabucline目前不关心分页符:\hline而是使用。

因此简单使用\hline确实是推荐的解决方案。

当然,\tabucline有很多功能是\hline缺少的,包括控制厚度、颜色和虚线的样式选项。如果您正在使用其中任何功能,那么简单地使用\hline将无法满足您的需求。理想的解决方案是让 tabu 的作者或其他 TeXnical 向导制作\tabucline与分页符兼容。不过,与此同时,我可以向您展示我发现的一些简单的解决方法,这些解决方法将允许您控制厚度颜色普通\hlines 的同时保留了您所寻求的行为(重复分页符上出现的规则)。通过这种方式,您可以获得一些最受欢迎的功能\tabucline(控制各个规则的粗细和颜色),同时保留分页符的良好行为\hline。(因为它们只使用\hline,所以这些技术应该可以很好地与任何 longtable 配合使用;它不一定是 longtabu。)

首先是简单情况:如果你需要改变全部规则,这很容易做到。对于厚度,设置\arrayrulewidth长度,对于颜色,加载 colortbl 包并使用命令\arrayrulecolor。也就是说,

\setlength{\arrayrulewidth}{2pt}

就在桌子前

\arrayrulecolor{blue}

宣言之后立即\begin{longtabu}

如果你想根据每条规则控制粗细和颜色,事情就会变得更加困难——也就是说,如果你想让表格中的一些水平线变粗变黑,而其他水平线变细变蓝。幸运的是,我发现这个相关问题有几个答案可以帮我们解决这个问题中最难的部分。下面是实践中如何使用这个方法的一个例子:

\documentclass{article}
\usepackage{longtable,tabu}
\usepackage[table]{xcolor}
\usepackage[paperwidth=5.5in,paperheight=8.5in,margin=.5in,footskip=.25in]{geometry}

\newcommand{\thickhline}[1]{\noalign{\global\arrayrulewidth#1}\hline
    \noalign{\global\arrayrulewidth#1}}

\newcommand{\coloredthickhline}[2]{
    \arrayrulecolor{#1}
    \thickhline{#2}
    \arrayrulecolor{black}
}

\begin{document}

\tabulinesep=4pt
\begin{longtabu}{XX[1.7]} \thickhline{3pt}
    \textbf{Base Potions} &
        These potions have no effect...
    \\\coloredthickhline{blue!35!lightgray}{.5pt}
    \leftskip=3ex Awkward Potion &
        This is the base for most potions...
    \\\coloredthickhline{blue!35!lightgray}{.5pt}
    % etc.
    \\\thickhline{3pt}
\end{longtabu}

\end{document}

以下是结果的截图:

在此处输入图片描述

如您所见,规则的行为与您希望的一样:分页符所在的规则在新页面上以正确的颜色和粗细重复。当然,这不是一个完美的解决方案——还有很多其他事情可以做\tabucline而不能做\hline——但我认为它可以满足大多数人的需求。

相关内容