Hello everyone,
I'm am looking to typeset a particular matrix, but I haven't got any good ideas on how to start with this. The matrix is the following:
Any help would be greatly appreciated, thanks in advance!
Math & Science ⇒ Typesetting a complex Matrix
Typesetting a complex Matrix
Last edited by whordijk on Tue Oct 18, 2011 10:07 pm, edited 2 times in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Typesetting a complex Matrix
I would not do that with a common environment like array and additional packages because the final result would not be satisfactory. The pgf/tikZ offers some structures that let you do such a matrix.
The above example embeds the matrix into a math environment just to show that this is possible.
Best regards and welcome to the board
Thorsten
Code: Select all
\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{calc,fit,matrix}
\begin{document}
\begin{equation}
\begin{tikzpicture}[baseline={($(current bounding box.center)-(0,0.75ex)$)}]
\matrix (example) [%
matrix of math nodes,
nodes in empty cells,
left delimiter=(,
right delimiter=),
nodes={anchor=center,minimum size=2em}
] {%
& |[draw]|I_{2^0} & & & & & & \\
& & & & & & & \\
& & & |[draw]|I_{2^0} & & & & \\
& & & & & & & \\
& & & & & |[draw]|I_{2^0} & & \\
& & & & & & & \\
& & & & & & & |[draw]|I_{2^0} \\
& & & & & & & \\
};
\node[draw,inner sep=0pt,fit=(example-1-3) (example-2-4)] {$I_{2^1}$};
\node[draw,inner sep=0pt,fit=(example-1-5) (example-4-8)] {$I_{2^2}$}; % produces warning about "Underfull hbox"
\node[draw,inner sep=0pt,fit=(example-5-7) (example-6-8)] {$I_{2^1}$};
\end{tikzpicture}
\end{equation}
\end{document}
Best regards and welcome to the board
Thorsten
- Attachments
-
- The output as produced by the given example.
- tikZ-special-matrix.png (7.41 KiB) Viewed 2843 times
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Typesetting a complex Matrix
Oh, wow: that's awesome! Thanks a lot localghost, much appreciated!