Graphics, Figures & Tables ⇒ Mispaced \noalign in longtable
Mispaced \noalign in longtable
I have a longtable with \centering in a latex document and it appears always the same error:
! Misplaced \noalign.
\hline ->\noalign
{\ifnum 0=`}\fi \penalty \@M \futurelet \@let@token \LT@@h
l.680 \hline
Well, I already done some research and I know that this error is common in longtables.
Thus, I already substituted all the \\ in the longtable for \tabularnewline.
And the error remains. I don't know what else to do. Can somebody please give me some suggestions?
Thank you. Best regards
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Mispaced \noalign in longtable
please post a reduced, minimal version of your code (in the sense of a minimal working example) allowing us to reproduce the error.
Mispaced \noalign in longtable
Code: Select all
\begin{center}
\footnotesize
\setlongtables
\renewcommand{\arraystretch}{1.5}
\renewcommand{\multirowsetup}{\centering}
\centering
\setlength{\tabcolsep}{2mm}
\begin{longtable}{|>{\centering}m{2.6cm}|>{\centering}m{2.5cm}|>{\centering}m{2.1cm}|>{\centering}m{3cm}|>{\centering}m{3cm}|}
\caption{Example LongTable}
\hline
\textbf{title 1} & \textbf{title 2} & \textbf{title 3} & \textbf{title 4} & \textbf{title 5} \tabularnewline
\hline
Data 1 & Data 2 & Data 3 & Data 4 & Data 5 \tabularnewline\hline
Data 1 & Data 2 & Data 3 & Data 4 & Data 5 \tabularnewline\hline
Data 1 & Data 2 & Data 3 & Data 4 & Data 5 \tabularnewline\hline
\end{longtable}
\label{tab:TabResumo}
\end{center}
! Misplaced \noalign.
\hline ->\noalign
{\ifnum 0=`}\fi \penalty \@M \futurelet \@let@token \LT@@h
l.680 \hline
And suggestions are welcome.
Best regards.
Mispaced \noalign in longtable
Code: Select all
...
\caption{Example LongTable} \tabularnewline
...
Mispaced \noalign in longtable
But now I'm having another error. Hope this time that I posted the code right.
I'm having the error:
Missing { inserted
realted to the first row of the longtable with a raisebox.
Code: Select all
\begin{document}
\begin{center}
\footnotesize
\setlongtables
\renewcommand{\arraystretch}{1.5}
\renewcommand{\multirowsetup}{\centering}
\centering
\setlength{\tabcolsep}{2mm}
\begin{longtable}{|>{\centering}m{2.6cm}|>{\centering}m{2cm}|>{\centering}m{2.6cm}|>{\centering}m{2.2cm}|>{\centering}m{1.6cm}|>{\centering}m{1.8cm}|}
\caption{Example LongTable}
\tabularnewline\hline
\textbf{title 1} & \textbf{title 2} & \textbf{title 3} & \textbf{title 4} & \textbf{title 5} & \textbf{title 6}
\endfirsthead
\multicolumn{6}{c}%
{{\bfseries \tablename\ \thetable{} -- Continuation from previous page}} \tabularnewline\hline
\textbf{title 1} & \textbf{title 2} & \textbf{title 3} & \textbf{title 4} & \textbf{title 5} & \textbf{title 6}
\tabularnewline
\endhead
\hline
\multicolumn{6}{|r|}{{Continue in next page}} \tabularnewline\hline
\endfoot
\endlastfoot
\multirow{3}{2.6cm}{Data 1} & \multirow{3}{2cm}{Data 2} & Data 3 & Data 4 & Data 5 & \raisebox{-1.6ex}{D}\tabularnewline\cline{4-7}
&& Data 3 & Data 4 & Data 5 & \raisebox{-1.6ex}{D}\tabularnewline\cline{4-7}
&& Data 3 & Data 4 & Data 5 & D \tabularnewline\hline
\end{longtable}
\label{tab:TabResumo}
\end{center}
\end{document}
Hope someone understand my doubt and can help me.
Best regards
Re: Mispaced \noalign in longtable
Sorry that I bothered you with this subject.
But now in the same line that I told you before, I have this error:
! Extra alignment tab has been changed to \cr.
<template> \endtemplate
Can somebody help me solve this problem. Thanks a lot all the help.
Best regards
Mispaced \noalign in longtable
Code: Select all
\cline{4-7}
Code: Select all
\cline{4-6}
Re: Mispaced \noalign in longtable

In the image I attached, you can see part of the longtable I have.
My problem is that in the last column the title and some letters appeared higher or lower than the rest of the text from the longtable.
I know that if I have only one letter I can use \raisebox to align the text, but what should I use in a whole word to achieve the alignment?
Best regards
- Attachments
-
- Untitled.png (42.35 KiB) Viewed 25207 times