When setting up the minted
environment to use a specific fontsize, it is not correctly resize with the environment.
This is a MWE:
\documentclass{scrbook}
\usepackage[chapter]{minted}
\setminted[c++]{fontsize=\footnotesize}
%% define shortcut
\newcommand{\cd}[1]{\mintinline{c++}{#1}}
\newcommand{\cdfoot}[1]{\mintinline[fontsize=\scriptsize]{c++}{#1}}
\usepackage{scrhack}
\begin{document}
\chapter{one}
regular inline \cd{code}\footnote{footnote \cd{code} (the same size as in text)}
regular inline \cd{code} {\footnotesize \cd{code}} (no difference)
regular inline \cd{code} \cdfoot{code} (this would be expected)
\end{document}
As shown, I can work around the problem by using an extra command, but this is error-prone since the visual difference is rather small and it is easy miss incorrect usage.