Hello friends
I am trying to produce a line across a matrix such that it is between rows, but I am not succeeding. Can anyone help, I am attaching my desired output.
thanks
Math & Science ⇒ Horizontal Line across Matrix
-
- Posts: 2
- Joined: Sun Jun 03, 2012 1:04 am
Horizontal Line across Matrix
- Attachments
-
- image.png (2.4 KiB) Viewed 27729 times
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Horizontal Line across Matrix
Two possible solutions.
Best regards and welcome to the board
Thorsten
- The
{array}
environment from vanilla LaTeX - The
bmatrix
environment from amsmath (here loaded by mathtools)
Code: Select all
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools} % loads »amsmath«
\begin{document}
\[
\left[
\begin{array}{cccc}
\lambda_0 & 0 & 0 & \cdot \\
0 & \lambda_1 & 0 & \cdot \\ \hline
0 & 0 & \lambda_3 & \cdot \\
\cdot & \cdot & \cdot & \cdot
\end{array}
\right]
\]
\[
\begin{bmatrix}
\lambda_0 & 0 & 0 & \cdot \\
0 & \lambda_1 & 0 & \cdot \\ \hline
0 & 0 & \lambda_3 & \cdot \\
\cdot & \cdot & \cdot & \cdot
\end{bmatrix}
\]
\end{document}
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 2
- Joined: Sun Jun 03, 2012 1:04 am
Re: Horizontal Line across Matrix
Thank You very much, it helped.
-Vaibhav
-Vaibhav
Re: Horizontal Line across Matrix
Does anyone know how to add vertical space on either side of the \hline in this example? The usual approach, namely,
foo \\[3pt] \hline \\ [3pt]
foo \\
that one can use in a table environment does not work in a matrix environment in math mode.
foo \\[3pt] \hline \\ [3pt]
foo \\
that one can use in a table environment does not work in a matrix environment in math mode.