我有一篇很长的文本,正在使用supertabular
包。虽然我知道包和 LaTeX 本身会计算并确定何时进行分页,但是否可以知道分页何时即将发生或刚刚发生?谢谢你的帮助。
谢谢你,大卫。
在下面的 LaTeX 文档中,您将在第 2 页看到两个页眉重合。一个页眉由 fancyheader 控制,这没问题,但是如果我知道发生了分页符或页眉将显示,则可以消除另一个页眉。
另外,如果要求不高的话,我在同一文档中使用了重新定义命令,效果很好,但在第一页上我没有值,因此它会打印空白。我试过了ifthenelse
,ifnum
但没有用,有没有办法在花式页眉上找到它,如果它是第一页,则不显示页眉的这一行?
任何帮助将不胜感激。
\documentclass[10pt,english]{report}
\usepackage[letterpaper,top=2.0cm,bottom=2.0cm,left=0.5cm,right=1cm]{geometry}
\usepackage{booktabs}
\usepackage{calc}
\usepackage{ifthen}
\usepackage{array}
\usepackage{fancyhdr}
\usepackage[iso]{datetime}
\usepackage{lastpage}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\pagestyle{fancy}
\fancyhf{}
\setlength\headheight{0.5pt}
\chead{\textbf{\normalsize{Neuroscience Report}}}
\lhead{\textbf{UCLA}}
\rhead{\textbf{\footnotesize{Draft}}}
\rfoot{\today \hspace{0.5pt} \currenttime}
\cfoot{Page \thepage}\lfoot{UCLA}
\renewcommand{\headrulewidth}{1pt}
\usepackage{supertabular}
\newcommand{\NewText}{}
\newcommand{\Testit}{\NewText}
\begin{document}
\tablehead
{
\toprule[1pt]
\multicolumn{1}{c}{\textbf{Col1}} & \textbf{Col2} & \textbf{Col3} & \textbf{Col4} & \textbf{Col5} & \textbf{Col6} & \multicolumn{1}{c}{\textbf{SubCol1}}\\
& & & & & & \multicolumn{1}{c}{\textbf{SubCol2}}\\
\toprule[1pt]
\multicolumn{6}{l}{\textbf{\Testit}}\\}
\begin{supertabular}{p{37mm}p{15mm}p{23mm}p{26mm}p{33mm}p{10mm}p{37mm}}
\multicolumn{6}{l}{\textbf {Set 1}}\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
\toprule[1pt]\\
\multicolumn{6}{l}{\textbf {Set 2}}\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
\toprule[1pt]\\
\multicolumn{6}{l}{\textbf {Set 3}}\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
\gdef\NewText{Set 4}
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
\toprule[1pt]\\
\multicolumn{6}{l}{\textbf {Set 4}}\\
03/07/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
03/05/2012 17:07:00 & Par1 & Par2 & Par3 & \raggedright{Par4} & Par5 & 04/19/2012 00:01:06\\
\toprule[1pt]\\
\end{supertabular}
\end{document}