Solving Latex Alignment Problem

  • Context: LaTeX 
  • Thread starter Thread starter norak
  • Start date Start date
  • Tags Tags
    alignment Latex
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 27K views
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.