Run the code in Generator.nb first.

LaTeX output

LaTeXName[v[n_,k_]]:=n<>"_"<>ToString[k]
LaTeXName[v["c",0]]:="c"

The list of simple summands of the multimatrix algebra, with their traces.

evenMatrixAlgebraData=Flatten[Table[{i,j,Length[pathsBetween[evenVertices[[i]],evenVertices[[j]],8]],traceWeight[evenVertices[[i]],evenVertices[[j]]]},{i,1,Length[evenVertices]},{j,1,Length[evenVertices]}],1];

evenMatrixAlgebraStrings="\mathcal{A}_{"<>LaTeXName[evenVertices[[#[[1]]]]]<>","<>LaTeXName[evenVertices[[#[[2]]]]]<>"}"<>" & = \\left(M_{"<>ToString[#[[3]]]<>"\\times"<>ToString[#[[3]]]<>"}, "<>ToString[AlgebraicNumberPolynomial[#[[4]],λ],TeXForm]<>"\\right)"&/@evenMatrixAlgebraData;

StringJoin@@(#[[1]]<>" & "<>#[[2]]<>" \\displaybreak[1] \\\\\n"&/@Partition[evenMatrixAlgebraStrings,2])

oddMatrixAlgebraData=Flatten[Table[{i,j,Length[pathsBetween[oddVertices[[i]],oddVertices[[j]],8]],traceWeight[oddVertices[[i]],oddVertices[[j]]]},{i,1,Length[oddVertices]},{j,1,Length[oddVertices]}],1];

The code produces the content of matrices/matrices.tex.

SetDirectory["~/projects/fusionatlas/articles/constructing/matrices/"]

WriteString ["generated1.tex",StringJoin@@Flatten[Table["$$\\mbox{"<>If[i==j==4,"\\scalebox{0.77}{",""]<>"\\tiny $A_{"<>LaTeXName[evenVertices[[i]]]<>","<>LaTeXName[evenVertices[[j]]]<>"} S_{"<>LaTeXName[evenVertices[[i]]]<>","<>LaTeXName[evenVertices[[j]]]<>"} A_{"<>LaTeXName[evenVertices[[i]]]<>","<>LaTeXName[evenVertices[[j]]]<>"}^{-1} = "<>ToString[(ASAi[evenVertices[[i]],evenVertices[[j]]]/.a_AlgebraicNumber:>AlgebraicNumberPolynomial[a,λ]),TeXForm] <> "$"<>If[i==j==4,"}",""]<>"}$$\n",{i,1,8},{j,1,8}]]
];
Close["generated1.tex"];

WriteString ["generated2.tex",StringJoin@@Flatten[Table["$$\\mbox{\\tiny $A_{"<>LaTeXName[oddVertices[[i]]]<>","<>LaTeXName[oddVertices[[j]]]<>"} \\rho^{1/2}(S)_{"<>LaTeXName[oddVertices[[i]]]<>","<>LaTeXName[oddVertices[[j]]]<>"} A_{"<>LaTeXName[oddVertices[[i]]]<>","<>LaTeXName[oddVertices[[j]]]<>"}^{-1} = d "<>ToString[(twistedASAi[oddVertices[[i]],oddVertices[[j]]]/.a_AlgebraicNumber:>AlgebraicNumberPolynomial[a,λ]),TeXForm] <> "$}$$"<>"\n",{i,1,6},{j,1,If[i<5,6,5]}]]
];
Close["generated2.tex"];

X=twistedASAi[oddVertices[[6]],oddVertices[[6]]]/.a_AlgebraicNumber:>AlgebraicNumberPolynomial[a,λ];

WriteString ["generated3.tex","$$A_{"<>LaTeXName[oddVertices[[6]]]<>","<>LaTeXName[oddVertices[[6]]]<>"} \\rho^{1/2}(S)_{"<>LaTeXName[oddVertices[[6]]]<>","<>LaTeXName[oddVertices[[6]]]<>"} A_{"<>LaTeXName[oddVertices[[6]]]<>","<>LaTeXName[oddVertices[[6]]]<>"}^{-1} = d \\begin{pmatrix} X_{11} & X_{22} \\\\ X_{21} & X_{22} \\end{pmatrix}$$ \n"<>
"$$\\mbox{\\scalebox{0.75}{$X_{11} = "<>ToString[X[[1;;110,1;;110]],TeXForm]<>"$}}$$\n"<>
"$$\\mbox{\\scalebox{0.75}{$X_{12} = "<>ToString[X[[1;;110,111;;220]],TeXForm]<>"$}}$$\n"<>
"$$\\mbox{\\scalebox{0.75}{$X_{21} = "<>ToString[X[[111;;220,1;;110]],TeXForm]<>"$}}$$\n"<>
"$$\\mbox{\\scalebox{0.75}{$X_{22} = "<>ToString[X[[111;;220,111;;220]],TeXForm]<>"$}}$$\n"
];
Close["generated3.tex"];

WriteString["matrices.m",ToString[{Table[(ASAi[evenVertices[[i]],evenVertices[[j]]]/.a_AlgebraicNumber:>AlgebraicNumberPolynomial[a,L]),{i,1,8},{j,1,8}],
Table[(twistedASAi[oddVertices[[i]],oddVertices[[j]]]/.a_AlgebraicNumber:>AlgebraicNumberPolynomial[a,L]),{i,1,6},{j,1,6}]},InputForm]];
Close["matrices.m"];