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?
- 206,688
- 161
4 Answers
The KOMA-classes allow one to use arbitrary font sizes as the base size. To quote the manual:
fontsize=sizeIn 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
sizefor 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 meanspt. 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}
- 206,688
-
-
1@AdrielCarlos That's what the manual says, but I haven't put it to the test. – Torbjørn T. Nov 22 '16 at 18:39
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}
- 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
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, and20pt.
- 506,678
-
I get it but there is another document class that don't have this limitation? – Adriel Carlos Nov 22 '16 at 18:25
-
-
@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 '16 at 18:32
David Carlilse's comment is the right answer:
What do I put in the
\documentclassso that I can change the font size to any value?use
\fontsize{13pt}{15pt}\selectfont[and change13ptand15ptto what is desired]
The explanation:
the
documentclassoptions are not font sizes. You can have any font size you [and] want whatever option you use,\fontsize{1cm}{2cm}\selectfontfor example. [Thedocumentclassoptions] 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 a13ptfont you can use\fontsize{13pt}{15pt}\selectfontirrespective of whatdocumentclassoptions are available.
- 101
-
1Contributions 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
-
1you 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
\largeis smaller than\normalsizemath 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 options10pt,11pt,12ptare 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
\documentclasswere 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:
- the OP is asking "how do I select arbitrary font sizes using
\documentclassoptions?", and the answer is "you don't, unless you want to use KOMI"; or - the OP is asking "how do I change the font size of a document?" and the answer is "
\fontsize{Xpt}{Ypt};\selectfontBUT 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 - the OP is asking "how do I select arbitrary font sizes using
-
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
-
@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
scalefntandrelsizeand looked through the unofficial manual onfontsizeand 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
XeLaTeXorLuaLaTeXamong the possibilities? – Bernard Nov 22 '16 at 18:58\fontsize{1cm}{2cm}\selectfontfor 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}\selectfontirrespective of what document class options are available. – David Carlisle Nov 22 '16 at 19:10