Don't use the matplotlib printer if matplotlib raises an exception

Fixes #2822.
Use \left [/(/{ \right ]/)/} for latex of lists, tuples and dicts

This makes them still work with the matplotlib.mathtext renderer, which
doesn't support matrices.
Fix latex doctests
Merge pull request #7707 from asmeurer/matplotlib_warning

Fix the matplotlib warnings