[Tex/LaTex] Change font to “Times New Roman” in PDFLaTeX

fontspdftex

Can anyone help me to change the font to "Times New Roman" in PDFLaTeX?

I already tried using the commands below without results:

% Font selection
\usepackage[T1]{fontenc}
\usepackage{times} 
\usepackage[utf8]{inputenc}
\usepackage{mathptmx}
\setmainfont{Times New Roman}

Best Answer

If you are compiling with pdflatex, this is one of several ways to get Times New Roman font for both math and text:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{newtxmath,newtxtext}
\usepackage{lipsum} % just to generate dummy text
\begin{document}
\lipsum
\end{document}

\setmainfont is a command of the fontspec package, which you can't use with the pdflatex engine.