我想问一个有关 LATEX 中表格的问题。
我用 LATEX 制作了一张表格,但网格不是“封闭的”……例如,参见右上角的角落以及第一行中的一些其他线……它们没有连接到顶部水平线。
我想问一下如何解决这个问题。
如能得到任何帮助我将非常感激。
该表如下所示:
我的代码如下:
\documentclass[a4paper,11pt,twoside,
headsepline, footsepline, chapterprefix=true, unknownkeysallowed % Linie fuer Kopfzeile,
]{scrbook}
\KOMAoptions{headings=optiontohead}
\usepackage[inner=3cm,outer=3cm,top=1.5cm,bottom=2cm,includeheadfoot, footskip=1cm]{geometry}
\usepackage{float}
\usepackage{verbatim}
\usepackage{makecell}
\usepackage{boldline, multirow}
\usepackage{caption} % FIXME
\usepackage{keyval} % FIXME
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[pdftex]{graphicx}
\usepackage[pdftex,table]{xcolor}
\usepackage[
pdftex,
colorlinks=true,
pdfstartview=FitV,
linkcolor=black,
citecolor=black,
urlcolor=black,
bookmarks=true
]{hyperref}
\urlstyle{sf}
\usepackage{ragged2e}
\usepackage{mathtools}
\usepackage{rotating}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathrsfs}
\usepackage{eufrak}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{textcomp}
\usepackage{array,blkarray}
\usepackage{arydshln}
\usepackage{multirow,bigdelim}
\usepackage{enumitem}
\usepackage[normalem]{ulem}
\usepackage[arrow, matrix, curve]{xy}
\usepackage{bbm}
\usepackage{arcs}
\usepackage{typearea}
\usepackage{longtable}
\usepackage[autostyle]{csquotes}
\usepackage{adjustbox}
\usepackage{sagetex}
\usepackage[nameinlink,capitalize]{cleveref}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{arrows}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{shapes}
\usetikzlibrary{positioning,arrows}
\usepackage{scalefnt}
\begin{document}
\resizebox{12cm}{!}{
\begin{tabular}{|l|c |c | cV{4} c c c|c c|c|c c|c|c|c|}
\hline
\multicolumn{2}{|l|}{$G=S_5$} & \multicolumn{2}{cV{4}}{$Q_v$} & \multicolumn{3}{c|}{$\langle 1 \rangle$} & \multicolumn{2}{c|}{$C_2$} & $C_2$ & \multicolumn{2}{c|}{$V_4$} & $V_4$ & $C_4$ & $D_8$\\
\hline
\multicolumn{2}{|l|}{$p=2$} & \multicolumn{2}{cV{4}}{$N_v$} & \multicolumn{3}{c|}{$S_5$} & \multicolumn{2}{c|}{$D_{12}$} & $D_8$ & \multicolumn{2}{c|}{$S_4$} & $D_8$ & $D_8$ & $D_8$\\
\hline
%\multicolumn{2}{|l|}{$ $} & \multicolumn{2}{cV{4}}{$ $} & \multicolumn{3}{c|}{$ $} & \multicolumn{2}{c|}{$ $} & $ $ & \multicolumn{2}{c|}{$ $} & & & \\%[-2.2ex]
%\multicolumn{2}{|c|}{ $ $ } & %\multicolumn{2}{cV{4}}{$\overline{N}$} & \multicolumn{3}{c|}{$S_5$} & \multicolumn{2}{c|}{$S_3$} & $V_4$ & \multicolumn{2}{c|}{$S_3$} & $C_2$ & $C_2$ & $\langle 1\rangle $\\
%\hline
\multicolumn{2}{|l|}{$ $} & \cellcolor{blue!45}$ $ & \cellcolor{orange!45}$ $ & \cellcolor{orange!45}$ $ & \cellcolor{orange!45}$ $ & \cellcolor{orange!45}$ $ & \cellcolor{orange!45}$ $ & \cellcolor{orange!45}$ $ & \cellcolor{orange!45}$ $ & \cellcolor{orange!45}$ $ & \cellcolor{orange!45}$ $ & \cellcolor{orange!45}$ $ & \cellcolor{orange!45}$ $ & \cellcolor{orange!45}$ $\\[-2.3ex]
\multicolumn{2}{|l|}{$ $} & \cellcolor{blue!45}$P$ & \cellcolor{orange!45}$ n_j \in N_v$ & \cellcolor{orange!45}$1$ & \cellcolor{orange!45}$(123)$ & \cellcolor{orange!45}$(12345)$ & \cellcolor{orange!45}$1$ & \cellcolor{orange!45}$(345)$ & \cellcolor{orange!45}$1$ & \cellcolor{orange!45}$1$ & \cellcolor{orange!45}$(234)$ & \cellcolor{orange!45}$1$ & \cellcolor{orange!45}$1$ & \cellcolor{orange!45}$1$\\
\Xhline{4\arrayrulewidth}
$\chi_1 + \chi_2 + 2\chi_3 + \chi_6 + \chi_7$ & $1$ & \multicolumn{2}{cV{4}}{\cellcolor{blue!45}} & \cellcolor{gray!45}$24$ & \cellcolor{gray!45}$0$ & \cellcolor{gray!45}$4$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$\\
$\chi_4 + \chi_5$ & $2$ & \multicolumn{2}{cV{4}}{\multirow{-1}{*}{\cellcolor{blue!45}$\langle 1 \rangle$}} & \cellcolor{gray!45}$8$ & \cellcolor{gray!45}$2$ & \cellcolor{gray!45}$-2$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$\\
$\chi_3 + \chi_6 + \chi_7$ & $3$ & \multicolumn{2}{cV{4}}{\cellcolor{blue!45}} & \cellcolor{gray!45}$16$ & \cellcolor{gray!45}$-2$ & \cellcolor{gray!45}$1$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$\\
\hline
$\chi_1 + \chi_3 + \chi_6$ & $4$ & \multicolumn{2}{cV{4}}{\cellcolor{blue!45}} & $12$ & $0$ & $2$ & \cellcolor{gray!45}$2$ & \cellcolor{gray!45}$2$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$\\
$\chi_4$ & $5$ & \multicolumn{2}{cV{4}}{\multirow{-2}{*}{\cellcolor{blue!45}$C_2$}} & $4$ & $1$ & $-1$ & \cellcolor{gray!45}$2$ & \cellcolor{gray!45}$-1$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$\\
\hline
$\chi_1 + \chi_2 + \chi_6 + \chi_7$ & $6$ & \multicolumn{2}{cV{4}}{\cellcolor{blue!45}$C_2$} & $12$ & $0$ & $2$ & $0$ & $0$ & \cellcolor{gray!45}$4$ & $0$ & $0$ & $0$ & $0$ & $0$\\
\hline
$\chi_1 + \chi_2$ & $7$ & \multicolumn{2}{cV{4}}{\cellcolor{blue!45}} & $2$ & $2$ & $2$ & $0$ & $0$ & $2$ & \cellcolor{gray!45}$2$ & \cellcolor{gray!45}$2$ & $0$ & $0$ & $0$\\
$\chi_6 + \chi_7$ & $8$ & \multicolumn{2}{cV{4}}{\multirow{-2}{*}{\cellcolor{blue!45}$V_4$}} & $10$ & $-2$ & $0$ & $0$ & $0$ & $2$ & \cellcolor{gray!45}$2$ & \cellcolor{gray!45}$-1$ & $0$ & $0$ & $0$\\
\hline
$\chi_1 + \chi_6$ & $9$ & \multicolumn{2}{cV{4}}{\cellcolor{blue!45}$V_4$} & $6$ & $0$ & $1$ & $2$ & $2$ & $2$ & $0$ & $0$ & \cellcolor{gray!45}$2$ & $0$ & $0$\\
\hline
$\chi_1 + \chi_7$ & $10$ & \multicolumn{2}{cV{4}}{\cellcolor{blue!45}$C_4$} & $6$ & $0$ & $1$ & $0$ & $0$ & $2$ & $0$ & $0$ & $0$ & \cellcolor{gray!45}$2$ & $0$\\
\hline
$\chi_1$ & $11$ & \multicolumn{2}{cV{4}}{\cellcolor{blue!45}$D_8$} & $1$ & $1$ & $1$ & $1$ & $1$ & $1$ & $1$ & $1$ & $1$ & $1$ & \cellcolor{gray!45}$1$\\
\hline
\end{tabular}}
\end{document}
答案1
删除\usepackage{arydshln}
。这就是导致此行为的原因。
顺便说一句,\scalebox
一般不建议使用,因为它会导致字体不一致。最好使用 LaTeX 字体命令,如\small
、\footnotesize
等。