Move the cursor of the underbrace

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

Discussion Overview

The discussion revolves around the manipulation of the underbrace cursor in mathematical expressions using MathJax. Participants explore how to adjust the positioning of the underbrace to better align with specific terms in equations, illustrating their points with examples involving trigonometric identities.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant suggests moving the cursor of the underbrace to align it with the center of a specific factor in an equation, providing an example for clarity.
  • Another participant proposes a method to achieve the desired alignment using spacing hacks, expressing doubt about MathJax's capabilities for precise centering.
  • A later reply acknowledges the previous suggestion and expresses appreciation for the improved visual representation of the equations.
  • Another participant introduces an alternative solution that involves centering both lines of equations while hiding the equation number to avoid misalignment.
  • Participants express gratitude for the shared insights and techniques, indicating a collaborative effort to refine the presentation of mathematical expressions.

Areas of Agreement / Disagreement

Participants generally agree on the need to adjust the underbrace for better visual alignment, but multiple approaches are proposed without a consensus on the best method. The discussion remains open to further exploration of these techniques.

Contextual Notes

There are limitations regarding the capabilities of MathJax in achieving precise alignment, and participants acknowledge the need for workarounds or alternative methods to meet their formatting needs.

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 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
  • · Replies 2 ·
Replies
2
Views
2K