matrix by matrix in R markdown
Three minor corrections should be sufficient to make this work for both, HTML and PDF output: remove the backslash before the closing bracket in \right\) delete the empty line in the middle specify the column alignment in each array environment, e.g., with \begin{array}{cc} –