Typing latex

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 i=0ni2 \sum_{i=0}^{n} i^2 and 02πcos(θ)dθ \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!

Note by Sreejato Bhattacharya
6 years, 3 months ago

No vote yet
1 vote

  Easy Math Editor

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

  • Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
  • Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
  • Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
  • Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold

- bulleted
- list

  • bulleted
  • list

1. numbered
2. list

  1. numbered
  2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1

paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
    # 4 spaces, and now they show
    # up as a code block.

    print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3 2×3 2 \times 3
2^{34} 234 2^{34}
a_{i-1} ai1 a_{i-1}
\frac{2}{3} 23 \frac{2}{3}
\sqrt{2} 2 \sqrt{2}
\sum_{i=1}^3 i=13 \sum_{i=1}^3
\sin \theta sinθ \sin \theta
\boxed{123} 123 \boxed{123}

Comments

Sort by:

Top Newest

\displaystyle \sum_{i=0}^{n}i^2 in math brackets will appear as i=0ni2 \displaystyle \sum_{i=0}^{n}i^2

jatin yadav - 6 years, 3 months ago

Log in to reply

i=0ni2=n(n+1)(2n+1)6 \displaystyle \sum_{i=0}^n i^2= \frac{n(n+1)(2n+1)}{6}

Thanks!

Sreejato Bhattacharya - 6 years, 3 months ago

Log in to reply

The intention of display style is to let inline equations, i.e. those of the form \ ( \ ), be allowed to take up more than 1 line of space, for example i=0ni2 \displaystyle \sum_{i=0}^n i^2 . This could cause your paragraph of text to appear jumpy, since the subscripts and superscripts now require more line width, as you can see in this paragraph.

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 - 6 years, 3 months ago

Log in to reply

\ [ latex \ ] aligns in the center and on a new line while \ ( latex \ ) aligns right or with text. At least I think so.

Bob Krueger - 6 years, 3 months ago

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 - 6 years, 3 months ago

Log in to reply

Or use the LaTeX\LaTeX \displaystyle

Ashish Siva - 3 years, 5 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 cos \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. 01f(x)dx \int_{0}^{1} f(x) dx

Pranav Arora - 6 years, 3 months ago

Log in to reply

Now I have a tip for you, instead of just appending dxdx to your integral, you should seperate it by \, like this:

\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 - 6 years, 3 months ago

Log in to reply

It does look better, thanks!

Pranav Arora - 6 years, 3 months ago

Log in to reply

☺☺☺☺☺☺☺☺☺☺☺☺

Ashish Siva - 3 years, 5 months ago

Log in to reply

×

Problem Loading...

Note Loading...

Set Loading...