
Tengo esta tabla larga y el título no aparece en la primera parte de la tabla.
\begin{longtable}{c|c|c|c}
\caption{Tipo N} \label{tab:Uh_B Ip y t ctes} \\
$U_h$ & $\Delta U_h$ & $B [T]$ & $\Delta B [T]$ \\ \hline\hline
\endfirsthead
\multicolumn{1}{c|}{$U_h$} & \multicolumn{1}{c|}{$\Delta U_h$} & \multicolumn{1}{c|}{$B [T]$ } & \multicolumn{1}{c}{$\Delta B [T]$} \\ \hline
\endfirsthead
\multicolumn{4}{c}%
{{\bfseries \tablename\ \thetable{} -- Continuación}} \\
\multicolumn{1}{c|}{$U_h$} & \multicolumn{1}{c|}{$\Delta U_h$} & \multicolumn{1}{c|}{$B [T]$ } & \multicolumn{1}{c}{$\Delta B [T]$} \\ \hline
\endhead
\hline \multicolumn{4}{|r|}{{Continua en la siguiente página}} \\ \hline
\endfoot
\hline \hline
\endlastfoot
0,054 & 0,001 & -0,300 & 0,001 \\ \hline
0,05 & 0,001 & -0,280 & 0,001 \\ \hline
0,046 & 0,001 & -0,260 & 0,001 \\ \hline
0,041 & 0,001 & -0,240 & 0,001 \\ \hline
0,037 & 0,001 & -0,220 & 0,001 \\ \hline
0,032 & 0,001 & -0,200 & 0,001 \\ \hline
0,028 & 0,001 & -0,180 & 0,001 \\ \hline
0,023 & 0,001 & -0,160 & 0,001 \\ \hline
0,019 & 0,001 & -0,140 & 0,001 \\ \hline
0,014 & 0,001 & -0,120 & 0,001 \\ \hline
0,010 & 0,001 & -0,100 & 0,001 \\ \hline
0,005 & 0,001 & -0,080 & 0,001 \\ \hline
0,001 & 0,001 & -0,060 & 0,001 \\ \hline
-0,002 & 0,001 & -0,040 & 0,001 \\ \hline
-0,007 & 0,001 & -0,020 & 0,001 \\ \hline
-0,011 & 0,001 & 0,000 & 0,001 \\ \hline
-0,016 & 0,001 & 0,020 & 0,001 \\ \hline
-0,021 & 0,001 & 0,040 & 0,001 \\ \hline
-0,026 & 0,001 & 0,060 & 0,001 \\ \hline
-0,030 & 0,001 & 0,080 & 0,001 \\ \hline
-0,034 & 0,001 & 0,100 & 0,001 \\ \hline
-0,039 & 0,001 & 0,120 & 0,001 \\ \hline
-0,043 & 0,001 & 0,140 & 0,001 \\ \hline
-0,048 & 0,001 & 0,160 & 0,001 \\ \hline
-0,052 & 0,001 & 0,180 & 0,001 \\ \hline
-0,057 & 0,001 & 0,200 & 0,001 \\ \hline
-0,061 & 0,001 & 0,220 & 0,001 \\ \hline
-0,065 & 0,001 & 0,240 & 0,001 \\ \hline
-0,070 & 0,001 & 0,260 & 0,001 \\ \hline
-0,074 & 0,001 & 0,280 & 0,001 \\ \hline
-0,079 & 0,001 & 0,300 & 0,001 \\ \hline
\end{longtable}
Esto proporciona el siguiente resultado:
Gracias por leer
Respuesta1
- Desafortunadamente, no proporciona un pequeño documento completo con su tabla, por lo que se desconoce el preámbulo necesario/usado.
- Si inserto su fragmento de código en un
article
documento estándar, puedo reproducir su problema. - Sin embargo, si vuelvo a escribir el "preámbulo" de la tabla larga con la configuración de la tabla, obtengo el resultado esperado (después de la tercera compilación, como se requiere en la tabla larga).
\documentclass{article}
\usepackage{longtable}
\begin{document}
\begin{longtable}{c c c c}
\caption{Tipo N}
\label{T2.4} \\
$U_h$ & $\Delta U_h$ & $B [T]$ & $\Delta B [T]$ \\
\hline
\endfirsthead
\caption[]{Tipo N -- (cont.)} \\
$U_h$ & $\Delta U_h$ & $B [T]$ & $\Delta B [T]$ \\
\hline
\endhead
\multicolumn{4}{r}{\footnotesize\textit{continued on the next page}}
\endfoot
\hline\hline
\endlastfoot
0,054 & 0,001 & -0,300 & 0,001 \\ \hline
0,05 & 0,001 & -0,280 & 0,001 \\ \hline
0,046 & 0,001 & -0,260 & 0,001 \\ \hline
0,041 & 0,001 & -0,240 & 0,001 \\ \hline
0,037 & 0,001 & -0,220 & 0,001 \\ \hline
0,032 & 0,001 & -0,200 & 0,001 \\ \hline
0,028 & 0,001 & -0,180 & 0,001 \\ \hline
0,023 & 0,001 & -0,160 & 0,001 \\ \hline
0,019 & 0,001 & -0,140 & 0,001 \\ \hline
0,014 & 0,001 & -0,120 & 0,001 \\ \hline
0,010 & 0,001 & -0,100 & 0,001 \\ \hline
0,005 & 0,001 & -0,080 & 0,001 \\ \hline
0,001 & 0,001 & -0,060 & 0,001 \\ \hline
-0,002 & 0,001 & -0,040 & 0,001 \\ \hline
-0,007 & 0,001 & -0,020 & 0,001 \\ \hline
-0,011 & 0,001 & 0,000 & 0,001 \\ \hline
-0,016 & 0,001 & 0,020 & 0,001 \\ \hline
-0,021 & 0,001 & 0,040 & 0,001 \\ \hline
-0,026 & 0,001 & 0,060 & 0,001 \\ \hline
-0,030 & 0,001 & 0,080 & 0,001 \\ \hline
-0,034 & 0,001 & 0,100 & 0,001 \\ \hline
-0,039 & 0,001 & 0,120 & 0,001 \\ \hline
-0,043 & 0,001 & 0,140 & 0,001 \\ \hline
-0,048 & 0,001 & 0,160 & 0,001 \\ \hline
-0,052 & 0,001 & 0,180 & 0,001 \\ \hline
-0,057 & 0,001 & 0,200 & 0,001 \\ \hline
-0,061 & 0,001 & 0,220 & 0,001 \\ \hline
-0,065 & 0,001 & 0,240 & 0,001 \\ \hline
-0,070 & 0,001 & 0,260 & 0,001 \\ \hline
-0,074 & 0,001 & 0,280 & 0,001 \\ \hline
-0,079 & 0,001 & 0,300 & 0,001 \\ \hline
\end{longtable}
\end{document}
Consideraría los comentarios de @daleif y, además de este, usaría tabularray
el paquete para su mesa. Con ellos la tabla es más bonita y su código es más sencillo:
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}
\begin{document}
\begin{longtblr}[
caption = {Tipo N},
label = {T2.4} ]{hline{2-Z}, vline{2-Y},
colspec = {Q[c, si={table-format=-1.3}]
Q[c, si={table-format= 1.3}]
Q[c, si={table-format=-1.3}]
Q[c, si={table-format= 1.3}]},
row{1} = {guard, mode=math},
rowhead=1}
U_h & \Delta U_h & B [T] & \Delta B [T] \\
% table body as before, but without all \hline-s
\end{longtblr}
\end{document}
No está claro por qué omitiste las líneas de la tabla superior, izquierda y derecha. Sugeriría eliminar todas las líneas verticales y horizontales, excepto las necesarias alrededor de los encabezados de las columnas y la parte inferior de la tabla. Para esas líneas usaría reglas de booktabs
paquete (cargadas por tblr
biblioteca):
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\begin{document}
\begin{longtblr}[
caption = {Tipo N},
label = {T2.4} ]{colspec = {Q[c, si={table-format=-1.3}]
Q[c, si={table-format= 1.3}]
Q[c, si={table-format=-1.3}]
Q[c, si={table-format= 1.3}]},
row{1} = {guard, mode=math},
row{2-Z} = {rowsep = 0pt},
row{even[3]} = {abovesep=1ex},
rowhead=1}
\toprule
U_h & \Delta U_h & B [T] & \Delta B [T] \\
\midrule
% table body is the same as before, but without all \hline-s
\bottomrule
\end{longtblr}
\end{document}
Respuesta2
Como hace @Zarko en surespuesta, le sugiero que utilice el siunitx
paquete (y su S
tipo de columna en particular) para alinear los números en sus respectivos marcadores decimales.
Además, me desharía de todas las reglas verticales y usaría menos reglas horizontales, pero bien espaciadas. Para proporcionar algo de "ritmo visual" en el cuerpo de la tabla larga, agregaría un poco más de espacio en blanco vertical después de cada quinta fila aproximadamente.
Y, por supuesto, deshazte del segundo \endfirsthead
bloque.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[spanish,es-tabla]{babel}
\usepackage{longtable}
\usepackage{booktabs} % for well-spaced horizontal rules
\usepackage[output-decimal-marker={,}]{siunitx}
\begin{document}
\begin{longtable}{@{} *{4}{S[table-format=-1.3]} @{}}
%% headers and footers
\caption{Tipo N} \label{tab:Uh_B Ip y t ctes} \\
{$U_h$} & {$\Delta U_h$} & {$B[T]$} & {$\Delta B[T]$} \\
\midrule
\endfirsthead
\multicolumn{4}{c}{\tablename\ \thetable\ -- Continuación} \\[1ex]
{$U_h$} & {$\Delta U_h$} & {$B[T]$} & {$\Delta B[T]$} \\
\midrule
\endhead
\midrule
\multicolumn{4}{r@{}}{\footnotesize Continua en la siguiente página} \\
\endfoot
\bottomrule
\endlastfoot
%% body of table
0,054 & 0,001 & -0,300 & 0,001 \\
0,05 & 0,001 & -0,280 & 0,001 \\
0,046 & 0,001 & -0,260 & 0,001 \\
0,041 & 0,001 & -0,240 & 0,001 \\
0,037 & 0,001 & -0,220 & 0,001 \\
\addlinespace
0,032 & 0,001 & -0,200 & 0,001 \\
0,028 & 0,001 & -0,180 & 0,001 \\
0,023 & 0,001 & -0,160 & 0,001 \\
0,019 & 0,001 & -0,140 & 0,001 \\
0,014 & 0,001 & -0,120 & 0,001 \\
\addlinespace
0,010 & 0,001 & -0,100 & 0,001 \\
0,005 & 0,001 & -0,080 & 0,001 \\
0,001 & 0,001 & -0,060 & 0,001 \\
-0,002 & 0,001 & -0,040 & 0,001 \\
-0,007 & 0,001 & -0,020 & 0,001 \\
\addlinespace
-0,011 & 0,001 & 0,000 & 0,001 \\
-0,016 & 0,001 & 0,020 & 0,001 \\
-0,021 & 0,001 & 0,040 & 0,001 \\
-0,026 & 0,001 & 0,060 & 0,001 \\
-0,030 & 0,001 & 0,080 & 0,001 \\
\addlinespace
-0,034 & 0,001 & 0,100 & 0,001 \\
-0,039 & 0,001 & 0,120 & 0,001 \\
-0,043 & 0,001 & 0,140 & 0,001 \\
-0,048 & 0,001 & 0,160 & 0,001 \\
-0,052 & 0,001 & 0,180 & 0,001 \\
\addlinespace
-0,057 & 0,001 & 0,200 & 0,001 \\
-0,061 & 0,001 & 0,220 & 0,001 \\
-0,065 & 0,001 & 0,240 & 0,001 \\
-0,070 & 0,001 & 0,260 & 0,001 \\
-0,074 & 0,001 & 0,280 & 0,001 \\
\addlinespace
-0,079 & 0,001 & 0,300 & 0,001 \\
\end{longtable}
\end{document}