0

The code

\texttt{ \{k\!,0\!,dim\} }

and

\begin{alltt} \{k\!,0\!,dim\} \end{alltt}

both produce a PDF in which copying that text and pasting it elsewhere (such as a text editor or Mathematica or internet browser) produces fk, 0, dimg. This is incredibly disadvantagous when you have a larger amount of code to be copied somewhere. How can I remedy this problem?

Minimal working example:

\documentclass[10pt,reqno]{amsart}
\usepackage{amssymb,alltt}
\begin{document}
\begin{alltt} \{k\!,0\!,dim\} \end{alltt}
\end{document} 
1
  • Instead of \texttt or alltt, could you try \verb+ ... +, where the paired + can be any character that isn't in the verbatim string. (I'm not able to test just now.) Feb 29, 2020 at 1:50

1 Answer 1

2

Use T1-encoding. With the default OT1 the braces are taken from the math font:

\documentclass[10pt,reqno]{amsart}
\usepackage[T1]{fontenc}
\usepackage{amssymb,alltt}
\begin{document}
\begin{alltt} \{k\!,0\!,dim\} \end{alltt}
\end{document} 

with T1:

enter image description here

with OT1:

enter image description here

1
  • It works, thank you!
    – Leo
    Feb 29, 2020 at 16:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .