表自体の表クリッピングのキャプション

表自体の表クリッピングのキャプション

私は今、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}ます。nicematrixcaption

\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パッケージの表の行のルール
  • 2 行目には、パッケージで提案されているように、データを数量として書き込みます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}

ここに画像の説明を入力してください

関連情報