2

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.

1 Answers1

2

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}
esdd
  • 85,675
  • Isn't that a duplicate? – Johannes_B Mar 02 '18 at 10:30
  • Maybe. Do you have a link? – esdd Mar 02 '18 at 10:32
  • https://tex.stackexchange.com/questions/27109/koma-classes-and-loadclass, and https://tex.stackexchange.com/questions/121805/create-a-document-class-based-on-a-koma-script-class-paper-size-problem?rq=1, and https://tex.stackexchange.com/questions/187517/why-are-these-options-passed-to-loadclass-ignored. – Johannes_B Mar 04 '18 at 08:08
  • @Johannes_B Thank you. I have closed it as a duplicate. – esdd Mar 04 '18 at 12:45