Spacing of Chapter Name and Chapter Number when using package sectsty

by Isaac   Last Updated September 11, 2019 15:23 PM

Hello my dear fellow latex users! I've been trying to fancy my thesis by setting a color to the chapter names and in order to do so, I used the package sectsty, because I am using a template where if I use titlesec everything gets terribly messed up.

The question is: How do I get to separate the chapter name and chapter number. As you can see, it is the only thing that gets messed up here.

\documentclass[11pt,a4paper]{scrreprt}

\usepackage{sectsty}
\usepackage{color}
\definecolor{Verde}{RGB}{99,154,0}
\chapterfont{\color{Verde}}
\sectionfont{\color{Verde}}

\begin{document}

\chapter{Mexican Hat}

Mi casa es tu casa

\section{La cucaracha}

Ya no puede caminar

\end{document}

Though I've been using Latex for a while now, I have never gone too deep to make my own renewcommands and stuff. So I'd love to keep using sectsty, because I wouldn't know how to improve all the template with titlesec.enter image description here



Answers 1


Since you're using the KOMA classes, you shouldn't use either titlesec or sectsty for this sort of thing; instead use the built-in methods that KOMA provides:

\documentclass[11pt,a4paper]{scrreprt}


\usepackage{xcolor}
\definecolor{Verde}{RGB}{99,154,0}
\setkomafont{disposition}{\sffamily\bfseries\color{Verde}}

\begin{document}

\chapter{Mexican Hat}

Mi casa es tu casa

\section{La cucaracha}

Ya no puede caminar

\end{document}

output of code

Alan Munn
Alan Munn
September 11, 2019 15:18 PM

Related Questions


Updated January 16, 2018 15:23 PM

Updated April 25, 2019 16:23 PM

Updated February 21, 2019 02:23 AM

Updated January 10, 2018 14:23 PM

Updated August 06, 2019 17:23 PM