> 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
> 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 @.
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}}
Ta
> 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
>>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
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
! 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...
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
> 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 ... :-)
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.
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>
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.
> 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}
> 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
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...
: 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