use $|$ and it the document compiles successfully & it is the best way to type pipe symbol in TeX or Latex.