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

learn more… | top users | synonyms (1)

17
votes
3answers
13k 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[ ...
1
vote
0answers
215 views

How to use tikz matrix in a LaTeX command? [duplicate]

Possible Duplicate: Problem with defining shortcuts for TikZ matrices. I tried to use a tikz Matrix in a LaTeX document as the following: \documentclass{article} \usepackage{tikz} ...
2
votes
1answer
472 views

Automatically shrinking a matrix

I'm wondering about a way to automatically shrink down a matrix. I can think of \arraycolsep command for the column width but I am not aware of an equivalent command for the height of the lines? ...
4
votes
1answer
1k views

Some problems drawing linked lists with TikZ's matrix library

Some time ago I found the question Draw an adjacency-list representation of a graph with tikz and wanted to solve it. I could but with some problems which still remain and How should I draw a ...
5
votes
1answer
8k views

How to properly resize a matrix?

Apparently text is resized in one way and math in other way. However, the commands to resize math do not work well on a matrix; it appears barely smaller and unexpectedly shifted down. The commands to ...
6
votes
3answers
798 views

Specific blockmatrices

I would like to put some block matrices in LaTeX: in the end they should look like this; The first matrix that I need looks like this, sorry I know it does not look very clear this way (for a better ...
1
vote
2answers
3k views

Can you put two matrices in display mode side by side in LyX?

I have two matrices, and I want to render them side by side with appropriate space in between in display mode. How should it be implemented in LyX?
9
votes
2answers
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} ...
6
votes
1answer
4k views

strategy / payoff matrix

I am trying to create a strategy matrix in LaTeX such as Any suggestion would be greatly appreciated. I would like there to be two values in each cell, aligned as in this diagram.
12
votes
1answer
856 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} ...
3
votes
1answer
3k views

multirow in tikz matrix

I am trying to insert a multirow in a tikz matrix with a grid, so: \documentclass{amsart} \usepackage{tikz} \usetikzlibrary{matrix,fit} \begin{document} \begin{tikzpicture} \matrix (table) [% ...
12
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} ...
1
vote
1answer
420 views

separate matrix equation

I want to separate my matric because its over the column size like patter below. from Vm(q,qdot) = [matrix] to Vm(q,qdot) and not \begin{equation} \label{eq6} \begin{array}{c} V_m (\bf {q}, ...
2
votes
2answers
544 views

Changing column separation in smallmatrix environment

How can I change the width of the space between columns in a smallmatrix environment? I can't find any decent documentation on smallmatrix anywhere. The array environment has the setcolsep{..} ...
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 ...
7
votes
3answers
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 ...
12
votes
4answers
8k 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.
14
votes
2answers
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 ...
3
votes
1answer
1k 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 ...
7
votes
2answers
314 views

Objects that are bigger than others inside a matrix

I wonder, if possible, how to create a matrix that looks like this:
31
votes
4answers
6k 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} \\ ...
2
votes
1answer
790 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 ...
3
votes
1answer
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 ...
25
votes
1answer
7k 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 ...
5
votes
2answers
6k 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] ...
2
votes
1answer
280 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 ...
2
votes
1answer
1k 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\\ ...
5
votes
2answers
396 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? ...
8
votes
1answer
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 ...
8
votes
1answer
526 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 ...
7
votes
2answers
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} ...
5
votes
1answer
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.
6
votes
2answers
5k 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 ...
7
votes
1answer
1k 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 ...
0
votes
2answers
1k 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 ...
37
votes
2answers
7k 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 ...
29
votes
2answers
22k 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 ...
4
votes
2answers
844 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} ...
4
votes
2answers
5k 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 ...
3
votes
2answers
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 ...
0
votes
0answers
322 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 ...
5
votes
3answers
3k 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?
2
votes
1answer
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 ...
18
votes
5answers
11k views

bordermatrix with blocks

I need to write a complicated matrix, that has a structure as in the attached picture.
11
votes
3answers
28k 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): ...
8
votes
3answers
3k 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 ...
6
votes
2answers
3k 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} ...
5
votes
3answers
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 ...
7
votes
2answers
989 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 ...
6
votes
3answers
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.