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 the following code:

 \textit{WMC \textgreater   average}

But the text looks like this:

WMC >average

It does not even change if I add even more spaces. So what am I doing wrong?

share|improve this question

2 Answers 2

up vote 9 down vote accepted

This is because commands gobble spaces. The simple work around is to type \textgreater{} to terminate the command, which will restore the space after the command. See the linked TeX FAQ entry for other possible solutions.

share|improve this answer
1  
Or an explicitly space can be added: \textgreater\space. In the OP's example it doesn't make any difference, but e.g. inside an`\edef` context it would make one. –  Martin Scharrer Mar 29 '11 at 22:38
    
Another option is to put a control space: \textgreater\ average. –  Bruno Le Floch Jul 30 '11 at 2:00

Another option is to use the xspace package if you don't want to manually insert a space after each use, to intelligently insert a space as needed:

enter image description here

Notes:

Code:

\documentclass{article}
\usepackage{xspace}

\let\OldTextgreater\textgreater
\renewcommand{\textgreater}{\OldTextgreater\xspace}%

\begin{document}
WMC \textgreater  average.

Using \verb|\textgreater| yields \textgreater.
\end{document}
share|improve this answer

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.