# Wrong scaled text size with relsize package and KOMA

The relsize package offers convenient ways to scale text in a document. The \textscale command allows to use arbitrary text sizes beyond the usual switches such as \large and \small. When KOMA script classes are used, however, the resulting size is messed up sometimes.

The following MWE should produce the letter M scaled from 10% to 99% of the current font size, 12pt, in steps of one percent.

% https://tex.stackexchange.com/q/4824/77970
\RequirePackage{fix-cm}
%
\documentclass{scrartcl}
\usepackage{relsize}
\KOMAoption{fontsize}{12}
\begin{document}

\renewcommand\RSpercentTolerance{0}
\newcount\foo
\foo=10
\loop
\textscale{0.\the\foo}{M}
\ifnum \foo<100
\repeat

\end{document}


However, some of the letters are out of place, smaller letters following after larger letters. For instance, \textscale{0.75}{M} produces a larger M than \textscale{0.76}{M}, while it should be the other way around. Is there a solution to this issue?

It seems that there is some incompatibility between the KOMA font size selection and the relsize package, although I cannot say what precisely. The issue is solved by simply loading the relsize package after setting the font size with \KOMAoption{fontsize}{12} as illustrated by the following MWE:

% https://tex.stackexchange.com/q/4824/77970
\RequirePackage{fix-cm}
%
\documentclass{scrartcl}
\KOMAoption{fontsize}{12}
\usepackage{relsize}
\begin{document}

\renewcommand\RSpercentTolerance{0}
\newcount\foo
\foo=10
\loop
\textscale{0.\the\foo}{M}

As expected, now \textscale{0.75}{M} produces a smaller M than \textscale{0.76}{M}. This solution appears to work smoothly wihtout any other side-effects.
• It is recommended to set fontsize=12pt in the class options: \documentclass[fontsize=12pt]{scrartcl}.