저는 지금 LaTeX를 시작하고 있는데 테이블 캡션에 문제가 있습니다. TabularX를 사용하고 있는데 캡션이 테이블 자체와 잘립니다. 혹시 저를 도와주실 수 있나요? 감사합니다!
코드 형식이 작동하지 않는 것 같아 정말 죄송합니다. 이유는 모르겠습니다.
\documentclass[
paper=a4,
fontsize=11pt,
parskip=half*,
]{scrartcl}
\begin{document}
\usepackage{tabularx}
\usepackage[labelfont={bf},
font={footnotesize},
labelsep=space,
format=hang,
justification=raggedright,
singlelinecheck=false
]{caption}
\captionsetup[table]{aboveskip=5pt, belowskip=-5pt}
\begin{table}[!ht]
\small
\centering
\captionof{table}[RFA-Analyseergebnisse des ausgefilterten Feststoff (Partikelretention 8-15µm)]{RFA-Analyseergebnisse des ausgefilterten Feststoff (Partikelretention 8-15µm)}
\begin{tabular}{ccccccccc}
\hline
\textbf{Al} & \textbf{Ni} & \textbf{Co} & \textbf{Mn} & \textbf{Cu} & \textbf{Fe} & \textbf{P} & \textbf{Ca} & \textbf{Si} \\ \hline
10.49\% & 22.68\% & 11.74\% & 6.65\% & 1.29\% & 0.85\% & 0.79\% & 0.36\% & 0.22\% \\ \hline
\end{tabular}
\label{RFA_Filterkuchen_1}
\end{table}
\end{document}
답변1
의심스러운 옵션을 제거하는 것 외에도 belowskip=-5pt
테이블을 더욱 개방적이고 매력적으로 보이게 하려고 노력해야 합니다. (a) 패키지의 매크로를 사용하여 booktabs
적절한 간격의 수평 규칙을 생성하고, (b) 그렇지 않은 방식 으로 그렇게 할 것을 제안합니다.굵은 글씨헤더 행의 항목(및 mhchem
화학 방정식을 조판하는 등의 패키지 사용) 및 (c) %
데이터 셀의 공통 기호를 캡션으로 이동합니다.
덧붙여서, 지시문이 환경 내에서 발생한다는 사실을 고려할 때 왜 대신에 를 table
사용하고 있는지 명확하지 않습니다 .\captionof{table}{...}
\caption{...}
\documentclass[
paper=a4,
fontsize=11pt,
parskip=half*,
]{scrartcl}
%\usepackage{tabularx} % does not appear to be needed
\usepackage[font={footnotesize}, % you sure about this?
labelfont = bf,
labelsep = space,
format = hang,
justification=raggedright,
singlelinecheck=false
]{caption}
\captionsetup[table]{skip=0.5\baselineskip}
% {aboveskip=5pt, belowskip=-5pt} % huh?
\usepackage{siunitx,mhchem,booktabs}
\begin{document}
\begin{table}[htb]
\centering
\small
\caption{RFA-Analyseergebnisse des ausgefilterten
Feststoffs (Partikelretention
8--15\,\unit{\micro\meter}), in \%}
\label{RFA_Filterkuchen_1}
\begin{tabular}{@{} *{9}{c} @{}}
\toprule
\ce{Al} & \ce{Ni} & \ce{Co} & \ce{Mn} & \ce{Cu} &
\ce{Fe} & \ce{P} & \ce{Ca} & \ce{Si} \\
\midrule
10.49 & 22.68 & 11.74 & 6.65 & 1.29 &
0.85 & 0.79 & 0.36 & 0.22 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
답변2
belowskip
매개변수를 에서 으로 -5pt
변경 하면 될 것 같습니다 5pt
. 그러나 \caption
테이블에만 사용할 수 있습니다 .또한 나는 당신에게 (초보자로서) 이것을 사용하도록 권장하고 싶습니다웹사이트테이블을 훨씬 쉽게 만들려면
\documentclass[
paper=a4,
fontsize=11pt,
parskip=half*,
]{scrartcl}
\usepackage{tabularx}
\usepackage[labelfont={bf},
font={footnotesize},
labelsep=space,
format=hang,
justification=raggedright,
singlelinecheck=false
]{caption}
%\captionsetup[table]{aboveskip=5pt, belowskip=5pt} % <--
\begin{document}
\begin{center}
\begin{table}[!ht]
\small
\caption{RFA-Analyseergebnisse des ausgefilterten Feststoff (Partikelretention 8-15µm)}
\begin{tabular}{ccccccccc}
\hline
\textbf{Al} & \textbf{Ni} & \textbf{Co} & \textbf{Mn} & \textbf{Cu} & \textbf{Fe} & \textbf{P} & \textbf{Ca} & \textbf{Si} \\ \hline
10.49\% & 22.68\% & 11.74\% & 6.65\% & 1.29\% & 0.85\% & 0.79\% & 0.36\% & 0.22\% \\ \hline
\end{tabular}
\label{RFA_Filterkuchen_1}
\end{table}
\end{center}
\end{document}
답변3
와 {NiceTabular}
내장 nicematrix
키 caption
.
\documentclass[
paper=a4,
fontsize=11pt,
parskip=half*,
]{scrartcl}
\usepackage{nicematrix,booktabs}
\begin{document}
\begin{table}[!ht]
\small
\centering
\begin{NiceTabular}
[ caption = { RFA-Analyseergebnisse des ausgefilterten Feststoff (Partikelretention 8-15µm) } ]
{@{}ccccccccc@{}}
\toprule
\RowStyle[bold]{}
Al & Ni & Co & Mn & Cu & Fe & P & Ca & Si \\
\midrule
10.49\% & 22.68\% & 11.74\% & 6.65\% & 1.29\% & 0.85\% & 0.79\% & 0.36\% & 0.22\% \\
\bottomrule
\end{NiceTabular}
\label{RFA_Filterkuchen_1}
\end{table}
\end{document}
답변4
나는 다음과 같은 방법으로 테이블을 작성합니다.
- 열이 있는 테이블 사용
tabularray
패키지의 경우X[c]
booktabs
테이블 라인의 경우 패키지 규칙- 두 번째 행에서는 package 에 제안된 대로 데이터를 수량으로 기록합니다
siunitx
. 패키지booktabs
는 라이브러리siunitx
로 로드됩니다 .tabularray
\documentclass[paper=a4,
fontsize=11pt,
parskip=half*,
]{scrartcl}
\usepackage[skip=1ex,
font={footnotesize},
labelfont=bf,
labelsep=space,
format=hang,
justification=raggedright,
singlelinecheck=false
]{caption}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\begin{document}
\begin{table}[!ht]
\centering
\caption{RFA-Analyseergebnisse des ausgefilterten Feststoff (Partikelretention 8-15µm)}
\label{RFA_Filterkuchen_1}
\begin{tblr}{colspec = { *{9}{X[c]} },
row{1} = {font=\bfseries}
}
\toprule
A & Ni & Co & Mn & Cu & Fe & P & Ca & Si \\
\midrule
\qty{10.49}{\%} & \qty{22.68}{\%} & \qty{11.74}{\%} &
\qty{6.65}{\%} & \qty{1.29}{\%} & \qty{0.85}{\%} &
\qty{0.79}{\%} & \qty{0.36}{\%} & \qty{0.22}{\%} \\
\bottomrule
\end{tblr}
\end{table}
\end{document}