Edit: I have found a smaller minimum working example, which is now included!
I'm working on creating a tool for creating an automatic latex document from a c++ header file. This works quite well, and I have defined some \newcommand to help reduce the size of the autogenerated file, as a lot of repetition happens. The file is mostly sequential sections of tables, a figure and 3-4 lines of text.
I use the fancyhdr package and have both a header and a footer. I also use the longtables package to allow for tables that are both long, and so they aren't being placed with a lot of space in between.
Now.... at one point something odd happens. For some reason, latex allows the creation of a new table, right on top of my footer, but only sometimes. At other times it makes a perfect seperation of two parts of a longtable, and continues on the next page.
I compile using pdflatex and texniccenter ver. 1 release candidate 1. Since my code is quite large even for a minimum working example, I don't know if I should post it here, but here goes. All real data has been removed, in case you were wondering

Code: Select all
Code, edit and compile here:
\documentclass[a4paper,10pt]{article}\usepackage[latin1]{inputenc} %Dansk tegnsætning\usepackage[english]{babel} %Dansk orddeling\usepackage[T1]{fontenc} %Valg af font\usepackage{longtable}\usepackage{setspace}\usepackage{lastpage}\usepackage{multirow}\usepackage[pdftex]{color,graphicx} %Indsættelse af grafik\usepackage{fancyheadings}\usepackage{colortbl}\usepackage[titles]{tocloft}\input{doc_setup}%% Start the latex document\begin{document}\section{DEFINITIONS}\subsection{Overview}kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk kkkkkkkks kkkk k fasdf asdrfsaer as fas df aser as asd fas df asdf asd f asd fas d f asf asd f asdf asd f asdfas dr awe rasd f as d f acv xc vxcvkkkkkkkkk kkkkkkkkkkkkkk kkkkkkkkk kkkkkkkkkkkkk kkkkkkkks kkkk k fasdf asdrfsaer as fas df aser as asd fas df asdf asd f asd fas d f asf asd f asdf asd f asdfas dr awe rasd f as d f acv xc vxcv sd f asd fas d f asf asd f asdf asd f asdfas dr awe rasd f as d f acv xc vxcv\footnotetext[1]{These records are available by subscription only.}\begin{spacing}{1.2}\begin{center}\begin{longtable}{|p{2.5cm}|p{8cm}|}\caption[Definitions]{Definitions} \\\blackcell{Type} & \blackcell{Description}\\\hline\endfirsthead\caption[]{Definitions (continued)} \\\blackcell{Type} & \blackcell{Description}\\\hline\endhead\endfoot
Code: Select all
%% Helper functions\newcommand{\tm}{$^{\textrm{tm}}$}\newcommand{\dgr}{$^{\circ}$}%% Header and Footer setup\setlength{\headwidth}{16cm}\setlength{\headrulewidth}{0.0pt}\setlength{\plainfootrulewidth}{0.4pt}\setlength{\footrulewidth}{0.4pt}\lfoot{\hspace{.2cm}Document}\cfoot{ Page \thepage \hspace{.1cm}of \pageref{LastPage}}\rfoot{\today\hspace{.2cm}}\lhead{}\chead{\vspace{-1cm}\renewcommand\arraystretch{1.5}\large\begin{tabular}{|p{3cm}|p{4cm}|p{2cm}|p{2cm}|p{3cm}|}\hline\multirow{2}{3cm}{\vspace{-.35cm}} & Document Number: & 1& Version: & 1 \\\cline{2-5}& Document Title: & \multicolumn{3}{|l|}{Title} \\\hline\end{tabular}}\rhead{}\pagestyle{fancyplain}%% Page layout\setlength{\textheight}{205mm}\setlength{\topmargin}{5mm}\setlength{\textwidth}{160mm}\setlength{\hoffset}{1.5cm}\setlength{\oddsidemargin}{-1.5cm}\setlength{\evensidemargin}{-1cm}%% Setting font to Arial\usepackage[scaled]{uarial}\renewcommand{\rmdefault}{phv} % Arial\renewcommand{\sfdefault}{phv} % Arial
Have anybody ever experienced something similar, and what did you do?
Thank you all
Henrik