[Tex/LaTex] Inputenc/Fontenc conflict

babelfont-encodings

I am freaking out with this problem.

I am writting a beamer presentation in spanish, and compiling with PDFLaTeX.
My input encoding has to be UTF-8.
So I write:

\documentclass[12pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\begin{document}
  \begin{frame}{Test}
    Mínimo: $\min$
  \end{frame}
\end{document}

Since I need that characters <>| properly see in the output,
I need to use T1 font encoding. So I changed the font to "times".

All that seems going well, but now it emerges the problem that accented commands appear wrong. For example, the command \min has to appear as mín (with the accented "i"), since in spanish we say "mínimo".
However, the output is: "m/in" or something like that.

I need the correct output, of course: mín

Is there a way to ensure that, for all internatl definitions in babel package, accents be produced always "as if" the command \' were used?

Best Answer

To avoid undesired inner replacements, load the professionalfonts font theme:

\documentclass[12pt]{beamer}
\usefonttheme{professionalfonts}

\usepackage[utf8]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\begin{document}
  \begin{frame}{Test}
    Mínimo: $\min$
  \end{frame}
\end{document}

The result:

enter image description here

By the way, as Bernard mentioned in his comment, instead of times you should use a better font package, such as mathptmx or newtx.