1

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.

  • Have you tried writing \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. – LaRiFaRi Jul 21 '14 at 13:18
  • 3
    Apart from the answers in that question, you can (if you use/are able to use microtype package) disable ligatures with \DisableLigatures[<,>]{encoding=*,family=tt}. – Manuel Jul 21 '14 at 13:24
  • @Manuel I tried to disable them using your command, but didn't work. Any suggestions why? – Wickoo Jul 21 '14 at 13:39
  • 1
    @Ali The suggestion may came when we have a minimal compilable example of the code you are compiling. Without it, no one can know what's going on. – Manuel Jul 21 '14 at 13:41
  • 1
    @Ali Although you should always post a minimal compilable example to show your problem (which helps everyone to answer your question), here it's a problem with me: I forgot a * after tt, you need to add it. – Manuel Jul 21 '14 at 13:49
4

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}

enter image description here

| improve this answer | |

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