2

This question already has an answer here:

Consider the following class:

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{sampleclass}

\LoadClass[
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 Mar 4 '18 at 12:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

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}
\LoadClass[
chapterprefix=true
]{scrbook}

\end{filecontents}

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.