1

I have the below code and would like the main body text to be Times New Roman (which i think I have managed by specifying the fontfamily as ptm in each section) and the section headings and sub-headings to be Arial 12. I know Arial cannot be used, so I have set the main font to Helvetica using \renewcommand{\sfdefault}{phv} however this does not appear to get applied to my sections when I use \renewcommand.

I know this should be easy, and I've tried to follow a few other posts but struggling to apply to my setup. Any help greatly appreciated.

\documentclass{article}
\usepackage[tmargin=1.25in,bmargin=1.25in,lmargin=1.5in,rmargin=1.5in]{geometry}
\usepackage{fancyhdr}

\renewcommand{\sfdefault}{phv} % Arial

\begin{document}
\fontfamily{ptm}\selectfont
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}

\sffamily
\noindent\rule{14cm}{1pt}
\begin{center}
\huge{\textbf{Title is using correct font}}
\par
\vspace{7mm}
\end{center}
\vspace{-\baselineskip}
\noindent\rule{14cm}{1pt}
\fontfamily{ptm}\selectfont
\begin{flushleft}

\vspace{7mm}
\par
\renewcommand{\sfdefault}{\large{\textbf{ABSTRACT should be arial 12}}}
\sfdefault
\par
\fontfamily{ptm}\selectfont
\vspace{7mm}
\par
Correctly using  Times New Roman 11
\vspace{7mm}
\par
\renewcommand{\sfdefault}{\large{\textbf{1 \quad \quad INTRODUCTION should be arial 12}}}
\sfdefault
\par
\fontfamily{ptm}\selectfont
\vspace{7mm}
\par
Correctly using  Times New Roman 11
\vspace{7mm}
\par

\renewcommand{\sfdefault}{\large{\textbf{2 \quad \quad METHODOLOGY should be arial 12}}}
\sfdefault
\par
\fontfamily{ptm}\selectfont
\vspace{7mm}
\par
Correctly using  Times New Roman 11
\vspace{7mm}
\par
\pagestyle{fancy}

\end{flushleft}
\end{document}
  • 1
    Aside: phv gives an Helvetica clone, not Arial. Of course, many typophiles regard Arial as a weak, undistinguished copy of Helvetica. Thus, your document may be better off (admittedly every so slightly...) by you employing Helvetica and not Arial... – Mico Jun 20 '18 at 22:00
  • 1
    Incidentally, what are you trying to achieve by redefining \sfdefault, repeatedly? – Mico Jun 20 '18 at 22:01
  • 1
    Another aside: The commands \large and \huge -- as well as \tiny, \scriptsize, \footnotesize, \small, \normalsize, \Large, and \LARGE -- are switches, i.e., they do not take arguments. Writing \large{blurb} is no different from just writing\large blurb. To confine the scope of \large, you must write {\large blurb}. – Mico Jun 20 '18 at 22:17
  • 3
    \renewcommand{\sfdefault}{\large{\textbf{ABSTRACT should be arial 12}}} is nothing that should appear in a LaTeX document. What are you trying to achieve? – egreg Jun 20 '18 at 22:20
  • 1
    You don't have any section headings or sections at all. – cfr Jun 20 '18 at 22:41
6

I've tried to simplify your code. Note the use of the sectsty package and its \sectionfont macro, and of \section* and \section, to pursue the simplification.

enter image description here

\documentclass[11pt]{article}
\usepackage[vmargin=1.25in,hmargin=1.5in]{geometry}

\usepackage{newtxtext}           % Times Roman
\usepackage[scaled=0.86]{helvet} % Helvetica

\usepackage{sectsty}
\sectionfont{\large\sffamily}

\begin{document}
\raggedright

\hrule
\begin{center}
\huge\bfseries\sffamily Title is using arial
\end{center}
\hrule

\section*{ABSTRACT now uses arial}

Correctly using Times Roman 

\section{INTRODUCTION now uses arial}

Correctly using Times Roman

\section{METHODOLOGY now uses arial}

Correctly using Times Roman 
\end{document}
  • @Mico thats great it looks exactly like I would like and much cleaner code also ! Ive used \sections before but thought I needed to use the renew command to get the font to apply to the sections only. Many thanks thats two questions answered in one day on here - v impressed ! – Bat Jun 20 '18 at 22:58
  • 1
    @cfr — Thanks. I’ve changed times to newtxtext. – Mico Jun 20 '18 at 23:12

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.