How to print elements of a matrix in LaTeX formatting?

homocomputeris
Thu, 07 Mar 2024 16:30:54 +0000
General Usage

Given a matrix

A = [[182740835762038560236502360265029360346025236045;;
 2];
[328470287402983460892460286408129634;;
 4]]

I’d like to get LaTeX-formatted output, one element per line, e.g.:

latexprint(A)

A_{1,1} = 182740835762038560236502360265029360346025236045
...
A_{2,2} = 4

Is there a package to do this?

If not, how do I:

Substitute the variable name A into a string?

Get all the Cartesian indices for the matrix and interpolate the string with them? eachindex() is 1:4 in this case, which is not very convenient.

5 posts - 3 participants