
이 긴 테이블이 있는데 테이블의 첫 번째 부분에 캡션이 표시되지 않습니다.
\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
문제를 재현할 수 있습니다. - 그러나 테이블 설정으로 긴 테이블 "서문"을 다시 입력하면 예상 결과를 얻을 수 있습니다(긴 테이블에서 요구되는 세 번째 컴파일 이후).
\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}
tabularray
나는 @daleif 주석과 귀하의 테이블에 대한 이 사용 패키지 옆을 고려할 것입니다 . 이를 사용하면 테이블이 더 좋고 코드도 더 간단해집니다.
\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
해당 소수점 표시의 숫자를 정렬하는 것이 좋습니다.
나는 모든 수직 규칙을 더 없애고 더 적은 수의 수평 규칙을 사용할 것입니다. 긴 테이블의 본문에 "시각적 리듬"을 제공하기 위해 다섯 번째 행마다 수직 공백을 조금 더 추가했습니다.
그리고 물론 두 번째 \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}