In latex, you can type \verb|{|
and get a real brace in a typewriter font. But if you type {\tt \{ }
, you get a sans-serif replacement. In code:
\verb|{| % nice, real brace.
{\tt \{ } % hideous fake brace.
LaTeX Font Warning: Font shape `OMS/lmtt/m/n' undefined
(Font) using `OMS/cmsy/m/n' instead
(Font) for symbol `textbraceleft' on input line 3.
How do you get the real, monospaced brace in a tt
environment? (I can't just nest verb
, because I need to change its color as well.)
Use the T1 font encoding with
\usepackage[T1]{fontenc}
You can try {\tt {\char '173}}
:
\newcommand{\lcb}{{\tt {\char '173}}}
See this. Seems to work for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With