MHB Move the cursor of the underbrace

  • Thread starter Thread starter anemone
  • Start date Start date
AI Thread Summary
The discussion revolves around the manipulation of the underbrace cursor in mathematical expressions to enhance clarity. The original poster seeks to adjust the cursor to point to specific factors in equations, illustrating this with examples involving cosine functions. A participant suggests a workaround using spacing hacks to achieve a visually appealing layout, but expresses doubts about the capabilities of MathJax for precise centering. Another participant proposes centering the equations while hiding the equation number to avoid misalignment, which is acknowledged as a better solution. The conversation highlights the importance of visual presentation in mathematical notation and the collaborative effort to find effective formatting techniques.
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

Back
Top