When I copy-paste curly brackets (aka braces) from \texttt{} mode, they are interpreted as f and g. What can I do to get proper curly brackets? I tried to use \string but this seems not to allow to be split across multple line

Here is my minimal working example



Compiles but gives "f g"-problem:

Compiles and gives proper curly brackets, but I need three lines not one:
\texttt{\string{ something \string}}

Does not compile:
\texttt{\string{ \\
 something \\

  • This is what I get when I compile your code... no f g-problem. – Werner Jul 11 '17 at 19:48
  • The same as I do. And when I copy and paste from the generated pdf, they are correct. – gusbrs Jul 11 '17 at 19:48
  • 3
    Try adding \usepackage[T1]{fontenc}, but I can't reproduce the issue. What TeX distribution and operating system are you running? – egreg Jul 11 '17 at 19:50
  • 1
    you want \usepackage[T1]{fontenc} so that \{ uses the ascii { slot – David Carlisle Jul 11 '17 at 19:51

I can't reproduce the issue; on the other hand, if you want to get the braces in the monospaced font you can either load


or input them as




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.