# Larger font size in math display equation environment?

Consider the following MWE:

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{graphicx} % \scalebox
% defaults seem to be: pslatex.sty:103: \DeclareMathSizes{12}{12}{9}{7}
% NB: Font shape OML/cmm/m/it' in size <16> not available, size <17.28> substituted on input line 6.
% \DeclareMathSizes{12}{17.28}{9}{7} % (a)
\begin{document}
Here I'll be trying a small example... First, I am writing an inline equation here: $a + b$; also comparing plain number 123 vs. $123$ as inline equation -- and here, below, I'm using display equation:

$$% % \large % (b) % \scalebox{1.5}{ % (c) f(y) = a \cdot k^{y} % % } % (c)$$

... and finally, I'm having a closing sentence, just to have some text after the display equation.

\end{document}

% # convert -density 150 test.pdf -crop 846x329+196+251 test_.png


Now - compiled as is, the output produced is:

That is the default output, and I'd like to change (in this case, increase/make larger) only the display equation's - the one in the equation environment - font size.

So, if I uncomment only statement (a) (with \DeclareMathSizes), I get this:

The display equation size changed, and the equation numbering didn't, which is good - but the inline equations also changed size, which I don't want.

Then, if I uncomment only statement (b) from the posted MWE (with \large), I get:

The display equation size changed, and the inline equations didn't, which is good - but also the equation numbering changed size, which I don't want.

Finally, if I uncomment only statement (c) from the posted MWE (with \scalebox and its closure) - I cannot even compile the MWE, as it fails with:

! Missing $inserted. <inserted text>$
l.14 }
% (c)
? X
No pages of output.
Transcript written on test.log.


So, how could I change only the math display equation font size? If there is a different approach for "case-by-case" (e.g. in individual equation blocks) setting, vs. a global setting (per document), that would be nice to know too.

• Do you want to increase the size inside all equation environment through out the dcoument or is it only at some places? – user11232 Feb 14 '14 at 12:53
• Thanks for the comment, @HarishKumar - I cannot exactly tell, honestly, which is why the last sentence in OP is so undecided :) I think I'd like to change only at some places first; then if it turns out that in the document I write, most equations seem to need this increase, then I'd like to convert the individual changes to a single, global document setting. Cheers! – sdaau Feb 14 '14 at 12:56
• – sdaau Feb 14 '14 at 13:50
• if the only problem were the size of the tag, this simple code replacement for amsmath fixes that: \makeatletter \def\maketag@@@#1{\hbox{\m@th\normalfont\normalsize#1}} \makeatother . however, it's not enough, since the vertical spacing is also affected badly by the change in size. – barbara beeton Feb 14 '14 at 15:00

This defines a new environment myequation with the help of environ package:

\NewEnviron{myequation}{%
$$\scalebox{1.5}{\BODY}$$
}


Code:

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{graphicx} % \scalebox
\usepackage{environ}
\NewEnviron{myequation}{%
$$\scalebox{1.5}{\BODY}$$
}

\begin{document}
Here I'll be trying a small example... First, I am writing an inline equation here: $a + b$; also comparing plain number 123 vs. $123$ as inline equation -- and here, below, I'm using display equation:
%% Don't leave this line empty
\begin{myequation}%
f(y) = a \cdot k^{y} %
\end{myequation}
%
... and finally, I'm having a closing sentence, just to have some text after the display equation.

\end{document}


• Many thanks for that, @HarishKumar - I was thinking there is maybe some command/parameter I could change, and keep on using equation; but this confirms that is probably not the way to do it. Thanks again - cheers! – sdaau Feb 14 '14 at 13:25
• @sdaau You are welcome. Glad it helped :) – user11232 Feb 14 '14 at 13:29
• Note that math mode is turned to inline instead of displayed (as regular equations). $\displaystyle \BODY$ fixes this. – arauzo Jan 23 '18 at 16:31

Just to make a note - via this answer: Setting math font size - TeX - LaTeX Stack Exchange; I also got this to work (\mbox + \fontsize + $$) with the equation environment (just the equation snippet here, without the rest of the MWE): $$% \mbox{\fontsize{17.28}{21.6}\selectfont\( % f(y) = a \cdot k^{y} %$$} %$$


Also this seems to work (\Large instead of \fontsize):

$$% \mbox{\Large$$% f(y) = a \cdot k^{y} %$$} %$$


The important quote from there seems to be:

... need to switch out of math mode, use a lower level font size change such as \fontsize ... and then switch back into math mode using \( not $ ... Another quote that may clarify, from How to change the size of formulas? - Wikidot Community: You'll also note that there's some \mbox weirdness in there. The font selection command don't work in math mode ... So, we use the \mbox to create a little text-mode environment inside the equation, change the font, and declare an equation inside the text box. Sort of like Russian dolls, but it works. (Note that the weird font sizes above are so as to avoid "LaTeX Font Warning: Font shape OMX/cmex/m/n' in size <16> not available, size <17.28> substituted on input line 15.") • What about \everydisplay\expandafter{\the\everydisplay\small }. It will make all display math in \small font size including equation numbers – Linuxss Sep 15 '16 at 8:01 You can use the relsizepackage, which has a \mathlargercommand. If you use it in one of the amsmath environments, you have to repeat the command for each part of the formulae (not working with &and \\:  \documentclass[a4paper,12pt]{article} \usepackage{amsmath} \usepackage{graphicx} % \usepackage{relsize} \begin{document} Here I'll be trying a small example... First, I am writing an inline equation here:$a + b$; also comparing plain number 123 vs.$123\$ as inline equation -- and here, below, I'm using display equation:
\begin{align}
f(z)  & = a \cdot k^{z} \\%
\mathlarger{f(z) } & = \mathlarger{a \cdot k^{z}}
\end{align}
... and finally, I'm having a closing sentence, just to have some text after the display equation.

\end{document}