I recommend emacs http://ftp.gnu.org/pub/gnu/emacs It has modes for TeX and LaTeX and automatically chooses the right one. As a side benefit once you have emacs you can then run R through ESS, the package that provides the modes for handling statistical languages http://ess.r-project.org/