In a previous question was answered how to escape curly braces within \texttt{}
. On answer suggest using the fontenc
package.
\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\(a + \underbrace{\mbox{\tt\{c\}}}_d\)
\end{document}
Another answer suggest using \string{
. However, in this case I got an error. Sorry, I do not get why it was raising an error. Example bellow works fine.
\documentclass{article}
\begin{document}
\(a + \underbrace{\mbox{\tt\string{c\string}}}_d\)
\end{document}
I now that in this case fontenc
solves the problem. Thus, my question is how can I this without using fontenc
. I do not see problems with fontenc
is only curiosity.
fontenc
for it. Do you want to write it to some file? – user31729 Oct 7 '14 at 14:28\texttt\string
the argument to\texttt
is\string
which will then generate an error. You don't need\mbox
around\texttt
so what do you want that is different to\underbrace{\texttt{\{c\}}}}
– David Carlisle Oct 7 '14 at 14:33fontenc
but without using it. – Daniel Hernández Oct 7 '14 at 14:35