8

Consider the following simple example:

% === this is simple.tex ===
\documentclass[paper=a5,pagesize]{scrbook}
\usepackage{lipsum}
\begin{document}
\lipsum{1-10}
\end{document}

When processing this source file with pdflatex, the output file has the correct page size of the DIN A5 format. Now for some reasons I want to introduce my own document class:

% === this is myclass.cls ===
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myclass}[2014/07/01 1.0 current]
\LoadClass[paper=a5,pagesize]{scrbook}

% === this is withclass.tex ===
\documentclass{myclass}
\usepackage{lipsum}
\begin{document}
\lipsum{1-10}
\end{document}

As you can see, I am passing exactly the same options. In this case, the output file is created using the system default page size, in my case DIN A4. I suspect that somehow the parameters do not get propagated from \LoadClass in the same way - is this correct and what can I do about it?

2 Answers 2

5

I found a solution in one of the related posts: I need to pass the options to the package typearea explicitly.

% === this is myclass.cls ===
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myclass}[2014/07/01 1.0 current]
\PassOptionsToPackage{paper=a5,pagesize}{typearea}
\LoadClass[paper=a5,pagesize]{scrbook}
1

My familiarity with this topic is pretty minimal, but for some reason explicitly passing the options to the scrbook class seems to also work

% === this is myclass.cls ===
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myclass}[2014/07/01 1.0 current]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrbook}}
\ProcessOptions\relax
\LoadClass{scrbook}

% === this is withclass.tex ===
\documentclass[paper=a5,pagesize]{myclass}
\usepackage{lipsum}
\begin{document}
\lipsum{1-10}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .