1

Anyone know what could be causing the problem here?

$$h(s) =

\begin{cases}

(a,0)\ & \text{if } a \not\in S\ &

(a,1)\ & \text{if } a \in S

\end{cases}

$$
  • 1
    Welcome to TeX.SX! Please, report the code exactly as you have it in your source. – egreg Mar 30 '17 at 17:08
  • did you cut and paste this code from an earlier question on this site? it looks suspiciously like an example of the problem reported here. if so, please let us know where you found it, so that the original can be corrected. – barbara beeton Mar 30 '17 at 18:51
  • @barbara No, this is from one of my own proofs for a problem in Aluffi's Abstract Algebra textbook. – Andrew Tawfeek Mar 30 '17 at 18:56
4

You have one & too many and one \\ too few.

You don't have any blank lines in the math material either, do you?

As egreg pointed out, with mathtools package there's cases*, where the second column is in text mode by default.

Moreover see also Why is [ … ] preferable to $$ … $$?

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
h(s) =
\begin{cases}
(a,0) & \text{if $a\notin S$} \\
(a,1) & \text{if $a \in S$}
\end{cases}
\]
or 
\[
h(s) =
\begin{cases*}
(a,0) & if $a\notin S$ \\
(a,1) & if $a \in S$
\end{cases*}
\]
\end{document}

enter image description here

  • +1. I've taken the liberty of making your write-up a bit more idiomatic (English). Feel free to revert. – Mico Mar 30 '17 at 17:13
  • @Mico Thank you, I was editing simultenously also to add tex.stackexchange.com/questions/503/why-is-preferable-to – CarLaTeX Mar 30 '17 at 17:14
  • It's easier to type \text{if $a\notin S$}; with mathtools there's cases* where the second column is in text mode by default. Note \notin rather than \not\in. – egreg Mar 30 '17 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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