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.
\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}
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 inscrartcl.cls
:We copy this and choose a larger font:
specialsection
should use a shared sequential numbering with vanillasection
s, not two parallel numberings: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 byKOMA-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.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 tobiblatex
, if you have the chance!):MWE