AnswerBun.com

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…

One Answer

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.

Output of the above code

Correct answer by F. Pantigny on December 10, 2020

Add your own answers!

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

     

Need an inverted semicircle as an accent mark over a character

0  Asked on January 11, 2021 by narayanaswami

   

Different footers on the pages

0  Asked on January 11, 2021 by dmitry-chupin

 

Installing LyX: “No textclass is found.”

2  Asked on January 11, 2021 by jjw

 

Problems with order in crossings tikzcd

1  Asked on January 11, 2021 by smm

 

How to use arbitrary font in pgfplots?

1  Asked on January 10, 2021 by thev

     

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP