20141117 fix tex visualization, start adding smarter logic