How to set font to times new roman in latex

To set the font to Times New Roman in LaTeX, you can use the following commands:

  1. For the entire document:

    \documentclass{article}
    \usepackage{fontspec}
    \setmainfont{Times New Roman}

    This will set the main font of the document to Times New Roman.

  2. For a specific section or paragraph:

    {\fontfamily{ptm}\selectfont This text will be in Times New Roman}

    This will set the font to Times New Roman for the text within the curly braces.

  3. Using the fontenc package:

    \documentclass{article}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \renewcommand{\rmdefault}{ptm}

    This will set the font to Times New Roman for the entire document.

Note: The fontspec package is used for XeLaTeX and LuaLaTeX, while the fontenc package is used for pdfLaTeX.

Also, you can use the newtxtext package which is a Times New Roman clone:

\documentclass{article}
\usepackage{newtxtext}

This will set the font to Times New Roman for the entire document.

You can also use the times package:

\documentclass{article}
\usepackage{times}

This will set the font to Times New Roman for the entire document.

Please note that the availability of the Times New Roman font may vary depending on the LaTeX distribution and the operating system you are using.