5

I want to create a document class based on a KOMA-Script class. First I would like change paper size, which would be defined in cls file. I see that similar problem was questioned in here, but without clear solution. Has anyone of you an example of own document class based on a scrbook?

wikibook.cls:

\ProvidesClass{wikibook}[2013/06/30]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrbook}}
\ProcessOptions\relax
\LoadClass[paper=b4]{scrbook}

or alternative:

\ProvidesClass{wikibook}[2013/06/30]
\PassOptionsToPackage{b4paper}{typearea}
\LoadClass{scrbook}

test.tex:

\documentclass[12pt]{wikibook}   
\usepackage{bookman} 
\usepackage{lipsum}    
\begin{document}    
   \chapter{First example} 
     \section{Section one}    
       \lipsum[2-8]   
   \chapter{Second example} 
     \section{Section two} 
\end{document}

Generated pdf size is persistently a4.

JardaFait
  • 3,922

1 Answers1

8

Package typearea does support ISO paper sizes including the B series. But the package does not automatically tell the paper size to the output driver. Then the layout is calculated for the specified paper size, but the media size of the PDF file gets the default size of the output driver. Package typearea provides option pagesize for telling the paper size to the output driver, see "Table 2.6.: Output driver for option pagesize=output driver" of KOMA-Script's documentation.

Example for the class file:

\ProvidesClass{wikibook}[2013/06/30]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrbook}}
\ProcessOptions\relax
\PassOptionsToPackage{paper=b5,pagesize=auto}{typearea}
\LoadClass{scrbook}
Heiko Oberdiek
  • 271,626