I get the following error when compiling my LaTeX source:
! LaTeX Error: \begin{document} ended by \end{sidewaystable}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.98
The table causing the problem, which is defined in chapter1.tex, and included in the main document by \include{chapter1}, is:
\afterpage{
\clearpage
\begin{sidewaystable}
\begin{center}
\scalebox{0.75}{
\begin{tabular}{p{4cm}|c|p{4cm}|p{5cm}l|ll|l|}
\hline
\multicolumn{3}{c|}{}
& \multicolumn{2}{c|}{Time Complexity}
& \multicolumn{2}{c|}{Space Complexity} \\
\hline
Author
& Year
& Method
& $m < n$
& $m = n$
& $m < n$
& $m = n$ \\
\hline
\hline
...
\hline
\end{tabular}
}
\caption{Time and space complexity of algorithms used to calculate Hermite Normal Form matrices measured in terms of the matrix dimension, $n$, by letting $M = O(n^c)$ for some constant $c$, and $m = O(n)$. Such conversions will be denoted by $O^{\thicksim}$(*).}
\end{center}
\end{sidewaystable}
\clearpage
}
The main source file uses the report document class. It also uses the following packages:
\usepackage{uowthesis}
\usepackage{epsfig}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathdots}
\usepackage{color}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{epsf}
\usepackage{float}
\usepackage{multirow}
\usepackage{afterpage}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
Apart from some \newtheorem and \newcommand statements, there is nothing spectacular about the main source file that should cause it to behave this way unless, of course, the \afterpage statement (above) interferes with the \beforepreface and \afterpreface statements, also included in the main source.
Note that I have decided not to paste the main source file as sample code in this question due to space limitations. Also, due to breach of confidentiality, intellectual property, etc. However, I can elaborate on certain portions of the main source if requested and, if necessary.
Modification: bill 3-JAN-2012 - Added sample main file.
Here's an abridged version of the main file that can be used to cause/show the problem. Hope it helps.
\documentclass[a4,12pt]{report}
\usepackage{uowthesis}
\usepackage{epsfig}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathdots}
\usepackage{color}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{epsf}
\usepackage{float}
\usepackage{multirow}
\usepackage{afterpage}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
%
\title{Optimal Key Lengths and Digital Signatures}
\author{Vasilios Evangelos Tourloupis}
\dedicate{My Family}
\degree{Master of Computer Science}
\dept{School of Computer Science and Software Engineering}
\beforepreface
%\include{abstract} % Abstract
%\include{acknowledgement} % Acknowledgements}
%\include{papers} % Publications
\afterpreface
\include{chapter1} % Introduction
\include{Chapter2} % Background
\include{Chapter3} % Efficient Self-Certified Signatures with Batch Verification
\include{chapter4} % Self-Certified Ring Signatures
\include{Chapter5} % Conclusion
%\bibliographystyle{alpha}
%\bibliography{thesis} %\include{NoCites} % Important references (probably not cited before)
\end{document}
\afterpageis interfering, why not try commenting it out and seeing if you get the same error? – Seamus Jan 2 '12 at 13:35uowthesis. Commenting out\afterpagealone did not solve the problem, however, commenting out the whole table did. Therefore, it must be a problem with the table (which I highly doubt as this is a straight copy and paste from an article class paper that had no problems compiling). – Bill Jan 2 '12 at 13:49tablework instead of sidewaystable? If it does, this might be because of a redefinition/undefinition of the sidewaystable environment (probably in your custom thesis class). – recluze Jan 2 '12 at 13:54uowthesis(which means that the error does not occur without it), so it seems it's the main reason for the problem you have. So we need theuowthesispackage for an analysis of the problem. – Axel Sommerfeldt Jan 2 '12 at 15:24uowthesis.styis old and creates many problems. In particular the definition of\@xfloatis buggy. Commenting it makes the problem disappear. However I discourage using such a buggy package. – egreg Jan 2 '12 at 21:13