# Why does \verb take its argument between pipes || rather than braces {}?

Is there something fundamentally different about \verb compared to other commands or is it just a design choice?

• What if you want a verbatim { :-) The use of pipes is not required by \verb, it's just the most common choice. – Joseph Wright Jul 27 '16 at 16:38
• @user2229219: How often do you use | in a document? Oh, not very often, so let's use | for \verb then, because I really don't use it often... – Werner Jul 27 '16 at 16:45
• The text between the pipes (or the character of your election) is not, strictly, an argument of \verb. This macro opens what we could call a "verbatim mode", and the first character sets how to close it. – Javier Bezos Jul 27 '16 at 17:16
• One thing you should be aware of is that the same character used to mark the start must be used to end it. So if you had \verb{foo}, the } would not end your verb, you would have to have \verb{foo{, which would be very bad for code readability. I think you could do this if you wanted though – Au101 Jul 27 '16 at 17:21
• almost everything about \verb is fundamentally different to other commands. – David Carlisle Jul 27 '16 at 19:31

\documentclass{article}
\verb|using a pipe in \verb to get a verbatim $| You can even use a \$ to begin and end your verbatim string:
\verb$Here's a verbatim pipe in braces: {|}$