TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an inline code example with a nested Java generic declaration, using the typewriter typeface. However, the closing >> is rendering as a black box. A cursory Google search suggested $>>$, but this removes the typewriter font. Using \textgreater in place of the actual > also encounters the same problem. Here is the offending snippet:

...declaration {\tt List<Map<Integer, String>>} is...

Any ideas?

share|improve this question
This does not happen in a minimal example with you code snippet. Please provide more details about your document preamble in the form of a minimal working example (MWE) that illustrates your problem. You would probably get away with using ...>{}>.... Also, rather use \ttfamily than the depricated \tt. – Werner Apr 12 '12 at 3:21
@Werner: I was able to fix the problem by adding a \hspace{1pt}, which is less than ideal, but seems to work. I will look into \ttfamily as well. Thanks. – Joe Einertson Apr 12 '12 at 3:27
So you are unable to reproduce the problem in some minimal form that we can view? – Werner Apr 12 '12 at 4:58

This can happen when >> becomes a ligature, a guillemet », so it would be differently rendered. If the typewriter font or the output viewer doesn't support this ligature, this can explain the black box. Ligatures can be prevented if you group one character such as {>}> or >{>} or group both {>}{>} or just insert an empty group inbetween, for separating the characters without causing space, >{}>.

A minimal example showing the difference:

...declaration {\ttfamily List<Map<Integer, String>>{>}>} is...

guillemet ligature

share|improve this answer

If you need this in only a few places, then Stefan's method is handy. If you need it several times it becomes heavy:


  \begingroup\lccode`~=`>\lowercase{\endgroup\def~}{>\kern0pt }}
  \begingroup\lccode`~=`<\lowercase{\endgroup\def~}{<\kern0pt }}


...declaration \noligtt{<< List<Map<Integer, String>>} is.


enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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