I'm writing a latex document and am using lots of examples of matrices where every entry is \ast
. I'd like to write a macro that automatically makes such a matrix for me. So, this would look something like
\newcommand{\myAsteriskMatrix}[2]{magic}
where the two inputs would be the number of rows and the number of columns.
I happen to be using the nicematrix
package, so a typical matrix looks something like this:
\documentclass{standalone}
\usepackage{nicematrix}
\begin{document}
$
\begin{bNiceMatrix}[r]
\ast & \ast & \ast \\
\ast & \ast & \ast
\end{bNiceMatrix}
$
\end{document}
This matrix could be generated by \myAsteriskMatrix{2}{3}
, but I can't figure out how to write this macro! Any ideas?
\documentclass
and the appropriate packages that sets up the problem.