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

learn more… | top users | synonyms (1)

41
votes
8answers
9k views

Highlight elements in the matrix

I have a matrix and need to highlight some elements in the matrix. I have found how to highlight a single element (I want to put the cell in the square): $$ A = \begin{bmatrix} \fbox{0} & ...
14
votes
3answers
8k views

Where is the \matrix command?

From what I can see, \matrix was a TeX command, but I cannot seem to find documentation on it. It works in MathJax, so I wonder if it can be used in LaTeX. ie this is valid MathJax: $$ \left[ ...
27
votes
2answers
5k views

Unknown error using tikz matrix of nodes 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 ...
8
votes
3answers
1k 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 ...
12
votes
2answers
2k 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} ...
38
votes
5answers
7k 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 ...
24
votes
1answer
5k 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 ...
27
votes
4answers
4k 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} \\ ...
16
votes
5answers
8k views

bordermatrix with blocks

I need to write a complicated matrix, that has a structure as in the attached picture.
19
votes
3answers
953 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:
24
votes
5answers
34k 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 ...
17
votes
3answers
4k 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 ...
12
votes
3answers
3k 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 ...
12
votes
2answers
2k 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 ...
19
votes
1answer
3k 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} ...
10
votes
1answer
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} ...
26
votes
2answers
14k 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 ...
14
votes
4answers
7k 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 \\ ...
5
votes
2answers
832 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} ...
36
votes
5answers
2k 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 ...
22
votes
5answers
8k 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 ...
15
votes
5answers
845 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 ...
4
votes
1answer
802 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} ...
12
votes
6answers
2k 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 ...
9
votes
2answers
1k 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} ...
5
votes
2answers
1k 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} . . . \[ ...
10
votes
3answers
561 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: ...
21
votes
3answers
10k 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 \ ...
12
votes
2answers
387 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 ...
6
votes
4answers
804 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 ...
56
votes
5answers
90k views

How to add a matrix to a LaTeX document

How do we add a matrix to a LaTeX document?
16
votes
3answers
2k 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 ...
9
votes
2answers
852 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 ...
13
votes
4answers
2k 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?
10
votes
3answers
2k views

Look for a bigger delimiter than \Bigg

\documentclass{article} \usepackage{amsmath} \begin{document} \[\left. \begin{vmatrix} a_{11}&a_{12}&a_{13}\\ a_{21}&a_{22}&a_{23}\\ a_{31}&a_{32}&a_{33} ...
9
votes
3answers
1k 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 ...
9
votes
1answer
542 views

Heatmap of a triangular matrix (or a sparse matrix)

So let me first of all shamelessly steal heatmap code from this answer to Drawing heatmaps using TikZ \documentclass{standalone} \usepackage{colortbl} \usepackage{pgfplots} \usepackage{pgfplotstable} ...
8
votes
3answers
15k 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): ...
0
votes
1answer
200 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 ...
5
votes
1answer
130 views

Strech the text to the borders of a node by using \hfill

The text inside the nodes is not streched to the right side of the node by using \hfill. Could it be the reason that it doesn't work with font=\tiny? But I need the text that small and I would like ...
3
votes
1answer
89 views

Highlighting in tabular environment

I am trying highlight a row of matrices in a tabular environment. However, the left brackets of the matrices are gone. And I don't know how to fix this. In addition, how can I highlight 2 elements ...
17
votes
1answer
2k views

TikZ two-blocks matrix

I would like to get a plot like the one I sketched below, basically two blocks of the same matrix with arrows going up and anti-diagonally for the red block and arrows going up for the green one. The ...
14
votes
1answer
6k 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 ...
11
votes
1answer
663 views

Correct delimiter height in TikZ

When using the left delimiter and right delimiter options, I am having the problem that their height is not equal to the node they are surrounding. Here is an example: \documentclass{article} ...
9
votes
2answers
13k views

3 dots in matrix

I was wondering if anyone knew how to draw 3 dots in a matrix that go in a diagonal way usually to represent that element flow similarily in the slots. I know there's one that goes in the bottom right ...
13
votes
1answer
3k views

matrix in a matrix

I would like to draw a matrix with top left, top right, bottom left and bottom right blocks. The top left should be a 3x3 matrix with numerical entries, the top right is 0, the bottom left is 0 and ...
8
votes
1answer
240 views

Formatting an array of complex numbers with pgfplotstable

Say I have two csv files representing the real and imaginary part of a complex matrix. I would like to nicely display this matrix in LaTeX. The difficulty is to correctly round numbers and not ...
11
votes
2answers
530 views

How can I add clips above matrix?

\documentclass{mwrep} \usepackage{kbordermatrix} \usepackage{amsmath} \begin{document} \begin{equation} \bar{P}= \kbordermatrix{ \mathrm{state} & 1 & 2 & 4 & 3 & 6 & ...
4
votes
2answers
4k views

Cannot insert multirow within multicolumn

I want to make a matrix that incorporates both multirow and multicolumn. However the code doesn't work. Sorry if the question is stupid, I am playing with matrices the whole day and probably I am ...
21
votes
2answers
6k views

Upper triangular matrix with big zero in lower triangular?

I can represent an upper trapezoidal matrix say as shown below. I would like to replace all those zeros with a single big zero that spans across the low triangle rows and columns, and maybe also add a ...