BUG: LatexFormatter.write_result multi-index
Supersedes #17499 
Closes #14484

Had to create a new PR because #17499 doesn't seem like it allows edits from maintainers (got denied when trying to push the remote).

cc @MxKy