Can I put the variable name here programmatically?
Julia warns one should use eachindex and the like, but I doubt I will ever need to print offset arrays. However, the disadvantage is that I can’t print arbitrary Nd-arrays like this.
Not with a function. You do could do it with a macro, e.g. you could write a macro:
macro latexprint(A)
:(latexprint(A, $(string(A))))
end
function latexprint(A, name)
for i in CartesianIndices(A)
println(name, "_{", join(Tuple(i),','), "} = ", A[i])
end
end