use \vert instead of \mid
a post to answer a question from email (I think this "old topic" must have been covered in the class; I'm posting it anyway)