For whatever reason, when I try to use Times New Roman (i.e., via \setmainfont{Times New Roman}
) and the courier
package together, LaTeX does not use Courier in \texttt
… it looks like it uses the regular LaTeX CMU Serif font, but I could be wrong. Is there some conflict between these two, and if so, is there a workaround? For reference, I'm using Overleaf with the XeLaTeX compiler.
PoC:
\documentclass{article}
\usepackage{fontspec}
\usepackage{enumitem}
\usepackage{courier}
\usepackage[T1]{fontenc}
\setmainfont{Times New Roman}
\title{Font tests}
\begin{document}
\section{Introduction}
The quick brown fox jumps over the lazy dog. \texttt{This should be in courier but it isn't...}
\end{document}
Best Answer
The
courier
package is a legacy 8-bit font package, sofontspec
will override it if you load both.You would want something like,
or
This uses GUST’s free clones of Times, Helvetica and Courier.