[Tex/LaTex] How to Specify Intermediate Font Sizes in Memoir Class

fontsizememoir

I've looked at:
KOMA – Set documentclass font to 9.5pt
and:
How to Specify Intermediate Font Sizes in Koma-Script?
but keep getting the following error:

LaTeX Warning: Unused global option(s):
[fontsize=11.6pt].

Here's a MWE:

\documentclass[fontsize=11.6pt]{memoir}
\usepackage{anyfontsize}
\usepackage[paperwidth=5in,paperheight=8in,bindingoffset=0.5in{geometry}

\addtolength{\textwidth}{.5in}

\usepackage{blindtext}
\usepackage{fix-cm}
\begin{document}
\Blinddocument
\end{document}

Best Answer

Document class options are specific to the document class. If there is no fontsize key-value pair defined, then it won't recognise it. That's the case for memoir. For specifying font sizes during the class loading, memoir only provides 9pt, 10pt, 11pt, 12pt, 14pt, 17pt, 20pt, 25pt, 30pt, 36pt, 48pt and 60pt, not 11.6pt (say). However, if you have scaleable fonts available they can be set at any size.

You can just set a font of arbitrary size using

\fontsize{<size>}{<bskip>}\selectfont

at the start of your document. In your case,

\begin{document}
\fontsize{11.6pt}{14pt}\selectfont
...

However, this will only temporarily set the font to 11.6pt, changing with every font switch. Moreover, any call to \normalsize would change it back to the default document choice.

My suggestion would be to choose a default document font size that is closest to what you're after - 12pt in your case - and then update \normalsize to select your 11.6pt choice (together with its default <bskip> of 14.5pt). Easiest here would be to patch \normalsize using etoolbox. So,

\documentclass[...,12pt,...]{memoir}

\usepackage{etoolbox}
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\normalsize}{\@xiipt}{{11.6pt}}{}{}% Update \normalsize
\normalsize% Set \normalsize

memoir does support loading of arbitrary font sizes via its *pt document class option (from the documentation; section 1.2.1 Extended font sizes):

If you use the *pt option then you have to supply a clo file containing all the size and space specifications for your chosen font size, and also tell memoir the name of the file. Before the \documentclass command define two macros, \anyptfilebase and \anyptsize like:

\newcommand*{\anyptfilebase}{<chars>}
\newcommand*{\anyptsize}{<num>}

When it comes time to get the font size and spacing information memoir will try and input a file called \anyptfilebase\anyptsize.clo which you should have made available; the \anyptsize{<num>} must be an integer. Internally, the class specifies

\providecommand*{\anyptfilebase}{mem}
\providecommand*{\anyptsize}{10}

which names the default as mem10.clo, which is for a 10pt font. If, for example, you have an 18pt font you want to use, then

\newcommand*{\anyptfilebase}{myfont}
\newcommand*{\anyptsize}{18}
\documentclass[...*pt...]{memoir}

will cause LaTeX to try and input the myfont18.clo file that you should have provided. Use one of the supplied clo files, such as mem10.clo or mem60.clo as an example of what must be specified in your clo file.