I try to write tabulars using the cals-package, but have run into a problem. I try to remove the side bearings (what you achieve by >@{}
using array). As far as I understand, I have to remove left padding of leftmost column by issuing a \setlength{\cals@paddingL}{0pt}
at all leftmost cells in the first column, and restore it by \cals@setpadding{Ag}\
immediately after the cell. The same goes for the right side.
This approach works in the body of the table as you will see from the enclosed picture. However, if I use the code in the heading (\thead{<code>}
), the code does not compile. For the MWE enclosed, you get the error message indicating a command is not defined.
Here is the MWE (MnWE):
\documentclass{article}
\usepackage{cals}
\begin{document}
\begin{calstable}
\colwidths{{50pt}{100pt}}
%
\thead{\bfseries\selectfont
\brow
\makeatletter\setlength{\cals@paddingL}{0pt}\makeatother % If you comment out line 16 and 18 the MWE compiles
\cell{col1}
\makeatletter\cals@setpadding{Ag}\makeatother % Comment out to compile
\cell{col2}
\erow
\mdseries\selectfont}
\tfoot{\lastrule\nointerlineskip
\textit{\strut Some table caption
(not implemented: PartKofN)}\par}
%
\brow
\makeatletter\setlength{\cals@paddingL}{0pt}\makeatother
\cell{r1,col1}
\makeatletter\cals@setpadding{Ag}\makeatother
\makeatletter\setlength{\cals@paddingR}{0pt}\makeatother
\alignR\cell{r1,col2}
\makeatletter\cals@setpadding{Ag}\makeatother
\erow
%
\brow
\alignL\cell{r2,col1}
\alignR\cell{r2,col2}
\erow
%
\brow
\alignL\cell{r3,col1}
\cell{r3,col2}
\erow
%\tbreak{Manual table break!\strut\par}
\brow
\cell{r4,col1}
\cell{r4,col2}
\erow
%
\brow
\cell{r5,col1}
\cell{r5,col2}
\erow
\end{calstable}
\end{document}
Here is the log-file:
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7050)
entering extended mode
(C:/temp/test-cals-ex2.tex
LaTeX2e <2018-12-01>
(C:\miktex\texmfs\install\tex/latex/base\article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(C:\miktex\texmfs\install\tex/latex/base\size10.clo))
(C:\miktex\texmfs\install\tex/latex/cals\cals.sty)
No file test-cals-ex2.aux.
! Undefined control sequence.
<argument> \cals
@paddingL
l.15 }
?
A bug or a user error?
\
inmakeatletter
:\brow makeatletter\setlength{\cals@paddingL