[Tex/LaTex] How to set default font size in latex cls file

documentclass-writingfontsize

I am using a custom LaTeX document class for my thesis which is derived from the report class. I'd like to set the default size of the font to 12pt, and still have the option to change it (to 10pt) via the \documentclass command. How can I do it?

Best Answer

12pt is the default. The demo class is baz.cls

\RequirePackage{filecontents}
\begin{filecontents}{baz.cls}
\def\@@ptsize{12pt}
\DeclareOption{10pt}{\def\@@ptsize{10pt}}
\DeclareOption{11pt}{\def\@@ptsize{11pt}}
\DeclareOption{12pt}{\def\@@ptsize{12pt}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\ProcessOptions\relax
\LoadClass[letterpaper,oneside,onecolumn,final,openany,\@@ptsize]{report}
\end{filecontents}

\documentclass
%[10pt]
%[11pt]
{baz} 
\usepackage{lipsum}

\begin{document}
\lipsum  
\end{document}