# Fill a matrix with multido

TeX - LaTeX Asked by joaopa on December 10, 2020

I would like to fulfill a matrix with multido (because I will have tons of matrices to write). I would like to do something like this but that does not work

documentclass[11pt]{article}
usepackage{amsmath,multido,ifthen}
begin{document}
$$begin{pMatrix}multido{i=1+1}{13}{% multido{I=1+1}{7}{% 1ifthenelse{I<7}{&}{\}}} end{pmatrix}$$
end{document}


If someone has a good idea…

You can use pAutoNiceMatrix of nicematrix to construct whatever matrix you want.

documentclass{article}
usepackage{nicematrix}
usepackage{ifthen}

begin{document}
[pAutoNiceMatrix{13-13}{ifthenelse{arabic{iRow}<arabic{jCol}}{1}{0}}]
end{document}


iRow is the LaTeX counter for the current row and jCol for the current column. They are defined by nicematrix.

Correct answer by F. Pantigny on December 10, 2020

## Related Questions

### Bend the line to make it more beautiful?

1  Asked on January 11, 2021

### 3D PDF figure generation

2  Asked on January 11, 2021 by hrvi

### pdftex.map: fflush() failed

0  Asked on January 11, 2021 by ltas

### How to automatically deduplicate the citation keys in bib file?

1  Asked on January 11, 2021 by farhill

### Arbitray link on pdf viewer sidebar

1  Asked on January 11, 2021

### How to use long radicals to write nested roots?

1  Asked on January 11, 2021

### Need an inverted semicircle as an accent mark over a character

0  Asked on January 11, 2021 by narayanaswami

### Automatic Paragraph Numbers (everypar only for paragraphs and not for section and so on)

2  Asked on January 11, 2021

### Different footers on the pages

0  Asked on January 11, 2021 by dmitry-chupin

### Create a simple “scheme” environment and a “List of Schemes”

3  Asked on January 11, 2021

### Installing LyX: “No textclass is found.”

2  Asked on January 11, 2021 by jjw

### How to center the title, the author, and the date in Tufte handout?

1  Asked on January 11, 2021

### Can someone helps me understanding the following code?

0  Asked on January 11, 2021

### Error: Could not start the command: pdflatex -synctex=1 -interaction=nonstopmode “filename”.tex

2  Asked on January 11, 2021 by muly

### xparse / wrapfigure: intextsep doesn’t affect the output when set inside a NewDocumentEnvironment

1  Asked on January 11, 2021

### Problems with order in crossings tikzcd

1  Asked on January 11, 2021 by smm

### LuaTeX node library: Vertical glue/kern does not work in manually made nodelist, what is missing?

1  Asked on January 11, 2021

0  Asked on January 10, 2021

### Glossary with term, translation, and page number (scrreprt)

1  Asked on January 10, 2021

### How to use arbitrary font in pgfplots?

1  Asked on January 10, 2021 by thev