1. Rob

Very interesting post, but I think you are missing something: Every once in a while if you change font sizes, the line height is not adjusted – resulting in large space between two lines. Maybe you could comment on that as well in this post? It would fit nicely…

• Hi Rob.
Thanks! Would you be able to provide a minimal working example of the issue you describe above?
Thanks, Tom.

• Rob

Sure!

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{blindtext}

\begin{document}
% Normalsize text
\blindtext

% Scriptsize text with normalsize line spacing
{\scriptsize
\blindtext}

% Scriptsize text with scriptsize line spacing
{\scriptsize

\blindtext

}

% \par does the trick as well
{\scriptsize
\blindtext
\par}
\end{document}
• Cool, thanks Rob!
I wasn’t aware of that issue. Will change it in the post.
Best, Tom.

• Rob

No problem, glad to help and keep up the good work!

• Thanks!

2. Humberto Munoz

Hi Tom, How I can change the font type in LaTeX for parts/elements of a document?

Thanks Humberto Munoz

3. The relsize package might also be worth mentioning in this context. 🙂

• Thanks! Tom.

4. Juan Luis Varona

The line height is assigned at the end of the paragraph.

So perhaps the solution for your doubt is to use

{\tiny Foo foo foo ... foo \par}

or

{\Huge Foo foo foo ... foo \par}
• Hi Juan!
Are you referring to Rob’s comment?
Thanks, Tom.

5. Smufos

Thanks a lot for this article and especially for the hint to use \par to adjust line spacing. Could you please add a short explanation on *why* this fixes the spacing?

• Hi Smufos,

Thanks for your question! The command \par ends the paragraph, that’s for sure. Now why \par does the trick, I’m not entirely sure. Apparently, TeX reads the whole paragraph first for optimal space adjustment between words. And manually ending the paragraph seems to also adjust \baselineskip when the font size is changed, whereas standard paragraph ending (blank line) does not. “The TeXbook” by Donald E. Knuth would be the right place to look for an answer :-).

Cheers, Tom.

6. Homa

Thanks for the article, but how can one adjust font size of all equations globally? I mean a global math size which differs from global text font size?
II seems ridiculous to change the math font size in big projects manually!

• Hi Homa,

Interesting question, thanks! You want to use the command \DeclareMathSizes as explained in the answer to this question.

Hope it helps,
Tom

7. Michael A. Peters

Hi, I’m dealing with a monospace type 1 font that is not part of CTAN, I used the fontinst instructions and they work well but it is a little too big when used inline with another font.

I noticed some fonts have a scale option that can be passed to their usepackage command that corrects this issue but I have no clue how to go about adjusting my .sty for that.

This is the extent of my lucimono.sty file:

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{lucimono}[2007/01/31 v.0.3 lucimono (Lucida Mono) package]
\RequirePackage[T1]{fontenc}
\RequirePackage{textcomp}
\renewcommand*{\ttdefault}{2lm}
\endinput

and it has worked well for years when used with lucida bright (I don’t like the monospace font that comes with lucida bright – I think it’s Lucida Typewriter, different than Lucida Mono) but when I use it with Times – it just is a little too big.

Any clue on where I need to look to find out how to add a scale option to my lucimono.sty file?

Thank you.

• Hi,

Thanks for your question. I’m not an expert on fonts really. However, what I read while trying to better understand your problem is that people recommend using luximono instead, which supports scaling through an optional parameter (see code below). You can download and install the luximono font as described here. In case you really need to use lucimono fonts, take a look at the luximono style file and how the scaling is done.

\documentclass[11pt]{article}
\usepackage[scaled=0.87]{luximono}
\renewcommand*\familydefault{\ttdefault}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{blindtext}

\begin{document}

\blindtext
{
\fontencoding{T1}\fontfamily{cmr}\selectfont
\blindtext
}

\end{document}

Best, Tom

8. Abhik

I want to write my Ph. D. Thesis in Gulliver font of latex. What should be the document class and commands for the font?

• tom

Hi Abhik,

Thanks for this interesting question! You can find an informative discussion on the Gulliver font here. Briefly, the Gulliver font is proprietary and no similar free font exists. In case using this particular font for your thesis is a university requirement, they should have a license and be able to tell you how to install it on your system. Otherwise, you might want to take a look at the LaTeX font catalogue and pick another font you like. Sorry for the “bad” news.

Cheers, Tom

9. nicola giosmin

excellent article, thank you for the “anyfontsize” package infos!

• tom

10. Abhik

I want to write my ph. d. thesis in the font Gulliver. Is there any package in Latex for it ? Kindly inform me.

• tom

It seems you asked the very same question about a year ago. Please see my response here.

11. Wow! Thanks so much for the fantastic blog! So useful! You just saved my life with the “anyfontsize”! Hooray!

• tom

Great, thanks for the positive feedback. Appreciate it!

12. John Ford

Very useful post. I’ve been using TeX for 35 years, and LaTeX for the last 20 or so, creating lecture notes with Beamer. I’ve frequently found the available font sizes limiting. The anyfontsize package solves that beautifully. Thank you.

• tom

Thanks for your comment! I greatly appreciate it. Best wishes, Tom

13. Chuxian Wang

Help me a lot

14. Hi sir,

In some standard templates like sage even though using \documentclass[12pt]{sage} font size won’t change. Is any solution for that in order to change font size..?

• tom

Hi Kanchana,

Thanks for your question. I couldn’t find the class-file for sage. It doesn’t seem to be distributed with TeXLive and wasn’t on CTAN. Would you mind pointing me to the place where I can get the cls-file for this class, please?

Thanks, Tom.

• tom

Dear Kanchana,

Thanks for the files. A pointer to the class file or the journal guidelines would have been good enough.

Anyway, the font size is hard coded in the class file (first few lines of code and line 233 onwards). Therefore, you can’t and shouldn’t change the font size if you are submitting to a SAGE journal. You can use macros such as \large to change parts of your text. See the article above for more details.

Should you want to use this class for your own purposes, you have to make changes to the class file.

HTH, Tom

15. Sanket

Have recently started using Latex. This helped a lot. Thank You.

• tom

Hi Sanket,
Great to hear, thanks!
All the best, Tom.

• Kanchana

Hi Tom sir,

I have modified the theme I want to upload it to net so that it might useful to new theme seeker. Do you know the procedure to upload it.

• tom

Hi Kanchana,

Thanks for getting back to me. By theme, do you mean the modified template? Perhaps you can post the code as a comment below. If it’s not too long and may be useful to other people, I’ll be happy to publish your code.

Thanks, Tom

16. Nishant Sharma

Its a fantastic work. I am a big fan of latex myself. Keep up the good work

• tom

Great to hear, thanks! Tom

17. ayed

Dear all, i would like write my thesis in normal font, please anyone know help me.

• tom

Hi Ayed,

Please specify what “normal” means. Helvetica, Times, or Arial are frequently used fonts. The default font in TeX/LaTeX is Computer Modern. Also, sometimes the university defines the font to be used for a thesis.

Best,
Tom

• Anonymous Coward

If he wants Times, then he could just add \usepackage{times}.

But, personally, I dislike this font. For now, my choice is on kpfonts (\usepackage{kpfonts}), which is a very good looking font.

18. Zainab

Hello,
I am writing my thesis. Some chapters have different font size – larger than others. How can make all the chapters have the same? May you help me please?

• tom

Hi Zainab,

This should not happen. You can set the normal font size globally as an optional argument to documentclass.

\documentclass[12pt]{report}

Whenever you use a macro to modify the font size locally, make sure you properly close it.

\begin{small}...\end{small}
% or
{\small ...}

Thank you Tom, wonderful resource that led me to solve the problem I had. Sometimes, it is not only the font size but also the space between the lines has to be adjusted (in my case for a verbatim environment), and doing so globally was quite a challenge.

Following your post, this is the solution I came across:

\usepackage{anyfontsize}
\usepackage{fancyvrb}
\DefineVerbatimEnvironment{verbatim}{Verbatim}{formatcom=%
\setmonofont{Menlo}

This reduced the space between the lines to 90% (if I understand it right), and sets the font, in my case Menlo, to the desired size according to your advice. This might also answer Michael Peters to whom you recommended the luximono package.

Best,

• tom

Thanks for your comment, I appreciate it. Sorry for the delay in accepting it.

Best,
Tom

20. infinitebuffalo

Is there any way to say “whatever the parent grouping’s font size is, make this group’s one size {larger|smaller}”, akin to CSS’s “font-size: larger/smaller”?

• tom

Hi there,

See here for a possible solution.

HTH, Tom

21. Gula

How do I make this font size thing into a macro?

I mean, allover fontsize is the default size while certain texts are a size depending on what I put in the macro.

Example:
Hello, {\large World}! How are {\large You} today? I, I am {\large fine}, thank you.

The way I want to do it:
Hello, {\aMacro World}! How are {\aMacro You} today? I, I am {\aMacro fine}, thank you.

What I’ve come up with so far is:
\newcommand{\aMacro}[1]{#1}
\aMacro{\footnotesize}% originally I wanted \large but now I want \footnotesize
… but this doesn’t work.

The purpose is of \aMacro is so that I can change those certain text ‘automatically’ (instead of manually) if I happen to want another size.

Thank you.

• Hi Gula

Try this:

\newcommand{\aMacro}[1]{\footnotesize #1}

Best, Tom

22. Yeom

I am writing my thesis and its format in Latex.
My university has given the reference format which is made by Hancom office (this program is only for Hangul in South korea).
So, I am changing it to Latex format.

But, I have a problem.
How do I change length of the text which have a fixed height.
I did not find this option. (In Hangul office, it is intuitively possible to adjust this option)

Thank you

• Hi Yeom,

To adjust the line width, use the geometry package. See this post for a short introduction.

Best,
Tom

23. Sudhanshu Shekhar Chaurasia

Thanks man!!!

24. praveen

hi,
How to set font size to 13 in report class?

• Hi Praveen,

13pt is not an option. You could use the class defined in the extsizes package to get a 14pt font size.

\documentclass[14pt]{extreport}

HTH, Tom

25. richardpaulhall

“\documentclass[12pt]{report}”

I am very new to Latex.
Where do you put that line?
Experimenting with it, I see no change in the document.

• With this line you define the type of document. So this should be the first line of your tex file.

26. Thank you!