1

My goal is to have everything in my document in a Times New Roman like font, including math. I am working with the authblk-package to produce a title page.

I have tried with the following but the Title, Subtitle, Sections and Subsections are not with a Times font.

\documentclass[a4paper,12pt,bibliography=totoc]{scrartcl}

\usepackage[affil-it]{authblk} 
\usepackage{blindtext} 
\usepackage{newtxtext} 
\usepackage{newtxmath}

\titlehead{This is in times \hfill}
\title{Main Title with wrong font}
\subtitle{Sub Title with wrong font}
\author[1,2,*]{First Author}
\author[1,2]{Second Author}
\author[1,3]{Third Author}
\author[2,4]{Supervisor Author}
\affil[1]{University}
\affil[2]{College}
\affil[3]{Institute}
\affil[4]{School \break}
\affil[*]{Corresponding author: [email protected] \newline Contributing authors: [email protected], [email protected], [email protected]}
\date{\today}


\begin{document}

\maketitle

\section{This}
\subsection{is in}
\subsubsection{times}

This is in times.

enter image description here

Same issue with:

% !TEX TS-program = xelatex
%That was the first line of code
%\usepackage{newtxtext} %newtx packages are commented
%\usepackage{newtxmath}

\usepackage{fontspec}
\setmainfont{Times New Roman}
2
  • KOMA-class scrartcl has its own mechanism for defining the fonts ... Did you read the manual for MOMA-Script?
    – Mensch
    Sep 15, 2021 at 14:54
  • No, but you helped me identify the issue! Just added one line of code (\setkomafont{disposition}{\bfseries}) in the preamble. Sep 15, 2021 at 14:58

2 Answers 2

1

OP here. It seems I was missing one line of code as scrartcl is a KOMA-class.(more info here). Just had to add

\setkomafont{disposition}{\bfseries}

Full MWE:

\documentclass[a4paper,12pt,bibliography=totoc]{scrartcl}

\usepackage[affil-it]{authblk} 
\usepackage{blindtext} 
\usepackage{newtxtext} 
\usepackage{newtxmath}
\setkomafont{disposition}{\bfseries} % this was missing
%\usepackage{fontspec}
%\setmainfont{Times New Roman}


\titlehead{This is in times \hfill}
\title{Main Title in Times}
\subtitle{Sub Title in Times}
\author[1,2,*]{First Author}
\author[1,2]{Second Author}
\author[1,3]{Third Author}
\author[2,4]{Supervisor Author}
\affil[1]{University}
\affil[2]{College}
\affil[3]{Institute}
\affil[4]{School \break}
\affil[*]{Corresponding author: [email protected] \newline Contributing authors: [email protected], [email protected], [email protected]}
\date{\today}


\begin{document}

\maketitle

\section{This is in times}
\subsection{This is in times as well}
\subsubsection{Times is the way to go}

This is in times.


\end{document}

enter image description here

0

Hope this is not the best, but it works:

\documentclass[a4paper,12pt,bibliography=totoc]{scrartcl}

\makeatletter
\renewcommand*{\@gr@gsffamily}{%just tweak this tag
  \if@egregdoesnotlikesansseriftitles\else\rmfamily\fi
}
\makeatother

\usepackage[affil-it]{authblk} 
\usepackage{blindtext} 
\usepackage{newtxtext} 
\usepackage{newtxmath}

\titlehead{This is in times \hfill}
\title{Main Title with wrong font}
\subtitle{Sub Title with wrong font}
\author[1,2,*]{First Author}
\author[1,2]{Second Author}
\author[1,3]{Third Author}
\author[2,4]{Supervisor Author}
\affil[1]{University}
\affil[2]{College}
\affil[3]{Institute}
\affil[4]{School \break}
\affil[*]{Corresponding author: [email protected] \newline Contributing authors: [email protected], [email protected], [email protected]}
\date{\today}


\begin{document}

\maketitle

\section{This}
\subsection{is in}
\subsubsection{times}

This is in times.

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .