# Tagged Questions

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

19k views

9k views

### “Single ampersand used with wrong catcode” error using tikz matrix in beamer

I am having trouble getting a basic example of a matrix of notes to show up in my beamer presentation. I am using the code copied from the pgf manual. Here is a complete working example. The error I ...
3k views

### use of tikzpicture matrix in align or gather environment

So far I have found using the matrix command in the TikZ package is the only way of drawing a T-shape around the bottom row and middle column of entries in a matrix. I now need to use this matrix in ...
3k views

### Problem with defining shortcuts for TikZ matrices.

For answering a question yesterday I wanted to define a shortcut for creating a matrix inside a tikzpicture. As a minimal example, consider \newcommand\mymatrix[1]{ \begin{tikzpicture} \...
19k views

### What's the best way make an “augmented” coefficient matrix?

When studying systems of linear equations, it's nice to remind people that the last column of the coefficient matrix holds the constants. This is often done in books by putting a vertical line ...
13k views

### bordermatrix with blocks

I need to write a complicated matrix, that has a structure as in the attached picture.
2k views

### Broken matrix - gaps in brackets

This is my minimal working example. \documentclass[12pt,a4paper]{mwrep} %\usepackage{amsfonts} \usepackage{amsmath} %\renewcommand\baselinestretch{1.5} \begin{document} \chapter{Example} \begin{...
5k views

### Array with labeling columns

Is there an intelligent way to label (or name) columns in a matrix? I would like to have something like \[M=\left[\begin{array}{c|cc} 1 & 2 & 3\\ 4 & 5 & 6 \end{array}\right],N=\left[\...
10k views

### TikZ matrix as a replacement for tabular

I would like to use TikZ matrices to for some drawings. I am currently using nodes and positioning them manually to simulate a tabular. That helps in positioning arrows and shading. However, if I ...
31k views

### How can I increase the line spacing in a matrix?

I'm trying to create a pmatrix whose components are rather complicated fractions (Christoffel symbols), and the line spacing is too small making the whole thing a bit cramped and hard to read. Is ...
5k views

### How to create vertical and horizontal dotted lines in a matrix?

Similar to this question, I am trying to output a similar matrix with dotted line instead of dashed line. Is there anyway to do this? I also try to use these three packages: \usepackage{...
1k views

### How to Specify two level row and column labels of a matrix by braces?

I'm trying to write the following matrices. I used the following code (given by Caramdir) \documentclass{article} % Load TikZ \usepackage{tikz} \usetikzlibrary{matrix,decorations.pathreplacing,...
11k views

### How do I label different rows or columns of a matrix using braces?

I have a matrix enclosed in brackets [ ] (or (), or {}, or |'s, or ||'s): - a b c d - | e f g h | | i j k l | - m n o p - which I want to label like so: R |---| -- - a b c d ...
1k views

### Matrix with labels nested in braces

What's the best way to produce a matrix with labels that are nested in braces, like this:
1k views

### Foreach inside a TikZ matrix

Consider this MWE: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture} \matrix [matrix of nodes] { a \\ b \\ c \\ }; \end{tikzpicture} \end{...
8k views

### Using display style fraction in a matrix environment

I'd like use the \dfrac command in a bmatrix environment as follows: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{bmatrix} \dfrac{\partial f}{\partial x} \\ \dfrac{\...
14k views

### Label rows of a matrix by characters

How to add label to index the rows and columns of the matrix ? because I want to number the line outside the matrix \[ \begin{array}{lc} \ Mat_{\varPhi to M} & \left(\begin{array}{@...
89k views

### typesetting column vector

I would like to define a command which typesets a column vector. For one vector I can have something like: \left( \begin{array}{c} a\\ b\\ \end{array} \right) I would like the command to produce ...
929 views

### Compilation problem with tikz diagram

As I said, I'm writing math books for school; one of them is about matrices and I have several problems with it. It's a big code, so I'm trying to summarize it: Problem with TikZ matrix: When I ...
4k views

### Perform matrix operations (addition, product, transpose, etc.) in LaTeX?

I know the calc package can perform infix-notation arithmetic in LaTeX... but I want more! I'd like to perform (not necessarily infix-notation) linear-algebra operations such as scalar ...
4k views

### Draw a line through one column of a matrix

I'd like to "cancel" (draw a line through) a column of a matrix (using \begin{pmatrix}..\end{pmatrix}). How can I do this?
6k views

### Multirow/multicolumn cells in TikZ matrices?

Is it possible to make TikZ matrix cells span multiple rows/columns, like they can in LaTeX tables using \multirow/\multicolumn? Specifically, I'd like to typeset something like the following in a ...
30k views

### How do I left-align entries in a matrix with \begin{matrix}?

I'd like to left align the -1 entry in the following matrix so that the 1s line up. Is there a way to get matrices to ignore signs in that way? \begin{matrix} 1 & 1 \ 1 & -1 \ \...
4k views

### Horizontal row separation line in tikz matrix (like \hline in tabular)

In this question tikz-matrix-as-a-replacement-for-tabular a nice solution was given to let the matrix in tikz behave like tabular. In this solution cell/.style={rectangle} was used to draw lines ...
1k views

### Tikz foreach inside matrix

Apparently this question has been asked a hundred times already. But I couldn't get it to work with any of the answers provided. I want to have nested for loops inside a Tikz matrix. Something like: ...
1k views

### Drawing a large binary matrix as colored grid in TikZ

I have a pretty big binary matrix of maybe 70 rows and 64 columns. For ease of viewing, I would like to draw this matrix in TikZ where e.g. a 1 is represtented by a red square and a 0 is a white ...
22k views

### Diagonal dots spanning multiple lines/columns of a matrix

I'm filling in large sparse matrices, for example \begin{bmatrix} 0 & -2 & 1 & & -1 & 2 \\ 2 & \ddots & \ddots & \ddots & & -1 \\ ...
686 views

### Long dashes for denoting omitted columns of a matrix

Mathematicians would often to like to think of a row of a m by n matrix with entries from a , say, field, as a vector in the n-dimensional vector space over the field. Though I am not a ...
3k views

### Add Overbrace to describe a column of matrix

I want to add some over-braces to a matrix to get the following output: However, this this what I managed to get: I don't know how to get the neuron 1 and neuron 2 headings...I was thinking of ...
1k views

### Obstacles to simulating an amsmath matrix by a TiKZ matrix of math nodes

I'm trying to figure out a TiKZ-based solution to this problem involving arrows between matrix rows. To this end, I would like to at least be able to make a matrix of math nodes simulate the behaviour ...
1k views

### How can I add some enhancement to the matrix [duplicate]

Possible Duplicate: Highlight elements in the matrix \documentclass[12pt,a4paper]{mwrep} \usepackage{amsmath} \usepackage[nodisplayskipstretch]{setspace} \setstretch{1.5} \begin{document} \...
5k views

### Formatting arrows between rows of corresponding matrices

Some material I'm creating requires output that looks like this: (note the position of the arrows). I'm using the following code (with the AMS macros) to generate this, and I'm looking for ...
13k views

### How to create a matrix with 20 columns in latex

The code below works, but when I add 10 more columns, it does not. So, how can I add ten more columns to the matrix below? \documentclass{article} \usepackage{amsmath} \begin{document} \begin{...
862 views

### How does this macro for augmented matrices work?

I've used this code I found somewhere to typeset literally hundreds of augmented matrices, and it's been amazing: \documentclass[a4paper,12pt]{article} \usepackage{amsmath} \usepackage{arydshln} \...
479 views

### Matrix decomposition dimensions diagram

What's the easiest way of making diagrams depicting matrix dimensions such as the following? I can do it with simple subscripts, but I like the visual effect that these diagrams give.
2k views

### Create a block matrix with four quadrants

I want to create a block matrix of this form: But Block A should be a diagonal matrix with 1 on the diagonal, the other blocks should be B, C and D like in the picture. But the size of each block ...
19k views

### Problem putting matrix operations in an equation [duplicate]

Possible Duplicate: Errors in matrix equation? I'm trying to use official equation container for the first time, and it's giving me some trouble. I have this equation of a simple matrix ...
153 views

### Shrinking or splitting some equations in a group of equations

I have a group of equations, such as /begin{gather} Eq1 // Eq2 // Eq3 // Eq4 /end{gather} Unfortunately, some of the equations in the group are too long to fit on the page. For equations that are ...
161k views

### How to add a matrix to a LaTeX document

How do we add a matrix to a LaTeX document?
7k views

### How to typeset block matrices?

I need to typeset a block matrix that is made of a 2X2 structure of blocks such that the (1,1) block and the (2,2) blocks are zero and the (1,2) and the (2,1) blocks are non-zero (and happen to have a ...
8k views

### Matrix change row or column background

I have a matrix shown below. I would like to have the whole row green rather than only the cells ... how can I do that? \label{eq:appendrow} \newcommand\x{\times} \newcommand\y{\...
5k views

### Typesetting a Row Vector

In the question typesetting a column vector, a very nice solution was given for typesetting a column vector with an arbitrary number of rows. I am attempting to modify the code to produce row vectors ...
42k views

### How to have matrices side by side in latex?

I'm new to latex and all of my matrices seem to be created on new lines, I can't seem to put them side by side. Here is what I am doing to make a matrix (with the 2d identity matrix as an example): \...
1k views

### TikZ marking several blocks in a matrix

I would like to mark a few blocks in a matrix and I followed directions from other similar questions but I get a weird TikZ behavior .. seems that I can not have more than one marked block in a matrix?...
3k views

### How to force nodes to have the same size in tikz matrices

Is there some intelligent way to have several tikz nodes have the same height and width? Consider the following example with output below. I'd like every node in each row to have the same height ...
2k views

### How to highlight a single element in a matrix?

I am trying to write out the LU decomposition of a matrix A. I am able to highlight the pivot column with elements below the pivot element except when I get to the last column. Does anyone know how I ...
3k views

### Underbraces in Matrix Divided in Blocks

How to put underbraces, inside the parenthesis of a matrix, to name both sides of the blocks? \documentclass[a4paper,12pt]{article} \usepackage{amsmath} \usepackage{array} \begin{document} . . . \[ \...