LaText table shows vertical lines incorrectly

97 Views Asked by At

Hi there I'm new to LaText and working on a fairly nested table. I got pretty much everything sorted but, for some reason, I cannot figure out how to properly add vertical lines...

This is an examples of the code I used

\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}

Basically, as per the {\begin{tabular}{l|ccc|ccc} I want lines to appear after the first and fourth column only; however, despite working the code produces incomplete/fragmented lines which make the whole table confusing to look at.
If anyone has any advice please help, thanks in advance!

0

There are 0 best solutions below