I've created a LaTeX (xelatex compiled) table with \cals
package, specifically, using \calstable
command. I'm using R's RMD file to compile LaTeX to PDF. However, I'm using two rows for a nested \thead{}
command with an intermediate .tex similar to the following:
%example.tex file
\documentclass[]{article}
% package load
\usepackage{cals}
\usepackage{xcolor}
% initialize @ symbol
\makeatletter
\begin{document}
% begin custom commands
\newcommand\cellVtop[1]{
\cell{#1}}
\newcommand\cellVbot[1]{
\cell{\vfill #1}}
\newcommand{\rrBoxGrantee}[1]{
\parbox{2.5in}{\raggedright #1}}
\newcommand{\rrBoxFiveCol}[1]{
\parbox{1in}{\raggedright #1}}
\newcommand{\rrBox}[1]{
\parbox{0.875in}{\raggedright #1}}
% end custom commands
\colwidths{{0.5in}{2.75in}{1.08333333333333in}{1.08333333333333in}{1.08333333333333in}}
\small
\begin{calstable}
\thead{
\brow
\nullcell{ltr}
\spancontent{}
\nullcell{ltr}
\spancontent{}
\nullcell{ltb}
\nullcell{tb}
\nullcell{trb}
\alignC\spancontent{\vfill \textbf{Enrollees}}
\erow
\brow
\alignC\cellVbot{\rrBox{\textbf{Rank}}}
\alignL\cellVbot{\rrBox{\textbf{Grantee}}}
\alignL\cellVbot{\rrBoxFiveCol{\textbf{Target}}}
\alignL\cellVbot{\rrBoxFiveCol{\textbf{Actual}}}
\alignL\cellVbot{\rrBoxFiveCol{\textbf{Percentage of Target}}}
\erow}
% begin multiple rows [...]
% repeat code for the below row until page break occurs (~30 rows)
\brow
\alignL\cellVtop{0}
\alignL\cellVtop{\rrBoxGrantee{Grantee A}}
\alignL\cellVtop{0}
\alignL\cellVtop{0}
\alignL\cellVtop{0\%}
\erow
% end multiple rows [...]
\normalsize
\end{calstable}
\pagebreak
\end{document}
With, [...]
representing excluded text for brevity.
However, when compiled, any table that runs to a next page is missing the header text of only the top-row of the \thead
. The strange thing is that cell formatting is correct, just no text. It does seem that when there are no calls to \nullcell{}
and \spancontent
, that the columns are repeated as expected. However, I need the top header with "Enrollees" included to be merged as pictured below.
Am I missing a setting for printing both \thead
rows or is this a bug?
P.S. I've confirmed that the example.tex file, above, can be compiled to .pdf via the following command in command prompt:
xelatex example.tex
\cellVbot
is undefined. And there are errors anyway.\documentclass
declaration and[...]
should either be expanded if they're useful to show the issue, or removed,.[...]
so that the code for that row can be repeated until a page break is required. The page break is where the issue is occurring.[...]
need to be repeated at least 30 times to introduce a page break. imo, it doesn't make sense to expand 30 rows in sample code since this can be done manually before executing the code via copy and paste 30 times.