Move the cursor of the underbrace

  • Context: MHB 
  • Thread starter Thread starter anemone
  • Start date Start date
Click For Summary
SUMMARY

The discussion centers on manipulating the cursor of the underbrace in mathematical expressions using MathJax. The user seeks to adjust the underbrace's position to align it with specific factors in equations, specifically to center it under the first factor of a second equation. A solution involving the use of the \rlap command is proposed to hide the equation number while centering the equations, enhancing visual clarity. The conversation highlights the limitations of MathJax in achieving precise centering compared to full TeX implementations.

PREREQUISITES
  • Understanding of MathJax syntax and commands
  • Familiarity with mathematical notation, specifically underbraces
  • Basic knowledge of LaTeX formatting techniques
  • Experience with equation alignment and centering in mathematical expressions
NEXT STEPS
  • Explore advanced MathJax features for equation formatting
  • Learn about LaTeX commands for precise alignment and spacing
  • Investigate full TeX implementations for enhanced mathematical typesetting
  • Research best practices for presenting complex mathematical equations visually
USEFUL FOR

Mathematicians, educators, and students who utilize MathJax for displaying mathematical content, as well as anyone interested in improving the visual presentation of equations in digital formats.

anemone
Gold Member
MHB
POTW Director
Messages
3,851
Reaction score
115
Hi MHB,

I was wondering if we can move the cursor of the underbrace so that it can shift to the left or right according to our need, and I will illustrate with an example to show my point:

What I want to do here is, I want to show that the product of the terms in the first two brackets in the first equation leads to the first factor in the second equation by moving the cursor of the underbrace to the left so that it points to the center of the first factor in the second equation:

$\underbrace{{\color{orange}(2\cos x+1)}(2\cos x -1)}(2\cos 2x -1)(2\cos 4x -1)(2\cos 8x -1)={\color{orange}(2\cos x+1)}(1)$

$(4\cos^2 x-1)(2\cos 2x -1)(2\cos 4x -1)(2\cos 8x -1)=2\cos x+1$

Any advice and opinion is much appreciated, and thanks in advance for your reply.:)
 
Physics news on Phys.org
anemone said:
Hi MHB,

I was wondering if we can move the cursor of the underbrace so that it can shift to the left or right according to our need, and I will illustrate with an example to show my point:

What I want to do here is, I want to show that the product of the terms in the first two brackets in the first equation leads to the first factor in the second equation by moving the cursor of the underbrace to the left so that it points to the center of the first factor in the second equation:

$\underbrace{{\color{orange}(2\cos x+1)}(2\cos x -1)}(2\cos 2x -1)(2\cos 4x -1)(2\cos 8x -1)={\color{orange}(2\cos x+1)} \quad(1)$

$(4\cos^2 x-1)(2\cos 2x -1)(2\cos 4x -1)(2\cos 8x -1)=2\cos x+1$

Any advice and opinion is much appreciated, and thanks in advance for your reply.:)
Did you mean something like this?

$\underbrace{{\color{orange}(2\cos x+1)}(2\cos x -1)}(2\cos 2x -1)(2\cos 4x -1)(2\cos 8x -1)={\color{orange}(2\cos x+1)}\quad(1)$

$\hspace{2em}(4\cos^2 x-1)(2\cos 2x -1)(2\cos 4x -1)(2\cos 8x -1)=2\cos x+1$

As you can see, the only way I can do this is by a hack to get the spacing approximately correct. I doubt whether MathJax has the capability to get the term $(4\cos^2 x-1)$ centred precisely under the centre of the underbrace, though it could surely be done in a full implementation of TeX.
 
Opalg said:
Did you mean something like this?

$\underbrace{{\color{orange}(2\cos x+1)}(2\cos x -1)}(2\cos 2x -1)(2\cos 4x -1)(2\cos 8x -1)={\color{orange}(2\cos x+1)}\quad(1)$

$\hspace{2em}(4\cos^2 x-1)(2\cos 2x -1)(2\cos 4x -1)(2\cos 8x -1)=2\cos x+1$

As you can see, the only way I can do this is by a hack to get the spacing approximately correct. I doubt whether MathJax has the capability to get the term $(4\cos^2 x-1)$ centred precisely under the centre of the underbrace, though it could surely be done in a full implementation of TeX.

Thank you Opalg for your quick reply!;)

I see...hmm...this is very close to what I have been looking for and now, I get a much nicer looking version of the same equations, so thank you Opalg for teaching me this trick. :)
 
anemone said:
Hi MHB,

I was wondering if we can move the cursor of the underbrace so that it can shift to the left or right according to our need, and I will illustrate with an example to show my point:

What I want to do here is, I want to show that the product of the terms in the first two brackets in the first equation leads to the first factor in the second equation by moving the cursor of the underbrace to the left so that it points to the center of the first factor in the second equation:

$\underbrace{{\color{orange}(2\cos x+1)}(2\cos x -1)}(2\cos 2x -1)(2\cos 4x -1)(2\cos 8x -1)={\color{orange}(2\cos x+1)}(1)$

$(4\cos^2 x-1)(2\cos 2x -1)(2\cos 4x -1)(2\cos 8x -1)=2\cos x+1$

Any advice and opinion is much appreciated, and thanks in advance for your reply.:)
It just occurred to me that a better solution (for the case of this example) is simply to centre the two lines of equations. The only snag there is that the first line has an equation number that does not occur in the second line. To prevent this being included in the centering you can hide it in an \rlap, getting this:

$\underbrace{{\color{orange}(2\cos x+1)}(2\cos x -1)}(2\cos 2x -1)(2\cos 4x -1)(2\cos 8x -1)={\color{orange}(2\cos x+1)} \rlap{\quad(1)}$

$(4\cos^2 x-1)(2\cos 2x -1)(2\cos 4x -1)(2\cos 8x -1)=2\cos x+1$​
 
Opalg said:
It just occurred to me that a better solution (for the case of this example) is simply to centre the two lines of equations. The only snag there is that the first line has an equation number that does not occur in the second line. To prevent this being included in the centering you can hide it in an \rlap, getting this:

$\underbrace{{\color{orange}(2\cos x+1)}(2\cos x -1)}(2\cos 2x -1)(2\cos 4x -1)(2\cos 8x -1)={\color{orange}(2\cos x+1)} \rlap{\quad(1)}$

$(4\cos^2 x-1)(2\cos 2x -1)(2\cos 4x -1)(2\cos 8x -1)=2\cos x+1$​


That is certainly a much better solution in my quest and I really appreciate your help on this, Opalg! (Sun)
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
8K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K