[Tex/LaTex] Larger font size in math display equation environment

equationsfontsize

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:

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

... 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:

test_01

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:

test_01a

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:

test_01b

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.

Best Answer

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

\NewEnviron{myequation}{%
    \begin{equation}
    \scalebox{1.5}{$\BODY$}
    \end{equation}
    }

Code:

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

\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}

enter image description here