Change font size of bibliography title

bibliographiessectioning

I want to change the font size of the bibliography title. Namely I want A. References at the end of the document to be the same font size as the first section Section with large font. As I need different section font sizes it's no option to change the sizes globally.enter image description here

\documentclass{scrartcl} 
\usepackage{lipsum}
\usepackage[nottoc, numbib]{tocbibind}

\begin{document}
    
    \tableofcontents
    \section[Section with large font]{\huge Section with large font}
    \lipsum[10] \cite{test} 
    \section{Section with standard font}
    \lipsum[5]
    \bibliography{test}
    
\end{document}

The content of test.bib is:

@misc{test,
author = {testauthor},
title = {{Test Title}},
url = {https://www.domain.com},
year = {2020}
}

EDIT: I got a little further by adding \addtokomafont{section}{\Huge} before and \addtokomafont{section}{\Large} after the section whose font size I want to change. By trial and error I found out the default value of the section size is \Large. Is there a better way to reset the \addtokomafont{section}{\Huge} command to the default value?

\documentclass[bibliography = totocnumbered]{scrartcl} 
\usepackage{lipsum}

\begin{document}
    
    \tableofcontents
    \addtokomafont{section}{\Huge}
    \section{Section with large font}
    \addtokomafont{section}{\Large}
    \lipsum[10] \cite{test} 
    \section{Section with standard font}
    \lipsum[5]
    \addtokomafont{section}{\Huge}
    \bibliography{test}
    \bibliographystyle{ieeetr}
    \addtokomafont{section}{\Large}
    
\end{document}

enter image description here

Best Answer

There are two separate questions: (1) headings in general and (2) heading for the bibliography.

(1) Section headings: (KOMA-script): font size

The cleanest way to go about this would be to define one or more custom section-level commands, each with the desired font size (following the approach outlined here).

It is less hacky and error-prone than specifying the font size before each section via \addtokomafont{section}{<size>}.

This is how \section is introduced in scrartcl.cls:

\DeclareSectionCommand[%
  style=section,%
  level=1,%
  indent=\z@,%
  beforeskip=-3.5ex \@plus -1ex \@minus -.2ex,%
  afterskip=2.3ex \@plus.2ex,%
  tocstyle=section,%
  tocindent=0pt,%
  tocnumwidth=1.5em%
]{section}

We copy this and choose a larger font:

\DeclareNewSectionCommand[%
  style=section,%
  level=1,%
  font=\Huge,%
  indent=\z@,%
  beforeskip=-3.5ex \@plus -1ex \@minus -.2ex,%
  afterskip=2.3ex \@plus.2ex,%
  tocstyle=section,%
  tocindent=0pt,%
  toclevel=1,%
  tocnumwidth=1.5em%
]{specialsection}

specialsection should use a shared sequential numbering with vanilla sections, not two parallel numberings:

\let\c@specialsection\c@section
\let\cl@specialsection\cl@section

See the MWE below.

(2) Bibliography heading (bibtex): font size

As you found out, tocbibind is not really needed to customize the bibliography's sectioning properties, given the wealth of options provided by KOMA-script.

As for the font size: I am not aware of a clean bibtex way to redefine the format of the bibliography heading accordingly to the custom sectioning format that we created (the way that \renewcommand\refname{...} can redefine the title).

We'll simply redefine \section to mean \specialsection for the space of the bibliography, so that this custom format doesn't spill over to later parts of the document. This is done by enclosing it in a group.

\begingroup
\let\section\specialsection
\bibliographystyle{...}
\bibliography{...}
\endgroup

This is just a marginal improvement on what you had already found. Note that with biblatex, there is a cleaner way to do this (and in 2022, do consider switching to biblatex, if you have the chance!):

\usepackage{biblatex}
\addbibresource{test.bib}
\defbibheading{SpecialBibHeadingStyle}{\specialsection{References}}
...
\begin{document}
...
\printbibliography[heading=SpecialBibHeadingStyle]

MWE

\begin{filecontents}[overwrite]{test.bib}
@misc{test,
author = {Author},
title = {Title}}
\end{filecontents}

\documentclass[bibliography=numbered]{scrartcl}

\makeatletter
\DeclareNewSectionCommand[%
  style=section,%
  level=1,%
  font=\Huge,%
  indent=\z@,%
  beforeskip=-3.5ex \@plus -1ex \@minus -.2ex,%
  afterskip=2.3ex \@plus.2ex,%
  tocstyle=section,%
  tocindent=0pt,%
  toclevel=1,%
  tocnumwidth=1.5em%
]{specialsection}

\let\c@specialsection\c@section% use the same counter as section
\let\cl@specialsection\cl@section% use the same reset list as section
\makeatother

\usepackage{biblatex}       % biblatex
\addbibresource{test.bib}
\defbibheading{SpecialBibHeadingStyle}{\specialsection{References}}

\begin{document}
\tableofcontents

\specialsection{Huge section}

\section{Large section}
\cite{test}

%\begingroup                % bibtex
%\let\section\specialsection
%\bibliographystyle{ieeetr}
%\bibliography{test}
%\endgroup

\printbibliography[heading=SpecialBibHeadingStyle]      % biblatex

\end{document}

TOC and sections with different font sizes