# Using < > symbols inside algorithmic [duplicate]

I have the following code

\begin{algorithm}
\begin{algorithmic}[h]

\IF{$valuea$ < $valueb$}
\STATE $valuer$ = 255
\ENDIF

\end{algorithmic}
\end{algorithm}


but it is printed on pdf like this

if value_a¡valueb then
valuer = 255
end if


with the "¡" symbol instead of the "<" is there a way to force using "<" symbol?

-

## marked as duplicate by Werner, Ulrich Schwarz, egreg, Claudio Fiandrino, percusseJul 17 '12 at 13:45

In pure answer to the question, any of the solutions provided by Why do the less than symbol (<) and the greater than symbol (>) appear wrong as upside down exclamation or question mark? will solve the problem. The easiest is probably to add

\usepackage{lmodern}% http://ctan.org/pkg/lmodern


...when using mathematical expressions, maintain the appropriate spacing by keeping the context mathematical. I would therefore suggest the following:

\documentclass{article}
\usepackage{algorithm}% http://ctan.org/pkg/algorithms
\usepackage{algorithmic}% http://ctan.org/pkg/algorithms
\begin{document}
\begin{algorithm}
\begin{algorithmic}[1]
\IF{$\mbox{value}_a<\mbox{value}_b$}
\STATE $\mbox{value}_r=255$
\ENDIF
\end{algorithmic}
\end{algorithm}
\end{document}


The operator spacing between the relations < and = will be kept better than using your original $valuea$ < $valueb$.

You may also consider transitioning to the more flexible algorithmicx bundle.

-