Transform LaTeX style matrices into Wolfram style matrices