LaTeX forum ⇒ GeneralChanging default font size

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

Changing default font size

Postby midan » Sat Dec 20, 2008 2:42 am

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
but it doesn't work. It seems like this is working only when used after \begin{document}.

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

Postby phi » Sat Dec 20, 2008 2:45 pm

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:
  1. \makeatletter
  2. \renewcommand*\@ptsize{2}
  3. \let\small\relax
  4. \let\footnotesize\relax
  5. \let\scriptsize\relax
  6. \let\tiny\relax
  7. \let\large\relax
  8. \let\Large\relax
  9. \let\LARGE\relax
  10. \let\huge\relax
  11. \input{size1\@ptsize.clo}
  12. \makeatother

Posts: 5
Joined: Thu Aug 14, 2008 10:38 pm

Postby midan » Sun Dec 21, 2008 6:48 am

Thanks, phi, this is exactly what I needed.

Return to “General”

Who is online

Users browsing this forum: No registered users and 3 guests