# How can I apply the same formatting command to the bibliography heading as for all other section headings?

I have been given a template that applies the same formatting command to all sections. I now added a bibliography and want the title of it to be formatted the same way. What is the simplest way to achieve this?

\documentclass{scrartcl}

\usepackage{xcolor,biblatex}

\begin{filecontents}{\jobname.bib}
@article{Test,
author = {Test, A},
title = {What a test}
}
\end{filecontents}

\begin{minipage}{\dimexpr\textwidth-2\fboxrule-2\fboxsep\relax}
#1
\end{minipage}}}

\begin{document}

Here I am citing \cite{Test}

\printbibliography

\end{document}


Please ignore the fact, that my \headingformatting is typographically not appeasing. I just wanted to show how the document looks from a technical point of view.

• I'm not sure about the use case of your template, but surely in the example the best solution to this would be to use KOMA-Script features to make sure that \section is typeset as desired without having to invoke \headingformatting for each \section manually. Jun 23 at 15:04
• @moewe I agree and would change that in the future, but as of now I quickly had to add a bibliography to an existing file, so I didn‘t want to break anything by fiddling around. Jun 25 at 8:30

As mentioned in the comments the best solution to this would be to use KOMA-Script features to make sure that \section is typeset as desired without having to invoke \headingformatting for each \section manually.

Since I don't know how to do that, here is the biblatex workaround that defines a new heading style that also applies \headingformatting for \section.

\documentclass{scrartcl}

\usepackage{xcolor,biblatex}

\begin{minipage}{\dimexpr\textwidth-2\fboxrule-2\fboxsep\relax}
#1
\end{minipage}}}

\begin{document}
Here I am citing \cite{sigfridsson}

\end{document}


The definition shown here is based on \section. If you want an unnumbered style, you can go for something like

\makeatletter
\@mkboth{\abx@MakeMarkcase{#1}}{\abx@MakeMarkcase{#1}}}
\makeatother


or

\makeatletter
\@mkboth{\abx@MakeMarkcase{#1}}{\abx@MakeMarkcase{#1}}}
\makeatother


This should works.

\documentclass{scrartcl}

\usepackage{xcolor,biblatex}

\begin{filecontents}{\jobname.bib}
@article{Test,
author = {Test, A},
title = {What a test}
}
\end{filecontents}