Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [matrices]

{matrices} is about matrices in {equations} and {diagrams}.

Filter by
Sorted by
Tagged with
2 votes
0 answers
25 views

Long nicematrix with color and margin text [closed]

I currently would like to have a matrix that is long and includes some color on each row. However, whenever I use the & multiple times, I get an error saying I have an extra alignment tab that has ...
Ivan's user avatar
  • 61
6 votes
2 answers
112 views

Simply Adjusting the Position of Dashed Lines in Nicematrix Package

I encountered a problem with the horizontal dashed line created by the nicematrix package in LaTeX. The line is a little close to the bottom of the matrix, overlapping with the elements of the second ...
Prince Chen's user avatar
2 votes
2 answers
54 views

pmatrix only considers one character before closing brackets

I am running Ubunutu 22.04.3 WSL2 with latexmk version 4.76. I had this bug when compiling with vimtex, so I tried compiling with latexmk directly and the same issue persisted. The compilation (with ...
Sadim's user avatar
  • 23
4 votes
1 answer
159 views

Lengthen tikz-cd Arrow Based on Label

I was wondering if it is possible to automatically lengthen a tikz-cd arrow based on the width of its label (perhaps with some padding)? Typesetting, for example, the commutative diagram \...
Dave's user avatar
  • 315
1 vote
1 answer
61 views

Upper triangular block matrix

I want to do that : It's a 3-3 matrix, with a star in the upper triangular region and a big zero in the lower. It doesn't seem possible to do that with nicematrix, because here the blocks are not ...
Louis Lascaud's user avatar
2 votes
1 answer
65 views

NiceMatrix Right Margin elements

I have been struggling to figure out what is wrong with my code. I currently have a matrix with some colors and on the margin, I would like arrows. At the moment I currently have this \documentclass{...
Ivan's user avatar
  • 61
4 votes
2 answers
111 views

Matrix overloads margins

I have the following matrix \documentclass{article} \usepackage{amsmath} \begin{document} \begin{bmatrix} \frac{1}{2}\alpha s_L & 0 ...
baristocrona's user avatar
2 votes
2 answers
267 views

How to Code Adjacency Matrix

do you know how to code this in latex?
Ryl's user avatar
  • 31
1 vote
1 answer
57 views

Space for the cases/matrix environment and use of \dfrac into \[...\]

I have this MWE: \documentclass[a4paper,12pt]{article} \usepackage{mathtools,amssymb} \begin{document} \[ \begin{cases} \frac{\partial f}{\partial x} =& 2x(1 - y)=0 \iff x = 0 \quad \text{o} \...
Sebastiano's user avatar
  • 55.3k
1 vote
2 answers
33 views

Augmented matrix with labeled rows at the right

I would like to write an augmented matrix with labeled rows out of the right bracket of the matrix, in such a way to enlight operations by row for Gaussian elimination procedure. I'm using this code ...
Redeldio's user avatar
  • 125
5 votes
1 answer
92 views

How can I add top (and bottom) padding to a pNiceMatrix?

I'm attempting to create a matrix where the basis I'm using appears to the top and left of the matrix, and based on online suggestions, I landed on using either the built-in \bordermatrix or the ...
Connor Mooneyhan's user avatar
3 votes
1 answer
126 views

Change column matrix in a matrix into a block matrix

Can any one help me with changing the column (a43,a53,a63,a73) to be a block $I_n$ and (a44,a54,a64,a74) to be a block $0_{N \times n}$ ? Here is the code for this version: \[ \begin{bmatrix} -I_{...
Nattapong Kongkaew's user avatar
2 votes
1 answer
39 views

aligning element of matrix spacing multiline

Since this matrix is ​​so long, it can only fit in 3 rows, but its elements are not aligned one under the other. How can I align this? Because it's not visually good this way \begin{multline*} \left[\...
Davut Kesen's user avatar
8 votes
3 answers
1k views

How to display a distance matrix in LaTeX

I want to show a distance matrix as in LaTeX, and I try: \documentclass{article} \usepackage{amsmath,amssymb} \begin{document} We obtain a distance matrix as follows: $$ \boldsymbol{D}=\{d_{ij}\}= \...
John Stone's user avatar
0 votes
3 answers
81 views

Matrix equations frequently in LaTeX

I'm writing a paper. Most of the equations are of the form d\mathbf{F} = (d\mathbf{X})\mathbf{AX}^T + ((d\mathbf{X})\mathbf{AX}^T)T Most elemets are Matrices, A , B , C , W but I've to use \mathbf{A} ...
Harry's user avatar
  • 3
1 vote
2 answers
54 views

How to add vertical braces to a matrix showing different groupings of the elements?

So, I am currently trying to do this: And this is what I tried so far, \[ \left[ \begin{array}{c} \left.\begin{matrix} x_k \\ y_k \\ v_k \\ \psi_k \\ \end{matrix}\right\} s_k^p \\ \...
featherweight's user avatar
0 votes
1 answer
96 views

Automatic space when typesetting block matrix

Is there an easy way to create block matrices which automatically adjust size based on their content? MWE using the nicematrix package: \documentclass{article} \usepackage{nicematrix} \begin{document}...
myca's user avatar
  • 1
1 vote
1 answer
78 views

bNiceMatrix not compiling unless followed by another bNiceMatrix

I am trying to use Overleaf to make a matrix using nicematrix. This code seems to work and produces the following: \documentclass{article} \usepackage{nicematrix} \begin{document} $$ \begin{...
abc123's user avatar
  • 23
0 votes
0 answers
51 views

How to solve the error in the matrix during execution?

The goal is to place a matrix and its corresponding figure side by side I'm using egreg's answer @egreg \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows.meta,positioning} \usepackage{...
Emad kareem's user avatar
2 votes
1 answer
46 views

Typesetting of matrices with multi-row and column entries [duplicate]

I want to make a matrix-vector product in latex that is similar in style to what is shown. Suppose that the entire matrix and vector is 3x3 and 3x1, but i want to group the entries as shown and ...
cTroels's user avatar
  • 23
1 vote
1 answer
33 views

How to define matrix with non-default spacing between columns?

I want to create a matrix that looks like the following, except to use brackets instead of parentheses: I have the following code to display it, but unlike in the above picture, the columns are too ...
pixel's user avatar
  • 1,356
3 votes
4 answers
88 views

Align multiple arrays vertically, which look like a pmatrix with a vertical line separator

\begin{align} \left(\begin{array}{rrr|rrr} 3&1&-2&1&0&0\\ -1&4&3&0&1&0\\ 1&2&-1&0&0&1 \end{array}\right) \begin{array}{rrr|r} \\ \text{II+...
Confused Learner's user avatar
3 votes
1 answer
113 views

Highlighting box within a matrix

I'm trying to ilustrate how matrix multiplication works with the following code: \begin{align*} & \begin{pmatrix} 1 &2 \\ -1 &0 \end{pmatrix} \\ \begin{pmatrix} 3 &...
Nickesponja's user avatar
1 vote
2 answers
96 views

In LyX, how to add pseudo-headers to a matrix with brackets?

I have this matrix in LyX: LyX generates this latex code: \documentclass[english]{article} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \usepackage{amsmath} \usepackage{babel} \begin{...
mins's user avatar
  • 340
6 votes
2 answers
168 views

Messy block matrix

I need to typeset the following matrix but I'm having trouble understanding the nicematrix package. I am trying to write it like this \begin{document} \begin{align*} \begin{pNiceArray}{...
Alex's user avatar
  • 63
3 votes
1 answer
112 views

Dividing a matrix with lines

What do I use to divide the matrix into a vertical line and a horizontal line? \begin{equation*} A= \begin{bmatrix} a & b & c & a & b & c & a & a & a & a \\ d &...
Tomais's user avatar
  • 163
2 votes
1 answer
69 views

Optional Parameter to \\ in Tikz's matrix of math nodes to Leave Extra Space after Last Line

I am using the solution form Obstacles to simulating an amsmath matrix by a TiKZ matrix of math nodes to create a tikz matrix in the style of a bmatrix. I would like to leave a little extra space ...
Peter Grill's user avatar
4 votes
2 answers
100 views

Automated Way to Determine Max Column/Max Row Number for Tikz "matrix of math nodes"

In the MWE below, I have defined \def\MaxRow{3} \def\MaxColumn{4} which means that this code won't work if I happen to add a row or a column to the matrix without also adjusting the constants \...
Peter Grill's user avatar
4 votes
1 answer
246 views

Slim big parentheses (around a matrix)

When typesetting formulas with matrices, I have a difficulty choosing between parentheses and brackets. The usual parentheses look too wide, waste horizontal space, and do not highlight the matrix ...
Alexey's user avatar
  • 2,109
2 votes
1 answer
105 views

Adjust top and bottom of tikz matrix's left delimiter and right delimiter individually

I am using the solution form Obstacles to simulating an amsmath matrix by a TiKZ matrix of math nodes to create a tikz matrix in the style of a bmatrix. This works pretty well, with the default ...
Peter Grill's user avatar
6 votes
2 answers
181 views

Reducing space before and after matrices

I find the extra space added before and after matrices quite ugly: \documentclass{article} \usepackage{amsmath} \begin{document} $f\begin{pmatrix} 1&2\\ 3&4 \end{pmatrix}.$ \end{...
Zuy's user avatar
  • 353
3 votes
3 answers
223 views

How to make both top and bottom space same using matrix

I tried with: \documentclass{article} \usepackage{amsmath}%amssymb, \usepackage{bm} \begin{document} Outputs to machine learning models are also often represented as vectors. For instance, consider ...
GowriSaro's user avatar
  • 560
3 votes
1 answer
56 views

How to make a matrix with \langle and \rangle symbols? [duplicate]

I am interested in making matrices like this: I have tried like this: \documentclass{article} \usepackage{amsmath} \begin{document} $\langle\mkern-1.5mu \begin{matrix} 1\\2\\3 ...
Alezigl's user avatar
  • 377
3 votes
1 answer
86 views

A vertical line separates matrix entries in the tikzpicture matrix environment?

How do we make a perfect vertical line as the line in the square matrix to separate between Cc and G on the left and the D and H on the right in the tikzpicture matrix environment? The line shall be ...
zeta's user avatar
  • 133
1 vote
2 answers
91 views

Horizontal Line in LaTeX Matrix

I would like to reproduce the following table from the Wikipedia page on Runga-Kutta methods: As a result, I need the dividing lines. While this answer here: https://tex.stackexchange.com/a/33522/...
Jacob Ivanov's user avatar
3 votes
4 answers
85 views

Matrix Configuration

I am wanting to write a matrix that looks like this: My latex code is: \left(\begin{array}{cc} I_{k} & m^T \\ \hline P \end{array}\right) which is not giving me exactly what I need. ...
mathgoonie's user avatar
3 votes
3 answers
659 views

mqty looks ugly due to bad vertical spacing

Below is a snippet of my code: 12: We can rewrite $W$ as $s\mqty[1 \\ 1 \\ 2 \\ 0]+t\mqty[3 \\ -1 \\ -1 \\ 4]$. Again we assume that $s$ and $t$ are real numbers. This shows that $W=$ Span$\left\{\...
Joy Jin's user avatar
  • 205
1 vote
1 answer
64 views

Underbrace in Matrix without array package [duplicate]

I've been struggling with matrix underbrace, and I can't find any way through all LaTeX questions about how to use an underbrace in a matrix without the array package. So far I got here, with these ...
Agente 156's user avatar
1 vote
0 answers
31 views

\newcommand with a tikz matrix would not compile

I've made a \newcommand containing a matrix of nodes in tikz. The thing is that when the matrix is one column only, everything works fine. When it's two columns or more it stops compiling. I am ...
Artemij Keidan's user avatar
5 votes
2 answers
89 views

Fix spacing in custom matrix environment

I have made a custom matrix environment for using Gauss Jordan elimination, I need a vertical bar between the two halves of my matrix. Here is what I have slopped together \newenvironment{gjmatrix}[1] ...
Abdullah Mustafa's user avatar
7 votes
2 answers
251 views

Add description next to matrix

I have the following definition of a standard basis vector: This text was compiled by the following code: \documentclass{article} \usepackage{amsmath} \begin{document} For $ \mathbb{R}^n $, we let ...
Mailbox's user avatar
  • 279
1 vote
1 answer
56 views

How can I fix the alignment of the vertical dots in this matlab style syntax matrix?

I am trying to adapt the code from this post to allow for matlab style syntax for matrices in latex. In the MWE example, the alignment of the \vdots is incorrect (should be centered)... My MWE is... \...
user41177's user avatar
  • 375
2 votes
2 answers
303 views

How to draw a hierarchical matrix pattern?

How to draw a hierarchical matrix pattern like this one (using TikZ or not)? And how to add a little square matrix between the product between the two retangular matrices? Is it possible to create a ...
jvictormata's user avatar
5 votes
2 answers
151 views

What are all the possible codes for the matrix \llbracket, \rrbracket and \llparenthesis,\rrparenthesis?

1. I am interested in the matrix: To make this matrix, I am using the following code (the full document): \documentclass{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{stmaryrd} \...
Alezigl's user avatar
  • 377
2 votes
2 answers
208 views

Matrices inside a matrix, with only text in the inner matrices

I want to draw a big matrix as an 8 by 8 to represent the combination of two HMMs. How do I go about it?
Cutie's user avatar
  • 45
0 votes
3 answers
75 views

How can I remove the extra vertical space above and below this matrix?

I have written the following code: \documentclass[a4paper,twoside,12pt]{article} \usepackage[margin=1cm]{geometry} \usepackage[utf8]{inputenc} \usepackage[italian]{babel} \usepackage{sansmathfonts} \...
Federico's user avatar
  • 113
2 votes
1 answer
38 views

How do you make the brackets of a row matrix the same boldness or thickness of a standard MxN matrix?

I have the following code: \begin{align*} \begin{cases} \dot{\mathbf{x}} = \begin{bmatrix*} \phantom{-}3 & -4 & \phantom{-}2\phantom{-} \\ -2 & \phantom{-}0 & \phantom{-}1\...
mrwillparker's user avatar
4 votes
1 answer
309 views

Making overlapping submatrices

Is there anyway I can make a matrix like this?: Yes, that looks strange, but I assure you I actually need this. The "column" and "row" numbers are actually some sort of physical ...
Nikolaj's user avatar
  • 143
4 votes
4 answers
205 views

Jordan normal form with mathematical symbols

I would like to make a Jordan normal form, like this: \documentclass{article} \usepackage{amsmath} \usepackage{array} \begin{document} \[ \newcommand{\?}[1]{\multicolumn{1}{c|}{#1}} \left(\begin{...
Fynn13's user avatar
  • 43
4 votes
2 answers
353 views

A function to extract a submatrix from a matrix

Is it possible to create a function to extract a submatrix from a matrix?, for example \[A=\begin{pmatrix} 5 & 0 & 0\\ 0 & 2 & -5\\ 6 & 1 & -2 \end{pmatrix}\] ...
Zaragosa's user avatar
  • 599

1
2 3 4 5
40