fancyhdr和cals垂直合併問題

fancyhdr和cals垂直合併問題
\documentclass[12pt,a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{cals}

\begin{document}

\headheight=81pt

\chead{
\begin{calstable}
\colwidths{{90pt}{90pt}}
\brow
\alignC
\nullcell{ltr}
\cell{b1}
\erow
\brow
\alignC
\nullcell{lr}
\cell{b2}
\erow
\brow
\alignC
\nullcell{lbr}\spancontent{a1, a2, a3}
\cell{b3}
\erow
\end{calstable}
}

\begin{calstable}
\colwidths{{70pt}{70pt}}
%
% 30 row alright,
% 31 row problem, because they begin a new page
%! Incompatible list can't be unboxed.
%\cals@row@dispatch@span ...nvbox \cals@backup@row 
%                                                  \cals@issue@row }\fi \let ...
%l.159 \erow
%           
%? H
%Sorry, Pandora. (You sneaky devil.)
%I refuse to unbox an \hbox in vertical mode or vice versa.
%And I can't open any boxes in math mode.
%
%? X
%No pages of output.
% 
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\end{calstable}

\end{document}

答案1

解決方法的一個想法是:讓另一個表格由非包排版cals。我附上一個使用基本tabular環境的範例以及這兩個頁面的預覽。那麼不同的尺寸/定義就不應該互相干擾。

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{cals}

\begin{document}
\headheight=81pt

\fancyhead[C]{%
\begingroup
\renewcommand\arraystretch{1.5}
\begin{tabular}{|c|c|c|}
\hline
Hello&World&!!!\\ \hline
!!!&Hello&World\\ \hline
World&!!!&Hello\\ \hline
\end{tabular}
\endgroup
\ifx\relax
\begin{calstable}
\colwidths{{90pt}{90pt}}
\brow
\alignC
\nullcell{ltr}
\cell{b1}
\erow
\brow
\alignC
\nullcell{lr}
\cell{b2}
\erow
\brow
\alignC
\nullcell{lbr}\spancontent{a1, a2, a3}
\cell{b3}
\erow
\end{calstable}%
\fi
}%End of \fancyhead...

\begin{calstable}
\colwidths{{70pt}{70pt}}
%
% 30 row alright,
% 31 row problem, because they begin a new page
%! Incompatible list can't be unboxed.
%\cals@row@dispatch@span ...nvbox \cals@backup@row 
%                                                  \cals@issue@row }\fi \let ...
%l.159 \erow
%           
%? H
%Sorry, Pandora. (You sneaky devil.)
%I refuse to unbox an \hbox in vertical mode or vice versa.
%And I can't open any boxes in math mode.
%
%? X
%No pages of output.
% 
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\brow
\cell{column1}
\cell{column2}
\erow
\end{calstable}

\end{document}

姆韋

相關內容