Text FormattingBold Small Caps in Chapter title [titlesec]

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
XmH
Posts: 3
Joined: Sat Nov 13, 2010 8:13 pm

Bold Small Caps in Chapter title [titlesec]

Post by XmH »

Hey guys,

I've been looking around but I can't find a way to have bold small caps on the chapter\section\subsection title using the titlesec package for formating.

This is a small example of what I have now :

Code: Select all

\documentclass[a4paper,11pt]{report}
\usepackage[T1]{fontenc}
\usepackage[english,french]{babel}
\usepackage{fancyhdr}
\usepackage[hmargin=2.5cm,vmargin=3cm]{geometry}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{listings}
\usepackage{textcomp}
\usepackage{lmodern}
\usepackage{pdfpages}
\usepackage{titlesec}



% Titlesec options
\titleformat{\chapter}[display]{\scshape\Large}{\filleft\Huge\thechapter}{4ex}{\titlerule\vspace{2ex}\filright}[\vspace{2ex}\titlerule]
\titleformat{\section}[hang]{\scshape}{\thesection}{2ex}{}[]
\titleformat{\subsection}[hang]{\scshape}{\thesubsection}{2ex}{}[]

\author{XmH}
\title{Title}
\date{\today}

\begin{document}

\begin{titlepage}
\maketitle
\thispagestyle{empty}
\end{titlepage}

\newpage
\fancypagestyle{plain}{     \lhead{}
                            \chead{}
                            %\rhead{\thechapter}
                            \lfoot{XXX}
                            \cfoot{\thepage}
                            \rfoot{XXX}
                            \renewcommand{\headrulewidth}{0.4pt}
                            \renewcommand{\footrulewidth}{0.4pt}
                        }
\pagestyle{plain}

\tableofcontents
\chapter{Introduction}

\section{Motivations}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis pretium ultricies tortor et dignissim. Vestibulum nibh felis, tincidunt vel viverra sed, commodo eget dui. In diam libero, malesuada id dictum in, consequat ac ipsum. Ut non lectus ipsum, et rutrum ligula. Nam elit nibh, commodo vitae vehicula nec, semper non sem. Nam laoreet placerat malesuada.
\end{document}
I've tried this option for the titlesec format:

Code: Select all

\titleformat{\section}[hang]{\bfseries\scshape}{\thesection}{2ex}{}[]
Even tried using \textbf and \textsc:

Code: Select all

\titleformat{\section}[hang]{\textbf\textsc}{\thesection}{2ex}{}[]
None of these works, so I'd love to know if anybody know how to have bold small caps in the chapter\sectin\subsection name using the titlesec format I have now (if there is another package that can make the same format I have now for the chapter, but with the bold small caps it's ok).

Thank in advance.
Have a nice day!

PS:
Here's the full list of the packages I use, just in case one is messing with titlesec and I don't know about it.

Code: Select all

\usepackage[T1]{fontenc}
\usepackage[english,french]{babel}
\usepackage{fancyhdr}
\usepackage[hmargin=2.5cm,vmargin=3cm]{geometry}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{listings}
\usepackage{color}
\usepackage{textcomp}
\usepackage{epigraph}
\usepackage{lmodern}
\usepackage{varioref}
\usepackage{float, caption}
\usepackage{subfig}
\usepackage{subfiles}
\usepackage{bigstrut}
\usepackage{lscape}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{amsmath, amssymb, mathrsfs}
\usepackage[colorlinks,citecolor={black},linkcolor={black}]{hyperref}
\usepackage{nomencl}
\usepackage{pdfpages}
\usepackage{titlesec}
\usepackage{schemabloc}
Last edited by XmH on Wed May 25, 2011 7:47 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Bold Small Caps in Chapter title [titlesec]

Post by Stefan Kottwitz »

Hi,

you just need to use a font which provides a bold version of small caps. It seems Latin modern does not, however kpfonts offer it. Try changing

Code: Select all

\usepackage{lmodern}
into

Code: Select all

\usepackage{kpfonts}
to see it.

Stefan
LaTeX.org admin
XmH
Posts: 3
Joined: Sat Nov 13, 2010 8:13 pm

Bold Small Caps in Chapter title [titlesec]

Post by XmH »

Hi,

Thx that works great! I just had to add pass this package under comments.

Code: Select all

%\usepackage{textcomp}
Apparently textcomp and kpfonts don't go well together.

Thanks again for your solution.

Bye
Post Reply