TransWikia.com

Labeling multi-line equation not working as expected

TeX - LaTeX Asked on October 3, 2021

My aim is to set the label of the following equation to right as usual. The difference is that here I have two lines which messes this labeling up.

documentclass[12pt]{article} 
usepackage{amsmath}

begin{document}
begin{equation}label{weight} 
omega_{x_R} = begin{cases}
   {1 over N, & text{if } N ge 1 
    1, & text{otherwise }
end{equation}

end{document}

See the following:

enter image description here

One Answer

Never ignore errors, the PDF is not usable after any error. You are missing end{cases} here. Also over is not LaTeX and should never be used.

enter image description here

documentclass[12pt]{article} 
usepackage{amsmath}

begin{document}
begin{equation}label{weight} 
omega_{x_R} = begin{cases}
   frac{1}{N}, & text{if } N ge 1 
    1, & text{otherwise }
    end{cases}
end{equation}

end{document}

Correct answer by David Carlisle on October 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP