# Options in custom class [duplicate]

Consider the following class:

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{sampleclass}

paper=a5,
chapterprefix=true
]{scrbook}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrbook}}
\ProcessOptions\relax


and the following document:

\documentclass[
]{sampleclass}

\begin{document}
\chapter{Test}
\end{document}


I am making the observation that the option chapterprefix=true has an effect on the document, while the option paper=a5 does not.

If I include the paper option in the document like this:

\documentclass[
paper=a5
]{sampleclass}

\begin{document}
\chapter{Test}
\end{document}


then it works. What is going on?

Edit: In the chat it was suggested the problem might be connected to the KOMA class so I just add the tag here to attract the KOMA experts.

## marked as duplicate by esdd koma-script StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Mar 4 '18 at 12:44

paper=a5 is an option of package typearea which is part of the KOMA-Script classes. It is loaded by each KOMA-Script class automatically. So you have to pass the option to package typearea:

\begin{filecontents}{sampleclass.cls}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{sampleclass}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrbook}}
\ProcessOptions\relax

\PassOptionsToPackage{paper=a5}{typearea}
chapterprefix=true
]{scrbook}

\end{filecontents}

\documentclass[
]{sampleclass}
\begin{document}
\chapter{Test}
\end{document}

• Isn't that a duplicate? – Johannes_B Mar 2 '18 at 10:30
• Maybe. Do you have a link? – esdd Mar 2 '18 at 10:32
• @Johannes_B Thank you. I have closed it as a duplicate. – esdd Mar 4 '18 at 12:45