[Tex/LaTex] Hyphenation in classicthesis graffito

classicthesishorizontal alignmenthyphenation

I am using the classicthesis package and the graffito side notes it provides. However, I'd like those side notes to be properly hyphenated, even though I think they were not intended to be by the author. I tried to adjust the definition of graffito to hyphenate, but to no avail. How should this be done?

\documentclass[11pt,a4paper,twoside]{report}
\usepackage{classicthesis}

% graffito definition, modified to change hyphenation penalties
\makeatletter
\def\graffito@setup{%
   \slshape\footnotesize% 
   \parindent=0pt \lineskip=0pt \lineskiplimit=0pt %
   \tolerance=2000
   \hyphenpenalty=0 % was 300
   \exhyphenpenalty=0 % was 300
   \doublehyphendemerits=100000% 
   \finalhyphendemerits=\doublehyphendemerits
   }
\makeatother


\begin{document}
\graffito{Text with extremely excessively unnecessarily long words which unfortunately,
undesiredly and awkwardly are not being hyphenated.}
\end{document}

Best Answer

The \graffito definition includes (after \graffito@setup) \raggedleft/\raggedright; this must be replaced with \RaggedLeft/\RaggedRight (from the ragged2e package) to allow hyphenation. For convenience, I use the etoolbox package to do so.

\documentclass[11pt,a4paper,twoside]{report}

\usepackage{classicthesis}

\usepackage {ragged2e}

\usepackage{etoolbox}

\patchcmd{\graffito}{\raggedright}{\RaggedRight}{}{}
\patchcmd{\graffito}{\raggedleft}{\RaggedLeft}{}{}

\begin{document}
\graffito{Text with extremely excessively unnecessarily long words which unfortunately,
undesiredly and awkwardly are not being hyphenated.}
\end{document}

enter image description here

Related Question