0

Angle brackets < and > in \texttt render as inverted exclamation mark and inverted question mark (spanish punctuation marks):

\documentclass{article}
\usepackage{beramono}
\begin{document}
\texttt{<>}
\end{document}

The above document renders the < and > characters as:

enter image description here

How do I fix this?

5

The Bera Mono fonts are not available in OT1 encoding, but only in T1; if you want to use them for typewriter type, you need \usepackage[T1]{fontenc}.

This should be clear from the shown warnings

LaTeX Font Warning: Font shape `OT1/fvm/m/n' undefined
(Font)              using `OT1/cmr/m/n' instead on input line 4.

Correct example

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{beramono}
\begin{document}
\texttt{<>}
\end{document}

enter image description here

  • I wanted to avoid T1 font encoding, because I thought it messed up copy-paste from the PDFs. After testing your answer, copy-paste (and the brackets) both seem to work fine, so my former issues must have been caused by something else. – Georges Dupéron Feb 10 '16 at 17:29
0

Short answer: You have to also use the package lmodern:

\documentclass{article}
\usepackage{beramono}
\usepackage{lmodern}
\begin{document}
\texttt{<>}
\end{document}

See Why do the less than symbol (<) and the greater than symbol (>) appear wrong as upside down exclamation (¡) or question mark (¿)? and "Greater than" sign shows up as inverted question mark for more details.

  • Well, you don't get Bera Mono as the typewriter font. – egreg Feb 10 '16 at 16:59

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.