# Part title framed

I was wondering how I could put a blue ({cmyk}{1,0.80,0.30,0.05}) coloured frame around my chapter titles, leaving out "PART 1" and just give the part title name itself, as is depicted in the picture below, also making the letters distance in the title bigger than usual (8 pt).

It should also be placed in the exact centre of the page. I'm using the titlesec package.

Frame should have a width of 2.25 pt.

Thanks!

## 3 Answers

Something like this?

Code:

\documentclass{article}

\usepackage{xcolor}
\definecolor{myblue}{cmyk}{1,0.80,0.30,0.05}

\usepackage{soul}
\sodef\sopart{}{8pt}{20pt}{16em}

\usepackage[explicit]{titlesec}
\titleformat{\part}[frame]
{\setlength\fboxrule{2.25pt}\color{myblue}}
{}
{5mm}
{\Large\sffamily\filcenter\color{myblue}\MakeUppercase{\sopart{#1}}}

\begin{document}
\part{Part name}
\end{document}


Here I've defined a new command \sopart for letterspacing, but this requires loading titlesec with the explicit option.

The following, instead, is a solution that uses the letterspace package (microtype bundle) for letterspacing and doesn't require the explicit option for titlesec, but it doesn't work with XeLaTeX:

\documentclass{article}

\usepackage{xcolor}
\definecolor{myblue}{cmyk}{1,0.80,0.30,0.05}

\usepackage[letterspace=600]{letterspace}

\usepackage{titlesec}
\titleformat{\part}[frame]
{\setlength\fboxrule{2.25pt}\color{myblue}}
{}
{5mm}
{\Large\sffamily\filcenter\color{myblue}\lsstyle\MakeUppercase}

\begin{document}
\part{Part name}
\end{document}


• So now I'm using your code, but now I can't force the exclusion of the part title in the table of contents with \part*{Part name}, and replacing it by a chapter title in ToC by \addcontentsline{toc}{chapter}{Part name} Solution? – FSJ963 Mar 28 '15 at 12:22
• @mmhenrot Redefining \part formatting is problematic. If you are using just starred \parts this can be solved by adding \makeatletter\renewcommand*\l@part[2]{}\makeatother in your preamble. – karlkoeller Mar 28 '15 at 13:06
• @mmhenrot Otherwise, if you are using report or book classes, it suffices to add \titleclass{\part}{top} just after loading titlesec. – karlkoeller Mar 28 '15 at 13:22

This seems close to what you want:

\documentclass{book}
\usepackage[cmyk]{xcolor}
\usepackage{titlesec}
\fboxrule=3pt
\titleformat{\chapter}[frame]
{\normalfont\color[cmyk]{1,0.80,0.30,0.05}}
{\filright}{12pt}
{\Huge\scshape\filcenter\color{black}}
\begin{document}

\chapter{Part Name Here}

\end{document}


With titlesec  and the framed package. I used the LetterSpace font feature with fontspec:

\documentclass[11pt, x11names]{report}
\usepackage[left=1.5in,right=1.5cm,top=2cm,bottom=2.5cm]{geometry}
\usepackage{fontspec}
\usepackage[dutch]{babel}
\usepackage{framed}

\usepackage{xcolor}
\usepackage{ragged2e}
\usepackage[T1]{fontenc}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[scaled=0.92]{helvet}
\usepackage[parfill]{parskip}
\usepackage[explicit, newparttoc, newlinetospace]{titlesec}
\usepackage{xunicode}
\usepackage{framed}
\definecolor{ugentblauw}{cmyk}{1 0.8 0.3 0.05}%
\colorlet{shadecolor}{ugentblauw}

\titleformat{\part}[block]{\thispagestyle{empty}\Huge\fontspec[LetterSpace=20.0]{NimbusSanL-Regu}\filcenter\color{ugentblauw}}%
{}{0pt}{\setlength\FrameRule{2.25pt}\begin{framed}\rule{0pt}{2.3ex}#1\end{framed}}

\titleformat{\chapter}[display]{\normalfont\color{white} \begin {shaded*}\bfseries}{\huge\chaptername~\thechapter}{20pt}{\Huge#1\end{shaded*}}

\titleformat{\section}{\normalfont\large\bfseries\color{ugentblauw}}{\thesection}{1em}{#1}

\begin{document}
\setcounter{page}{1}
\pagenumbering{arabic}

\tableofcontents

\part{PART NAME\\ HERE}

\chapter{Chapter}

This is some text.

\section{Section}
Indeed, text it is.
\bibliography{bibinflu}

\end{document}