1

I have a problem using longtable, i used it because i needed a table that occupies two pages, and the caption that marks Table 4.1: Table of statistics, i want it to be for example Chart 4.1 : Table of Statistics, or something like that, i just need to use renewcommand i think, i have used it in figures and changed Figure to another thing, but I'm not being able to do so with longtable.... Any ideas? Thanks

\renewcommand\tablename{Chart}
\caption{Tabla de actividades}
\end{longtable}

Throws this error

! Misplaced \noalign. \caption ->\noalign \bgroup \@ifnextchar [{\egroup \LT@c@ption \@firstofone ... l.381 \caption {Tabla de actividades} ?

\begin{longtable}{|c|c|c|c|}
\hline

\#                      & Actividades                                                                                                                                                                                                   & Objetivos                                                 & Duraci\'on Estimada \\     \hline
1                       & \begin{tabular}[c]{@{}c@{}}Redacci\'on del documento de \\     Trabajo de Grado\end{tabular}                                                                                                                        & \multicolumn{1}{l|}{}                                     & 11 semanas        \\     \hline
2                       & \begin{tabular}[c]{@{}c@{}}Redacci\'on\\ del documento     de\\  Trabajo Especial de Grado\end{tabular}                                                                                                             & Todos                                                     & 20 semanas        \\     \hline
3                       & \begin{tabular}[c]{@{}c@{}}Realizar un estudio de los     requisitos \\ existentes en los horarios del\\          Departamento de     computaci\'on\end{tabular}                                                          &     1.1                                                       & 2 semanas         \\ \hline
\multicolumn{1}{|l|}{4} & \begin{tabular}[c]{@{}c@{}}Construir\\ la representaci\'on     \\ adecuada de un horario de clases \\ del Departamento\\ de Computaci\'on\end{tabular}                                                                & 1.1                                                       & 2 semanas         \\     \hline
5                       & \begin{tabular}[c]{@{}c@{}}Definir\\ las estructuras     necesarias \\ para guardar la informaci\'on de \\ todos los\\ elementos involucrados\\      en la asignaci\'on de horarios\end{tabular}                      & 1.1 y 1.2                                                     & 2 semanas         \\ \hline
6                       & \begin{tabular}[c]{@{}c@{}}Codificar\\ ambas     metaheur\'isticas \\ usando un lenguaje de \\ programaci\'on de alto\\ nivel     adecuado\end{tabular}                                                               &     \begin{tabular}[c]{@{}c@{}}1.2, 1.3 y\\ 1.4\end{tabular}  & 5 semanas         \\ \hline
7                       & \begin{tabular}[c]{@{}c@{}}Determinar la matriz de     feromonas\\  y n\'umero de hormigas ideal\end{tabular}                                                                                                       & 1.2 y 1.4                                                 & 2 semanas         \\     \hline
8                       & \begin{tabular}[c]{@{}c@{}}Definir los movimientos, \\     condiciones tab\'u, \\ criterios de aspiraci\'on mediante\\ la aplicaci\'on de pruebas     para \\ optimizar el c\'alculo de la \\ soluci\'on final\end{tabular} & 1.3 y 1.4                                                     & 2 semanas         \\ \hline
9                       & \begin{tabular}[c]{@{}c@{}}Establecer el nivel de     hibridizaci\'on \\ entre ambas metaheur\'isticas\end{tabular}                                                                                                   & \begin{tabular}[c]{@{}c@{}}1.2, 1.3 \\ y 1.4\end{tabular} & 2 semanas         \\     \hline
10                      & \begin{tabular}[c]{@{}c@{}}Crear\\ distintos casos de     prueba\\ basados en modelos de entradas de datos\\  sintetizadospara la asignaci\'on de     horarios\end{tabular}                                         & 2.1                                                           & 2 semanas         \\ \hline
11                      & \begin{tabular}[c]{@{}c@{}}Realizar pruebas finales\\  que     permitan precisar \\ el comportamiento y eficiencia\\ del programa frente a los \\     distintos casos de prueba establecidos\end{tabular}         & 2.1                                                           & 2 semanas         \\ \hline
12                      & \begin{tabular}[c]{@{}c@{}}Realizar el an\'alisis\\  de     los resultados usando\\  las m\'etricas definidas\end{tabular}                                                                                            & 2.2                                                       & 2 semanas         \\     \hline

\caption{Tabla de Actividades} 
\end{longtable}

If I try to put caption at the top, same as renew, it throws me some errors

! Extra alignment tab has been changed to \cr. \endtemplate

l.370 ... & Objetivos ...

  • \renewcommand\tablename{Chart} will change the display, if you want separately counted tables and charts it's a bit trickier and you should clarify exactly what you do want. – David Carlisle Mar 22 '15 at 19:19
  • It didn't work, throwed the error aboce – user3663177 Mar 22 '15 at 20:04
  • You put the definition in the wrong place, I'll post an answer – David Carlisle Mar 22 '15 at 21:03
  • \caption is a table row you need \\ after it if it isn't the last row, (see the example in my answer) that is unrelated to the question about \tablename, please don't edit questions to ask unrelated questions as it makes the answers very hard for later readers to follow – David Carlisle Mar 22 '15 at 21:32
2

As far as possible longtable uses the same caption settings as table so you just need to redefine \tablename

\documentclass{article}
\usepackage{longtable}
\begin{document}



\renewcommand\tablename{Chart} 
\begin{longtable}{cc}
\caption{zzz}\\
zz&zz\\
z&z
\end{longtable}

\end{document}

\caption in longtable is really a \multicolumn so like \multicolumn has to be the first thing in its cell, which is why you got an error if the redefinition is immediately before the caption.

  • Thanks, but I'm not getting it right :/ I'll post a larger version of the code right as it is... some parts are in spanish cuz i speak spanish. What I want is to change the Table 4.1, but it throws me errors – user3663177 Mar 22 '15 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.