9

I am using scrbook as documentclass and would like to setup the default font of the whole document to 9.5pt.

Just like you do with 9pt, 10pt, ... :

\documentclass[fontsize=9.5pt, DIV=calc]{scrbook} 

\usepackage[ngerman]{babel} 
\usepackage{blindtext} 
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[paperwidth=170mm, paperheight=240mm, top=25mm, bottom=25mm, left=25mm, right=20mm, headsep=10mm, footskip=10mm]{geometry}
\usepackage[onehalfspacing]{setspace}

\begin{document} 

\tableofcontents 
\Blinddocument 

\end{document}

This code leads to this warnings:

  • Using fallback calculation to setup font sizes for basic size '9.5pt' on input line 1655
  • Font shape 'OT1/cmr/m/n' in size <9.5> not available
  • Size substitutions with differences up to 0.5pt have occurred

I did a little bit of research and found out that you can change the fontsize in KOMA with this command:

\fontsize{Xpt}{Ypt}\selectfont

Where Xpt is the font size and Ypt is the baseline skip (which is nearly 120% of fontsize).

So I changed the code to this:

\documentclass[DIV=calc]{scrbook} 

\usepackage[ngerman]{babel} 
\usepackage{blindtext} 
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[paperwidth=170mm, paperheight=240mm, top=25mm, bottom=25mm, left=25mm, right=20mm, headsep=10mm, footskip=10mm]{geometry} 
\usepackage[onehalfspacing]{setspace}

\begin{document} 
\fontsize{9.5pt}{11.4pt}\selectfont
\tableofcontents 
\Blinddocument 

\end{document}

No errors and no warnings, but now the main-text is only setup to 9.5pt the captions, header, footer and so on, are setup to 10pt...

Also it seems that there is a problem with setting the baseline skip and onehalfspacing. If I add to the code fontsize=9pt to the documentclass, the captions, header, footer and so in, are setup to 9pt and the spacing changed again, and it does not look right...

Is there no way to set the hole fontsize to 9.5pt so Latex can manage the scale of the footer, header, captions and the spacing like it does when you set fontsize to 9pt?

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Heiko Oberdiek Apr 13 '14 at 09:27
  • 1
    Regarding the »fallback calculation« warning see http://tex.stackexchange.com/q/108569/5049 – cgnieder Apr 13 '14 at 09:29
  • At least with 9.6pt I get no warnings. Not in your example, in your example setspace causes trouble to me. – Manuel Apr 13 '14 at 11:18
  • If I set the fontsize in the first example to 9.6pt and remove the setspace, I get at still one warning: Using fallback calculation to setup font sizes for basic.... But there must be a way to set the fontsize globaly to 9.5pt and still have the option onhalfspacing. – ゲオルギオス Apr 13 '14 at 13:38
  • What you are trying to do is not impossible but it is involved. You are currently using a low level command to switch the font size but that does not affect any of the higher level LaTeX font commands such as \normalsize, \large, \small etc. So any command which includes \normalsize, for example, will switch back to what LaTeX thinks the default is meant to be and that is whatever you've set or the class sets - not what \fontsize sets. Why exactly do you want to do this? I ask because doing this is far from straightforward. Perhaps there is an alternative approach? – cfr Apr 13 '14 at 14:53
  • Hey @cfr, I totally understand what you are going to say! My code is just a try and error... I would prefer to set the fontsize 9.5pt as a default resp. on class. But that does not work... What I want is just an easy and right way to say LaTeX that the default font should be 9.5pt and please scale the \large, \small, etc. on this size! If you know a way, plz tell me! – ゲオルギオス Apr 13 '14 at 21:05
  • It works a bit better with book, especially with fontspec and XeLaTeX, but it still won't work properly for the reasons outlined. There just is no 'easy and right way' to do this. – cfr Apr 13 '14 at 22:03
  • Oh okay... I would like to stay at scrbook. This makes me a little bit sad, I really thought that there must be an easy way so set this size of font... ): – ゲオルギオス Apr 14 '14 at 04:25
  • 1
    The "fallback"-message is simply an information. And you can avoid the size substitution by loading the package fix-cm. Then fontsize=9.5pt should work fine. See also http://www.golatex.de/warning-wegen-schriftgroesse-und-seitengroesse-t12852.html. – Ulrike Fischer Apr 14 '14 at 07:27
  • @UlrikeFischer That's great. But… still I don't get what is happening here. If instead of fontsize = 9.5 you use fontsize = 9.39, 9.4, 9.6002, etc. you get no warnings. Why is there a problem exactly between 9.4 and 9.6? – Manuel Apr 14 '14 at 09:33
  • 2
    Because of \def\fontsubfuzz{.4pt} in the latex kernel. So latex will inform you of font substitution only if the size declared in the fd file differ from the one you are trying to use by more than 0.4pt. (9pt and 10pt are declared by default). With fix-cm all size are declared so all warnings will disappear. – Ulrike Fischer Apr 14 '14 at 09:50
  • With '\RequirePackage{fix-cm}' and 'fontsize = 9.5' I get 10 errors and 1 warning... The errors are all about Undefined control sequence ): – ゲオルギオス Apr 15 '14 at 06:46
  • I don't believe that you get undefined control sequence with your example. Show the log-file. But you shouldn't use onehalfspacing with such fontsizes. Use e.g. \setstretch{1.25} instead. Btw: I hate it to have to answer the same question to the same person in two places. – Ulrike Fischer Apr 15 '14 at 07:09
  • Now I got it to work! onehalfspacing was the problem... Thx for the help and sry! The only warning I get now is the Using fallback calculation to setup font sizes for basic size '9.5pt' on input line 1655, which is in your opinion only an information. But is there a way to get rid of this last "warning"? – ゲオルギオス Apr 15 '14 at 22:20

1 Answers1

5

The "fallback"-message is simply an information. And you can avoid the size substitution by loading the package fix-cm. Then fontsize=9.5pt should work fine.

You don't get substituation warnings with fontsize=0.96 as the LaTeX-kernel defines \def\fontsubfuzz{.4pt}. So latex will inform you of font substitution only if the size declared in the fd file differ from the one you are trying to use by more than 0.4pt. (9pt and 10pt are declared by default). With fix-cm all size are declared so all warnings will disappear.

Ulrike Fischer
  • 327,261