Questions tagged [matrices]

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

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

Trying to personalize this code for block matrices

I have this code, which outputs a block matrix: \documentclass[letterpaper,12pt]{book} \usepackage[T1]{fontenc} \usepackage[spanish,es-tabla]{babel} \usepackage{amsmath, nccmath, amsthm} \...
3
votes
3answers
74 views

Continuous borders through multiple blocks of a blockarray

I have this rather complicated matrix I'm trying to make with the blkarray package. \begin{figure} \aboverulesep=0pt \belowrulesep=0pt \center \begin{blockarray}{cccccccccccc} & $e_1$ &...
3
votes
2answers
58 views

Spalign package: the use of square brackets with the borders

I am curious, since I have done several tests, how to set up the square brackets for the first matrix when I use the border with spalign package. I have seen this question and....actually I am not ...
1
vote
3answers
91 views

Unusual partitioned matrix

Could anyone tell me the way the latex code producing a matrix partition whose form is the attached picture
0
votes
1answer
32 views

Aligning the cells in a matrix in an equation

I have been trying to align the "<" and ">" after t_{c} with that of the equal "=" sign in the second matrix (see the codes below). Any ideas on how I can do that? ...
1
vote
0answers
19 views

Creating matrix newenvironment with arraystretch [duplicate]

I want to create a new matrix environment with different spacing for a matrix instead of manually typing arraystretch locally for each matrix. I am new to more advanced LaTeX coding, and have not ...
0
votes
0answers
19 views

hf-tikz: no shape found

I'm trying to have two separate frames, each highlighting only the rows or the columns in a matrix, using hf-tikz in beamer: \begin{frame} \frametitle{Matrices} \begin{equation*} \begin{...
-1
votes
1answer
58 views

Balance the spacing in matrices including minus signs? [closed]

I often find matrices including entries with minus signs unbalanced. I already experimented with differently aligning the columns and \phantom{-}minus signs, but find it hard to get a satisfying ...
0
votes
0answers
20 views

Matrix within equation does not compile (missing $ inserted) [duplicate]

the following piece of code has a missing $ inserted error. \begin{equation} \theta^{\star} = \begin{bmatrix} \boldsymbol{c}^{\star} \\ \boldsymbol{m}^{\star} \end{bmatrix} ,\quad \begin{bmatrix} \...
0
votes
0answers
33 views

Using \usepackage in Google Colab

I am trying to use Google Colab with LaTex to make a matrix with column and row labels. Outside of Colab, the code that I would need is \documentclass[12pt]{report} \usepackage{blkarray} \usepackage{...
6
votes
6answers
1k views

How to fill a Vigenère square?

Im trying to do a Vigenère square, but I have to modify it several times, so is there any way to fill it with multido or any other method, instead of tabular and by hand. UPDATE All are great answers ...
0
votes
3answers
27 views

Labeling and Double Labeling Matrices in LaTex (Overleaf) - useful for Markov chain transition matrices

This is actually not a question, but a solution. I looked everywhere and all of the solutions given are super complicated so I thought I would share my own for people who need help!! Treat the matrix/...
4
votes
2answers
40 views

How to add extra space between the left-side legend and the left parenthesis of a matrix in the presence of a vertical line?

I have the following example: \documentclass{article} \usepackage[english]{babel} \usepackage{booktabs} \usepackage{array} \usepackage{blkarray} \begin{document} \begin{equation}\label{cexA_Rmat} \...
1
vote
2answers
62 views

infinite matrix with diagonal rectangle close and open

i want to draw this, with rectangle over sucesion ${\lambda_{i,i-1}}_{i}$. Rectangle must be close in \lambda_{1,0} and finish open, not close, i know from others examples how do close in begin and ...
6
votes
3answers
188 views

How to create a Matrix with Label on its top? [duplicate]

I've been trying to create a matrix (displayed in the image below), and I haven't been able to figure out so far. I've tried the following code (as an example), but its not quite the same as you can ...
1
vote
1answer
24 views

`package ams error: old form '\matrix' should be \begin{matrix} \end{align}`

I am using the following code in my latex editor but is saying package ams error: old form '\matrix' should be \begin{matrix} \end{align}: \begin{align} \matrix{ \mathscr{C} & \overset{F}{ \...
1
vote
1answer
33 views

Macro with & character inside

So I'm trying to make a simple macro that creates a vector for me. I'm expecting that I can do \myVec{1,...,5} and the macro can expand to \begin{bmatrix}1 & 2 & 3 & 4 & 5\end{bmatrix}....
2
votes
1answer
36 views

Latex: How to add dashed lines for matrix?

In a $4\times5$ matrix, \documentclass{article} \usepackage{amsmath,amsfonts,bm,mathdots} \begin{document} $$\left(\begin{matrix} 1 &2 &-1 &3 &4\\ 0 &1 &3 &-2 &...
0
votes
1answer
31 views

Aligning an adjacency matrix next to a TikZ graph

How can I align an adjacency matrix of a graph drawn with TikZ next to the graph? Here the adjacency matrix is an edge-origin-destination adjancency matrix, so that it indicates which edges belong to ...
2
votes
1answer
36 views

How can I type text above a matrix?

I'm trying to write a matrix like the one in the image, but I don't know how to do it (I tried using the align environment, but I had no luck). Any help will be really appreciated. :)
1
vote
2answers
55 views

Latex: How to write single cross arrow in a 2x2 matrix?

Is there a way to make a version of the diagram provided above? Thank you very much.
0
votes
0answers
23 views

Defining custom commands with output dependent on the number of variables [duplicate]

I recently started looking into building custom commands in latex to make life easier and one thing that I wanted to do was create a command that outputs a diagonal matrix from the specified input ...
3
votes
2answers
71 views

How to add these arrows on this Matrix

Consider the following matrix : I have no problem in constructing the matrix and I have no problem in circling the first and the fifth row, but I have no idea how to insert these arrows outside this ...
4
votes
4answers
106 views

How to symmetricize this nxn Identity matrix

Consider the following code : I= \begin{bmatrix} 1 & 0 & 0 & \cdots & 0 & 0 \\ 0 & 1 & 0 & \ddots & & \vdots \\ \vdots & \ddots & \ddots & \ddots &...
0
votes
2answers
64 views

Place text next to a down arrow

I would like to place a text next to an arrow. The figure below shows how I would like it to look. I tried to use the commands ^ and _ and also \hspace and \vspace, but it is not getting the way you ...
2
votes
1answer
39 views

How to Decrease interval space in this Matrix - Vector Multiplication

Consider this following code : \begin{matrix} & A & \\ & \begin{bmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1, n} \\ a_{2,1} & a_{2,2} & \cdots &...
0
votes
1answer
22 views

Order in the presentation

I am giving a presentation and I would like to make the slides in the following order: The commands are: \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{arrows.meta} \newcommand\myarrow{% \...
3
votes
1answer
91 views

How to make an arrow of the desired shape

I'm doing a presentation on derivatives and I thought about using a matrix to explain the derivative of a function. It is the first time that I am doing something like this and I am having a little ...
2
votes
2answers
38 views

Shortening row or column matrices of constant size

I am using many times matrices that have only one row or one column. For example: \begin{pmatrix}1 \\ 2 \\ 3 \end{pmatrix} \begin{pmatrix}1 & 2 & 3 \end{pmatrix} So I figured it will be ...
2
votes
2answers
72 views

plot matrix with arrows describing it

I try to plot this matrix (image) with this code but the shape of my equation has problem(second image) How I could correct it? \documentclass[12pt]{article} \usepackage{amsmath} \...
0
votes
1answer
48 views

Positioning and aligning many many matrices

Edit: I swapped \begin{aligned} &\ro{r_2+-1r_1}\\ &\end{aligned} with &\ro{r_2+-1r_1}\\ , added some linebreaks an now it looks quite well. I am working on a python matrix editor(it's ...
6
votes
3answers
534 views

Create a Householder matrix in LaTeX

I have difficulties to create a Householder matrix. M = \left( \begin{array}{c | c c c c} 1 & 0 & 0 & 0 & 0 \\ \hline 0 & \\ 0 & H_{u} \in \mathbb{R}^{...
10
votes
2answers
356 views

Horizontal Line in Array

Good evening, I'm trying to achieve following picture in latex, but i can't do it. Can someone help me? This is what I have so far: \documentclass[a4paper,12pt]{scrartcl} \usepackage{booktabs} \...
2
votes
1answer
48 views

Formula alignment in a transition matrix

I used the issue raised in the link below to build 2 alternative ways of generating a transition matrix for a Markov Chain. However, as you can see, in the first version, my formula are losing their ...
1
vote
0answers
25 views

Matrix row gets printed in 2 separate rows [duplicate]

I want to write a 12x12 matrix in beamer but the last 2 row elements get printed in another line. I've only included one of the rows here to demonstrate the problem but I have the same issue with the ...
4
votes
2answers
65 views

How to format a matrix system of equations in LATEX

I currently have the following code for a system of equations: \documentclass{article} \usepackage{amsmath} \usepackage{etoolbox} \newcommand{\dpartial}[2]{\frac{\partial #1}{\partial #2}} \...
2
votes
3answers
71 views

Deriving the code for these three matrices

I would like to kindly ask if someone is able to derive the code for the following :
7
votes
4answers
863 views

How to create a self-comparing matrix like this?

I am looking to create a matrix like this. What would be the a way to achieve this?
0
votes
0answers
58 views

cannot compile matrix to pdf

I have a problem knitting my rmd to pdf. I have tried copying the code that works for others from this forum but it is not working for me. I keep receiving: !LaTeX Error: Can be used only in preamble. ...
2
votes
1answer
30 views

How can I make a matrix equation smaller in way that it fits in one line on a page?

I have the following matrix equation written in latex. \documentclass[a4paper, 12 pt]{report} \usepackage{amsmath} \usepackage{amssymb} \usepackage[top=1in, bottom=1in, left=1.5in, right=1in]{geometry}...
0
votes
0answers
29 views

Set \phantom{-} for all columns of a matrix that has at least one negative entry

I would like to add \phantom{-} to every column of a matrix that contains at least one entry with a - in front. Here is an answer that my current code is based off. It inserts \phantom{-} in front of ...
1
vote
0answers
30 views

How to move the martix inside the page?

I have a $16 \timex 16$ matrix. I want to rotate and write down it on new page. The odd and even pages are diffrent. My atempt is below: \documentclass[12pt, reqno]{amsart} \usepackage{amsmath, amsthm,...
4
votes
2answers
91 views

Matrices in equations

I would like to know how it is possible to put matrices and determinants inside equations. In particular I would like to know how to generate the following equality: Thanks in advanced!
5
votes
3answers
243 views

Correctly format \vdots in small matrix

I want to format this matrix in the \scriptsize font size: \documentclass[12pt]{article} \usepackage{amsmath} \begin{document} \scriptsize $S=\begin{pmatrix}\sigma_1 & 0 & 0\\ ...
0
votes
1answer
27 views

How to divide matrix over two lines (matrix too big for page)

I'm writing a math assignment and my matrix is too wide for the page and falls off, even if I switch it to landscape. Any advice as to how I can split the matrix over two lines? \documentclass{article}...
0
votes
1answer
46 views

What do the commands for matrix brackets stand for?

Usually, many TeX commands are abbreviations of some English words. For instance, \hline stands for horizontal line, \frac stands for fraction, \neq stands for not equal, etc. What do the commands for ...
6
votes
3answers
889 views

Why my diagonal dots become 6 dots rather than 3?

\documentclass[12pt,letterpaper]{article} \usepackage[margin=1.1in]{geometry} \usepackage{amsmath} \usepackage{mathdots} \usepackage{amssymb} \usepackage{fancyhdr} \usepackage{pgfplots} \usepackage{...
0
votes
1answer
46 views

How to create a TeXstudio macro to apply “Align Columns” for all matrices I want

How to create a TeXstudio macro to apply "Align Columns" for all matrices I want After learning about about the command Align Columns I immediately fell in love with it and created a ...
0
votes
0answers
37 views

Block diagonal matrix with a large first block

What is the latex code for the following block matrix with a large first block and all other blocks having the same (smaller) size?
0
votes
0answers
27 views

How to change cell colour in Latex [duplicate]

I have this matrix but I would like the second element in the second row to be highlighted, is that possible? I have tired everything!!! this is what I have so far... \begin{bmatrix} 1 & 2 & 3\...

1
2 3 4 5
33