I want to color the section and subsection numbers in my document.
I tried the solution here https://tex.stackexchange.com/a/193186/80972 but it doesn't work for me.
Here's an example using that solution
\documentclass[]{scrartcl}
\usepackage[svgnames]{xcolor}
\renewcommand*{\othersectionlevelsformat}[3]{\textcolor{LightSteelBlue}{#3}\autodot\enskip}
\begin{document}
\section{A section}
Bla bla.
\subsection{A subsection}
Bla.
\end{document}
As you can see the numbers are still black.
Any help is appreciated. Best regards.
Best Answer
The command
\othersectionlevelsformat
, in latest versions of KOMA-Script, doesn't work as before any more (to say the truth I think it's there for backwards compatibility only).Now every sectioning command has its own formatting command. Here's a list:
So, instead of using
\othersectionlevelsformat
you will have to use\sectionformat
and\subsectionformat
in this way:MWE:
Output: