Bold and italic subsection title with custom font size

I have defined fontsize, and even with your answered question help I solved the situation in this way:

\usepackage{titlesec}

\titleformat{\chapter}

{\normalfont\fontfamily{phv}\fontsize{16}{19}\bfseries}{\thechapter}{1em}{}

\titleformat{\section}

{\normalfont\fontfamily{phv}\fontsize{12}{17}\bfseries}{\thesection}{1em}{}

\titleformat{\subsection}

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


Now i have to add only to the subsection an italic style .How can I do?? Thank you so much for your attention and your precious help!

-
Please always post a complete Minimal (non-)Working Example demonstrating the issue. That at least means adding \documentclass..., \begin{document}... \end{document} etc. That said, just add \itshape after \bfseries to the format for \subsection. –  cfr Mar 16 '14 at 19:25
Welcome to TeX.SE! –  Mico Mar 16 '14 at 19:32

You should avoid explicit \fontfamily instructions as long as possible. You're better declaring a sans serif font and then use \sffamily; for slanted type, add \slshape. If you use Helvetica for titles, you should use it in every case a sans serif font is requested in the document.

\documentclass{book}
\usepackage{helvet}
\usepackage{titlesec}

\titleformat{\chapter}
{\normalfont\fontsize{16}{19}\sffamily\bfseries}
{\thechapter}
{1em}
{}

\titleformat{\section}
{\normalfont\fontsize{12}{17}\sffamily\bfseries}
{\thesection}
{1em}
{}

\titleformat{\subsection}
{\normalfont\fontsize{12}{17}\sffamily\bfseries\slshape}
{\thesubsection}
{1em}
{}

\begin{document}
\chapter{Something}
\section{Title}
\subsection{Again}
\end{document}


Note that the code, as you formatted it, doesn't compile. I prefer this layout for the \titleformat command, that clearly shows the various arguments.

-
Could you please explain why one should avoid explicit \fontfamily instructions as long as possible. –  Gonzalo Medina Mar 17 '14 at 0:00
@GonzaloMedina This ensures better independence of the document's code from things that might change. Instead of Helvetica one might prefer TeX Gyre Heros and this could be obtained by just modifying \usepackage{helvet} into \usepackage{tgheros}. Also a scaled option can be given (to both packages). –  egreg Mar 17 '14 at 0:06
\usepackage{titlesec}

\titleformat{\chapter}
{\normalfont\fontfamily{phv}\fontsize{16}{19}\bfseries}{\thechapter}{1em}{}

\titleformat{\section}
{\normalfont\fontfamily{phv}\fontsize{12}{17}\bfseries}{\thesection}{1em}{}

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


For example:

\documentclass{book}
\usepackage{titlesec}

\titleformat{\chapter}
{\normalfont\fontfamily{phv}\fontsize{16}{19}\bfseries}{\thechapter}{1em}{}

\titleformat{\section}
{\normalfont\fontfamily{phv}\fontsize{12}{17}\bfseries}{\thesection}{1em}{}

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

\begin{document}

\chapter{Chapter}
\section{Section}
\subsection{Subsection}

\end{document}


Note that an oblique font is substituted for italic as no italic shape is available for this family.

-
@egreg Ah, true. Of course, it obviously wouldn't compile anyway. –  cfr Mar 16 '14 at 22:01