I need to adjust the vertical position of a horizontal line inside a matrix. Here's a MWE code to play with:
\documentclass[11pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\begin{document}
\begin{equation}
R = \left[ \begin{array}{ccc|ccc}
A & B & C & A & B &C \\[2ex]
A & B & C & A & B &C \\[2ex]
A & B & C & A & B &C \\[2ex]
\hline
A & B & C & A & B &C \\[2ex]
A & B & C & A & B &C \\[2ex]
A & B & C & A & B &C
\end{array} \right]\!.
\end{equation}
\end{document}
Preview:
I don't want the line to produce any gap on the crossing vertical line, and I need to keep the \\[2ex]
vertical spacing between each element in the matrix. So how can I move up the horizontal line, without changing the rest of the matrix?
2ex
of row sep, you could also modify the\arraystretch
for that matrix, e.g. to\def\arraystretch{1.6}
, and then removing the additional[2ex]
to each\\
. Maybe there is also a possibility to set\arraystretch
so that is is equivalent to\\[2ex]
.