I had typed my LaTeX article using Computer Modern
fonts. Now I want Times New Roman and double spacing. I'm getting so many errors regarding font packages. Please help.
\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage[doublespacing]{setspace}
\usepackage[auth-sc]{authblk}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\textwidth=13cm
Best Answer
For the sake of closing this question, here is a summary of the comments:
fontspec
withxe
- /lualatex
fontspec
lets you use any TrueType and OpenType font easily (with commands like\setmainsfont
that just need the name of the font you want to use), but require you to compile your document with a modern TeX engine such asxelatex
orlualatex
. These two engines in return forces you to useutf8
encoding, and are therefore incompatible with\inputenc
. Also, asfontspec
is a kinda upgrade tofontenc
, you shouldn't loadfontenc
either.For more information on
xelatex
/lualatex
vspdflatex
, read these questions:fontenc
withpdflatex
If for some reason you want or need to compile with the legacy
pdflatex
, you will need to find a font that is available in Type1 format, and load it "the old way".The best option seem to be TeX Gyre Termes, loaded by the
tgtermes
package. Part of the modern TeX Gyre collection of fonts, an initiative aimed at providing high quality versions of standard fonts for TeX and in OpenType format, it is a replacement for the older URW Nimbus Roman font, that can be loaded by themathptmx
package (AFAIK,mathptmx
isnimbus
with math support added, but I might be wrong).Another option is the New TX font, loaded by the
newtxtext
andnewtxmath
packages (you need to load both).Note that for both these options you should also switch to Cork font encoding, i.e.
\usepackage[T1]{fontenc}
.For more about Times replacement, you can read What is going on with all these Times clones?