Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a simple expression in my text which refuses to compile and I don't know why:

...\textit{isInterestedIn(Class$\<$? extends ContentChange$\>$ changeClass)}...

The complete error statement goes like this:

! Undefined control sequence.
<recently read> \<
l.298 ...? extends ContentChange$\>$ changeClass)}
mit einem der \textit{Tex...
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

I don't really understand, what's the problem here.

share|improve this question
    
What do you want. Type only $<$ and $y$. Or do you looking for something like: \langle\text{extends ContentChange}\rangle –  Marco Daniel Sep 1 '11 at 11:44
add comment

2 Answers

up vote 4 down vote accepted

The command (called control sequence) \< is unknown. \ means the start of a control sequence. Write $<$ or $\backslash<$ instead, the latter if you really need a backslash .

share|improve this answer
    
Thanks man, that did the trick for me. However, I'm a little curious why Texmaker returned me this expression from it's math character table...?! –  ubuntudroid Sep 1 '11 at 11:54
1  
One can use \left< and \right> as abbreviations for \left\langle and \right\rangle; even \bigl< and \bigr> are legal. But \< has always been undefined in LaTeX (other than in the tabbing environment). –  egreg Sep 1 '11 at 12:56
1  
-1 from me for suggesting $\backslah$ for text mode backslash. For obtaining a backslash in text mode, use \textbackslash; for using < and > in text mode, use T1 font encoding (or an opentype font). –  Aditya Sep 1 '11 at 18:13
    
@Aditya: thanks for explaining the downvote. You could add your comment as answer. Btw. I assume the backslash is not needed at all: See for example public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) here in Java documentation. And for deciding choosing math < or text < I don't see much information of the OP about the context such as encoding or desired shape of <, so I just fixed and explained. –  Stefan Kottwitz Sep 1 '11 at 19:21
add comment

You do not need to use math mode to get text < and >. A simpler solution is to either use T1 font encoding, or an opentype font (with lualatex or xetex). For example, with pdflatex

\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\textit{<text>}
\end{document}

or with lualatex

\documentclass{article}
\usepackage{fontenc}
\setmainfont{TeX Gyre Pagella}
\begin{document}
\textit{<text>}
\end{document}
share|improve this answer
add comment

Your Answer

 
discard

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.