我用来\arrayrulewidth
指定规则的宽度/厚度,例如在表格中:
\taburulecolor{title}
\arrayrulewidth=1pt
\setlength{\arrayrulewidth}{1pt} % Definiert die Liniendicke von Trennlinien in den array- und tabular-Umgebungen.
%referenced by btable
\newenvironment{mycustomtable}
{
\begin{center}
\def\arraystretch{1} %Seems to be better than to use %\renewcommand{\baselinestretch}{1} % Zeilenabstand
\tabulinesep=1.2mm % cell padding according to http://mirror.ctan.org/macros/latex/contrib/tabu/tabu.pdf
\begin{longtabu}[l]
}
{
\end{longtabu}
%\renewcommand{\baselinestretch}{1.5}% Zeilenabstand
\end{center}
}
更改\arrayrulewidth
确实会影响厚度。但是:它不是固定的,会不时发生变化。在某些情况下,\arrayrulewidth
似乎会在相同环境中自动调整,例如分页符之后。为什么会这样?我如何将 arrayrulewidth 指定为不会(永远)改变的固定值?
答案1
由于没有给出所有包,因此我只能猜测包的情况。
在组内进行更改是一种更好的方法,\arrayrulewidth
这样它就不会干扰其他表环境。幸运的是,您已经在使用\newenvironment
,因此将其放在那里相当舒服。为了更好地处理,最好为提供一个(可选)参数,以便mycustomtable
可以在不更改代码的情况下调整数组规则宽度,但这取决于 OP...
\documentclass{scrbook}
\usepackage{tabu}%
\usepackage{longtable}
\begin{document}
\taburulecolor{title}
\arrayrulewidth=1pt
\setlength{\arrayrulewidth}{1pt} % Definiert die Liniendicke von Trennlinien in den array- und tabular-Umgebungen.
%referenced by btable
\newenvironment{mycustomtable}
{
% Lets overexaggerate a little bit ;-)
\setlength{\arrayrulewidth}{5pt}
\begin{center}
\def\arraystretch{1} %Seems to be better than to use %\renewcommand{\baselinestretch}{1} % Zeilenabstand
\tabulinesep=1.2mm % cell padding according to http://mirror.ctan.org/macros/latex/contrib/tabu/tabu.pdf
\begin{longtabu}[l]
}
{
\end{longtabu}
%\renewcommand{\baselinestretch}{1.5}% Zeilenabstand
\end{center}
}
\begin{mycustomtable}{llll}
\hline
This & is & a & table \tabularnewline
\hline
\end{mycustomtable}
\begin{tabular}{llll}
\hline
This & is & a & table \tabularnewline
\hline
\end{tabular}
\end{document}
为了与标准表进行比较,我tabular
也添加了一个环境。