# characters “>>” in LaTeX

I'm writing about programming language Haskell and I need to describe operators named >>= and >>. I wrap all references to names from the programming language in \texttt{ ... }, for example:

We use operator \texttt{+} to add two numbers.


But when I write \texttt{>>}:

We use operator \texttt{>>} to sequence two actions.


I got the "much greater than" sign, which is not what I want (see the image).

I found some questions asking similar problem (“<<” sign in Latex), but the solutions proposed there don't work for me:

The only solution I found is to break \texttt{>>} to \texttt{>}\texttt{>}, but it gets painful when I use longer expressions; for example:

To sequence many actions, use \texttt{a1 >> a2 >> a3 >> ... >> a4}


must be broken to

To sequence many actions, use \texttt{a1 >}\texttt{> a2 >}\texttt{> a3 >}\texttt{> ... >}\texttt{> a4}


I'd rather avoid using \verb, because:

1. I want to be consistent with the rest of the text using \texttt
2. I sometimes need to use formatting in the code snippets to emphasize a variable or something

P.S.: I do use

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

-
use package listings for the code sequences –  Herbert Feb 5 '13 at 13:16
Consider the listings package for automatic formatting of source code, or if you are on *nix, the minted package based on Python/Pygments for even superior syntax coloring. –  marczellm Feb 5 '13 at 13:17
I use listings for multi-line code listings, but didn't know about \lstinline. I'll have a closer look at \lstMakeShortInline, but it doesn't seem to work in \item[...]. –  honzasp Feb 5 '13 at 13:43

These are ligatures. You can either avoid them locally by putting braces between the input. Or globally with microtype:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\DisableLigatures[>,<]{encoding = T1,family=tt*} %
\begin{document}
\texttt{>>}   %need the microtype command.
\texttt{>{}>} %works always
\end{document}

-
Yes, thank you, this seems to work! I had to \usepackage{lmodern} because I was getting pdfTeX error (font expansion): auto expansion is only possible with scalable (answer on tex.SE). –  honzasp Feb 5 '13 at 13:38
@honzasp: An alternative to lmodern is to install the cm-super-package. –  Ulrike Fischer Feb 5 '13 at 13:40