Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question already has an answer here:

I have to following code:

\begin{align*}
r^2  = \left[\frac  {23604,7 - \frac{1}{22} \cdot 253 \cdot 1942.5}  {\sqrt{[3795 - \frac{1}{22} \cdot 253^2]  [173348.4 - \frac{1}{22} \cdot 1942.5^2]  }} \right]^2 \\ \\

r^2  = \left[\frac{1265.95}{\sqrt{885.5 \cdot 1834.51}} \right]^2 \\ \\

r^2  = \left[\frac{1265.95}{\sqrt{1624458.2}} \right]^2 \\ \\

r^2  = \left[\frac{1265.95}{1274.54} \right]^2 \\ \\

r^2  = [0.99356]^2 = 0.9866
\end{align*}

and got the error:

! Paragraph ended before \align* was complete.

! Missing $ inserted.

and a few more...can somebody spot the mistake? :<

share|improve this question

marked as duplicate by Werner, Thorsten Donig, karlkoeller, Sean Allred, Andrew Swann Nov 3 '13 at 17:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

6  
The align* environment doesn't like blank lines inside. –  Thorsten Donig Nov 3 '13 at 16:31
    
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  karlkoeller Nov 3 '13 at 16:32
add comment

2 Answers

A recommended solution just for fun!

\documentclass[preview,border=12pt,varwidth]{standalone}% change this line back to your own document class (article)
\usepackage{amsmath}
\begin{document}
\abovedisplayskip=0pt\relax% remove this line in  your production
\begin{align*}
r^2  
&= \left(\frac{23604.7 -\frac{1}{22} \cdot 253 \cdot 1942.5}{\sqrt{(3795 -\frac{1}{22} \cdot 253^2)(173348.4 -\frac{1}{22} \cdot 1942.5^2)}}\right)^2 \\
&= \left(\frac{1265.95}{\sqrt{885.5 \cdot 1834.51}} \right)^2 \\
&= \left(\frac{1265.95}{\sqrt{1624458.2}} \right)^2 \\
&= \left(\frac{1265.95}{1274.54} \right)^2\\
&= 0.99356^2 \\
&= 0.9866
\end{align*}
\end{document}

enter image description here

share|improve this answer
add comment

Some code improvement:

\documentclass{article}

\usepackage{amsmath}
\usepackage[
  locale=DE  % comma as decimal separator
%  locale=UK  % full stop as decimal separator
]{siunitx}

\begin{document}

\begin{align*}
  r^2
  &= \left[\frac{\num{23604.7} - \frac{1}{22} \cdot 253 \cdot \num{1942.5}}{\sqrt{[3795 - \frac{1}{22} \cdot 253^2] [\num{173348.4} - \frac{1}{22} \cdot \num{1942.5}^2]}}\right]^2\\
  &= \left[\frac{\num{1265.95}}{\sqrt{\num{885.5} \cdot \num{1834.51}}}\right]^2\\
  &= \left[\frac{\num{1265.95}}{\sqrt{\num{1624458.2}}}\right]^2\\
  &= \left[\frac{\num{1265.95}}{\num{1274.54}}\right]^2\\
  &= \num{0.99356}^2\\
  &= \num{0.9866}
\end{align*}

\end{document}

output

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.