Linked Questions

12
votes
2answers
2k views

Tikz foreach inside matrix

Apparently this question has been asked a hundred times already. But I couldn't get it to work with any of the answers provided. I want to have nested for loops inside a Tikz matrix. Something like: ...
2
votes
2answers
2k views

How do I draw the following matrix in LaTeX?

I want to draw the following matrix in LaTeX: I found that I should use the TikZ package, and I have spent a lot of time looking at the package. However, I have no experience of using the package ...
7
votes
2answers
1k views

Nested foreach inside a TikZ matrix for both rows and columns

I'm trying to create a matrix using nested \foreach loops. I tried following the example I found in a previous question, but I keep getting errors. Here is the code I tried to run: \documentclass{...
6
votes
2answers
1k views

Foreach loop with command inside Tikz matrix

This question is directly related to Foreach inside a TikZ matrix. But I can't expand it with a macro inside, such that: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \usepackage{...
4
votes
2answers
621 views

Using pgffor's \foreach to place graphics into a tabular

I want to arrange EPS graphics (included via \includegraphics) in a tabular using \foreach. Currently this is done without any loops like this: \begin{tabular}{*5{>{\centering\arraybackslash}m{.15\...
3
votes
1answer
1k views

How to insert N images using TikZ's \foreach?

I'd like to avoid having to copy & paste the same code 50 times in my input file, so I'm trying to use the automation offered by TikZ's \foreach. I do not know why this code generates 101 errors. ...
7
votes
1answer
730 views

Is there a way to use pgffor to build the rows for a tabular environment?

I was trying to build a tabular environment that is auto-generated through the use of pgffor's \foreach macro. But I can't seem to get it right. Here's a MWE for generating a multiplication table: \...
3
votes
2answers
607 views

tikz square box array side by side alignment

I wish to draw square box array side by side, but my code below still has gap between square box. My math is wrong? \documentclass[border=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{shapes....
2
votes
1answer
650 views

Automated table for excercise points in tikz

I'm a computer science student. And I write most of my excercises in LaTeX. So I often have to create a table for excercise points, with different numbers of excercises and different amounts of points ...
2
votes
3answers
71 views

Code generated by \xappto is not usable when generated from within \foreach

The objective is to generate rows of a TikZ matrix from a string. In the example below, \drawpodpair{NAME:TYPE}{SCOPE} produces a matrix row. I want to call \foreach over a string of the form N1:T1,...
0
votes
1answer
125 views

Matrix node inside foreach loop give error when multiple columns

This question is different from \foreach inside \matrix questions 1 and 2. I was trying to do this question 3dmatrix. The \matrix command, when put inside \foreach gives the following error when ...
0
votes
0answers
54 views

Expand Tikz matrix with foreach statement?

I am playing with Tikz matrices and would like to use the foreach statement to "expand a matrix". More precisely, I wonder if I can use a foreach statement such as: \n in {Alice (the genious), Bob, ...