Implement a doctest_globalcleanup string

Refs #9595
Use latex preview package to vertically align equations correctly.

Refs #9595
Merge remote-tracking branch 'origin/feature/9595_global_doctest_cleanup'