GeneralChanging default font size

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
midan
Posts: 5
Joined: Thu Aug 14, 2008 10:38 pm

Changing default font size

Post by midan »

Hello,
I would like to change the default font size of a latex file to, e.g., 12pt, in the preamable, and not within the class options. Specifically, I am using Ipe to generate drawings to be later included in my LaTeX document. Ipe generates text using a temporary latex file that starts with \documentclass{article}. I have no control over the options, hence cannot state \documentclass[12pt]{article}, which I would normally do. I can add preamable commands, but that's it.
So the question is: what would be an alternative to the [12pt] option of the article class. Maybe a package with a default options to specify the font size? I tried
\fontsize{12}{15}\selectfont
but it doesn't work. It seems like this is working only when used after \begin{document}.
Thanks,
Moshe

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Changing default font size

Post by phi »

In the standard document classes, the font size selection works as follows: The last digit of the default font size (0, 1 or 2) is saved in the command \@ptsize, then the file size1\@ptsize.clo is read, which changes some parameters. So you should be able to simulate the behavior by adding the following to the preamble:

Code: Select all

\makeatletter
\renewcommand*\@ptsize{2}
\let\small\relax
\let\footnotesize\relax
\let\scriptsize\relax
\let\tiny\relax
\let\large\relax
\let\Large\relax
\let\LARGE\relax
\let\huge\relax
\input{size1\@ptsize.clo}
\makeatother
midan
Posts: 5
Joined: Thu Aug 14, 2008 10:38 pm

Re: Changing default font size

Post by midan »

Thanks, phi, this is exactly what I needed.
Cheers!
Post Reply