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.

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.

share|improve this question
1  
Do you want to increase the size inside all equation environment through out the dcoument or is it only at some places? –  Harish Kumar Feb 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 at 12:56
    
    
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 at 15:00

3 Answers 3

up vote 7 down vote accepted

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

share|improve this answer
    
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 at 13:25
1  
@sdaau You are welcome. Glad it helped :) –  Harish Kumar Feb 14 at 13:29

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}

enter image description here

share|improve this answer

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

\begin{equation}% 
\mbox{\fontsize{17.28}{21.6}\selectfont\( %
f(y) = a \cdot k^{y} %
\)} %
\end{equation}

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

\begin{equation}% 
\mbox{\Large\( %
f(y) = a \cdot k^{y} %
\)} %
\end{equation}

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.")

share|improve this answer

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.