Questions tagged [matrices]
{matrices} is about matrices in {equations} and {diagrams}.
1,975
questions
2
votes
1
answer
32
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[\...
8
votes
3
answers
996
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}\}=
\...
0
votes
3
answers
76
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} ...
1
vote
2
answers
41
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 \\
\...
0
votes
1
answer
87
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}...
1
vote
1
answer
69
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{...
0
votes
0
answers
46
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{...
2
votes
1
answer
38
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 ...
1
vote
1
answer
32
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 ...
3
votes
4
answers
83
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+...
3
votes
1
answer
104
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 &...
1
vote
2
answers
78
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{...
6
votes
2
answers
159
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}{...
3
votes
1
answer
109
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 &...
2
votes
1
answer
68
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 ...
4
votes
2
answers
95
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 \...
4
votes
1
answer
236
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 ...
2
votes
1
answer
95
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 ...
6
votes
2
answers
178
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{...
3
votes
3
answers
220
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 ...
3
votes
1
answer
51
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
...
3
votes
1
answer
85
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 ...
1
vote
2
answers
70
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/...
3
votes
4
answers
84
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. ...
3
votes
3
answers
496
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\{\...
1
vote
1
answer
57
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 ...
1
vote
0
answers
28
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 ...
5
votes
2
answers
85
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] ...
7
votes
2
answers
244
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 ...
1
vote
1
answer
53
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...
\...
2
votes
2
answers
295
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 ...
5
votes
2
answers
145
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}
\...
2
votes
2
answers
206
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?
0
votes
3
answers
73
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}
\...
2
votes
1
answer
31
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\...
4
votes
1
answer
274
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 ...
4
votes
4
answers
181
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{...
4
votes
2
answers
324
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}\]
...
8
votes
4
answers
924
views
What are all the possible codes for {{A\\B}}?
I am interested in the matrix:
To make this matrix, I am using the following code:
$\left\{\!\!\!\left\{\begin{array}{l} A \\ B \end{array}\right\}\!\!\!\right\}$
What are other possible codes to ...
1
vote
1
answer
64
views
How to make a matrix with \llfloor and \rrfloor and how to make smaller distance between two curly brackets?
I am working on brackets.
1) I want to make a smaller distance between curly brackets like this $\{\!\!\{A, B\}\!\!\}$ in equation
\begin{equation} \left\{\left\{\begin{array}{l} A \\ B \end{array}\...
2
votes
3
answers
163
views
Why is the alignment of ordered list messed up by default and how to fix it?
I was recently trying to form a table inside an ordered list but, there's a small indent in the list with the table that's driving me crazy.
Below is the code snippet-
\documentclass[12pt]{article}
\...
0
votes
1
answer
92
views
How to draw a sparse matrix pattern (using TikZ or not)?
I would like to draw sparsity patterns with overlapping blocks and at the same time be able to write operations in the picture like in the figure below:
-1
votes
2
answers
98
views
Draw a table with arrows in Latex [closed]
I want to draw this table in Latex please help me.
4
votes
3
answers
214
views
increase space between delimiter and adjacent column in matrix
Suppose I have the following simple matrix, constructed in the usual way using bmatrix:
Anal-retentive editor asks if the spacing between the delimiter and the adjacent column can be increased for &...
2
votes
1
answer
99
views
Align elements inside a matrix
How can I improve the alignment inside this matrix equation?
My Tex code is
\begin{equation}
\begin{bmatrix}
d\varepsilon_v\\
d\varepsilon_q
\end{bmatrix}
=
\left[
\begin{matrix}
\dfrac{1}{K^{'}} &...
8
votes
3
answers
282
views
Why does the "\left [" partially disappear when I color a row in a table? But [ does not disappear
The problem is shown in the picture below: the tall left-hand square brackets that should be produced by \left[ and \begin{bmatrix} vanish.
The code is as follows
\documentclass{article}
\usepackage[...
0
votes
0
answers
40
views
How to insert a big (28 x 28) matrix in latex?
I'm trying to fit a 28 $\times$ 28 matrix in the page but it's not setting in page. The rows are taking two lines to come. Is there any way to put a matrix like this?
3
votes
1
answer
155
views
How to put left brace in nicematrix?
I want to have a matrix, where on the left side I have left brace with n written on it. But the current code I have does not produce the desired result. The left brace is not drawn due to some issue ...
1
vote
1
answer
75
views
How to draw matrices with lines and side braces? [duplicate]
I want to generate something like in the figure below. I have currently the following but is not complete as you can observe. Any idea how to do this?
\documentclass{article}
\usepackage[utf8]{...
3
votes
2
answers
207
views
Lines inside Array
I want to create a line inside an array (for a matrix), among which what I have created is as shown below. (I used \usepackage{hhline} and \usepackage{arydshln})
\[\small{\left [\begin{array}{cc|c}
...