# I keep getting an error when trying to use \mathlarger

I am trying to include a summation in a paper. I was able to get it to work using this code orignially:

\begin{center}
$$\sum_{r=1}^{\infty} \frac{1}{r^{n}} = 1 + \frac{1}{2^n} + \frac{1}{3^n} + ... + \frac{1}{r^n}$$
\end{center}


However, I had wanted everything in the equation to be larger overall. I found another post on here that answered that exact question but I keep getting an error when I run it and I've checked it over several times and can't figure out what is going wrong. The code and error are listed below. I am also using the \relsize package for the larger code.

Error:

"...larger{‎‎\sum}}_{r=1}^{\infty‎}\frac{1}{r^n} = ‎1 + \frac{1}..."


Code:

\begin{center}
$\mathlarger{\mathlarger{‎‎\sum}}_{r=1}^{\infty‎}\frac{1}{r^n} = ‎1 + \frac{1}{2^n} + \frac{1}{3^n} + ... + \frac{1}{r^n}$
\end{center}


Any feedback would be appreciated.

• Using center for equations is wrong, as also is using $$. – egreg Apr 29 at 23:03 ## 2 Answers First, as @egreg said, don't use center for equations and $$ is obsolete, use $..$ instead. Second, you seem to have copy-pasted the formula from somewhere and there have been hidden unicode characters at different places; before \sum, after \infty and before 1, remove these and the formula will compile successfully.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{relsize}
\begin{document}

$\mathlarger{\mathlarger{\sum}}_{r=1}^{\infty} \frac{1}{r^{n}} = 1 + \frac{1}{2^n} + \frac{1}{3^n} + ... + \frac{1}{r^n}$

\end{document}

• Thank you! This solved the problem. – Alex Adinolfi Apr 29 at 23:17

The request was to increase size overall (not just the sum part) allowing for multiple expansion

\documentclass[]{report}
\usepackage{relsize,exscale}
\begin{document}\centering
$\mathop{\mathlarger{\sum_{r=1}^{\infty} \frac{1}{r^{n}} = 1 + \frac{1}{2^n} + \frac{1}{3^n} + ... + \frac{1}{r^n}}}$

$\mathop{\mathlarger{\mathlarger{\sum_{r=1}^{\infty} \frac{1}{r^{n}} = 1 + \frac{1}{2^n} + \frac{1}{3^n} + ... + \frac{1}{r^n}}}}$

$\mathop{\mathlarger{\mathlarger{\mathlarger{\sum_{r=1}^{\infty} \frac{1}{r^{n}} = 1 + \frac{1}{2^n} + \frac{1}{3^n} + ... + \frac{1}{r^n}}}}}$
\end{document}


Note if using exscale and amsmath then they should be loaded in that order see Compatibility between amsmath and exscale
e.g.

\usepackage{lmodern}
\usepackage{exscale,amsmath}


I do not know if the order for relsize is important, there are mixed answers and comments for its efficacy in different scenarios, however the nested and repeated use of \mathlarger was shown to benefit from the application of exscale. In that solution the \mathop{whole definition} was proposed, I ( a cut and paste advocate) followed that proposal. However note David Carlisle (who has much experience of such usage) has questioned if that is advisable hence it may not be necessary and could be dropped in many cases.

• \mathop around the whole expression? – David Carlisle Apr 30 at 7:04