1

thanks to Bernard's answer to my last question, I was able to obtain the ToC page appearance I wanted. Now I'm facing one last (hopefully) issue: the fact is that I thought that I could add some tracking (letter spacing) to my capitalized headings in any moment, and I didn't realize immediately that in Bernard's syntax it wasn't exactly straightforward. At least using the package soul as I had planned after some resarch here on tex.stackexchange. Here is my MWE:

\documentclass[11pt,twoside]{book}
\usepackage[a5paper,inner=14mm,outer=20mm,top=21mm,bottom=22.5mm]{geometry}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{gensymb}
\usepackage{graphicx}
\usepackage{units}
\usepackage{tcolorbox}
\usepackage{fancyhdr}
\usepackage{microtype}
\usepackage{mwe}

\usepackage{soul}
\sodef\myspaced{}{.12em}{.6em plus.1em minus.1em}{.6em plus.1em minus.1em}

\usepackage{titlesec}
\usepackage[rightlabels]{titletoc}
        \titlecontents{chapter}
        [6.55em]
        {\medskip}
        {\contentslabel[\textsf{\itshape\footnotesize\MakeUppercase{\chaptername}~\normalsize\thecontentslabel}]{6.55em}\quad\textbf}
        {\hspace*{-6.55em}\textbf}
        {\hfill\sffamily\contentspage}[\smallskip]

\titleformat{\chapter}[display]
{\normalfont\Large\filcenter\rmfamily}
{\LARGE\sffamily\MakeUppercase{\myspaced{\chaptertitlename}} \huge\thechapter}%  <--- HERE_1
{0.5pc}
{\color{green}\titleline*[c]{\titlerule[3pt]}\color{black}
\vspace{1pc}%
\Huge\bfseries}[\vspace{6pt}]
\setlength{\titlewidth}{0.65\textwidth}

\titleformat{name=\chapter, numberless}[block]
{\thispagestyle{empty}\vspace*{0.7ex}\normalfont\LARGE\filcenter\sffamily}%  <--- HERE_2
{}
{0em}
{\MakeUppercase}[\vspace{-0.8ex}{\color{green}\rule{\titlewidth}{3pt}}]%  <--- HERE_3

\begin{document}

\tableofcontents
\clearpage\thispagestyle{empty}

\chapter{Title of Chapter One}
\lipsum
\chapter{Title of Chapter Two}
\chapter{Title of Chapter Three is longer}
\chapter{Short}
\chapter{Other normal title}
\chapter{Other normal title}
\chapter{Other normal title}

\end{document}

my intervention at the line marked with HERE_1 let me obtain the chapter headings as I wanted. The following picture compares the outcome before and after introducing the "myspaced" command:

enter image description here

Now I'd like to get the same result with the word "CONTENTS" in the toc page:

enter image description here

But my attempts are failing. I've tried to introduce \myspaced in the lines HERE_2 and HERE_3, but I get (depending on where exactly I add it) from nothing, to affecting the sans serif-ness, to a compiling error. Can anybody help me work this out? Must I change package? Soul was so easy in its first application!

Thank you!

2

Here is a solution with microtype: I set the loading option [letterspace=100] (which means 100/1000 em). The package defines the command \textls{#1} and the switch \lsstyle.

\documentclass[11pt,twoside]{book}
\usepackage[a5paper,inner=14mm,outer=20mm,top=21mm,bottom=22.5mm]{geometry}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{gensymb}
\usepackage{graphicx}
\usepackage{units}
\usepackage{tcolorbox}
\usepackage{fancyhdr}
\usepackage[letterspace=100]{microtype}
\usepackage{mwe}

\usepackage{titlesec}
\usepackage[rightlabels]{titletoc}
        \titlecontents{chapter}
        [6.55em]
        {\medskip}
        {\contentslabel[\textsf{\itshape\footnotesize\MakeUppercase{\chaptername}~\normalsize\thecontentslabel}]{6.55em}\quad\textbf}
        {\hspace*{-6.55em}\textbf}
        {\hfill\sffamily\contentspage}[\smallskip]

\titleformat{\chapter}[display]
{\normalfont\Large\filcenter\rmfamily}
{\LARGE\sffamily\MakeUppercase{\textls{\chaptertitlename}} \huge\thechapter}% <--- HERE_1
{0.5pc}
{\color{green}\titleline*[c]{\titlerule[3pt]}\color{black}
\vspace{1pc}%
\Huge\bfseries}[\vspace{6pt}]
\setlength{\titlewidth}{0.65\textwidth}

\titleformat{name=\chapter, numberless}[block]
{\thispagestyle{empty}\vspace*{0.7ex}\normalfont\LARGE\filcenter\sffamily}% <--- HERE_2
{}
{0em}
{\lsstyle\MakeUppercase}[\vspace{-0.8ex}{\color{green}\rule{\titlewidth}{3pt}}]% <--- HERE_3

\begin{document}

\tableofcontents
\clearpage\thispagestyle{empty}

\chapter{Title of Chapter One}
\lipsum
\chapter{Title of Chapter Two}
\chapter{Title of Chapter Three is longer}
\chapter{Short}
\chapter{Other normal title}
\chapter{Other normal title}
\chapter{Other normal title}

\end{document} 

enter image description here

  • Wow, with hindsight it seems so easy, microtype was already there... really an Egg of Columbus! Thank you Bernard, you saved me so much time!! – lesath82 Oct 26 '17 at 23:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.