How can I make text that is larger than the size of the output of {\Huge ...}
?
I would like to be able to make text arbitrarily large (even if that is done by some suboptimal scaling routine).
You can use the Memoir document class. It provides two things that are relevant to your question:
The standard LaTeX document classes only allow you to choose 10pt, 11pt or 12point as the "base" font size for your document. Memoir provides many more choices: 9pt, 10pt, 11pt, 12pt, 14pt, 17pt, 20pt, 25pt, 30pt, 36pt, 48pt and 60pt. Since all font size declarations are affected by the base font size, using a bigger base font size will make \Huge
render in a bigger font.
For when it absolutely has to be bigger than \Huge
, crank it to 11 with \HUGE
.
beamer
instead, it'll be outright impossible.
If you use Type 1 fonts (e.g., package mathptmx
or mathpazo
), you can simply use the \fontsize
command with large point sizes:
{\fontsize{50}{60}\selectfont Foo!}
(The first parameter (50) is font size. The second parameter (60) is line spacing. An appropriate line spacing depends on the font. Something like 1.2 times font size is commonly used with CM fonts. But it does not really matter if you are typesetting just one line of text.)
Type 1
(or not) ?
Commented
Jul 9, 2013 at 15:44
A quick search on CTAN turned up anyfontsize
. To quote the description:
The package allows the to user select any font size (via e.g.
\fontsize{...}{...}\selectfont
), even those sizes that are not listed in the .fd file. If such a size is requested, LaTeX will search for and select the nearest listed size; anyfontsize will then scale the font to the size actually requested.Similar functionality is available for the CM family (type1cm), for the EC family (type1ec), or for either computer modern encoding (fix-cm); the present package generalises the facility.
The \resizebox
command (from graphicx
package) is convenient if you want to produce, e.g., a title that fills the entire page width:
\resizebox{\linewidth}{!}{\itshape Foo!}
To extend on @Yiannis and the comment by @isomorphismes I also needed to have the fix-cm package loaded
\documentclass[10pt,a4paper]{article}
\usepackage{fix-cm}
\makeatletter
\newcommand\HUGE{\@setfontsize\Huge{50}{60}}
\makeatother
\begin{document}
\Huge Huge text
\HUGE HUGE text
\end{document}
fix-cm
docs state that the package should be loaded with \RequirePackage{fix-cm}
before \documentclass
.
In your class add:
%% Define a HUGE
\newcommand\HUGE{\@setfontsize\Huge{38}{47}}
\makeatletter
and postface it with \makeatother
.
Commented
May 26, 2015 at 5:16
In XeTeX (using fontspec) you can use system fonts many of which have a "Scale" attribute you can set to a large number. For instance, in one document I have this line for a largeish Japanese font:
\newfontinstance\bigkanafont[Color=000000,Scale=2.5]{Hiragino Mincho Pro W3}
According to http://www.mostlymaths.net/2009/03/big-fonts-in-latex.html, you can use the fix-cm
package to get arbitrary-size fonts. In fact, searching CTAN for fix-cm
seems to give a few different packages that provide this functionality. I've never used any of them myself so I couldn't tell you which ones might work or not, but it shouldn't be hard to try them.
\scalebox{2}{\fontsize{32pt}{0pt}\selectfont \textbf{Your text}}
This piece of code worked for me and also provided better control over the size by adjusting the scale factor
There is also a package called moresize
that can be useful.
And another trick is to use, 10pt, 11pt, or 12pt but with a proportional, smaller "geometry
" than the one desired.
moresize
package. It does not provide arbitrary fontsizes however, just some more, so that one could try the EC font design sizes for example, and it can tune math scriptsize settings that should bring multiline headlines with math in a better shape. To solve the OP's problem, I'd go with one of the other recommendations.
moresize
is perfect for adding \HUGE
without changing document class. ;)
Commented
Jan 22, 2023 at 2:50