[Tex/LaTex] How to have the three source-code symbols _ < > produce themselves (_ < >) in the typeset output by default

characters

I use LaTeX to take quick notes about my programming work. I have a couple of frustrations:

  • I need to use underscore a lot because of variables named with underscores. However, I have to escape each one of them "\_", thus making my notes less readable on the markup side.
  • I commonly want to use "<" and ">" symbols – why oh why are the default representations of these symbols "¿" and "¡"?

Is there anyway I can alter LaTeX so that "_", "<", and ">" literally typeset as "_", "<", and ">"?

Best Answer

There are canonical ways to fix both of these problems. For the underscore:

\usepackage{underscore}

For the rendering of < and >:

\usepackage[T1]{fontenc}
\usepackage{lmodern}
Related Question