I have the following piece of text in Latex: \texttt{List<List<Integer>>}
and it was rendering properly. Then, I decided to use beramono as my typewriter font, and I have a problem: >> is now rendered as a » character. How should I fix it? In a listing environment, >> is shown correctly.
1 Answer
The >>
is transformed into a ligature, which can be really beautiful for quotes. In this case you will have to split the ligature (\texttt{<{}< {<}< <{<} <\/<}
or some babel
shorthand...) or just use the \verb
command which is meant for such purpose.
% arara: pdflatex
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[scaled]{beramono}
\begin{document}
\texttt{List<List<Integer>>} vs.\ \verb+List<List<Integer>>+
\end{document}
\verb+List<List<Integer>>+
? Just a guess. If you want to get answers without any guessing, you should provide a minimal working example of your problem.microtype
package) disable ligatures with\DisableLigatures[<,>]{encoding=*,family=tt}
.*
aftertt
, you need to add it.