0

I am new to latex; hence, this can be trivial question. However, I could not handle it.

I want to make my subsection title bold and italic. I tried some methods, but I could not accomplish it.

\documentclass[preprint,authoryear,12pt]{elsarticle}
\usepackage[utf8]{inputenc}

\begin{document}

\maketitle

\section{Introduction}
\subsection{My Life}
\end{document}

The style of subsection part My Life is italic and not bold. I want to make it both bold and italic. By the way, I have to use the document class in sample code above. It is necessity provided by article owners of my university.

  • Have a look here: tex.stackexchange.com/questions/165930/… – Sango Sep 17 at 8:17
  • Could you please clarify on "by article owners of my university"? If you wish to use elsarticle because you want to publish a paper with them, it might be better to not change their style. – leandriis Sep 17 at 8:19
0

And here is my comment as an answer, use package titlesec:

\documentclass[preprint,authoryear,12pt]{elsarticle}
\usepackage[utf8]{inputenc}
\usepackage{titlesec}


\titleformat{\subsection}
{\normalfont\fontfamily{phv}\fontsize{12}{17}\bfseries\itshape}{\thesubsection}{1em}{}


\begin{document}

\maketitle

\section{Introduction}
\subsection{My Life}
\end{document}

Result

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.