Matrix multiplication with LaTeX

Alexx Hardt asked on TeX.SX:

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):

Matrix multiplication

I guess this will be quite a bit of work, but is there another way than using the eepic package? I have read into some examples and the manual, and it seems very complex to generate a graphic like this with that package.

If there is no other way, I’ll have to use eepic, but I hope someone here could point me to a package or another way.


I recommend to use TikZ and its matrix library, specifically the matrix of math nodes feature. TikZ offers a great and comprehensive manual.

Have a look at this example and its source code, written by Alain Matthes, in the TikZ example gallery: Matrix multiplication. It deals exactly with your subject.

Matrix multiplication example
Stefan Kottwitz

18. April 2011 by stefan
Categories: Mathematics, Questions & Answers, TeX.SX | Leave a comment

Leave a Reply

Required fields are marked *