2

My university lecturer requires Times New Roman font, with 14 pt text size for section, and 13 pt for subsection. I changed major font for 12(teacher request ) but I can't obtain right font size in sections. I read that it is possible to do with other font type, but I can use Times New Roman only. I strove to do that, but It is really hard for me, because, I'm neewbie.

4

To use Times New Roman as the main text font, you will likely need to compile your document with either XeLaTeX or LuaLaTeX. Under pdfLaTeX, several font packages provide clones of Times Roman, but not of Times New Roman.

The following code compiles under pdfLaTeX, XeLaTeX, and LuaLaTeX. It employs the sectsty package to modify the font settings for section- and subsection-level headers.

enter image description here

\documentclass[12pt]{article}  % main document font size: 12pt

\usepackage{ifxetex,ifluatex}
\ifluatex
  \usepackage{unicode-math}
  \setmainfont{Times New Roman} % text font
  \setmathfont{XITS Math} % Times Roman math font
\else\ifxetex
  \usepackage{fontspec}
  \setmainfont{Times New Roman}
  % possibly need to choose a suitable math font
\else
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{newtxtext,newtxmath}
\fi\fi

\usepackage{sectsty} % use 20% "leading"
\sectionfont{\fontsize{14}{16.8}\selectfont}
\subsectionfont{\fontsize{13}{15.6}\selectfont}

\begin{document}

\section{Hello World}
\subsection{Good Morning}
\subsubsection{In The Beginning}
Once upon a time, in a far-away land, \dots

\end{document} 
  • 1
    Thanks. It is working properly with XeLaTeX . I appreciate that. Times Roman should not be a problem. – GM095 Apr 26 '18 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.