LaTeX Solving Latex Alignment Problem

  • Thread starter Thread starter norak
  • Start date Start date
  • Tags Tags
    alignment Latex
Click For Summary
The discussion centers around the use of the "align" environment in LaTeX for formatting mathematical equations. The original poster shares their code for a mathematical expression but encounters an error when compiling it with their own LaTeX compiler, specifically regarding the "align" environment. A key point raised is that the "align" environment is part of the AMS-LaTeX package, which must be included in the document preamble with the line \usepackage{amsmath}. It is noted that Physics Forums automatically enables AMS-LaTeX, allowing the code to work correctly there, while the user's local setup lacks this configuration, leading to the compilation error.
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:

<br /> \begin{align*} <br /> L_{A}(s)&amp;=V(A,0)-V(A,s) \\<br /> &amp;=\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 /> &amp;=\int^{T(A)+A-\alpha S_{A}}_{T(A)+A-\alpha(S_{A}+s)}e^{-r(t-A)W_{t}dt}<br /> \end{align*}<br />

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
4K
Replies
5
Views
2K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K