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.

2
  • Have a look here: tex.stackexchange.com/questions/165930/…
    – Sango
    Commented Sep 17, 2019 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
    Commented Sep 17, 2019 at 8:19

2 Answers 2

1

subsection

\documentclass[preprint,authoryear,12pt]{elsarticle}
\usepackage[utf8]{inputenc}
\makeatletter
\renewcommand\subsection{\@startsection {subsection}{2}{\z@}%
                {3.5ex \@plus -1ex \@minus -.2ex}%
                {1.5ex \@plus.2ex\noindent}%
                {\normalsize\bfseries\itshape}%
                }
\makeatother
\begin{document}

\maketitle

\section{Introduction}
\subsection{My Life}
\end{document}
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

You must log in to answer this question.

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