4

Trying to generate a column vector with a horizontal line/rule separating top half of the vector from the bottom half. Am starting from the following MWE:


\documentclass[11pt,letterpaper,oneside]{article}

\usepackage{amsmath}

\begin{document}

\begin{equation*}
\textbf{Y}=\begin{bmatrix}
 11\\
12\\
11\\
14\\
\rule{1.5em}{0.5pt}\\
8\\
11\\
12\\
10
\end{bmatrix}
\end{equation*}

\end{document} 

Works more or less, but I'm trying to tweak aesthetics by reducing the height above/below the rule. Functionally, this is analogous to trying to change the height of a single row n a matrix, which I don't think is doable.

I know I can move the rule up as desired using \raisebox


\raisebox{.5ex}{\rule{1.5em}{0.5pt}}\\

but that doesn't entirely satisfy.

Even possible? Basically, I'd like the space above/below the rule to be the same as the default spacing above/below each row.

Thanks...I can live with what I've got, but would like to tweak it, if possible.

2

Two possibilities, the idea of the second one can be used for general partitioned matrices where \cmidrule defined by booktabs doesn't mix with vertical rules in an array.

\documentclass[11pt,letterpaper,oneside]{article}

\usepackage{amsmath,booktabs}

\begin{document}

\begin{equation*}
\textbf{Y}=\begin{bmatrix}
  11\\
  12\\
  \cmidrule(lr){1-1}
  8\\
  10
\end{bmatrix}
=\left[\begin{array}{@{}c@{}}
  11\\
  12\\
  \hline
  8\\
  10
\end{array}\right]
\end{equation*}

\end{document}

enter image description here

1

Stack the rule under the above entry, but all on the same row.

\documentclass[11pt,letterpaper,oneside]{article}
\usepackage{amsmath,stackengine}
\stackMath
\begin{document}
\begin{equation*}
\textbf{Y}=\begin{bmatrix}
 11\\
12\\
11\\
\stackunder{14}{\rule{1.5em}{0.5pt}}\\
8\\
11\\
12\\
10
\end{bmatrix}
\end{equation*}
\end{document} 

enter image description here

  • @JohnnyCanuck You are welcome. I noticed for the many questions you have asked, you have not "accepted" any of the answers. If there is one particular answer of the several given to one of your questions that best answers it, the way to indicate so is to click the check mark to the left of that answer. That also tells other readers what is the best approach to that problem. For any answer (to your question or to others) that you find "useful", you can also click the up arrow to the left of the answer, which raises its score by "1". Best wishes and welcome to the site. – Steven B. Segletes Jun 7 '15 at 1:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.