Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am new to LaTeX. I am having a hard time creating a font past 40 points. Here is my code:

\documentclass[letterpaper]{article}
\begin{document}
    \fontsize{40}{48}\selectfont hi
\end{document}

If I change the 40 and corresponding 48 to anything bigger, it does not seem to increase the size of the word "hi". I can go lower but not higher.

Technically I need this for some text in a cell for a table I am working on in LaTeX, but I'm sure if I figured out what I was doing wrong I could apply it to the table. The font size I am aiming for is somewhere around 60 to 100 points in size.

share|improve this question

2 Answers 2

Edit: I added a new example to compare scaled fonts and resized fonts.

LaTeX can't use font sizes that are not listed in the .fd file. When compiling your MWE, you can see some warnings:

LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <40> not available
(Font)              size <24.88> substituted on input line 8.

because the .fd file of Computer Modern provides a discrete list of sizes (with a maximum size of 24.88pt).

To use scalable fonts, there are some useful packages:

  • type1cm (Computer Modern via cm-super).

  • anyfontsize (with any font but automatically only via latex)

  • lmodern (a sort of "super cm-super").

Here is an example using lmodern package (that provides scalable fonts):

enter image description here

\documentclass[letterpaper]{article}
\usepackage{lmodern}
\usepackage{graphicx}
\begin{document}
    \fontsize{40}{48}\selectfont hi
    \fontsize{60}{70}\selectfont hi
    \fontsize{100}{120}\selectfont hi%

    % compare scaled fonts and resized fonts
    \fontsize{100}{120}\selectfont hi%
    \scalebox{5}{\fontsize{20}{24}\selectfont hi}%
    \scalebox{10}{\fontsize{10}{12}\selectfont hi}%
    \scalebox{20}{\fontsize{5}{6}\selectfont hi}

    % a BIG font
    \fontsize{300}{350}\selectfont hi
\end{document}
share|improve this answer
    
Could you add why it doesn't work for the default CM fonts? –  egreg Sep 25 '12 at 8:54
    
How about just adding the anyfontsize package? –  daleif Sep 25 '12 at 9:55
1  
It works for CM fonts with package type1cm with smoother scaling. The restriction of the standard behaviour comes from the times with PK fonts, where for each size a new PK fonts had to be generated. Using fixed sizes helped to limit the number of PK fonts. –  Heiko Oberdiek Sep 25 '12 at 12:50

If this does not form part of regular textual content, you can always resize it in a box:

enter image description here

\documentclass{article}
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\begin{document}
\begin{tabular}{ccccc}
  hi &
  \large hi &
  \Huge hi &
  \resizebox{!}{100pt}{hi} &
  \scalebox{20}{hi}
\end{tabular}
\end{document}

graphicx provides the scaling/resizing capability.

share|improve this answer
3  
Change the size of a font is not always a homothetic transformation... –  Paul Gaborit Sep 25 '12 at 6:12
    
I suggest you read again the third paragraph of chapter 1 of the TeXbook. –  Martin Schröder Sep 25 '12 at 15:05
    
@MartinSchröder: The OP mentions "Technically I need this for some text in a cell for a table" which is small in scale. The examples shown by Paul reflecting the "poor" transformation of text under scaling is a bit extreme: Why would one resize a 5pt (\tiny) font to 100pt - it is visually obvious that the kerning for \tiny is awkward, which is exacerbated when enlarged 20 times. Honestly, I don'y see a loss in quality using the above method, nor the need to switch to a different typesetting system as a result. –  Werner Sep 25 '12 at 15:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.