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?

5
  • I thin that does also (or even exclusively?) depend on the font you use, does it not? What exactly happens? You get a warning? Nov 22, 2016 at 18:17
  • Any font, if I put a valor that isn't listed all formating brake Nov 22, 2016 at 18:24
  • Are XeLaTeXor LuaLaTeX among the possibilities?
    – Bernard
    Nov 22, 2016 at 18:58
  • 3
    the documentclass options are not font sizes. You can have any font size you want whatever option you use, \fontsize{1cm}{2cm}\selectfont for example. They 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 document class options are available. Nov 22, 2016 at 19:10
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. Nov 23, 2016 at 2:48

4 Answers 4

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}
2
  • 13 was just a random number it will work with any value? Nov 22, 2016 at 18:38
  • 1
    @AdrielCarlos That's what the manual says, but I haven't put it to the test. Nov 22, 2016 at 18:39
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}
1
  • 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. Nov 23, 2016 at 3: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.

3
  • I get it but there is another document class that don't have this limitation? Nov 22, 2016 at 18:25
  • Maybe try compiling with xelatex, loading fontspec?
    – Bernard
    Nov 22, 2016 at 18:31
  • @Bernard - You wanna make that into a separate answer? (Maybe ask the OP first if using XeLaTeX and/or LuaLaTeX is a viable option?)
    – Mico
    Nov 22, 2016 at 18:32
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.

15
  • 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, 2023 at 0: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, Oct 23, 2023 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, 2023 at 22:51
  • 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.... Oct 28, 2023 at 23:03
  • 1
    @mtd but no harm done I'd just leave things as they are now Oct 28, 2023 at 23:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .