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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to align two equations, however they are not aligning at the equals sign but at the comma at the end of the equation. How can I change this?

\begin{align}



A_{ij}^y= 

\begin{cases} 

  1, & \text{if the link between $x_{i,j}$ and $y_{i,j}$ is included},\\ 

  0, & \text{otherwise},

\end{cases} \\

    R_{ij} = r_{ij},

\end{align}

Thanks for your help

share|improve this question
1  
Welcome to TeX.SE. Please post full examples, not just fragments – Christian Hupfer Feb 26 at 13:16
    
you have not specified any alignment point. you need &= – David Carlisle Feb 26 at 13:16

You have to place the alignment marks & at the equals sign:

\documentclass[border=5pt,preview]{standalone}
\usepackage{mathtools}

\begin{document}
\begin{align}
A_{ij}^y &=
\begin{cases*}
1, & if the link between $x_{i,j}$ and $y_{i,j}$ is included,\\
0, & otherwise,
\end{cases*}\\
R_{ij} &= r_{ij},
\end{align}
\end{document}

Also, I have used the cases* environment from the mathtools package to typeset the cases, as that typesets the second column in text mode.

enter image description here

share|improve this answer

You need & as alignment specifier, as in the cases environment:

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{align}
A_{ij}^y &= 
\begin{cases} 
  1, & \text{if the link between $x_{i,j}$ and $y_{i,j}$ is included},\\ 
  0, & \text{otherwise},
\end{cases} \\
    R_{ij} &= r_{ij},
\end{align}

\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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