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

learn more… | top users | synonyms (1)

7
votes
1answer
1k views

Block matrix equation with dimensioning

I need to write following matrix equation in LaTex. The dotted lines shown need to be present in the structure but need not have colors (could as well be black). I have used it here only to show the ...
7
votes
1answer
700 views

How to label arrows in tikz-cd diagrams with matrices?

I'm using tikz-cd for some commutative diagrams, but if I try to label an arrow with a matrix, & appears to be "undefined control sequence". So all the entries in a row get concatenated, and it ...
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 ...
6
votes
1answer
166 views

Automatic way to match matrix heights

I have a simple matrix equation, but one of the matrices has subscripts and superscripts on both lines: \documentclass{article} \usepackage{lmodern} \usepackage[T1]{fontenc} ...
6
votes
2answers
2k views

Vertically align the tops of matrices in an equation

The following matrix equation looks great: \begin{align*} \overset{A}{\left[\begin{matrix}t_{1}&1\\ \vdots&\vdots\\ t_{n}&1 \end{matrix}\right]} \overset{x}{\left[\begin{matrix} ...
5
votes
1answer
146 views

Labeling the columns of matrices

I am trying to TeX a transition matrix for a Markov process and I want to be consistent with our textbook and label the columns and rows. I found \kbordermatrix and that let me produce: ...
4
votes
1answer
101 views

Getting block matrices to be the same size

I want to produce equations with block matrices \documentclass[a4paper,12pt,titlepage]{article} \usepackage[fleqn]{amsmath} \usepackage[pdftex]{graphicx} \usepackage{blkarray} \usepackage{mathtools} ...
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 ...
11
votes
2answers
450 views

Programmatically setting column style of a matrix in TikZ

I'm trying to programmatically set the style of the columns of a TikZ matrix. My attempt is the following: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} ...
10
votes
2answers
8k views

Matrix in small size

Does anyone have a good idea for an alternative matrix definition with a font size between the standard size used for say pmatrix and the \scriptstyle size used by smallmatrix? I have several vectors ...
8
votes
3answers
212 views

Align matrices problem

I have an equation of matrices and I want to align the dimensions of the matrices below the equation of matrices. However, I produce something very ugly. Can someone advise how to make it look better ...
8
votes
2answers
1k views

Creating straight line in matrix

I need to add some straight lines inside a matrix to indicate labeling of rows, like this: How do I do that?
8
votes
2answers
824 views

Enforcing That \array Stays Square When Drawing Matrix

I'm trying to draw a block matrix in LaTeX, and this is what I have so far: \begin{array}{|c|c|} \hline I_{r \times r} & 0 \\ \hline 0 & 0 \\ \hline \end{array} Here's a ...
8
votes
1answer
1k views

How to cross a row in matrix with a line?

Is there an "easy" way to cross the row in a matrix with a line? I am trying to demonstrate to my students how to type in LaTeX their homework assignment on Boolean function. The below table is used ...
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 ...
7
votes
2answers
179 views

How can I get the explanation borders with pmatrix?

I have asked this question in chat. How can I add the explanation borders to the below matrix? \begin{align*} C_{D_{1\succ 2}, \mathrm{increasing}} &= \underbrace{\begin{pmatrix} 1 & ...
7
votes
2answers
1k views

Position two stacked tikz matrices

I would like to take two TikZ matrix, possibly of different dimensions and stack them. My demo code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} ...
6
votes
1answer
3k views

diagonal line within matrix

I've got simple task - draw block of matrices, when one of the matrices contains diagonal and vertical lines. I am able to make diagonal dotted lines but so far i have not succeeded with solid line. ...
5
votes
2answers
329 views

Matrix color blocks

I am looking to produce a matrix multiplication where one of the matrices consists of coloured blocks. Much like: Is there any way to produce something like this in Latex?
5
votes
1answer
316 views

Array Alignment using TikZ Matrices; cell over a complete row

I want to align subplots in a pgfplot. with \matrix it is easy to align pictures. My problem is, that I need several rows with two columns/pictures and a last row with a picture over both columns. ...
5
votes
1answer
4k views

How to create a matrix with rows and columns labeled (at the right side)?

I would like to create a matrix with rows and columns being labeled. I would like the matrix elements to be right aligned, the row labels being displayed to the right of the matrix, and the column ...
4
votes
1answer
645 views

Problem with \cdashline and package arydshln

I have a problem with \cdashline. I use the \cdashline in a matrix but I have an error with \usepackage{arydshln} I think: ! Use of \x doesn't match its definition. \LT@array ->\adl@arrayinit ...
4
votes
3answers
1k views

Is it possible to draw an n by n grid with text in each cell, with a different background shade/colour in each? (confusion matrix)

I am making a confusion matrix for a document, and I was wondering if LaTeX has the capabilities to handle this. It is essentially a table, but with background shading corresponding to the value in ...
4
votes
1answer
465 views

Row spacing in kbordermatrix

I want to create a matrix with row and column lables (outide matrix delimiters). After a lot of googling, I have found that TeX macro kbordermatrix is best suited for this purpose. Here is my code ...
2
votes
1answer
87 views

Problems with matrix highlighting in two separate equations using hf-tikz

I have the following 2 matrix. If I do that: \documentclass{article} \usepackage{amsmath} \usepackage[usenames,dvipsnames]{xcolor} \newcommand\x{\times} % requires version 0.3 of the package ...
2
votes
1answer
414 views

Underline multicolumns in tikz matrix

In a TikZ matrix, how can I underline multicolumns automatically as follows (esp. when height of one header cell is larger than others): MWE from this question: \documentclass{standalone} ...
1
vote
2answers
124 views

Improving my latex codes for matrices

i want to write my latex code as in the image inserted below. Please can someone help me to improve my code here to let them look like in the image. \begin{multline*} \begin{bmatrix} k_{A,t} \\ ...
10
votes
1answer
3k views

Aligning matrix nodes in tikz

Another question about aligning nodes using matrices in tikz. Consider the following: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture} \matrix ...
9
votes
2answers
21k views

Misplaced alignment tab character when building a matrix

I'm still new to latex. I've been having a problem with building a matrix and I have no idea what I'm doing (or what I'm doing wrong), so be gentle please :) \begin{matrix} 5 & 6 & 7 \\ 4 ...
8
votes
2answers
1k views

How to shorten \hline in a matrix

I indicate blocks in a matrix using \hline: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} \begin{bmatrix} a & b\\ \hline c & d ...
8
votes
1answer
534 views

bracket covering only a part of a matrix

How can I write a matrix, with brackets that cover only rows/columns in a certain range, but still has the right indentation? What I would like: My current solution: \[ \overset{ ...
8
votes
2answers
381 views

Align the length of two nodes inside a matrix

I wanted to create a node with vertical and horizontal parts. So after some searching I found that I can achieve this by using a matrix. I tried the code below: \documentclass{article} ...
8
votes
2answers
3k views

Create a math matrix in TikZ partition lines

I want to draw a math matrix in TikZ, where I can draw helping partition lines. So far I found it pretty simple to just draw a matrix with brackets. \begin{tikzpicture} \matrix [matrix of math ...
7
votes
3answers
187 views

Conditional compilation of code based on package version [duplicate]

I am working on a document with a colleague and we have different versions of PGF/Tikz installed -- I have version 3 and he has version 2.10. This is causing a problem for compilation on our two ...
7
votes
1answer
417 views

Matrix vertical alignment in combination with double spacing

Why does the following code mess up the vertical alignment in the matrices? \documentclass{article} \usepackage{amsmath} \usepackage{setspace} \doublespacing \begin{document} The first case is ...
7
votes
1answer
411 views

Twist a single line matrix in TikZ

I have a single line matrix made with TikZ: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture} \node [matrix,fill=white!20,draw=blue] (my matrix) ...
7
votes
2answers
3k views

How can I put a matrix in a figure caption?

I would like to put a matrix in a figure caption. The following example demonstrates the idea: \documentclass{amsart} \usepackage{graphics, epsfig, psfrag} \begin{document} \begin{figure} ...
6
votes
1answer
916 views

Language support for Icelandic does not exist?

I have been trying for a few days now to get Icelandic characters. I've installed the cm-super font package and I'm using MiKTeX 2.9 on a Windows 8 Lenovo yoga btw. Anyways I've made sure that ...
6
votes
1answer
5k views

Compact block matrix

I'm trying to create a block matrix and surely there are hundreds of question about those already. But most of what I read so far, seems quite hackish in the end. What I have is: ...
6
votes
1answer
291 views

How to model {smallmatrix} with {array}?

It is pretty normal, I guess, to use \begin{array} ... \end{array} to model matrices, when more control is required than you get with pmatrix, bmatrix, etc., with the proper \left and \right, and the ...
6
votes
2answers
152 views

nodes in matrix and its incorporation into document

i continue with my previous post (here) concerning various additions to matrix. I have following problem: how to add nodes into matrix and this whole matrix incorporate into the document ? My task is ...
6
votes
1answer
668 views

Adding nodes and horizontal lines for pmatrix

Yesterday, I posted question concerning solid diagonal line within matrix. But my problem continues, since I am supposed to add into the matrix even the vertical line and labels. Is there a way how to ...
6
votes
1answer
694 views

Problems with a matrix of multipart nodes

Just for fun I wanted to reproduce the memory of Can't get split rectangle to shrink small enough in this TikZ picture using a matrix of nodes avoiding the use of \foreach loops to place nodes. My ...
5
votes
2answers
261 views

Isometric Tables in LaTeX

Can someone please help me with a simple LaTeX code to draw something like the attached picture?
5
votes
1answer
199 views

Trouble creating properly aligned matrix within a matrix

I'm trying to insert parentheses around a group of elements creating a matrix within a larger matrix. So far I have this: \begin{equation} \begin{bmatrix} \begin{matrix} 0 & 0 \\ 0 & \omega_0 ...
5
votes
1answer
2k views

Write elements above and right outside the matrix

I found writing matrix's code is a boring work. There is one, you can see in pic below. Can anybody help?
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?
4
votes
1answer
338 views

Wrong (too much) vertical space above \vdots in small matrix

If one uses \vdots in a smallmatrix-environment the vertical spacing above the dots is too large. It is the same spacing as in a normally sized matrix-environment. Minimal working example: ...
4
votes
3answers
806 views

Writing a formula below a matrix

I have a matrix environment: \begin{bmatrix} ... \end{bmatrix} How can I write below that matrix? I tried with substack, so I wrote \end{bmatrix}_{\substack{...}} That doesn't work as it does ...
4
votes
1answer
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 ...