[Tex/LaTex] \arrayrulewidth does not work – different thickness

rulestables

I'm using \arrayrulewidth to specify my rule's width/thickness, e.g. in tables:

\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}
}

Changing \arrayrulewidth does effect the thickness. But: It's not fixed and changes from time to time. In some cases, \arrayrulewidth seems to adjust automatically within the same environment, e.g. after a pagebreak. Why is that and how can I specify arrayrulewidth to a fixed value that will not (never) change?

Best Answer

Since not all packages are given, I can only guess about packages.

It is a better method to change \arrayrulewidth within a group such that it does not interfere with other tables environments. Fortunately you are using a \newenvironment already, so it is quite comfortable to place it there. For better handling, it would be better to provide an (optional) argument to the mycustomtable such that the array rule width can be adapted without changing the code, but that is up to the 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}

In order to compare with a standard table, I have added a tabular environment too.

enter image description here