
この長い表を持っていますが、表の最初の部分にキャプションが表示されません
\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}
これにより、次の出力が得られます。
読んでくれてありがとう
答え1
- 残念ながら、テーブルに完全な小さなドキュメントが提供されていないため、必要な/使用される序文は不明です。
- コードの一部を標準
article
ドキュメントに挿入すると、問題を再現できます。 - ただし、テーブル設定を使用して longtable の「プリアンブル」を再入力すると、期待どおりの結果が得られました (long table で必要な 3 回目のコンパイル後)。
\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}
@daleif のコメントと、これに加えてテーブル用のパッケージを検討しますtabularray
。これらを使用すると、テーブルがより見やすくなり、コードもシンプルになります。
\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}
なぜ表の上部、左側、右側の線を省略したのかは不明です。列ヘッダーと表の下部の周囲に必要な線を除いて、すべての垂直線と水平線を削除することをお勧めします。これらの線については、booktabs
パッケージのルールを使用します (tblr
ライブラリによってロードされます)。
\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}
答え2
@Zarkoが彼の答えそれぞれの小数点に数字を揃えるには、siunitx
パッケージ、特にその列タイプを使用することをお勧めします。S
さらに、縦罫線をすべて取り除き、より少ない数の、しかし十分な間隔を置いた横罫線を使用します。長い表の本体に「視覚的なリズム」を与えるために、5 行ごとに縦方向の空白を少し追加します。
そして、もちろん、2 番目の\endfirsthead
ブロックは削除してください。
\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}