3

According to the KOMA-Script manual,

the KOMA-Script classes offer the feature of selection of any desired size for the main document font. In this context, any well known TeX unit of measure may be used and using a number without unit of measure means pt.

The default Koma Script font size is 11 points. I can specify 8 points without any difficulty, but if I try 8.5 I get the following error message

LaTeX Warning: Unused global option(s):
    [8.5pt].

And the text reverts then to the default 11 point size. So how do I specify intermediate point sizes in KOMA-Script?

To respond to Johannes_B comment, I tried this:

\documentclass[fontsize=8.5pt,paper=a6,pagesize]{scrbook} 
\KOMAoption{fontsize}{8.5pt}
 %if set here, you need to:
\recalctypearea 
\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont[Mapping=tex-text]{Minion Pro Cond}
\usepackage{blindtext} 
\begin{document} 
\blindtext 
\end{document}  

The error message received was:

LaTeX Font Warning: Size substitutions with differences
(Font)              up to 0.5pt have occurred.

It is kind of strange that you would have to specify the font size twice; but OK. But more importantly, if size substitutions merely drop the font back to 8 pt. or pump it up to 9pt, then you really don't have access to intermediate point sizes in Koma-script. Or?

(second edit) Why is this syntax OK: A. \documentclass[8pt]{scrbook} but this not? B. \documentclass[8.5pt]{scrbook}

I deleted the pagesize code because it's not relevant (except with respect to the calculation of the type area). In Example A there is no "fontsize=8pt" declaration, yet the class produces 8 pt typesetting. Example B yields the previous error (i.e., global option ignored) while adding "fontsize=8.5" yields an error message that the font size may be substituted (how would you know?) with differences of up to .5 pt (up or down or both?).

  • 1
    The warning is very clear, you are using an option that is not defined. Set the fontsize the way it is supposed to be -> \documentclass[fontsize=4pt]{scrartcl} %\KOMAoption{fontsize}{4pt}%if set here, you need to: \recalctypearea \usepackage{blindtext} \begin{document} \blindtext \end{document} – Johannes_B Sep 7 '14 at 16:50
  • 1
    But beware, just because you can request any font size, does not mean any font size is available. – Johannes_B Sep 7 '14 at 16:54
  • I'm not sure I understand. The syntax is: working: \documentclass[8pt,a6,pagesize]{scrbook}; not working: \documentclass[8.5pt,a6,pagesize{scrbook}. Are you saying you have to specify fontsize twice in Koma-Script? I.e., once in the document class declaration, and again through a \KOMAoption command? – user26732 Sep 7 '14 at 20:24
  • No, just once using `fontsize=8.5 pt. You can copy the above example, correct the comment and run the document. – Johannes_B Sep 7 '14 at 20:32
  • Made my previous comments into an answer. One or two other bits of advice unrelated to your main question. If you aren’t actually using the other features of xltxtra and xunicode, you could load realscripts instead (and even metalogo, if you actually use it) and make your document compatible with LuaLaTeX. I prefer to do that when possible because (among other reasons) microtype supports font expansion on LuaLaTeX but not XeLaTeX, and that makes a very noticeable difference. – Davislor Aug 2 at 19:17
4

Just to have the code properly:

The warning is very clear, you are using an option that is not defined. Set the fontsize the way it is supposed to be. If you are not setting it globally (as an option to documentclass) but at a later point using \KOMAoption{fontsize}{4pt} you need to tell package typearea to recalc the typearea.

\documentclass[
fontsize=8.5pt,
paper=a6,
pagesize
]{scrartcl}
%\KOMAoption{fontsize}{8.5pt}
%\recalctypearea
\usepackage{blindtext}
\begin{document}
\blindtext
\end{document}

But you need to be aware of something: Just because you can request a font of any given size, you need to have that size available. If not, LaTeX will fall back to the next matching available font size.

2

LaTeX is trying to give you helpful warnings, in this case it works. Just remember to always look at the first thing LaTeX says about something.


So we start with an MWE and compile that with pdflatex.

\documentclass[
    paper=a6,
    8.5pt,
  ]{scrartcl}

\usepackage{lipsum}

\begin{document}

\lipsum[1]

\end{document}

LaTeX tells us

LaTeX Warning: Unused global option(s):
    [8.5pt].

There is no option called 8.5pt. (There are similar options like 10pt that set the font size to the given value, but those are specially defined, you can't just insert any dimension and expect KOMA Script to know what to do with it.)


Okay, so we insert the appropriate option

\documentclass[
    paper=a6,
    fontsize=8.5pt,
  ]{scrartcl}

\usepackage{lipsum}

\begin{document}

\lipsum[1]

\end{document}

and LaTeX tells us1

LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <8.5> not available
(Font)              size <8> substituted on input line 2162.

What does this mean? Well, in order to typeset a document with 8.5pt text you have to actually use a font that provides those glyphs. The default font (Computer Modern) does not, so LaTeX chooses a close size that is present (8 in this case) and warns you about it. You will have to select a scalable font to be able to get arbitrary font sizes.


We can load lmodern to get a font (Latin Modern) that looks pretty much the same as Computer Modern but is scalable. It is however only available after \begin{document}, so we have to postpone our font size selection until then.

\documentclass[
    paper=a6,
  ]{scrartcl}

\usepackage{lmodern}
\AtBeginDocument{%
  \KOMAoption{fontsize}{8.5pt}%
  \recalctypearea
}

\usepackage{lipsum}

\begin{document}

\lipsum[1]

\end{document}

No more warnings.


1 This is where pdflatex makes a difference. If we had used lualatex or xelatex, this would work just fine.

  • Since the MWE loaded xltxtra and xunicode, I imagine the asker was using XeLaTeX. – Davislor Aug 2 at 18:44
  • @Davislor I thought so, too. However, they also got the warning about the font not being available in that size that they should not have gotten in XeLaTeX.. – schtandard Aug 3 at 0:20
  • That warning was for the math fonts that fontspec didn’t change. See my answer. – Davislor Aug 3 at 0:52
1

Checking the .log file shows that the error you were getting about font sizes not available is for some legacy 7- and 8-bit math fonts that fontspec doesn’t change from the defaults. You can fix this bug by loading any package that sets up scalable math fonts, such as unicode-math (which I personally recommend), newtxmath or lmodern. Your text font was already properly scaled.

It should not be necessary to pass an option you already gave to the document class again, with \KOMAoption, except in a few special cases like the one schtandard discussed. You don’t need to in this instance.

You also ask why there is a class option 8pt but no 8.5pt. Good question! There aren’t options for every possible size, such as 10.125pt or 3.14129pt, much less for the other units of height that fontsize= supports like 10bp, because there would be infinitely many. LaTeX doesn’t parse the option into a decimal number plus a suffix. It has a predefined list of them. The preferred option to use is fontsize=. The standard document classes added options like 8pt and 11pt back when TeX used METAFONT to generate fixed-size bitmap fonts, and that interface hasn’t aged well. Those options were grandfathered in for compatibility.

Since the question is about font scaling, here’s how I usually set up my font scaling with fontspec:

\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{Some Font}[Scale = 1.0]

This sets the main font to its natural size and automatically scales every (modern) font in the document to the same x-height. In some cases, Scale=MatchUppercase might be more appropriate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.