How can I escape curly braces within the \texttt{}
environment?
\texttt{ \{ }
produces errors within my template, which can be found here: (link)
I saw this question for square braces, but the solution seems like a bit of a hack, and doesn't work for curly braces.
(FYI, the purpose of this is to include a regex statement in monospaced font, among normal font in the rest of a table. If there's a preferable solution, I'm open to ideas there.)
\texttt{This has \{brackets\} in it}
? – cslstr May 29 '14 at 18:37{
(except in typewriter) there is very little reason to ever be using those now. If you use T1 encoded fonts\{
works as shown in Ian's answer – David Carlisle May 29 '14 at 18:45\texttt{\{}
produces errors. That should not produce an error (but may use the wrong font if you use OT1) Please always post a complete document that demonstrates the problem – David Carlisle May 29 '14 at 18:48