提问人:Matteo 提问时间:11/16/2023 最后编辑:Matteo 更新时间:11/16/2023 访问量:32
LaText 表格错误地显示垂直线
LaText table shows vertical lines incorrectly
问:
嗨,我是 LaText 的新手,正在处理一个相当嵌套的表。我几乎把所有东西都整理好了,但是,由于某种原因,我无法弄清楚如何正确添加垂直线......
这是我使用的代码示例
\documentclass[11pt]{article}
\usepackage[letterpaper,margin=1in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{longtable}
\usepackage{nicematrix} %test for v-line contiguity
\usepackage{multirow} %allows for multirow tables
\usepackage{booktabs} %allowas for proper v&h spacing in a table
\usepackage{amsmath} %could be use to set table high and width
\usepackage{diagbox} %single cell diagonal line
\usepackage{array}
\usepackage{float}
\usepackage{caption}
\usepackage{subcaption}
\captionsetup[table]{font=small}
\captionsetup[figure]{font=small}
%%line editing package and function
\usepackage{arydshln}
\makeatletter
\newcommand{\thickhline}{%
\noalign {\ifnum 0=`}\fi \hrule height 1pt
\futurelet \reserved@a \@xhline
}
\usepackage{graphicx} % Required for inserting images
\usepackage[inkscapearea=page]{svg}
\usepackage{biblatex}
\usepackage{pdflscape}
\newcommand{\set}[1]{\{ #1 \}}
\begin{table}[H]
\centering
\resizebox{\textwidth}{!}{\begin{tabular}{l|ccc|ccc}
\thickhline
\hline
\multicolumn{7}{c}{\textbf{reference 1}} \\\thickhline
\multirow{2}{*}{\diagbox{GRAPH}{METRIC}}
& \multicolumn{3}{c}{tool 1} & \multicolumn{3}{c}{tool 2} \\
\cdashline{2-7}[.4pt/1pt]
& \textit{recall} & \textit{precision} & \textit{F1} & \textit{recall} & \textit{precision} & \textit{F1} \\
\cmidrule{1-7}
exp_1 & a & b & c & d & e & f \\
exp_2 & a & b & c & d & e & f \\
exp_3 & a & b & c & d & e & f \\
\hdashline
exp_4 & a & b & c & d & e & f \\
exp_5 & a & b & c & d & e & f \\
exp_6 & a & b & c & d & e & f \\
exp_7 & a & b & c & d & e & f \\
\hdashline
exp_8 & a & b & c & d & e & f \\\hline
\hline
\thickhline
\hline
\multicolumn{7}{c}{\textbf{reference 2}} \\
\thickhline
\multirow{2}{*}{\diagbox{GRAPH}{METRIC}}
& \multicolumn{3}{c}{tool 1} & \multicolumn{3}{c}{tool 2} \\
\cdashline{2-7}[.4pt/1pt]
& \textit{recall} & \textit{precision} & \textit{F1} & \textit{recall} & \textit{precision} & \textit{F1} \\
\cmidrule{1-7}
exp_1 & a & b & c & d & e & f \\
exp_2 & a & b & c & d & e & f \\
exp_3 & a & b & c & d & e & f \\
\hdashline
exp_4 & a & b & c & d & e & f \\
exp_5 & a & b & c & d & e & f \\
exp_6 & a & b & c & d & e & f \\
exp_7 & a & b & c & d & e & f \\
\hdashline
exp_8 & a & b & c & d & e & f \\\hline
\hline
\thickhline
\end{tabular}}
\end{table}
基本上,根据我希望行只出现在第一列和第四列之后;然而,尽管代码有效,但会产生不完整/碎片化的行,这使得整个表看起来令人困惑。
如果有人有任何建议,请帮忙,提前致谢!{\begin{tabular}{l|ccc|ccc}
答: 暂无答案
评论
\documentclass{...}
\usepackage
\begin{document}
\end{document}