6

What do I put in the \documentclass so that I can change the font size to any value? I'm asking because for {extarticle} 13pt isn't an option. So what do I do?

Torbjørn T.
  • 206,688

4 Answers4

6

The KOMA-classes allow one to use arbitrary font sizes as the base size. To quote the manual:

fontsize=size

In contrast to the standard classes and most other classes that provide only a very limited number of font sizes, 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. If you use this option inside the document, the main document font size and all dependent

Of course these classes changes a lot of other things as well, but you could try

\documentclass[fontsize=13pt]{scrartcl}
Torbjørn T.
  • 206,688
6

As stated by @TorbjørnT., the KOMA-classes allow one to use arbitrary font sizes as the base size. The important notice here is that one should load the \RequirePackage{fix-cm} package before \documentclass. This way, you can avoid size substitution which usually occurs when choosing a non-standard fontsize (11.5, 13, 15, etc.). Refer to the KOMA-script manual for more details. Here is an example:

\RequirePackage{fix-cm}
\documentclass[fontsize=13pt,DIV=12]{scrartcl}
\usepackage{lipsum}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\begin{document}

\lipsum

\end{document}
AboAmmar
  • 46,352
  • 4
  • 58
  • 127
  • Whatever happened to a slow, tedious METAFONT run whenever the user specified an absent font size? Twenty years ago, this question wouldn't have been asked. – Eric Towers Nov 23 '16 at 03:16
5

From page 2 of the 2-page user guide of the extarticle document class:

The sizes available are 8pt, 9pt, 10pt, 11pt, 12pt, 14pt, 17pt, and 20pt.

Mico
  • 506,678
0

David Carlilse's comment is the right answer:

What do I put in the \documentclass so that I can change the font size to any value?

use \fontsize{13pt}{15pt}\selectfont [and change 13pt and 15pt to what is desired]

The explanation:

the documentclass options are not font sizes. You can have any font size you [and] want whatever option you use, \fontsize{1cm}{2cm}\selectfont for example. [The documentclass options] are option names that just happen to look like lengths and specify not only the default body font size, but also affect margins, headings and several other aspects of the design. So if you want a 13pt font you can use \fontsize{13pt}{15pt}\selectfont irrespective of what documentclass options are available.

mtd
  • 101
  • 1
    Contributions are welcome, but copy-pasting somebody else's comments is not a good idea. Aside from anything else, David's answer is problematic if you interpret it to mean you can make your default document font 13pt and expect stuff to work right. It won't. This may be a reasonable option for a title page, say, if you're laying everything out manually anyway. But it is certainly not a reasonable answer to this question. Nor did David propose it as an answer to this question. It's a comment on a comment. – cfr Oct 23 '23 at 00:02
  • 1
    you can (as I wrote) select an arbitrary font size, but this isn't answering the question on how to set up a document design option based on that size. If you select 13pt/15pt in this way you may find that \large is smaller than \normalsize math fonts are not set up (as 13pt isn't a common size) subsection headings may be smaller than the body text etc. This is why the standard class options 10pt, 11pt, 12pt are option names not simply font sizes, and why the class does not take arbitrary values, – David Carlisle Oct 23 '23 at 16:56
  • @cfr This exactly answers the question "how do I change [exactly] the font size", which is what the OP asked -- they mistakenly thought that was done with \documentclass, but it's not. – mtd Oct 28 '23 at 22:51
  • @DavidCarlisle understood that the question "how to set the document design option based on an arbitrary font size?" is not answered, but that's not what the OP was asking, it seems. You usefully (to me, anyway) pointed out that the OP could change the font size and that changing the font size alone was not what the document design options to \documentclass were intended to do. – mtd Oct 28 '23 at 22:54
  • @cfr I'm not sure why copy-pasting someone's comments -- if they are the answer -- with full attribution is a bad idea, if they're the answer (as I pointed out). – mtd Oct 28 '23 at 22:58
  • @DavidCarlisle @cfr if we think the question is ambiguous:
    1. the OP is asking "how do I select arbitrary font sizes using \documentclass options?", and the answer is "you don't, unless you want to use KOMI"; or
    2. the OP is asking "how do I change the font size of a document?" and the answer is "\fontsize{Xpt}{Ypt};\selectfont BUT you probably don't want to do that because font size of normal font is NOT the only thing you probably want to change"

    ...then do you suggest we create an answer that answers both questions, or somehow ask the OP to clarify the question, or...?

    – mtd Oct 28 '23 at 23:02
  • 1
    @mtd I'm not to worried about the comment (egreg got to be highest rep user by copying all my comments:-) but I commented rather than answered because i didn't consider it an answer.... – David Carlisle Oct 28 '23 at 23:03
  • 1
    @mtd but no harm done I'd just leave things as they are now – David Carlisle Oct 28 '23 at 23:04
  • @DavidCarlisle definitely not trying for farm rep -- thanks for the time replying to my questions...will do as you suggest; and, of course, thanks very much for the original comment! – mtd Oct 28 '23 at 23:10
  • Note this won't change the font size of normal font. So it isn't just that only doing that isn't what you probably want to do. – cfr Oct 29 '23 at 01:54
  • I know this isn't true across the SE network, but on TeX SE people usually ask somebody to turn a comment into an answer if they think it should be an answer. It's not wrong according to SE's rules, but I suppose you could call it a community norm. People tend to get annoyed if you turn their comments into answers without suggesting they do it themselves first. And people will offer to delete their answers if they do this accidentally, if the original commentator wants to answer instead. – cfr Oct 29 '23 at 01:59
  • @cfr Thanks for the clarification, and I'm happy to follow the community norms. I'm not an expert TeX user, though I was definitely helped by @ DavidCarlisle's comment enough to try to make it the answer that I wish I had found. – mtd Oct 30 '23 at 12:54
  • @cfr it doesn't change the normal font?! I would love to figure out what's going on, then, cause the document I was interested in (I happened to be using \documentclass[extarticle]) definitely seemed to get bigger across all the font sizes. I'll hunt around for how to show all the sizes and figure things out. – mtd Oct 30 '23 at 12:58
  • I've seen scalefnt and relsize and looked through the unofficial manual on fontsize and made a MWE (pdf output) and I understand more. I'll try to craft an answer that would have saved me/us all this... – mtd Oct 30 '23 at 14:10
  • I still think your guys' comments are the essence of the best answer. It also seems like https://tex.stackexchange.com/a/585314/106529 answers the intended question already. – mtd Oct 30 '23 at 14:10