How to only align math lines with an anchor symbol & in them?

How to only align math lines with an anchor symbol & in them, and ignore the rest? I am showing a proof of the Reflection Formula, and I want to quickly mention that the combining of limits is justified, but because of the alignment symbols, the text is shifted and looks horrible. Quitting math mode and reentering it for this one sentence doesn’t work, because then the alignment between the top and bottom math sections are no longer the same!

This example is with a text, but is there a way to do it in general? How can I only align math lines with the anchor symbol in them?

Proof:
$
frac(pi, sin(pi x)) &= Gamma(x) Gamma(1-x)\
frac(pi x, sin(pi x)) &= x Gamma(x) Gamma(1-x)\
frac(pi x, sin(pi x)) &= Gamma(1+x) Gamma(1-x)\
frac(pi x, sin(pi x)) &= (lim_(N -> infinity) N^(x+1-1) product_(k = 1)^N frac(k, x + 1 - 1 + k)) (lim_(N -> infinity) N^(1-x-1) product_(k = 1)^N frac(k, 1-x -1 + k))\
frac(pi x, sin(pi x)) &= (lim_(N -> infinity) N^x product_(k = 1)^N frac(k, x + k)) (lim_(N -> infinity) N^(-x) product_(k = 1)^N frac(k, -x + k))\
"Both limits exist, so we may combine them"\
frac(pi x, sin(pi x)) &= lim_(N -> infinity) N^x N^(-x) (product_(k = 1)^N frac(k, x + k)) (product_(k = 1)^N frac(k, -x + k))\
frac(pi x, sin(pi x)) &= product_(k = 1)^infinity frac(k, x + k) frac(k, -x + k))\
frac(pi x, sin(pi x)) &= product_(k = 1)^infinity frac(k^2, k^2-x^2)\
frac(sin(pi x), pi x) &= product_(k = 1)^infinity frac(k^2-x^2, k^2)\
frac(sin(pi x), pi x) &= product_(k = 1)^infinity (1-frac(x^2, k^2))\
$

Welcome to the forum. The alignment is a somewhat hard problem, since semantically you don’t have any way of making two math parts communicate with each other. The text in between is definitely not a math text, and therefore should be typeset as a regular paragraph.

There are many such questions, but in this case I think the easiest way would be to copy the longest line, hide it, and remove the empty space:

Proof:

$
  frac(pi, sin(pi x)) &= Gamma(x) Gamma(1-x)\
  frac(pi x, sin(pi x)) &= x Gamma(x) Gamma(1-x)\
  frac(pi x, sin(pi x)) &= Gamma(1+x) Gamma(1-x)\
  frac(pi x, sin(pi x)) &= (lim_(N -> infinity) N^(x+1-1) product_(k = 1)^N frac(k, x + 1 - 1 + k)) (lim_(N -> infinity) N^(1-x-1) product_(k = 1)^N frac(k, 1-x -1 + k))\
  frac(pi x, sin(pi x)) &= (lim_(N -> infinity) N^x product_(k = 1)^N frac(k, x + k)) (lim_(N -> infinity) N^(-x) product_(k = 1)^N frac(k, -x + k))\
$

Both limits exist, so we may combine them

#pad(top: -3.6em, $
  std.hide(frac(pi x, sin(pi x)) &= (lim_(N -> infinity) N^(x+1-1) product_(k = 1)^N frac(k, x + 1 - 1 + k)) (lim_(N -> infinity) N^(1-x-1) product_(k = 1)^N frac(k, 1-x -1 + k)))\
  frac(pi x, sin(pi x)) &= lim_(N -> infinity) N^x N^(-x) (product_(k = 1)^N frac(k, x + k)) (product_(k = 1)^N frac(k, -x + k))\
  frac(pi x, sin(pi x)) &= product_(k = 1)^infinity frac(k, x + k) frac(k, -x + k))\
  frac(pi x, sin(pi x)) &= product_(k = 1)^infinity frac(k^2, k^2-x^2)\
  frac(sin(pi x), pi x) &= product_(k = 1)^infinity frac(k^2-x^2, k^2)\
  frac(sin(pi x), pi x) &= product_(k = 1)^infinity (1-frac(x^2, k^2))\
$)

#lorem(12)

move won’t work, because it doesn’t have reflow (like rotate or scale), hence the layout doesn’t move with moved content.

1 Like