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

Re: Long table/supertabular problem...

1,161 views
Skip to first unread message
Message has been deleted

Herbert Voss

unread,
Sep 9, 2005, 11:32:08 AM9/9/05
to
mdek...@gmail.com wrote:

> Ive made a long table with some custom adjustments but now it has
> become to long for the page and won't wrap to the next page. I have
> tried using the longtable command and the supertabular command...and I
> assume its because I don't understand how to apply them properly
> because they keep causing errors...Any advice/help would be much
> appreciated....Thanks in advance...
>
>
> I have defined a special column width in the preamble...
> \newcolumntype{P}{>{\centering\arraybackslash}p}\begin{center}

\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}

\begin{table}
\small
\begin{longtable}{P{1in}P{1.3in}P{1.3in}P{2.3in}}\hline
heading & Heading & Heading & the long heading that goes off page I
tried wrapping etc...\\ \hline
\end{longtable}
\caption{}
\end{table}

Herbert

--
http://TeXnik.de/
http://PSTricks.tug.org/
ftp://ftp.dante.de/tex-archive/info/math/voss/mathmode/Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes

Ulrike Fischer

unread,
Sep 9, 2005, 11:44:09 AM9/9/05
to
Herbert Voss <Herber...@gmx.net> schrieb:

> mdek...@gmail.com wrote:
>
>> Ive made a long table with some custom adjustments but now it has
>> become to long for the page and won't wrap to the next page. I have
>> tried using the longtable command and the supertabular command...and I
>> assume its because I don't understand how to apply them properly
>> because they keep causing errors...Any advice/help would be much
>> appreciated....Thanks in advance...
>>
>

> \begin{table}

> \begin{longtable}{P{1in}P{1.3in}P{1.3in}P{2.3in}}\hline

Not a good idea to put a longtable in a table environment if one wants
it to break across pages ...

--
Ulrike Fischer
e-mail: zusätzlich meinen Vornamen vor dem @ einfügen.
e-mail: add my first name between the news and the @.

Herbert Voss

unread,
Sep 9, 2005, 12:02:55 PM9/9/05
to
Ulrike Fischer wrote:
> Herbert Voss <Herber...@gmx.net> schrieb:
>
>
>>mdek...@gmail.com wrote:
>>
>>
>>>Ive made a long table with some custom adjustments but now it has
>>>become to long for the page and won't wrap to the next page. I have
>>>tried using the longtable command and the supertabular command...and I
>>>assume its because I don't understand how to apply them properly
>>>because they keep causing errors...Any advice/help would be much
>>>appreciated....Thanks in advance...
>>>
>>
>>\begin{table}
>
>
>>\begin{longtable}{P{1in}P{1.3in}P{1.3in}P{2.3in}}\hline
>
>
> Not a good idea to put a longtable in a table environment if one wants
> it to break across pages ...

uups ...
and it is also nonsense with a caption outside the
longtable.


{\small


\begin{longtable}{P{1in}P{1.3in}P{1.3in}P{2.3in}}\hline

heading & Heading & Heading & the long heading that goes off page I
tried wrapping etc...\\ \hline

\caption{}
\end{longtable}}

mdek...@gmail.com

unread,
Sep 9, 2005, 1:08:21 PM9/9/05
to
Hi thanks in advance for your help here...(everyone!) but im confused
are you suggesting the longtable command is not the way to go? If not
what would people suggest...I simply want the table to break accross
pages as it would if I was using a word processor if that makes sense?

Ta

Tina Friedrich

unread,
Sep 9, 2005, 1:30:28 PM9/9/05
to
Hi,

> Hi thanks in advance for your help here...(everyone!) but im confused
> are you suggesting the longtable command is not the way to go? If not
> what would people suggest...I simply want the table to break accross
> pages as it would if I was using a word processor if that makes sense?

longtable can definitely be used to have a table that runs over more than
one page; but longtable is a substitute for table. If you use longtable,
you don't use table any more. So, try something like

\begin{longtable}
\small
\begin{center}
\begin{tabular}{P{1in}P{1.3in}P{1.3in}P{2.3in}}


\hline
{ heading } & { Heading} & { Heading} & { the long heading that goes
off page I tried wrapping} etc...
\\ \hline

\end{tabular}
\end{center}
\caption{}
\end{longtable}

Tina

Herbert Voss

unread,
Sep 9, 2005, 2:32:36 PM9/9/05
to
Tina Friedrich wrote:

>>Hi thanks in advance for your help here...(everyone!) but im confused
>>are you suggesting the longtable command is not the way to go? If not
>>what would people suggest...I simply want the table to break accross
>>pages as it would if I was using a word processor if that makes sense?
>
>
> longtable can definitely be used to have a table that runs over more than
> one page; but longtable is a substitute for table. If you use longtable,
> you don't use table any more. So, try something like
>
> \begin{longtable}
> \small
> \begin{center}

a longtable is centered by default

mdek...@gmail.com

unread,
Sep 10, 2005, 8:56:43 AM9/10/05
to
Well that doesn't seem to work I tried doing it as Tina suggested and I
left out the \begin center as Herbert suggested...

I added /usepackage{longtable} to the top and it complained when I
tried to make it complianed....(below) which I assume is to do with me
having \caption{\small} Whats wrong with that? Solutions please...

! Package array Error: Illegal pream-token (\small): `c' used.

See the array package documentation for explanation.
Type H <return> for immediate help.
...

l.346 \small

mdek...@gmail.com

unread,
Sep 10, 2005, 8:59:09 AM9/10/05
to
when I leave out the \small commands... it complains about my user
defined column widths...

! Package array Error: Illegal pream-token (\begin): `c' used.

See the array package documentation for explanation.
Type H <return> for immediate help.
...

l.346 \begin


{tabular}{P{1in}P{1.3in}P{1.3in}P{2.3in}}

?


Help please...thanks...

Morten Høgholm

unread,
Sep 10, 2005, 9:08:22 AM9/10/05
to

A complete, yet minimal example of what you are doing never hurts. This
works:

\documentclass{article}
\usepackage{array,longtable}


\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}

\begin{document}
{\small
\begin{longtable}{P{1in}P{1.3in}P{1.3in}P{2.3in}}\hline


heading & Heading & Heading & the long heading that goes off page I
tried wrapping etc...\\ \hline

\caption{A caption}
\end{longtable}
}

--
Morten

Herbert Voss

unread,
Sep 10, 2005, 9:32:25 AM9/10/05
to
Morten Høgholm wrote:

> A complete, yet minimal example of what you are doing never hurts. This
> works:
>
> \documentclass{article}
> \usepackage{array,longtable}
> \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
> \begin{document}
> {\small
> \begin{longtable}{P{1in}P{1.3in}P{1.3in}P{2.3in}}\hline
> heading & Heading & Heading & the long heading that goes off page I
> tried wrapping etc...\\ \hline
> \caption{A caption}
> \end{longtable}
> }

\end{document}

now it works ... :-)

mdek...@gmail.com

unread,
Sep 10, 2005, 12:33:50 PM9/10/05
to
Hi I tried what you suggested...but it didnt work so I amended what you
amended...in the newcolumtype statement back to the way it was. And
that seemed to work but now it crashing...elsewhere where previously it
was fine.

My script now looks like....

\documentclass{article}
\usepackage{array,longtable}
\newcolumntype{P}{>{\centering\arraybackslash}p}


\begin{document}
{\small
\begin{longtable}{P{1in}P{1.3in}P{1.3in}P{2.3in}}\hline
heading & Heading & Heading & the long heading that goes off page I

tried wrapping etc...\\ \hline
\caption{A caption}
\end{longtable}

}

and it crashes when I try compiling it now saying...

! Misplaced \noalign.
\caption ->\noalign
\bgroup \@ifnextchar [{\egroup \LT@c@ption
\@firstofone ...
l.376 \caption
{\small{Summary of Literature MODIS uncertainty values}}
?

so I tried removing the \small comment

and now it still crashes...

! Misplaced \noalign.
\caption ->\noalign
\bgroup \@ifnextchar [{\egroup \LT@c@ption
\@firstofone ...
l.376 \caption
{Summary of Literature MODIS uncertainty values}
?

Not sure what is still wrong...

thanks to all those who are trying to help!

Mart.

mdek...@gmail.com

unread,
Sep 10, 2005, 12:37:31 PM9/10/05
to
and i have the end doc statement !

Heiko Oberdiek

unread,
Sep 10, 2005, 12:48:21 PM9/10/05
to
mdek...@gmail.com wrote:

You don't have a name?

> \documentclass{article}
> \usepackage{array,longtable}
> \newcolumntype{P}{>{\centering\arraybackslash}p}
> \begin{document}
> {\small
> \begin{longtable}{P{1in}P{1.3in}P{1.3in}P{2.3in}}\hline
> heading & Heading & Heading & the long heading that goes off page I
>
> tried wrapping etc...\\ \hline
> \caption{A caption}
> \end{longtable}
>
> }
>
> and it crashes when I try compiling it now saying...
>
> ! Misplaced \noalign.
> \caption ->\noalign
> \bgroup \@ifnextchar [{\egroup \LT@c@ption
> \@firstofone ...
> l.376 \caption
> {\small{Summary of Literature MODIS uncertainty values}}

Your example has 13 lines, the error messages prints line 376.
Probably you should read some LaTeX book and the documentation
for longtable:
* \small does not take an argument.
* The error message text says, that your \caption is misplaced,
probably not at the start of line.

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

mdek...@gmail.com

unread,
Sep 11, 2005, 9:15:26 AM9/11/05
to
I don't have a name? Martin...!

I have amended the table and it compiles fine...as long as the caption
command isn't used!!! which is clearly not much use... as it
stands...below works...

\documentclass{article}
\usepackage{array,longtable}
\newcolumntype{P}{>{\centering\arraybackslash}p}
\begin{document}

{\small
\begin{longtable}{P{1in}P{1.3in}P{1.3in}P{2.3in}}\hline

heading & Heading & Heading & the long heading etc etc\\ \hline
\end{longtable}

but when you add
\caption before \end{longtable} it crashes...

! Misplaced \noalign.
\caption ->\noalign
\bgroup \@ifnextchar [{\egroup \LT@c@ption
\@firstofone ...

l.378 \caption


{Summary of Literature MODIS uncertainty values}

I can't see why there is an issue with the alignment? any ideas what Im
missing?

I tried using the package \topcaption instead...

but that creates new trouble....

! Undefined control sequence.
<argument> c@\@captype

l.342 \topcaption


{Summary of Literature MODIS uncertainty values}

even though I have declared \usepackage{topcation}

What is the issue with captions and longtable???

Many thanks
Mart.

Herbert Voss

unread,
Sep 11, 2005, 9:21:16 AM9/11/05
to
mdek...@gmail.com wrote:

> I have amended the table and it compiles fine...as long as the caption
> command isn't used!!! which is clearly not much use... as it
> stands...below works...
>
> \documentclass{article}
> \usepackage{array,longtable}
> \newcolumntype{P}{>{\centering\arraybackslash}p}
> \begin{document}
>
> {\small
> \begin{longtable}{P{1in}P{1.3in}P{1.3in}P{2.3in}}\hline
> heading & Heading & Heading & the long heading etc etc\\ \hline
> \end{longtable}
>
> but when you add
> \caption before \end{longtable} it crashes...


no it doesn't ...

\documentclass{article}
\usepackage{array,longtable}
\newcolumntype{P}{>{\centering\arraybackslash}p}
\begin{document}

{\small
\begin{longtable}{P{1in}P{1.3in}P{1.3in}P{2.3in}}\hline
heading & Heading & Heading & the long heading etc etc\\ \hline

\caption{a nice caption}
\end{longtable}
}

\end{document}


Morten Høgholm

unread,
Sep 11, 2005, 9:26:57 AM9/11/05
to
On Sun, 11 Sep 2005 15:15:26 +0200, <mdek...@gmail.com> wrote:

> I have amended the table and it compiles fine...as long as the caption
> command isn't used!!! which is clearly not much use... as it
> stands...below works...
>
> \documentclass{article}
> \usepackage{array,longtable}
> \newcolumntype{P}{>{\centering\arraybackslash}p}
> \begin{document}
>
> {\small
> \begin{longtable}{P{1in}P{1.3in}P{1.3in}P{2.3in}}\hline
> heading & Heading & Heading & the long heading etc etc\\ \hline
> \end{longtable}
>
> but when you add
> \caption before \end{longtable} it crashes...
>
> ! Misplaced \noalign.
> \caption ->\noalign
> \bgroup \@ifnextchar [{\egroup \LT@c@ption
> \@firstofone ...
> l.378 \caption
> {Summary of Literature MODIS uncertainty values}
>
> I can't see why there is an issue with the alignment? any ideas what Im
> missing?

With the risk of sounding patronizing: You lack the ability to create a
minimal yet complete example for us!

Does the minimal document I posted earlier produce the error (after adding
\end{document} of course)? If it doesn't what do you add that makes it
produce the error?

My crystal ball tells me you might be doing something like this instead:

{\small
\begin{longtable}{P{1in}P{1.3in}P{1.3in}P{2.3in}}\hline

heading & Heading & Heading & the long heading that goes off page I
tried wrapping etc...\\ \hline
}\caption{A caption}
\end{longtable}

The closing brace for the font change cannot occur in the middle of the
table so you must move it.
--
Morten

mdek...@gmail.com

unread,
Sep 11, 2005, 11:24:40 AM9/11/05
to
Dear both Morten and Herbert,

Thank you for all of your help...The final problem with the caption
command was related to the fact that I had missed the \\ at the end of
the last column. I apologise for not being able to make a more
complete example...but its quite a long table (and I didnt want to post
waffle)! But thank you for your patience...

Oliver Corff

unread,
Sep 21, 2005, 5:43:58 PM9/21/05
to
mdek...@gmail.com wrote:

: Thank you for all of your help...The final problem with the caption

It may be a bit late for this posting, but some hints are hopefully
permitted. I've run into the minimal example trap too. So what you can
do is the following:

1. Take the code which does not work and reduce everything unrelated to
problem to be demonstrated to zero.

2. Put the dubious code in a minimal example file. That's the idea of
Heiko's comment: the example file discussed here has a handful of
lines, but your log file excerpts showed a line number near 378.
This implies that you didn't compile the minimal example but fiddled
with the stuff in your original document instead. So we were essentially
discussing two different things here. Heiko and Herbert spoke about
the example visible in this thread, you spoke about material in your
file (but *not* the example _file_). That doesn't help much because in
principle nobody can estimate the side effects of commands in your long
file.

3. Boiling down the file to the bare minimum to demonstrate the problem
frequently helps isolate the problem and make it so visible that the
answer is virtually coming from your own example. A good question yields
half the answer.

Oliver.
--
Dr. Oliver Corff e-mail: co...@zedat.fu-berlin.de

0 new messages