# Tagged Questions

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

2k views

### How to make a newcommand producing a matrix

I would like to do something like this \newcommand{\pmat}[1][2][3][4]{\begin{pmatrix} #1 & #2 \\ #3 & #4\end{pmatrix}} But this produces the error ERROR: LaTeX Error: Missing \begin{...
11k views

### How to construct a confusion matrix in LaTeX?

A confusion matrix looks like: Is there an easy way to do the same using LaTeX? Otherwise I could just create a diagram with any software.
2k views

### Using brackets as delimiters for matrix in TikZ-PGF Matrix Library

The TikZ-PGF manual is clear that for the matrix library, the delimiters are parentheses and braces: Delimiters are parentheses or braces to the left and right of a formula or a matrix. I ...
2k views

### Writing Gauss-Jordan Transformation Matrix

I am having trouble writing procedure for Gauss-Jordan transformation matrix in LaTeX. I want to write something like r2 - r1 r3-2r1 [A|I] -------> [A'|I'] -----> and so on ...
321 views

### Objects that are bigger than others inside a matrix

I wonder, if possible, how to create a matrix that looks like this:
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{\...
922 views

### From LaTeX to reST

While using reST (restructuredtext) to produce some mathematical documents I could not find documentation regarding multidimensional matrices. How do you create matrices in reST? Is there is a quick,...
2k views

### Vertical align in tikz matrix

\documentclass[a4paper,12pt]{report} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \begin{center} \begin{tikzpicture} \tikzset{square matrix/.style={ matrix of nodes, column ...
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 ...
7k views

### tikz: control text size and location

I am trying to create flowchart, using tikz: \begin{document} \tikzstyle{decision} = [diamond, draw, fill=blue!20, minimum size=2em, text badly centered, node distance=2.5cm, inner sep=0pt] \...
298 views

### Vertically asymmetric matrices

I am noticing an odd problem with LaTeX that causes matrices and arrays that I compile to have a whitespace gap at the top of the array. When I use the same code as others online, I produce different ...
2k views

### Aligning bmatrix-matrices next to each other?

I have this code: \[ \begin{bmatrix} Pagerank&Sidnummer\\ 0.068945&2\\ 0.068945&3\\ 0.076517&1\\ 0.076517&4\\ 0.11536&7\\ 0.11536&8\\ 0....
431 views

### Matrix doesn't shrink when put in fraction.

This is my minimal example, the problem is the different size of the two x. I would expect the matrix to be shrunken too, but it isn't. Why is this and how is it corrected? \documentclass[a4paper,...
1k views

### How can I draw a diagram for matrix multiplication with LaTeX?

I'm trying to make a PDF manual for matrix multiplication with LaTeX. I'd like to generate a graphic similar to this one (from Wikipedia/Matrix multiplication): I guess this will be quite a bit of ...
572 views

### Intersections with border of matrix node

Consider the following code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix,intersections,calc} \begin{document} \begin{tikzpicture} \matrix (m) [matrix of math nodes,row sep={...
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,...
1k views

### Writing Some Special Matrices in LaTeX

I've to write the following matrices in LaTex. Any help in this regard will be highly appreciated.
6k views

### Label matrix dimensions

I have a matrix equation like Ax=b I'd like to include the dimensions under each, like so \underset{p\times k}{A} \underset{k\times 1}{x} = \underset{p\times 1}{b} The problem is that this is ...
2k views

### Centering xymatrix in equation environment

The xymatrix diagram does not seem to vertically align when grouped in an equation environment. For example, this code produces the following image (which seems to place the xymatrix 2.5em lower than ...
2k views

### Double square bracket

I need to have 2 square bracket matrix on the same equation line. I'm able to do just for a single square bracket matrix (for \xi) with below \xi = \left[ \begin{array}{c} \xi^1 \\ \vdots \\...
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 ...
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 ...
913 views

### Problem with \bordermatrix inside array

When a \bordermatrix is placed inside an array, the spacing between rows will be wrong (see the MWE below). What is causing this problem? Is there a solution? \documentclass{book} \begin{document} ...
6k 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 ...
1k views

### Weird error with xymatrix and pmatrix.

Please look at the following minimal example: \documentclass{article} \usepackage[all]{xy} \begin{document} $$\xymatrix{ \begin{pmatrix} 1 & 1\end{pmatrix} }$$ \end{document} The output I get ...
325 views

### Matrix with labels [duplicate]

Possible Duplicate: bordermatrix with blocks I'm attempting to copy the matrix on this page: http://tiny.cc/ipliw with the labels outside the matrix. I can make the matrix (given below) but I ...
4k views

### How do I typeset vertical and horizontal lines inside a matrix?

(From the notation used in course notes for Stanford CS229 available online.) I'm trying to typeset the following matrices made up of row or column vectors: Any ideas?
1k views

### Putting a rectangle around matrix nodes?

I built up a simple UML diagram, where one of the class boxes has an union containing a number of elements. I want to show that those elements are part of an union. But how can I do so with tikz? I ...
13k views

### bordermatrix with blocks

I need to write a complicated matrix, that has a structure as in the attached picture.
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): \...
4k views

### How to draw a separator between the columns of a matrix.

Is there a simple way to tell TikZ that I want a vertical line to separate the columns of a matrix? I know how to draw them manually, I am looking for an automatic solution, maybe using styles or ...
5k views

### Putting a tabular in a node within a matrix

I have a picture in which each of the nodes looks something like this: \node (species1) [shape=rectangle,draw] { \begin{tabular}{c c c} \multicolumn{3}{c}{{Species 1}} \\ \colorbox{red}{G1a} &...
3k views

### Submatrix in LaTeX

I would like to create something like this: i ( ) ( ) (______ ) j( | ) ( | ) The matrix including its submatrix can be created by using ...
1k views

### Positive and Negative power in matrices and fixed size

I'd like to create a matrix that has some positive power and negative power. I'd like to have an alignment to right, so for example: \begin{array}{rr} 3 \times 10^3 & 2 \times 10^3 \\ 3 \...
2k views

### Plot a matrix of real values with TikZ/PGF like imshow in matlab

How can I plot a matrix of real values with TikZ/PGF such that it looks like plotted with imshow in MATLAB? \addplot3 does something similar, but I'd like to have that in a color-coded 2D plot.
8k views

### Smaller matrices (or other math elements) in displayed math

I'm trying to find The Right Way to make a smaller matrix (but not a smallmatrix) along the following lines. Example: Consider the following piece of LaTeX code: % \usepackage{amsmath} in the pre-...
724 views

### aligning columns at decimal point in TikZ matrices

Is there a way to align numbers in a TikZ matrix at the decimal points, as is possible in normal tables (Aligning numbers by decimal points in table columns)? http://www.texample.net/tikz/builds/ ...
2k views

### TikZ: How to rotate a matrix (of nodes)?

Please consider the following TikZ code: % aligning text in node: node[align=left] only in latest 2010 tikz: % http://compgroups.net/comp.text.tex/-tikz-option-for-ragged-left-text-in-node % or use ...
4k views

### Two matrices side by side

I'm trying to typeset two matrices side by side, somewhat like: A = (matrix) B = (matrix) I tried to next the matrices inside an align environment: \begin{align*} A &= \begin{pmatrix} ... ...
1k views

### How to make tikz center the cells of a matrix?

I want to construct complicated things in tikz matrices (but don't we all), and when I'm done, I want the rows and columns of the matrix to align along the centers of these complicated things. Here ...
2k views

### Same height for list of comma-separated vectors

I am trying to typeset a list of vectors spanning a multidimensional space, using the notation span{v_1,v_2,...,v_n} (I haven't found out how to inline it as rendered latex) i.e.: span \{ \begin{...
1k views

### symmetric matrices

What are your solutions to properly place the shortcut 'sym' in symmetric matrices? \documentclass{book} \usepackage{amsmath} \begin{document} \begin{bmatrix}u,_1+x_3\theta_2,_1-x_2\...
3k views

### vertically aligning vectors and matrices

What are your techniques to make what's below look better? Thanks. \documentclass{article} \usepackage{amsmath} \newcommand{\ud}{\mathop{\mathrm{{}d}}\mathopen{}} \begin{document} \...
2k views

### How to get TikZ nodes not to change alignment?

I'm still working on rendering a nice block matrix. I've been using BMAT but it is irrelevant for the question at hand. I want to connect various entries in an array/matrix/BMAT by lines, and I'm ...
342 views

### using easybmat and tikz packages together?

In continuation to this question, I was looking for a way to add nice diagonal lines inside a BMAT matrix to express a band structure of the matrix. However, a LaTeX file with both TikZ and easybmat ...
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 ...
590 views

### In TikZ, is it possible to nest matrices?

This is similar to this question, but not quite the same thing. I want to make a matrix of graphs that are all relatively the same, and I made the graphs using the matrix construct. [By the way, did ...
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 ...