# How to change the font size of sections and subsections?

I'm using a customised class file (not written by me, I'm just being kind of forced to use it) and I was asked to change the size of the sections and subsections' title fonts. This class loads as its base scrartcl and in its body I've found this, referent to the sections and subsections

\renewcommand\thesection{\Roman{section}}
\renewcommand\thesubsection{\thesection.\alph{subsection}}
%
\allsectionsfont{
\usefont{T1}{lmr}{b}{n}
\color{PrussianBlue}
}
\subsectionfont{
\usefont{T1}{lmr}{b}{n}
\color{PrussianBlue}
}


How can I change the font size for the sections and subsections' titles, be it in the class file or in the .tex directly?

Thank you very much.

Disclaimer: Maybe the unknown class does other strange things. So it is possible that the following suggestions do not work for you. I can only simulate the class with the informations given in the question:

\documentclass{scrartcl}
%%%% the following lines are only to simulate the settings of the unknown class of the OP
\definecolor{PrussianBlue}{RGB}{0,39,124}
\usepackage{sectsty}
\renewcommand\thesection{\Roman{section}}
\renewcommand\thesubsection{\thesection.\alph{subsection}}
%
\allsectionsfont{
\usefont{T1}{lmr}{b}{n}
\color{PrussianBlue}
}
\subsectionfont{
\usefont{T1}{lmr}{b}{n}
\color{PrussianBlue}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{blindtext}% dummy text
\begin{document}
\blinddocument
\end{document}


The class uses \shadowtext for the titles of all section levels. So there is no line break allowed inside the titles, i.e. the titles have to be single lined.

## With KOMA-Script commands

Using

\RedeclareSectionCommands
[font=\usefont{T1}{lmr}{b}{n}\normalsize\color{PrussianBlue}]
{part,section,subsection,subsubsection,paragraph,subparagraph}


in the preamle of your document KOMA-Script controlls the section headings again. Additionally the font settings for all levels are changed.

Then you can use

\addtokomafont{section}{\huge}


to change the fontsize of section and subsection.

If you still want the section titles shaded add the following redefinition to the preamble of your document:

\renewcommand\sectionlinesformat[4]{%
}


To shade the text for part titles too, you have to use

\addtokomafont{part}{\shadowtext}


Because \shadowtext takes an argument, it must be the last of commands which are added to a font element.

Code:

\documentclass{scrartcl}
%% the following lines are only to simulate the settings of the unknown class of the OP
\definecolor{PrussianBlue}{RGB}{0,39,124}
\usepackage{sectsty}
\renewcommand\thesection{\Roman{section}}
\renewcommand\thesubsection{\thesection.\alph{subsection}}
%
\allsectionsfont{
\usefont{T1}{lmr}{b}{n}
\color{PrussianBlue}
}
\subsectionfont{
\usefont{T1}{lmr}{b}{n}
\color{PrussianBlue}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\RedeclareSectionCommands
[font=\usefont{T1}{lmr}{b}{n}\normalsize\color{PrussianBlue}]
{part,section,subsection,subsubsection,paragraph,subparagraph}

\renewcommand\sectionlinesformat[4]{%
}

\usepackage{blindtext}% dummy text
\begin{document}
\blinddocument
\end{document}


## With package sectsty

Note that the usage of package sectsty with a KOMA-Script class is not recommended because it breaks some features of these classes. Nevertheless it should be possible.

You only have to repeat all settings for all levels that should be changed. Again \shadowtext must be the last command.

\documentclass{scrartcl}
%% the following lines are only to simulate the settings of the unknown class of the OP
\definecolor{PrussianBlue}{RGB}{0,39,124}
\usepackage{sectsty}
\renewcommand\thesection{\Roman{section}}
\renewcommand\thesubsection{\thesection.\alph{subsection}}
%
\allsectionsfont{
\usefont{T1}{lmr}{b}{n}
\color{PrussianBlue}
}
\subsectionfont{
\usefont{T1}{lmr}{b}{n}
\color{PrussianBlue}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\sectionfont{
\usefont{T1}{lmr}{b}{n}
\color{PrussianBlue}
\huge