Estou começando no LaTeX agora e tenho um problema com a legenda da minha tabela. Estou usando TabularX e a legenda está recortada com a própria tabela. Você poderia me ajudar? Obrigado!
Lamento muito que a formatação do código não pareça funcionar, não sei por quê.
\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}
Responder1
Além de se livrar da belowskip=-5pt
opção questionável, você realmente deveria tentar dar à sua mesa uma “aparência” mais aberta e convidativa. Eu sugiro que você faça isso (a) usando as macros do booktabs
pacote para criar regras horizontais bem espaçadas, (b) nãoem negritoos itens na linha do cabeçalho (e empregar um pacote para mhchem
compor as equações químicas) e (c) mover o %
símbolo comum das células de dados para a legenda.
Aliás, tendo em vista o fato da diretiva ocorrer dentro de um table
ambiente, não está claro para mim por que você está usando \captionof{table}{...}
em vez de apenas \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}
Responder2
Eu acho que você deveria apenas alterar o belowskip
parâmetro de -5pt
para 5pt
. Porém, você pode usar apenas \caption
para a mesa.
Além disso, eu recomendaria que você (como iniciante) usasse estesite de casamentopara criar tabelas com muita facilidade
\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}
Responder3
Com {NiceTabular}
of nicematrix
e sua chave integrada 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}
Responder4
Eu escreveria sua tabela da seguinte maneira:
- para tabela use
tabularray
pacote comX[c]
colunas - para regras de linhas de tabela do
booktabs
pacote - na segunda linha eu escreveria os dados como quantidades propostas em
siunitx
package . Pacotesbooktabs
esiunitx
são carregados comotabularray
bibliotecas:
\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}