texMatrix = (m) => {
const mt = math.transpose(m)
const values = mt.valueOf()
const string = values.map((row) => {
return row.map((d) => (Math.round(d * 1000000) / 1000000).toFixed(6)).join(' & ')
}).join(" \\\\ ")
const s = `\\left[\\begin{matrix}
${string}
\\end{matrix}\\right]`
const ss = s.replace('/\/\g', '\\')
return ss
}