
下の図のような表を作成しましたが、問題ないかわかりません。つまり、2 行のうち最初の行の後に行間が表示されるのはなぜでしょうか。赤色でマークしました。それとも、これが正しい動作なのでしょうか? どなたか教えてください。ここにコードを追加しました。
\begin{table}[htbp]
\centering
\caption{Summary of the comparison with existing approaches}
\label{tab:Testing Results}
\begin{tabular}{|p{.30 cm}|p{2.2cm}|l|l|l|}
\hline
\multicolumn{2}{|p{2.5cm}|} {\diagbox { }{Approach}}&Lizhi [4]&Yuan [9]&Our Approach\\\hline
CS1 & Total Paths &6 &10 &3\\ \cline{2-5}
& Feasible Paths &6 &3 &3\\ \cline{2-5}
& Infeasible Paths &0 &7 &0 \\\hline
CS2 & Total Paths &35 &6 &1\\ \cline{2-5}
& Feasible Paths &35 &4 &1\\ \cline{2-5}
& Infeasible Paths &0 &2 &0 \\\hline
\end{tabular}
\end{table}
答え1
行数を減らし、数字を揃えた表の簡略版:
\documentclass{article}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{diagbox}
\usepackage{siunitx}
\begin{document}
\begin{table}[htbp]
\centering
\caption{Summary of the comparison with existing approaches}
\label{tab:Testing Results}
\begin{tabular}{
l
l
S[table-format=2]
S[table-format=2]
S[table-format=1]
}
\toprule
& & \multicolumn{3}{c}{Approach}\\
\cmidrule{3-5}
& & {Lizhi [4]}&{Yuan [9]}&{Our approach}\\
\midrule
CS1 & Total paths &6 &10 &3\\
& Feasible paths &6 &3 &3\\
& Infeasible paths &0 &7 &0 \\
\addlinespace
CS2 & Total paths &35 &6 &1\\
& Feasible paths &35 &4 &1\\
& Infeasible paths &0 &2 &0 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
その他のコメント:
参考文献は LaTeX でも作成でき、
[4]
マクロ[9]
を呼び出すことで置き換えることができます\cite
。タイトルケースを使用する理由がわかりません。したがって、この例では、表のエントリに単純な文の大文字/小文字を使用しています。
Our approach
に切り捨てられる可能性がありますOur
。