I'm writing an application that generate latex code, therefore the solution must be the most generic possible to ensure that it will generate clean pdf all the time. I would like to let my users specify the thickness of the tables (both horizontal and vertical lines) and the best solution I've found so far is to use "\specialrule" from the booktabs package.
Here is a MWE :
\documentclass{article}
\usepackage{longtable}
\usepackage{tabularx}
\usepackage{booktabs}
\newcommand\VRule[1][\arrayrulewidth]{\vrule width #1}
\begin{document}
Some text goes here
and here
and here
and here
and here
\begin{longtable}{!{\VRule[3pt]}c!{\VRule[3pt]}c!{\VRule[3pt]}c!{\VRule[3pt]}c!{\VRule[3pt]}c!{\VRule[3pt]}}
\specialrule{3pt}{0pt}{0pt}
This & is & the & nice & header \\ \specialrule{3pt}{0pt}{0pt} \endhead
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
Portable & 1 & 676 & 21.00 & 676.00 \\ \specialrule{3pt}{0pt}{0pt}
\end{longtable}
\end{document}
My problem is that the break does not work correctly depending on the height of content before the table and the thickness of the lines. In this case, the last horizontal line of the longtable on the first page is moved on the second page.