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

Solution environment with empty space below it

0  Asked on July 28, 2021 by aroosh

 

Marie Curie template citation style

1  Asked on July 28, 2021 by mikeg

   

Math mode not working

1  Asked on July 28, 2021 by chetan-annam

 

Fill inside a tikz path

1  Asked on July 28, 2021

 

easybmat matrices dotted lines

2  Asked on July 28, 2021 by yori

 

Tikz: Padding in finite automata nodes

0  Asked on July 28, 2021 by nicnajder

     

Big gap between chapter and text

0  Asked on July 28, 2021 by jonas-r

   

Flatfile comma and semicolon hightlight in lstlisting?

1  Asked on July 28, 2021 by petter-stergren

 

Place many TikZ drawings in one page

1  Asked on July 28, 2021 by ildar

   

Help with a header for a cls and tex

1  Asked on July 28, 2021 by nuno-m-silva

     

Ask a Question

Get help from others!

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