Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bold + italic (sub)section headers? titlesec

1,985 views
Skip to first unread message

johnny_canuck

unread,
Mar 9, 2013, 12:21:07 PM3/9/13
to
Can get bold along, fine. Italic alone, fine. But....bold+ italic? Stumped. Following MWE - I want the subsection header to be sffamily, bold, and italic. I've tried slshape, itshape, emph - apparently missing the magic combination.

Thanks in advance for pointers to the obvious.

\documentclass[10pt,letterpaper,oneside,onecolumn]{article}

%set basic page geometry - using geometry package - normal
\usepackage[dvips,top=1.0in,bottom=0.5in,right=1.1in,left=1.1in,includefoot]{geometry}

\usepackage{lipsum}

\usepackage{titlesec}
\titleformat*{\section}{\large\bfseries\sffamily}
\titleformat*{\subsection}{\sffamily\bfseries\slshape}

\usepackage[protrusion=true,expansion]{microtype}

\begin{document}


\section*{Introduction}
\label{section:intro}

\lipsum[1]

\section*{Methods}
\subsection*{statistical approaches}

\lipsum[1]

\end{document}

johnny_canuck

unread,
Mar 9, 2013, 12:30:24 PM3/9/13
to
Sigh - single word answer:

\usepackage{lmodern}

Ulrike Fischer

unread,
Mar 9, 2013, 1:03:12 PM3/9/13
to
Am Sat, 9 Mar 2013 09:30:24 -0800 (PST) schrieb johnny_canuck:


>I want the subsection header to be sffamily, bold, and italic.
> Sigh - single word answer:

> \usepackage{lmodern}

and/or T1-encoding (which is a good idea anyway):

\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}
\sffamily sans serif \bfseries bold and \itshape italic.
\end{document}


--
Ulrike Fischer
http://www.troubleshooting-tex.de/

Dan

unread,
Mar 9, 2013, 9:37:49 PM3/9/13
to
On Mar 9, 12:03 pm, Ulrike Fischer <ne...@nililand.de> wrote:
> Am Sat, 9 Mar 2013 09:30:24 -0800 (PST) schrieb johnny_canuck:
>
> >I want the subsection header to be sffamily, bold, and italic.
> > Sigh - single word answer:
> > \usepackage{lmodern}
>
> and/or T1-encoding (which is a good idea anyway):

Strictly speaking the font encoding is not the answer (however
good an idea it might be for other reasons), it is using a font
family that contains the necessary variants. The only reason
\usepackage[T1]{fontenc} works is that it makes the EC fonts
the default instead of CM. And EC (unlike CM) contains a sans
serif, bold, italic font.

Using T! encoding with the wrong set of fonts wouldn't work
and keeping the default OT1 encoding can still work if one uses
a font set that contains the necessary variants. For example,
Latin Modern.


Dan

johnny_canuck

unread,
Mar 9, 2013, 10:17:00 PM3/9/13
to ne...@nililand.de
Indeed - danke!

johnny_canuck

unread,
Mar 9, 2013, 10:17:13 PM3/9/13
to
Good point.

Peter Flynn

unread,
Mar 10, 2013, 7:08:46 PM3/10/13
to
On 03/09/2013 05:21 PM, johnny_canuck wrote:
> Can get bold along, fine. Italic alone, fine. But....bold+ italic? Stumped.

They are commutative, exactly the same as in other systems.

\textit{\textbf{Stuff}} or {\bfseries\itshape Stuff} as appropriate.

///Peter

Guenter Milde

unread,
Mar 11, 2013, 4:26:36 PM3/11/13
to
Mind, that this is (intentionally) not the case for mathematical
formulas: $\mathit{\mathbf{x}}$ is bold-upright and $\mathbf{mathit{x}}$ is
medium-italic.

In headers, if all maths should be bolder than usual, use the \mathbold
switch outside the formula: \mathbold $\mathit{x}$ is bold-italic.

See the font guide (fntguide.pdf) for details and rationale.

Günter

0 new messages