I want to write a "big" equation, not in display-math mode -- as given by the equation
environment -- but in inline-math mode, say
$E=mc^2$
How can I enlarge it?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityI want to write a "big" equation, not in display-math mode -- as given by the equation
environment -- but in inline-math mode, say
$E=mc^2$
How can I enlarge it?
Will one of \large
, \Large
, \LARGE
, \huge
, or \Huge
do? Observe that because these commands are text-mode commands, they must be executed before entering math mode.
\documentclass{article}
\usepackage{xcolor}
\begin{document}
\obeylines
{\tiny $E=mc^2$}
{\scriptsize $E=mc^2$}
{\footnotesize $E=mc^2$}
{\small $E=mc^2$}
{\color{red} $E=mc^2$ --- \texttt{\textbackslash normalsize}} % \normalsize is the default
{\large $E=mc^2$}
{\Large $E=mc^2$}
{\LARGE $E=mc^2$}
{\huge $E=mc^2$}
{\Huge $E=mc^2$}
\end{document}
Note the use of the curly braces to limit the scope of the size-setting switches.
Welcome to TeX.SE! There are different solutions given in the comment section but here's another one that could be less verbose and customizable.
\documentclass{article}
\usepackage{graphicx}% \scalebox
\newcommand{\enlargeMath}[1]{\scalebox{2}{#1}}
\begin{document}
\noindent Normal font: $X_2^2$\\[1ex]
enlarged font: \scalebox{2}{$X_2^2$}\\[1ex]
% or using the \enlargeMath command that we
% defined to eliminate the scale factor.
\enlargeMath{$X_2^2$}
\end{document}
\scalebox{2}{$X_2^2$}
and {\huge$X_2^2$}
. Or, maybe more easily, you could discuss the difference between \scalebox{2.06}{X}
and {\huge X}
. (Hint: It matters that Computer Modern fonts employ optical sizing.)
– Mico
May 10 '19 at 4:24
\scalebox
scales its contents linearly, by the factor given in the first argument. But if you compare the outputs of \scalebox{2.5}{X}
and {\Huge X}
, notice that the latter letter is drawn more finely, i.e, with thinner strokes; also, the serifs are shorter. Conversely, when comparing the outputs of \scalebox{0.5}{X}
and {\tiny X}
, notice that the latter letter's strokes are much thicker. Computer Modern fonts employ optical sizing: larger-than-normal letters are drawn with thinner strokes, while smaller-than-normal letters are drawn with heavier strokes. This improves legibility.
– Mico
May 10 '19 at 4:36
\tiny
, \Huge
, etc. vs \scalebox
?
– M. Al Jumaily
May 10 '19 at 4:44
\normalsize-\large-\Large
etc), and if the font in use employs optical scaling (as is the case for Computer Modern), then it's probably a good idea to employ \large
, \Large
, etc. If, however, if the required magnification cannot be achieved by \large
, \Large
, etc, or if the (math) font doesn't employ optical scaling, \scalebox{}{}
is more convenient.
– Mico
May 10 '19 at 4:47
\documentclass{article} \usepackage{relsize} \begin{document} $\mathlarger{\mathlarger{\mathlarger{E=mc^2}}}$ compare to $E=mc^2$ \end{document}
? Of course, if you add more or less\mathlarger
s then the thing will grow less or more. – user121799 May 10 '19 at 2:49$\displaystyle E=mc^2$
which should raise the exponent some. The default is\textstyle
. – John Kormylo May 10 '19 at 3:43