[Tex/LaTex] How to get the font sizes I need when they are in between the defaults? SAE Class progress

document-classesfontsize

I don't really know much about hacking together a class file, but as I have mentioned elsewhere on the forum, I am trying to do one for SAE. My current class file only supports a 10pt font size as the \normalsize. Using the various fontsize commands (from \tiny to \Huge), I can hit 5, 7, 8, 9, 10, 12, 14.4, 17.28, 20.74, and 24.88.

Ideally, I would like my \normalsize font to be 9pt (this is the body fontsize for SAE papers), but I need 7, 8, 9, 10, 11, 12, and 15pt fonts.

My question is, how do I achieve this? I have looked at many pages on the forums about custom font scaling and I'm a little confused.

The LaTeX manual doesn't say much on this: http://svn.gna.org/viewcvs/checkout/latexrefman/trunk/latex2e.html#Font-sizes

I was thinking about following basically the amsart.sty template, but I'm not sure how much I have to include. Do I define specific point sizes in the following way for each size:?

\renewcommand\normalsize{\@xsetfontsize\normalsize 6%
  \@adjustvertspacing \let\@listi\@listI}
\DeclareRobustCommand{\Tiny}{\@xsetfontsize\Tiny 1}
\DeclareRobustCommand{\tiny}{\@xsetfontsize\tiny 2}
\DeclareRobustCommand{\SMALL}{\@xsetfontsize\SMALL 3}
\DeclareRobustCommand{\Small}{\@xsetfontsize\Small 4%
  \@adjustvertspacing
  \def\@listi{\topsep\smallskipamount \parsep\z@skip \itemsep\z@skip
    \leftmargin=\leftmargini
    \labelwidth=\leftmargini \advance\labelwidth-\labelsep
  }%
}
\DeclareRobustCommand{\small}{\@xsetfontsize\small 5\@adjustvertspacing}
\def\footnotesize{\Small}
\def\scriptsize{\SMALL}
\DeclareRobustCommand{\large}{\@xsetfontsize\large 7\@adjustvertspacing}
\DeclareRobustCommand{\Large}{\@xsetfontsize\Large 8\@adjustvertspacing}
\DeclareRobustCommand{\LARGE}{\@xsetfontsize\LARGE 9}
\DeclareRobustCommand{\huge}{\@xsetfontsize\huge{10}}
\DeclareRobustCommand{\Huge}{\@xsetfontsize\Huge{11}}
\def\@xsetfontsize#1#2{%
  \chardef\@currsizeindex#2\relax
  \edef\@tempa{\@nx\@setfontsize\@nx#1%
    \@xp\ifcase\@xp\@currsizeindex\@typesizes
      \else{99}{99}\fi}%
  \@tempa
}

\DeclareOption{9pt}{\def\@mainsize{9}\def\@ptsize{9}%
  \def\@typesizes{%
    \or{5}{6}\or{5}{6}\or{6}{7}\or{7}{8}\or{8}{10}%
    \or{9}{11}% normalsize
    \or{10}{12}\or{\@xipt}{13}\or{\@xiipt}{14}%
    \or{\@xivpt}{17}\or{\@xviipt}{20}}%
  \normalsize \linespacing=\baselineskip
}

Before I start delving too deep into an area I know nothing about, I was hoping to get some guidance from somebody with a little more experience in this area… I really want to be able to have the class default to the following sizes:

  • footnotesize = 7pt
  • small = 8pt
  • normalsize = 9pt
  • large = 10pt
  • Large = 11pt
  • LARGE = 12pt
  • huge = 15pt

If you look closely at my class file, it is based on the article class and has the following in it:

\LoadClass[twocolumn]{article}
\ExecuteOptions{times,letter,10pt}
\ProcessOptions

However, changing the 10pt in \ExecuteOptions does nothing in my document…

Here is an MWE that prints out my current font sizes with my current (somewhat crappy) class file (class file is downloadable below):

\documentclass[letterpaper]{saeRyan}
\makeatletter
\newcommand\thefontsize[1]{{#1 The current font size is: \f@size pt\par}}
\makeatother
\begin{document}
\thefontsize\tiny
\thefontsize\scriptsize
\thefontsize\footnotesize
\thefontsize\small
\thefontsize\normalsize
\thefontsize\large
\thefontsize\Large
\thefontsize\LARGE
\thefontsize\huge
\thefontsize\Huge
\end{document}

The class file in its current state can be found here:
https://drive.google.com/file/d/0B6FxKnpluKC4NjU1TzNuZTFEWEE/view?usp=sharing

Best Answer

My solution to this problem was to first change the base class of my SAE class file from article to extarticle:

% The extarticle class allows for 9 pt font as the normalsize font.
\LoadClass[twocolumn,9pt]{extarticle}

This took care of most of the font sizes I needed, and allowed me to use a 9 pt. font as the \normalsize font in the document. For the fonts that were not available via the normal font size commands, I defined two additional font sizes in the following way:

% Define two additional exact font sizes to meet SAE guidelines. These font sizes are not included as part of the extarticle class, so we define them here. A 15pt font (baseline skip = 15*1.2 = 18), and an 11 pt font (baseline skip = 11*1.2 = 13.2). The general rule of thumb is that the baseline skip is 1.2 times the font point size. We will need to use \SAEtitlesize in the title definition, and SAEheadtwosize in the \subsection{} definition (heading level 2).
\newcommand\SAEtitlesize{\@setfontsize\SAEtitlesize{15pt}{18}}
\newcommand\SAEheadtwosize{\@setfontsize\SAEtwohead{11pt}{13.2}}

% A note about font sizes in this class: The class is based off the extarticle class, which supports 8-20pt font sizes as the default. Here we select 9pt fonts as the default \normalsize font. Thus in the SAE document class you will get the following font point sizes for each latex fontsize command:

% \tiny:         5 pt
% \scriptsize:   6 pt. 
% \footnotesize: 7 pt. SAE asks that text inside tables is 7 pt. Use \footnotesize before tables for this.
% \small:        8 pt. SAE asks for caption fonts to be 8 pt. Use \small for captions.
% \normalsize   9 pt. This should be the standard fontsize for the text body, as well as for 4th level headings (in bold/italic). This should also be the size of the paper number at the top of the page (in bold), and the size of the nomenclature/definitions/abbreviations at the end of the paper.
% \large        10 pt. This should be the size of 3rd level headings (in bold, \subsubsection{}), and the affiliations
% \Large        10.95 pt. 
% \SAEheadtwosize 11 pt. This custom font size should be the size of Heading level 2 (subsection{})
% \LARGE        12 pt. This should be the size of the author list (in bold), and all 1st level headings (in bold), including abstract, introduction, body headings, summary, references, contact info, acknowledgements, definitions/abbreviations, and the appendix heading.
% \huge         14.4 pt. 
% \SAEtitlesize 15 pt. This custom font size should be the size of the title.
% \Huge         17.28 pt.
Related Question