2

I'm using LyX. I came across with the following Matrix:

enter image description here

I could use the following LaTeX for that:

\begin{bmatrix}| & |\\
\underline{x}_{1} & \underline{x}_{2}\\
| & |
\end{bmatrix}

But is it the right way? What If I want the | in multilines? Then I'll just use the | in each place. I'm sure there is a better way for that.

vesii
  • 373

1 Answers1

2

I think that this question is a duplicate of this: How do I typeset vertical and horizontal lines inside a matrix?

Here I put a small code where I have changed the parameters of vertical rules.

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}
\usepackage{amssymb}
\newcommand*{\vertbar}{\rule[-1.5ex]{1.1pt}{3ex}}
\begin{document}
\[\begin{bmatrix}\vertbar &\vertbar\\
\underline{x}_{1} & \underline{x}_{2}\\
\vertbar & \vertbar
\end{bmatrix}\]
\end{document}
Sebastiano
  • 54,118