Question: how to write nxn matrix in latex?
Answer: Enter math mode by using \[, and then go up to Insert on the tool bar. Click it and then select Matrix (n x m). LATEX will offer you a box where you can give the dimensions. If you then press OK, it will immediately write down the matrix with a * to mark each entry you need to write.