I wonder why the default font sizes won't work in the following modified class file.
\RequirePackage{filecontents}
\begin{filecontents}{example.cls}
\ProvidesClass{example}
\NeedsTeXFormat{LaTeX2e}[1996/06/01]%
\LoadClass{article}
\DeclareOption{folio}{
\setlength{\paperheight}{330.2mm}%
\setlength{\paperwidth}{215.9mm}%
}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\end{filecontents}
\documentclass
%[10pt]
%[11pt, folio]
[12pt,folio]
{example}
\usepackage{lipsum}
\begin{document}
\lipsum
\end{document}
I tried the suggestion in How to set default font size in latex cls file?
\RequirePackage{filecontents}
\begin{filecontents}{example.cls}
\ProvidesClass{example}
\NeedsTeXFormat{LaTeX2e}[1996/06/01]%
\def\@@ptsize{12pt}
\DeclareOption{10pt}{\def\@@ptsize{10pt}}
\DeclareOption{11pt}{\def\@@ptsize{11pt}}
\DeclareOption{12pt}{\def\@@ptsize{12pt}}
\LoadClass[\@@ptsize]{article}
\DeclareOption{folio}{
\setlength{\paperheight}{330.2mm}%
\setlength{\paperwidth}{215.9mm}%
}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\end{filecontents}
\documentclass
%[10pt]
%[11pt, folio]
[10pt,folio]
{example}
\usepackage{lipsum}
\begin{document}
\lipsum
\end{document}
but I get an error.
! LaTeX Error: \RequirePackage or \LoadClass in Options Section.
I tried putting all \DeclareOptions after the \LoadClass command but I am not seeing any effect in the document.
Edit
I should have mentioned that putting \LoadClass after \ProcessOptions, as in the answer by Werner has the effect of the paper size folio option not working.
\paperheightand\paperwidth. However, if your plan is to change the page dimensions, they won't have any effect in the preamble. See What is the difference between\paperheight,\paperwidthand\pdfpageheight,\pdfpagewidth? Instead, you should try to set\pdfpagewidthand\pdfpageheightif you're using pdfLaTeX. – Werner Oct 09 '19 at 15:20