Solving Latex Alignment Problem

  • Context: LaTeX 
  • Thread starter Thread starter norak
  • Start date Start date
  • Tags Tags
    alignment Latex
Click For Summary
SUMMARY

The discussion addresses a common issue with LaTeX alignment when using the "align" environment. The user encountered an error while compiling their LaTeX code, specifically stating that the "align" environment does not work. The solution provided indicates that the "align" environment is part of the AMS-LaTeX package, which must be included in the document preamble with the line \usepackage{amsmath}. This package is enabled by default on Physics Forums, allowing the code to compile correctly there.

PREREQUISITES
  • Familiarity with LaTeX document structure
  • Understanding of the AMS-LaTeX package
  • Knowledge of LaTeX environments, specifically "align"
  • Basic skills in troubleshooting LaTeX compilation errors
NEXT STEPS
  • Research how to include packages in LaTeX documents using \usepackage
  • Learn about other useful environments in AMS-LaTeX
  • Explore common LaTeX compilation errors and their solutions
  • Investigate advanced formatting techniques in LaTeX for mathematical expressions
USEFUL FOR

Mathematicians, physicists, students, and anyone using LaTeX for typesetting mathematical documents who need to resolve alignment issues in their code.

norak
Messages
2
Reaction score
0
Hi guys, I want to write up some math and have the following code:

\begin{align}
L_{A}(s)&=V(A,0)-V(A,s) \\
&=\int_{t=A}^{T(A)+A-\alpha S_{A}}e^{-r(t-A)}W_{t}dt - \int_{t=A}^{T(A)+A-\alpha (S_{A}+s)}e^{-r(t-A)}W_{t}dt \\
&=\int^{T(A)+A-\alpha S_{A}}_{T(A)+A-\alpha(S_{A}+s)}e^{-r(t-A)W_{t}dt}
\end{align}

Now using Physics Forum's inbuilt Latex thingy the following appears:

[tex] \begin{align*} <br /> L_{A}(s)&=V(A,0)-V(A,s) \\<br /> &=\int_{t=A}^{T(A)+A-\alpha S_{A}}e^{-r(t-A)}W_{t}dt - \int_{t=A}^{T(A)+A-\alpha (S_{A}+s)}e^{-r(t-A)}W_{t}dt \\<br /> &=\int^{T(A)+A-\alpha S_{A}}_{T(A)+A-\alpha(S_{A}+s)}e^{-r(t-A)W_{t}dt}<br /> \end{align*}[/tex]

However, when I try to compile this using my own Latex compiler, I get the following error message:

latex-prob-070723.png


It says that the "align" doesn't work! Are there any computer experts who know what I am doing wrong??
 
Physics news on Phys.org
The "align" environment is provided by the AMS-LaTeX package and can be activated by including the line
Code:
\usepackage{amsmath}
somewhere in the preamble of your document. I believe the LaTeX functionality of Physics Forums enables AMS-LaTeX by default, which is why the "align" environment is working correctly on Physics Forums but is not working in your document.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
6
Views
1K
Replies
46
Views
7K
Replies
5
Views
2K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K