5

I am using a longtable environment to put some graph images in (perfectly works in all the other figures with tabular environments that i have produced already) However, when in comes to the longtable, the page is not breaking and i cannot find the issue. Any help appreciated.


\begin{figure} [htbp]
\begin{center}
\begin{longtable}{l l}
\endfirsthead
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\endhead
\endfoot
\endlastfoot
\textbf{a)} & \textbf{b)} \\
\includegraphics[width=\figwidth]{images/FAs1} & \includegraphics[width=\figwidth]{images/FAs2}\\
\textbf{c)} & \textbf{d)} \\
\includegraphics[width=\figwidth]{images/FAs3} & \includegraphics[width=\figwidth]{images/FAs4}\\
\textbf{e)} & \textbf{f)} \\
\includegraphics[width=\figwidth]{images/FAs5} & \includegraphics[width=\figwidth]{images/FAs6}\
\newpage

\textbf{g)} & \textbf{h)} \\
\includegraphics[width=\figwidth]{images/FAs7} & \includegraphics[width=\figwidth]{images/FAs8}\\
\textbf{i)} & \textbf{j)} \\
\includegraphics[width=\figwidth]{images/FAs9} & \includegraphics[width=\figwidth]{images/FAs10}\\
\caption{Fatty acids found in \nig in \wt and \crt }
\label{fig:FAs}
\end{longtable}
\end{center}
\end{figure}

Many thanks!

3
  • 1
    you put it in a figure environment which is a box, so stops all page breaking (you also put it in a center environment which has no effect) just remove those two environemnts Aug 29, 2013 at 10:56
  • Welcome to TeX.SX. Please provide a real minimal example showing which packages you are loading. It should start with \documentclass{... and end with \end{document}. For example I don't know what \wt and \crt mean and would have to search that for being able to help.
    – LaRiFaRi
    Aug 29, 2013 at 10:56
  • \wt and \crt are my own created commands a part of a thesis.
    – Inovatio
    Aug 29, 2013 at 13:05

1 Answer 1

7

As already pointed out by @David Carlisle, you should not put a longtable into a figure environment. Here is the new code. I had to change the width for not knowing what you used there. Just change it back. I also switched off the commands in the caption.

% arara: pdflatex

\documentclass{article}
\usepackage{longtable}
\usepackage[%
    ,demo
    ]{graphicx}

\begin{document}
\begin{longtable}{l l}
\endfirsthead
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\endhead
\endfoot
\endlastfoot
\textbf{a)} & \textbf{b)} \\
\includegraphics[width=5cm]{images/FAs1} & \includegraphics[width=5cm]{images/FAs2}\\
\textbf{c)} & \textbf{d)} \\
\includegraphics[width=5cm]{images/FAs3} & \includegraphics[width=5cm]{images/FAs4}\\
\textbf{e)} & \textbf{f)} \\
\includegraphics[width=5cm]{images/FAs5} & \includegraphics[width=5cm]{images/FAs6}\\
%
\newpage
%
\textbf{g)} & \textbf{h)} \\
\includegraphics[width=5cm]{images/FAs7} & \includegraphics[width=5cm]{images/FAs8}\\
\textbf{i)} & \textbf{j)} \\
\includegraphics[width=5cm]{images/FAs9} & \includegraphics[width=5cm]{images/FAs10}\\
\caption{Fatty acids found in %\nig in \wt and \crt % commented out for not knowing what that is.
}
\label{fig:FAs}
\end{longtable}
\end{document}
2
  • Thank you, was not aware that figure environment stops the page breaking. Is there any other way to keep the figure environment and get the same output?
    – Inovatio
    Aug 29, 2013 at 13:12
  • Do you actually need a longtable? How about many subfigures with own captions (or at least "(a)", "(b)"...) grouped in a grid inside of a figure. They can split as well. See something I wrote this morning: tex.stackexchange.com/a/130629/32245
    – LaRiFaRi
    Aug 29, 2013 at 13:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .