LaTeX - Changing the font size for a document, but in the preamble, not the document class? [closed]
Asked Answered
M

5

16

I have a LaTeX document. I want to change the font size of all the text, to make it smaller.

Normally I would just change the documentclass part. However I am generating LaTeX files from another programme, and it is setting the documentclass, I can't change that. However I can put things in the preamble.

Is there anyway to change the font size in the preamble, without touching the documentclass declaration.

Moraceous answered 14/4, 2010 at 10:39 Comment(0)
T
14

You can use the \fontsize{size}{skip} command, where size is your desired fontsize, and skip is the distance between lines (multiplied by baselineskip). For the new fontsize to take effect, you need to follow this command with \selectfont.

A similar question has been asked here: how to set LaTeX font size in millimeter?

Theda answered 14/4, 2010 at 10:49 Comment(1)
Putting that in my preamble doesn't change the font size.Moraceous
F
7

See LaTeX - Changing the FontSize. You can surround your text in begin...end blocks for the specific size, or you can surround your text with braces where you place the size immediately after the brace. Example:

\begin{Large}
This text is large.
\end{Large}

Or, using the braces:

{\Large This text is large.}
Flatulent answered 14/4, 2010 at 10:46 Comment(1)
Yes that's a possibility, but I would need to do that for every single paragraph in the document. This is not the 'LaTeX way'Moraceous
C
4

Use any scale. For example, write

\mag 900

and get scale 90% or write

\mag 1440

and get scale 144%.

Callao answered 14/4, 2010 at 13:17 Comment(2)
That doesn't change the font size for me. All it seems to do is change the spacing between things, (e.g. border, margins etc.)Moraceous
@Rory. It works for me. It must work. All is scaled. Check \mag 500, for example.Callao
C
-1

Untested, but this might work, if you want to overwrite which size option the document class uses:

\makeatletter
\PassOptionsToClass{10pt}{article}
\makeatother

Of course, pick a size option that is supported by the document class, and replace article by the class your tool generates.

Corked answered 18/4, 2010 at 1:53 Comment(0)
F
-2

You can designate font size as an option to most documentclasses, as in

\documentclass[letterpaper, **11pt**]{article}

Braces control scoping in TeX, just like elsewhere, as Michael indicated, so you can surround the whole document with {\Large }, but that's kinda silly when you can just use the option to the documentclass as above.

Another possibility is defining your own style file or documentclass. LaTeX is built for it, so give it a try.

Fowlkes answered 14/4, 2010 at 14:15 Comment(2)
I can't change the document class definition. I can't use this.Moraceous
I misunderstood your question: can you change anything about the program producing the documents? In other words, is it your code?Fowlkes

© 2022 - 2024 — McMap. All rights reserved.