Need help -- Having trouble with eqnarray*/gathered/aligned

  • Context: LaTeX 
  • Thread starter Thread starter benorin
  • Start date Start date
Click For Summary
SUMMARY

The discussion centers on formatting mathematical equations in LaTeX, specifically using the eqnarray* environment for aligned equations. The user is experiencing issues with the gathered environment, which does not display the equations correctly in Overleaf. They seek guidance on achieving proper alignment with eqnarray* while ensuring that the LaTeX code compiles without errors. The user also notes a potential issue with unmatched curly braces in their code, which could affect compilation.

PREREQUISITES
  • Understanding of LaTeX syntax and environments
  • Familiarity with mathematical typesetting in LaTeX
  • Knowledge of the eqnarray* and gathered environments
  • Basic troubleshooting skills for LaTeX compilation errors
NEXT STEPS
  • Research the differences between eqnarray* and gathered environments in LaTeX
  • Learn how to use the align environment for better equation alignment
  • Explore common LaTeX compilation errors and their solutions
  • Practice writing complex mathematical equations in LaTeX using Overleaf
USEFUL FOR

Mathematicians, students, and researchers who are using LaTeX for typesetting complex equations and need assistance with formatting and alignment issues in Overleaf.

benorin
Science Advisor
Insights Author
Messages
1,442
Reaction score
191
TL;DR
I have a long chain of equalities that I trying to get to display correctly with looking ugly or going off the page. I got this to work on this forum (MathJax) but having various issues in Overleaf
Code:
\begin{gathered} Z(n) = \int_{C^n}  {\tfrac{{\prod\nolimits_{i = 1}^n {d{x_i}} }}{{1 - \prod\nolimits_{k = 1}^n {{x_k}} }} \\ &=& \int_{C^{n - 1}}  {\log \left( {\tfrac{1}{{1 - \prod\nolimits_{k = 1}^{n - 1} {{x_k}} }}} \right) \cdot \prod\limits_{i = 1}^{n - 1} {\tfrac{{d{x_i}}}{{{x_i}}}} }   \\ &=& \int_{C^{n - 1}}   {\log \left[ {\prod\limits_{q = 0}^\infty  {\left( {1 + \prod\limits_{k = 1}^{n - 1} {x_k^{{2^q}}} } \right)} } \right] \cdot \prod\limits_{i = 1}^{n - 1} {\tfrac{{d{x_i}}}{{{x_i}}}} }  \\  = \sum\limits_{q = 0}^\infty  \int_{C^{n - 1}}  {\log \left( {1 + \prod\limits_{k = 1}^{n - 1} {x_k^{{2^q}}} } \right) \cdot \prod\limits_{i = 1}^{n - 1} {\tfrac{{d{x_i}}}{{{x_i}}}} }   \\ = \mathop  \lim\limits_{N \to \infty } \,\sum\limits_{q = 0}^\infty  {\sum\limits_{k = 1}^\infty  {\tfrac{{{{\left( { - 1} \right)}^{k - 1}}}}{k}\int_{C_N^{n - 1}}  {\prod\limits_{k = 1}^{n - 1} {x_k^{k{2^q} - 1}d{x_k}} } } }   \\ &=& \mathop  \lim\limits_{N \to \infty } \,\sum\limits_{q = 0}^\infty  {\sum\limits_{k = 1}^\infty  {\tfrac{{{{\left( { - 1} \right)}^{k - 1}}}}{k}{{\left( {n - 2} \right)}^{\sum\limits_{p = 1}^n {\frac{{k{2^q}}}{{2N}}} }}{{\prod\limits_{i = 1}^{n - 1} {\left[ {\frac{1}{{2N}}\Gamma \left( {\frac{{k{2^q}}}{{2N}}} \right)} \right]} } \mathord{\left/ {\vphantom {{\prod\limits_{i = 1}^{n - 1} {\left[ {\frac{1}{{2N}}\Gamma \left( {\frac{{k{2^q}}}{{2N}}} \right)} \right]} } {\Gamma \left( {1 + \sum\limits_{j = 1}^{n - 1} {\frac{{k{2^q}}}{{2N}}} } \right)}}} \right. } {\Gamma \left( {1 + \sum\limits_{j = 1}^{n - 1} {\frac{{k{2^q}}}{{2N}}} } \right)}}} }  \\ &=& \sum\limits_{q = 0}^\infty  {\sum\limits_{k = 1}^\infty  {\tfrac{{{{\left( { - 1} \right)}^{k - 1}}}}{{{k^n}{2^{\left( {n - 1} \right)q}}}} \cdot \underbrace {\mathop  \lim\limits_{N \to \infty } \,{{\left( {n - 2} \right)}^{\frac{{\left( {n - 1} \right)k{2^q}}}{{2N}}}}}_{ = {{\left( {n - 2} \right)}^0}} \cdot \underbrace {\mathop  \lim\limits_{N \to \infty } \,\tfrac{{{\Gamma ^{n - 1}}\left( {1 + \frac{{k{2^q}}}{{2N}}} \right)}}{{\Gamma \left( {1 + \tfrac{{\left( {n - 1} \right)k{2^q}}}{{2N}}} \right)}}}_{ = 1{\text{ Limit 2.4}}}} } \\  = \sum\limits_{q = 0}^\infty  {\sum\limits_{k = 1}^\infty  {\tfrac{{{{\left( { - 1} \right)}^{k - 1}}}}{{{k^n}}} \cdot {{\left( {\tfrac{1}{{{2^{n - 1}}}}} \right)}^q}} }  = \sum\limits_{k = 1}^\infty  {\left[ {\tfrac{{{{\left( { - 1} \right)}^{k - 1}}}}{{{k^n}}}\sum\limits_{q = 0}^\infty  {{{\left( {\tfrac{1}{{{2^{n - 1}}}}} \right)}^q}} } \right]}  \\ = {\left( {1 - {2^{1 - n}}} \right)^{ - 1}}\sum\limits_{k = 1}^\infty  {\tfrac{{{{\left( { - 1} \right)}^{k - 1}}}}{{{k^n}}}} = \sum\limits_{k = 1}^\infty  {\tfrac{1}{{{k^n}}}}  = \zeta \left( n \right)  \\ \end{gathered}

Note there were $'s at the beginning and end of the above code. I can't get it to compile with eqnarray in Overleaf so I posted the gathered. When I use aligned it ignores the newline commands and just runs off the page in just a single row.

This is what Overleaf does with that code

AltZetaLatex.png


Ideally we will get this to work with eqnarray*, that is how I want it to display with aligned equal signs, on the forum it looks like this (except in latex I used only a single integral sign to denote the multiple integrals)

AltZeta.png

Note the Latex code above is slightly different. Thanks. BTW this is the first time using an actual LaTeX editor.[/code]
 
Physics news on Phys.org
Your code looks incomprehensible to me. But I can determine that the '{' in character 37 does not seem to be matched by a closing '}'. Does that make a difference?
 
  • Like
Likes   Reactions: jedishrfu

Similar threads

  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
1K