I have a few questions about typing LaTeX. However, I know the basics of LaTeX, but the answers to my following questions would help my LaTeX equations look better. Any kind of help is appreciated.

1) In certain submitted solutions I have seen the LaTeX equations to be aligned at the center instead of beside the text. Is there any code which aligns the equations at the center?

2) When I type summations or definite integrals in LaTeX, for example \sum*{i=0}^{n} i^2 or \int*{0}^{2 \pi} cos( \theta) d\theta, they appear respectively as \( \sum_{i=0}^{n} i^2\) and \( \int_{0}^{2 \pi} cos( \theta) d\theta \). Note that the subscripts and superscripts do not appear exactly above the \( \sum \) or the \( \int \) sign, but to a little right of them. However in some comments in Brilliant discussions, for example this one, I have seen that the superscripts and subscripts can be written directly above the mathematical signs. What is the code to do it?

I am asking it here only because I know it is possible, but the LaTeX guideline does not seem to answer it. Any kind of help will be appreciated. \( ☺ \)

Thanks!

## Comments

Sort by:

TopNewest\ [ latex \ ] aligns in the center and on a new line while \ ( latex \ ) aligns right or with text. At least I think so. – Bob Krueger · 3 years, 7 months ago

Log in to reply

\displaystyle \sum_{i=0}^{n}i^2 in math brackets will appear as \( \displaystyle \sum_{i=0}^{n}i^2 \) – Jatin Yadav · 3 years, 7 months ago

Log in to reply

Thanks! – Sreejato Bhattacharya · 3 years, 7 months ago

Log in to reply

Conversely, since stand-along equations, i.e. those of the form \ [ \ ], already take up a chunk of their own space, and hence the equations (tend to) display as intended. It is not required to use \displaystyle (which you did in your code above) – Calvin Lin Staff · 3 years, 7 months ago

Log in to reply

Now that your queries are answered, I would like to add that you can write "cos" in a neater way. Use \cos in your latex code i.e \( \displaystyle \cos \). You see that it looks much better than simply writing "cos" in your code. The same works for other trig functions too.

Limits can be applied to a definite integral the same way you would do for a summation. \[ \int_{0}^{1} f(x) dx \] – Pranav Arora · 3 years, 7 months ago

Log in to reply

\[ \text{\int_0^1 f(x) \, dx } \implies \int_0^1 f(x) \, dx \]

It's not really a big deal, but it does look a tiny bit nicer. – Tim Vermeulen · 3 years, 7 months ago

Log in to reply

– Pranav Arora · 3 years, 7 months ago

It does look better, thanks!Log in to reply

You can also add \limits to your expression, like this:

\[ \text{\sum\limits_{i=0}^n i^2 } \implies \sum\limits_{i=0}^n i^2 \] – Tim Vermeulen · 3 years, 7 months ago

Log in to reply

`\displaystyle`

– Ashish Siva · 10 months agoLog in to reply

☺☺☺☺☺☺☺☺☺☺☺☺ – Ashish Siva · 10 months ago

Log in to reply