Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LaTex error: \begin{document} ended by \end{table}

7,985 views
Skip to first unread message

user.nokia.com

unread,
Aug 30, 2001, 6:26:55 AM8/30/01
to
Hi,

I have this problem. I want to use colors in my table's, but when I try
to include the colortbl package I get the following error message:
LaTex error: \begin{document} ended by \end{table}. I hope someone can
help me...

Here is the sample code I tried.

\documentclass[12pt]{report}
\usepackage{xthesis}
\usepackage[centertags]{amsmath}
\usepackage{graphicx}
\usepackage[centertags]{amsmath}
\usepackage[T1]{fontenc}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{newlfont}
%\usepackage{longtable}
\usepackage{colortbl} %Causes an error

\begin{document}

\begin{table}
\begin{tabular}{c c c c}
SOMETHING & IS & WRONG!&!\\
\end{tabular}
\caption{caption text}
\end{table}

\end{document}


And here part of the log file.

.
.
.
(C:\Apps\MiKTeX2.1\tex\latex\base\ulasy.fd
File: ulasy.fd 1998/08/17 v2.2eLaTeX symbol font definitions
)
! Too many }'s.
\color@endbox ->\color@endgroup \egroup

l.32 \end{table}

?

! LaTeX Error: \begin{document} ended by \end{table}.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.32 \end{table}

?
! Extra \endgroup.
<recently read> \endgroup

l.32 \end{table}
?
(testi_table.aux) )
No pages of output.


David Kastrup

unread,
Aug 30, 2001, 7:13:44 AM8/30/01
to
>>>>> "user" == user nokia com <juha.k...@nokia.com> writes:

user> Hi, I have this problem. I want to use colors in my table's,
user> but when I try to include the colortbl package I get the
user> following error message: LaTex error: \begin{document} ended
user> by \end{table}. I hope someone can help me...

user> \begin{table} \begin{tabular}{c c c c} SOMETHING & IS &

colortbl hooks into the line parser. It seems that vanilla tabular
accidentally is ignoring the completely illegal column specifications
(the spaces you put into {cccc}), while colortbl is confused about
them.

--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: David....@neuroinformatik.ruhr-uni-bochum.de

user.nokia.com

unread,
Aug 30, 2001, 8:43:42 AM8/30/01
to
Hi David,

I'm not sure if I fully understood what you ment... If you meant that I
should remove those spaces, I did so and tried to run Latex again. Result
I got from this experiment looked the same as before the spaces were
removed (same error message appeared).

But thanks any way!!! And if I you have more ideas... Any kind of help is
greatly appreciated....

-Juha

Heiko Oberdiek

unread,
Aug 30, 2001, 11:31:55 AM8/30/01
to
On Thu, 30 Aug 2001 10:26:55 GMT, "user.nokia.com"
<juha.k...@nokia.com> wrote:

> I have this problem. I want to use colors in my table's, but when I try
> to include the colortbl package I get the following error message:
> LaTex error: \begin{document} ended by \end{table}. I hope someone can
> help me...
>
> Here is the sample code I tried.

>[...]

Omit all packages that are not necessary to reproduce the error.

> \usepackage{xthesis}

I do not know that package. Without your file runs without error
message.

Yours sincerely
Heiko <ober...@uni-freiburg.de>

Dan Luecking

unread,
Aug 30, 2001, 3:58:07 PM8/30/01
to
"user.nokia.com" <juha.k...@nokia.com> wrote in message news:<3B8E14C8...@nokia.com>...

> Hi,
>
> I have this problem. I want to use colors in my table's, but when I try
> to include the colortbl package I get the following error message:
> LaTex error: \begin{document} ended by \end{table}. I hope someone can

This is the second error message, which may be purely
a consequence an unstable situation created by the first
one of the first one.

> help me...
>
> Here is the sample code I tried.
>
> \documentclass[12pt]{report}
> \usepackage{xthesis}

I don't have this package, so I commented it out, and
then no errors occured. This would appear to suggest
a conflict between xthesis and colortbl.

[many other packages snipped]


> \usepackage[centertags]{amsmath}
> \usepackage{graphicx}
> \usepackage[centertags]{amsmath}

Loading amsmath once out to be sufficiant :-)

> \usepackage{colortbl} %Causes an error

You really should do this work yourself: delete
\usepackage commands one at a time until the problem
goes away. Start with standard and/or apparently
unrelated packages. (Do not delete the last package
added, colortble. You know it causes a problem; you
want to find what it is conflicting with.) If you
manage to delete all the packages and the problem
remains then you know it is either an error or a
problem with the package.

>
> \begin{document}
>
> \begin{table}
> \begin{tabular}{c c c c}

It seems to be innocuous, but spaces ought not be
assumed to be unimportant.

> SOMETHING & IS & WRONG!&!\\
> \end{tabular}

The last line of a tabular should not end with \\.
Neither this nor the spaces seems to be the cause
of the problem, I would see whether xthesis redefines
any table or tabular-related commands.

Dan Luecking

user.nokia.com

unread,
Aug 31, 2001, 2:18:33 AM8/31/01
to
Hi Dan,

Thanks a lot!! There really was something redefined in the xthesis.sty that applied to all floats
(see end of this mail). I commented it out and the error message disappeared...

The reason why there was all those usepackage things in the sample code, was that the real document
I'm writing needs some of those...

This is also the first time I'm using LaTex, so I don't really know what all these instructions mean.
I have much to learn, but I'm trying...

Once again, thank you very much!! You helped me a lot!! I have wasted much time (almost two days) to
find out the reason for this error... Thank you!!

Here is the section I commented out.

% Redefine the macro used for floats (including figures and tables)
% so that single spacing is used.
% (Note \def\figure{\@float{figure}set single spacing} doesn't work
% because figure has an optional argument)
\comment{
\def\@xfloat#1[#2]{\ifhmode \@bsphack\@floatpenalty -\@Mii\else
\@floatpenalty-\@Miii\fi\def\@captype{#1}\ifinner
\@parmoderr\@floatpenalty\z@
\else\@next\@currbox\@freelist{\@tempcnta\csname ftype@#1\endcsname
\multiply\@tempcnta\@xxxii\advance\@tempcnta\sixt@@n
\@tfor \@tempa :=#2\do
{\if\@tempa h\advance\@tempcnta \@ne\fi
\if\@tempa t\advance\@tempcnta \tw@\fi
\if\@tempa b\advance\@tempcnta 4\relax\fi
\if\@tempa p\advance\@tempcnta 8\relax\fi
}\global\count\@currbox\@tempcnta}\@fltovf\fi
\global\setbox\@currbox\vbox\bgroup
\def\baselinestretch{1}\@normalsize
\boxmaxdepth\z@
\hsize\columnwidth \@parboxrestore}
}


-Juha


0 new messages