Latex fix

By our powers combined, here is a proposed fix for Issue #418 
@grosu especially, but also everybody else: please check pdf output and suggest improvements.

@dwightguth please review