In LaTeX, if I use \verb, how can I escape |? For example, I want to display ab|bc: \verb|ab[]bc|. What should replace []?


you can choose any symbol as a delimiter for the verb argument, except the *, it is reserved for \verb*=a b= (\textvisiblespace)

enter image description here

  • I chose "!". Bad choice... There may be more characters which cause errors. – Blaf May 17 '18 at 8:23
  • Sure, it depends to the setting of active characters, like the one from Babel and German language, foe example. – user2478 May 17 '18 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.