# Customize the section title with Latin Modern

I have created a thesis using `mathptmx` font. Now I would like to customize only the section title using Latin Modern Sans Bold.

I used `titlesec` with

``````\usepackage{titlesec}
\titleformat{\section}
{\fontfamily{lmr}\sffamily\bfseries\Large}
{\thesection}{1em}{}
``````

I would like to know if this is right because I'm not convinced.

-
You should say `\fontfamily{lmss}\bfseries\Large` –  egreg Jan 18 '13 at 12:14
Thanks egreg. I didn't know the existence of that font family –  Mazzy Jan 18 '13 at 12:18

## 1 Answer

You should change the default sans serif family in your document, which is done by saying

``````\renewcommand{\sfdefault}{lmss}
``````

in the preamble. Thus each call of `\sffamily` in the document will choose the Latin Modern Sans font corresponding to the other specifications. For setting the section title you'll simply say

``````\usepackage{titlesec}
\titleformat{\section}
{\sffamily\bfseries\Large}
{\thesection}
{1em}
{}
``````

This is based on the obvious assumption that you should not have two different sans serif fonts in a document.

-