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 W开发者_运维知识库arning: 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.
精彩评论