Math & Science ⇒ Horizontal Line across Matrix
-
- Posts: 2
- Joined: Sun Jun 03, 2012 1:04 am
Horizontal Line across Matrix
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
- Attachments
-
- image.png (2.4 KiB) Viewed 27966 times
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Horizontal Line across Matrix
- 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
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
-Vaibhav
Re: Horizontal Line across Matrix
foo \\[3pt] \hline \\ [3pt]
foo \\
that one can use in a table environment does not work in a matrix environment in math mode.