2

The document is otherwise exactly what I want. The text respects the footer on every page but one. On this one page, the first thing is a figure, followed by a longtable (that doesn't actually happen to break across a page, but used to) followed by a \subsubsection command and a \paragraph command, followed by text and another longtable, followed by text and then an equation.

The subsubsection heading appears just above the footer. The paragraph heading (I have had to go down the paragraph level to match the format of a standard Word template on my project, so giving up on paragraph headings is a non-starter) and the subsequent sentences are over the footer, and the following table and its following text are both gone - they're not part of the document at all anymore, although its title shows up at the very bottom of the page. If the figure is not the first thing on the page, the footer is respected and the text flows across the pages properly.

I've appended a minimum example below but it only happens when there's a figure at the top of the page so it's pretty long. The sizing of the figure placeholder positions the text below the table where I see the problem.


\documentclass[10pt]{article}
\RequirePackage{array}
\RequirePackage{fancyhdr}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage[includeheadfoot,hmarginratio=1:1]{geometry}                
\geometry{letterpaper}                   

\newcolumntype{L}[1]{>{\raggedright}m{#1}}
\newcolumntype{C}[1]{>{\centering}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft}m{#1}}
\newcommand\T{\rule{0pt}{2.6ex}}           % Top strut
\newcommand\B{\rule[-1.2ex]{0pt}{0pt}}  % Bottom strut

\setcounter{secnumdepth}{6}

\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent

\begin{document}
    \newcommand{\docNumber}{LETTERS-HERE}
    \newcommand{\docRevision}{0}

\clearpage
    \pagestyle{fancy}
    \fancyheadoffset{0cm}
    \rhead{}
    \chead{\fontsize{10pt}{10pt}\selectfont \bfseries{\docNumber\ Rev.\docRevision}}
    \lhead{}
    \rfoot{}
    \cfoot{\fontsize{10pt}{10pt}\selectfont \thepage \\ \small{Footer content goes here.  Lots and lots of footer content.  In really tiny type.  Really.  Lots of footer content.  Because I have to, not because I want to.}}
    \rfoot{}

    \newgeometry{includeheadfoot,margin=1in}
    \pagenumbering{roman}

%%%%%%
% Start main matter and adjust page numbering
%%%%%%
\newpage
\pagenumbering{arabic}
\setcounter{page}{1}

\section{section intro}
\label{sec:intro}
Curabitur ullamcorper ullamcorper vehicula. Nam condimentum placerat orci at hendrerit. Nullam gravida purus risus, at aliquet erat condimentum eu. Morbi semper libero in neque dignissim, vitae imperdiet enim suscipit. Morbi euismod sed massa quis lacinia. Sed augue sem, pretium id nunc eu, consectetur sagittis dui. Nullam ac semper ligula, in ullamcorper lectus. Etiam ultrices finibus leo, id viverra libero egestas sed. Suspendisse rhoncus dapibus dolor, pharetra pretium velit gravida non. Nulla id sodales justo. Vivamus ornare, mi eget vehicula congue, turpis metus congue odio, vel sollicitudin tellus justo eget turpis. Nam laoreet risus non tortor vestibulum efficitur. Fusce sed ex eros. Morbi eleifend, odio et pharetra tincidunt, tortor risus eleifend massa, eu pulvinar leo velit id risus. Nam in congue eros. Curabitur non lorem posuere, porttitor nulla a, interdum quam.

Maecenas tempor leo quis felis viverra vestibulum. Phasellus semper nibh magna, id placerat velit aliquam quis. Curabitur sodales sit amet nulla in condimentum. Aliquam in commodo dui. Sed vitae suscipit mauris. Integer fermentum commodo mi, a malesuada nisi feugiat vel. Vivamus porta, mauris ac consequat porta, turpis nunc pellentesque risus, vel commodo metus arcu viverra enim.

Maecenas nisi diam, fermentum et lacinia non, sollicitudin ut orci. Phasellus nibh sem, pretium vel felis vel, commodo lacinia sapien. Etiam vehicula nulla consectetur sagittis lobortis. Morbi posuere arcu ut quam eleifend, at malesuada metus iaculis. Praesent in sollicitudin augue. Cras ac eros volutpat, varius tellus id, suscipit mauris. Nam venenatis consectetur metus vel accumsan.

Donec ut lobortis mauris. Aenean nec ante dui. Sed eu pulvinar leo. Nullam ornare, magna nec sollicitudin hendrerit, diam neque gravida elit, pulvinar interdum odio lacus at lectus. Integer felis neque, convallis vitae dignissim in, auctor eget ante. Pellentesque varius consectetur libero mollis aliquet. Nullam ullamcorper, purus vitae pellentesque dapibus, justo neque facilisis massa, a gravida orci quam vitae arcu. Pellentesque elit est, viverra iaculis tortor at, dapibus porta sapien. Etiam varius nunc nisi, quis consequat felis semper non.

Aliquam pretium feugiat ligula, sed congue risus iaculis et. Donec posuere quam gravida lectus cursus egestas. Suspendisse vestibulum egestas ornare. Nunc venenatis nisi sit amet ipsum bibendum euismod. Aliquam scelerisque est ac tortor consectetur porttitor. Etiam venenatis pharetra eros at luctus. Quisque eu nulla vel leo interdum porttitor. Donec sit amet facilisis ex. Vivamus sit amet augue ipsum. Aenean dui mi, ultricies eget dolor at, facilisis fermentum ex. Cras sed sem vel erat dignissim tincidunt semper vel dolor. Proin non pulvinar mi.

Curabitur ullamcorper ullamcorper vehicula. Nam condimentum placerat orci at hendrerit. Nullam gravida purus risus, at aliquet erat condimentum eu. Morbi semper libero in neque dignissim, vitae imperdiet enim suscipit. Morbi euismod sed massa quis lacinia. Sed augue sem, pretium id nunc eu, consectetur sagittis dui. Nullam ac semper ligula, in ullamcorper lectus. Etiam ultrices finibus leo, id viverra libero egestas sed. Suspendisse rhoncus dapibus dolor, pharetra pretium velit gravida non. Nulla id sodales justo. Vivamus ornare, mi eget vehicula congue, turpis metus congue odio, vel sollicitudin tellus justo eget turpis. Nam laoreet risus non tortor vestibulum efficitur. Fusce sed ex eros. Morbi eleifend, odio et pharetra tincidunt, tortor risus eleifend massa, eu pulvinar leo velit id risus. Nam in congue eros. Curabitur non lorem posuere, porttitor nulla a, interdum quam.

Maecenas tempor leo quis felis viverra vestibulum. Phasellus semper nibh magna, id placerat velit aliquam quis. Curabitur sodales sit amet nulla in condimentum. Aliquam in commodo dui. Sed vitae suscipit mauris. Integer fermentum commodo mi, a malesuada nisi feugiat vel. Vivamus porta, mauris ac consequat porta, turpis nunc pellentesque risus, vel commodo metus arcu viverra enim.

\begin{figure}[h]
\centering
\includegraphics[width=6in, viewport=10 50 720 500, clip=true]{NoFileHere.png}
\caption[Caption of Figure Placeholder]{Detailed description of non-existent figure goes here.}
\label{fig:noFileHere}
\end{figure}

\setlength\extrarowheight{0pt}
\renewcommand{\arraystretch}{1.5}
\begin{center}
\begin{longtable}{|>{\centering $}m{1.25in}<{$}|>{\sffamily}p{5in}<{\rmfamily}|}
\caption{Mathematical notation} 
\label{tab:mathNotation1} \\
\hline \endfirsthead
\caption[]{\emph{continued}}\\
\hline \endhead
\hline
\multicolumn{2}{r}{\emph{continued on next page}}
\endfoot
\hline \endlastfoot
\hline
\tilde{\mathbf{v}}=\mathbf{q}_{i,b}-\mathbf{d}_{e,i} \B \T & Tilde (~$\tilde{ }$~):  difference between q and d values (uses $e,i-1$ for subscript $i-1$ and $e,i$ for subscript $i$) \\
\hline
 $ \begin{displaymath} \dot{\mathbf{v}}=\frac{\delta\mathbf{v}}{\delta t} \end{displaymath} $  & Dot (~$\dot{ }$~):  partial derivative with respect to time \\
\hline
\delta \mathbf{x} = \mathbf{x}_i - \mathbf{x}_{i-1} \B \T &  Delta ($\delta$):  difference between current and past values \\
\hline
\delta t \B \T &  Elapsed time \\
\hline
\delta t \B \T &  Elapsed time \\
\hline
\delta t \B \T &  Elapsed time \\
\hline
\theta_i \B \T & Sensed thingummies at time $i$ \\
\hline
\end{longtable}
\end{center}

%%%%%%%
%% section two comment - weirdness begins here
%%%%%%%%
\subsubsection{SSSection Heading Two}
\label{subsubsec:headingtwo}

\paragraph{Where the problem is}

Mauris augue ipsum, posuere nec consectetur et, finibus eget libero. Proin interdum elit vel risus egestas tincidunt. Aliquam dapibus, arcu a elementum pharetra, ex sem venenatis nisi, in sagittis tellus nibh sed augue. 

\begin{center}
\begin{longtable}{ >{\centering $}m{1.25in}<{$} >{\sffamily}p{5in}<{\rmfamily}}
\caption{Mathematical notation } 
\label{tab:mathNotation} \\
\endfirsthead
\caption[]{\emph{continued}}\\
 \endhead
\multicolumn{2}{r}{\emph{continued on next page}}
\endfoot
 \endlastfoot
\theta \B \T & $\theta$~is the vector of random stuff related to the other stuff\\
\tilde{\theta}_{i-1} \B \T & is the vector of the old weird other stuff minus the new not weird stuff \\
\theta_r \B \T & is the random (input) stuff differences \\
\theta_c \B \T & is the new vector of weird stuff\\
\mathrm{f}_s  \B \T & is the vector of not at all weird, really bibs and bobs (the weird murmel sensed) \\
\mathrm{f}_d  \B \T & is the vector of colored whosiwhatsises (the input whosiwhatsises)
\end{longtable}
\end{center}

Praesent diam neque, luctus et tincidunt non, vulputate auctor neque. Duis massa metus, elementum sit amet est non, eleifend facilisis ipsum. Donec fermentum vel orci ac tincidunt. Nullam id ipsum eget ligula tincidunt tempor eget vitae massa. Nam aliquam scelerisque ipsum, sed pulvinar urna accumsan quis.

\begin{equation}
\ddot{\tilde{\theta_i}}=\mathrm{M}^{-1}_i \left( J^T \left( \theta_i \right) \left( \mathrm{f}_s - \mathrm{f}_d \right) - \mathrm{K}_{pj}\tilde{\theta}_{i-1} - \mathrm{K}_{dj}\dot{\tilde{\theta}}_{i-1} \right)
\end{equation}

Aliquam pretium feugiat ligula, sed congue risus iaculis et. Donec posuere quam gravida lectus cursus egestas. Suspendisse vestibulum egestas ornare. Nunc venenatis nisi sit amet ipsum bibendum euismod. Aliquam scelerisque est ac tortor consectetur porttitor. Etiam venenatis pharetra eros at luctus. Quisque eu nulla vel leo interdum porttitor. Donec sit amet facilisis ex. Vivamus sit amet augue ipsum. Aenean dui mi, ultricies eget dolor at, facilisis fermentum ex. Cras sed sem vel erat dignissim tincidunt semper vel dolor. Proin non pulvinar mi.

\end{document}
1

You can get latex back on track by using \clearpage before the section heading.

Note that longtable should never be in center environment it does not affect the alignment of longtables as they are always full width, it just adds spurious vertical space). I also changed [h] to [ht] as [h] should never be used on its own.

\documentclass[10pt]{article}
\RequirePackage{array}
\RequirePackage{fancyhdr}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage[includeheadfoot,hmarginratio=1:1]{geometry}                
\geometry{letterpaper}                   

\newcolumntype{L}[1]{>{\raggedright}m{#1}}
\newcolumntype{C}[1]{>{\centering}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft}m{#1}}
\newcommand\T{\rule{0pt}{2.6ex}}           % Top strut
\newcommand\B{\rule[-1.2ex]{0pt}{0pt}}  % Bottom strut

\setcounter{secnumdepth}{6}

\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent

\begin{document}
    \newcommand{\docNumber}{LETTERS-HERE}
    \newcommand{\docRevision}{0}

\clearpage
    \pagestyle{fancy}
    \fancyheadoffset{0cm}
    \rhead{}
    \chead{\fontsize{10pt}{10pt}\selectfont \bfseries{\docNumber\ Rev.\docRevision}}
    \lhead{}
    \rfoot{}
    \cfoot{\fontsize{10pt}{10pt}\selectfont \thepage \\ \small{Footer content goes here.  Lots and lots of footer content.  In really tiny type.  Really.  Lots of footer content.  Because I have to, not because I want to.}}
    \rfoot{}

    \newgeometry{includeheadfoot,margin=1in}
    \pagenumbering{roman}

%%%%%%
% Start main matter and adjust page numbering
%%%%%%
\newpage
\pagenumbering{arabic}
\setcounter{page}{1}

\section{section intro}
\label{sec:intro}
Curabitur ullamcorper ullamcorper vehicula. Nam condimentum placerat orci at hendrerit. Nullam gravida purus risus, at aliquet erat condimentum eu. Morbi semper libero in neque dignissim, vitae imperdiet enim suscipit. Morbi euismod sed massa quis lacinia. Sed augue sem, pretium id nunc eu, consectetur sagittis dui. Nullam ac semper ligula, in ullamcorper lectus. Etiam ultrices finibus leo, id viverra libero egestas sed. Suspendisse rhoncus dapibus dolor, pharetra pretium velit gravida non. Nulla id sodales justo. Vivamus ornare, mi eget vehicula congue, turpis metus congue odio, vel sollicitudin tellus justo eget turpis. Nam laoreet risus non tortor vestibulum efficitur. Fusce sed ex eros. Morbi eleifend, odio et pharetra tincidunt, tortor risus eleifend massa, eu pulvinar leo velit id risus. Nam in congue eros. Curabitur non lorem posuere, porttitor nulla a, interdum quam.

Maecenas tempor leo quis felis viverra vestibulum. Phasellus semper nibh magna, id placerat velit aliquam quis. Curabitur sodales sit amet nulla in condimentum. Aliquam in commodo dui. Sed vitae suscipit mauris. Integer fermentum commodo mi, a malesuada nisi feugiat vel. Vivamus porta, mauris ac consequat porta, turpis nunc pellentesque risus, vel commodo metus arcu viverra enim.

Maecenas nisi diam, fermentum et lacinia non, sollicitudin ut orci. Phasellus nibh sem, pretium vel felis vel, commodo lacinia sapien. Etiam vehicula nulla consectetur sagittis lobortis. Morbi posuere arcu ut quam eleifend, at malesuada metus iaculis. Praesent in sollicitudin augue. Cras ac eros volutpat, varius tellus id, suscipit mauris. Nam venenatis consectetur metus vel accumsan.

Donec ut lobortis mauris. Aenean nec ante dui. Sed eu pulvinar leo. Nullam ornare, magna nec sollicitudin hendrerit, diam neque gravida elit, pulvinar interdum odio lacus at lectus. Integer felis neque, convallis vitae dignissim in, auctor eget ante. Pellentesque varius consectetur libero mollis aliquet. Nullam ullamcorper, purus vitae pellentesque dapibus, justo neque facilisis massa, a gravida orci quam vitae arcu. Pellentesque elit est, viverra iaculis tortor at, dapibus porta sapien. Etiam varius nunc nisi, quis consequat felis semper non.

Aliquam pretium feugiat ligula, sed congue risus iaculis et. Donec posuere quam gravida lectus cursus egestas. Suspendisse vestibulum egestas ornare. Nunc venenatis nisi sit amet ipsum bibendum euismod. Aliquam scelerisque est ac tortor consectetur porttitor. Etiam venenatis pharetra eros at luctus. Quisque eu nulla vel leo interdum porttitor. Donec sit amet facilisis ex. Vivamus sit amet augue ipsum. Aenean dui mi, ultricies eget dolor at, facilisis fermentum ex. Cras sed sem vel erat dignissim tincidunt semper vel dolor. Proin non pulvinar mi.

Curabitur ullamcorper ullamcorper vehicula. Nam condimentum placerat orci at hendrerit. Nullam gravida purus risus, at aliquet erat condimentum eu. Morbi semper libero in neque dignissim, vitae imperdiet enim suscipit. Morbi euismod sed massa quis lacinia. Sed augue sem, pretium id nunc eu, consectetur sagittis dui. Nullam ac semper ligula, in ullamcorper lectus. Etiam ultrices finibus leo, id viverra libero egestas sed. Suspendisse rhoncus dapibus dolor, pharetra pretium velit gravida non. Nulla id sodales justo. Vivamus ornare, mi eget vehicula congue, turpis metus congue odio, vel sollicitudin tellus justo eget turpis. Nam laoreet risus non tortor vestibulum efficitur. Fusce sed ex eros. Morbi eleifend, odio et pharetra tincidunt, tortor risus eleifend massa, eu pulvinar leo velit id risus. Nam in congue eros. Curabitur non lorem posuere, porttitor nulla a, interdum quam.

Maecenas tempor leo quis felis viverra vestibulum. Phasellus semper nibh magna, id placerat velit aliquam quis. Curabitur sodales sit amet nulla in condimentum. Aliquam in commodo dui. Sed vitae suscipit mauris. Integer fermentum commodo mi, a malesuada nisi feugiat vel. Vivamus porta, mauris ac consequat porta, turpis nunc pellentesque risus, vel commodo metus arcu viverra enim.

\begin{figure}[ht]
\centering
\includegraphics[width=6in, viewport=10 50 720 500, clip=true]{NoFileHere.png}
\caption[Caption of Figure Placeholder]{Detailed description of non-existent figure goes here.}
\label{fig:noFileHere}
\end{figure}

\setlength\extrarowheight{0pt}
\renewcommand{\arraystretch}{1.5}
\begin{center}
\begin{longtable}{|>{\centering $}m{1.25in}<{$}|>{\sffamily}p{5in}<{\rmfamily}|}
\caption{Mathematical notation} 
\label{tab:mathNotation1} \\
\hline \endfirsthead
\caption[]{\emph{continued}}\\
\hline \endhead
\hline
\multicolumn{2}{r}{\emph{continued on next page}}
\endfoot
\hline \endlastfoot
\hline
\tilde{\mathbf{v}}=\mathbf{q}_{i,b}-\mathbf{d}_{e,i} \B \T & Tilde (~$\tilde{ }$~):  difference between q and d values (uses $e,i-1$ for subscript $i-1$ and $e,i$ for subscript $i$) \\
\hline
 $ \begin{displaymath} \dot{\mathbf{v}}=\frac{\delta\mathbf{v}}{\delta t} \end{displaymath} $  & Dot (~$\dot{ }$~):  partial derivative with respect to time \\
\hline
\delta \mathbf{x} = \mathbf{x}_i - \mathbf{x}_{i-1} \B \T &  Delta ($\delta$):  difference between current and past values \\
\hline
\delta t \B \T &  Elapsed time \\
\hline
\delta t \B \T &  Elapsed time \\
\hline
\delta t \B \T &  Elapsed time \\
\hline
\theta_i \B \T & Sensed thingummies at time $i$ \\
\hline
\end{longtable}
\end{center}

%%%%%%%
%% section two comment - weirdness begins here
%%%%%%%%
\clearpage

\subsubsection{SSSection Heading Two}
\label{subsubsec:headingtwo}

\paragraph{Where the problem is}

Mauris augue ipsum, posuere nec consectetur et, finibus eget libero. Proin interdum elit vel risus egestas tincidunt. Aliquam dapibus, arcu a elementum pharetra, ex sem venenatis nisi, in sagittis tellus nibh sed augue. 


\begin{longtable}{ >{\centering $}m{1.25in}<{$} >{\sffamily}p{5in}<{\rmfamily}}
\caption{Mathematical notation } 
\label{tab:mathNotation} \\
\endfirsthead
\caption[]{\emph{continued}}\\
 \endhead
\multicolumn{2}{r}{\emph{continued on next page}}
\endfoot
 \endlastfoot
\theta \B \T & $\theta$~is the vector of random stuff related to the other stuff\\
\tilde{\theta}_{i-1} \B \T & is the vector of the old weird other stuff minus the new not weird stuff \\
\theta_r \B \T & is the random (input) stuff differences \\
\theta_c \B \T & is the new vector of weird stuff\\
\mathrm{f}_s  \B \T & is the vector of not at all weird, really bibs and bobs (the weird murmel sensed) \\
\mathrm{f}_d  \B \T & is the vector of colored whosiwhatsises (the input whosiwhatsises)
\end{longtable}


Praesent diam neque, luctus et tincidunt non, vulputate auctor neque. Duis massa metus, elementum sit amet est non, eleifend facilisis ipsum. Donec fermentum vel orci ac tincidunt. Nullam id ipsum eget ligula tincidunt tempor eget vitae massa. Nam aliquam scelerisque ipsum, sed pulvinar urna accumsan quis.

\begin{equation}
\ddot{\tilde{\theta_i}}=\mathrm{M}^{-1}_i \left( J^T \left( \theta_i \right) \left( \mathrm{f}_s - \mathrm{f}_d \right) - \mathrm{K}_{pj}\tilde{\theta}_{i-1} - \mathrm{K}_{dj}\dot{\tilde{\theta}}_{i-1} \right)
\end{equation}

Aliquam pretium feugiat ligula, sed congue risus iaculis et. Donec posuere quam gravida lectus cursus egestas. Suspendisse vestibulum egestas ornare. Nunc venenatis nisi sit amet ipsum bibendum euismod. Aliquam scelerisque est ac tortor consectetur porttitor. Etiam venenatis pharetra eros at luctus. Quisque eu nulla vel leo interdum porttitor. Donec sit amet facilisis ex. Vivamus sit amet augue ipsum. Aenean dui mi, ultricies eget dolor at, facilisis fermentum ex. Cras sed sem vel erat dignissim tincidunt semper vel dolor. Proin non pulvinar mi.

\end{document}
  • Thanks!I can't use [ht] because the format I need to match always puts tables where they are and breaks them across pages, even if it's stupid. – signer Jul 15 '15 at 14:54
  • @signer since latex will just complain and change it to ht anyway using h does not ensure that. – David Carlisle Jul 15 '15 at 15:01
  • Sorry, didn't realize there was a time limit on comment editing... The same format also mandates that only top level sections start new pages. \clearpage fixes it for where it is now, but if the table needs to break across pages, instead of having to remove the \begin{table} and \end{table} statements, I now get a blank page after the table and need to remove the \clearpage. Anyone have an alternative that doesn't require a manual change? (And h! seemed to put it where I wanted.) – signer Jul 15 '15 at 15:09
0

Partial but not permanent solution:

If the table isn't breaking across a page, then when the longtable environment is enclosed in a table float

\begin{table}[h!] \begin{center} \begin{longtable} ... \end{longtable} \end{center} \end{table}

the problem goes away. However, the table will not break across the page, so if it subsequently becomes necessary for it to continue on the next page, the \begin{table} and \end{table} statements will need to be removed by hand.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.