I am trying to use label nodes for a tikz qtree that include the lower-than < and greater-than > characters like shown in the first node of the example below. The problem is that instead of showing < and > some other strange symbols are presented - see first node label of the picture below.

While the second node does solve the problem somehow by just forcing < and > to be in math-mode I seek for a solution which also forces the text to accept the \textbf command it is enclosed in.

        [.\node(html){\textbf{$<$html$>$}}; ]

enter image description here

  1. Is there a solution?
  2. What is the reason for this - in my eyes - strange behavior?
  • 1
    Use \usepackage[T1]{fontenc}. – Ulrike Fischer Mar 27 '13 at 12:55
  • @UlrikeFischer : \usepackage[T1]{fontenc} works ... but why? – petermeissner Mar 27 '13 at 13:02
  • @peter-m you can find a possible explanation in my answer below – Old Nick Mar 27 '13 at 13:08
  • 1
    Just a note about method and problem diagnosis for future reference: your example has nothing to do with tikz-qtree or tikz at all. This is why constructing true minimal examples is important in diagnosing problems. The minimal example that shows the problem is simply a document that contains just <> and no other packages loaded. – Alan Munn Mar 27 '13 at 13:11

use \textless and \textgreater

from The Comprehensive LaTeX Symbol List (pag. 114)

The characters “<”, “>”, and “|” do work as expected in math mode, although they produce, respectively, “¡”, “¿”, and “—” in text mode when using the OT1 font encoding.[13] The following are some alternatives for typesetting “<”, “>”, and “|”:

– Specify a document font encoding other than OT1 (as described on page 8).

– Use the appropriate symbol commands from Table 2 on page 9, viz. \textless, \textgreater, and \textbar.

– Enter the symbols in math mode instead of text mode, i.e., $$, and $|$.

[13] Donald Knuth didn’t think such symbols were important outside of mathematics so he omitted them from his text fonts.

  • I needed to to greater then or equal to in my or gates so i used $\ge$1 according to this suggestion. Thanks. – span Oct 27 '13 at 13:25

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