Questions tagged [matrices]

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

Filter by
Sorted by
Tagged with
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[\...
Davut Kesen's user avatar
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}\}= \...
John Stone's user avatar
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} ...
Harry's user avatar
  • 3
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 \\ \...
featherweight's user avatar
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}...
myca's user avatar
  • 1
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{...
abc123's user avatar
  • 23
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{...
Emad kareem's user avatar
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 ...
cTroels's user avatar
  • 23
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 ...
pixel's user avatar
  • 1,357
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+...
Confused Learner's user avatar
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 &...
Nickesponja's user avatar
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{...
mins's user avatar
  • 340
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}{...
Alex's user avatar
  • 63
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 &...
Tomais's user avatar
  • 163
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 ...
Peter Grill's user avatar
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 \...
Peter Grill's user avatar
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 ...
Alexey's user avatar
  • 2,079
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 ...
Peter Grill's user avatar
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{...
Zuy's user avatar
  • 353
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 ...
GowriSaro's user avatar
  • 540
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 ...
Alezigl's user avatar
  • 375
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 ...
zeta's user avatar
  • 133
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/...
Jacob Ivanov's user avatar
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. ...
mathgoonie's user avatar
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\{\...
Joy Jin's user avatar
  • 205
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 ...
Agente 156's user avatar
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 ...
Artemij Keidan's user avatar
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] ...
Abdullah Mustafa's user avatar
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 ...
Mailbox's user avatar
  • 279
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... \...
user41177's user avatar
  • 375
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 ...
jvictormata's user avatar
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} \...
Alezigl's user avatar
  • 375
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?
Cutie's user avatar
  • 45
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} \...
Federico's user avatar
  • 113
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\...
mrwillparker's user avatar
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 ...
Nikolaj's user avatar
  • 143
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{...
Fynn13's user avatar
  • 43
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}\] ...
Zaragosa's user avatar
  • 599
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 ...
Alezigl's user avatar
  • 375
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}\...
Alezigl's user avatar
  • 375
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} \...
SilianRail's user avatar
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:
jvictormata's user avatar
-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.
saleh din's user avatar
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 &...
Johnny Canuck's user avatar
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^{'}} &...
Chris S's user avatar
  • 23
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[...
Darkhomo Van's user avatar
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?
Harshdeep Chhabra's user avatar
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 ...
pixel's user avatar
  • 1,357
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]{...
pixel's user avatar
  • 1,357
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} ...
Wildan B. W.'s user avatar

1
2 3 4 5
40