0

Please help me with my Latex code. I've been trying to get this running but I don't understand the error:

_Runaway argument?
 h \in ZWEI-PAAR \iff \exists k1,k2,k3,k4 \in h: (k1\neq k2 \\ \wedge \ETC.
Paragraph ended before \split was complete.
<to be read again> 
                   \par 
l.63_

Here's the code snippet.

\begin{equation*}
\begin{split}

 h \in ZWEI-PAAR \iff \exists k1,k2,k3,k4 \in  h: (k1\neq k2 \\
\wedge k1 \neq k3 
\wedge k3 \neq k4 
\wedge wert(k1)= wert(k2) \\
\wedge wert(k3) = wert(k4) \\    
\wedge \nexists k \in h \backslash \{k1,k2,k3,k4,k5\}:
  wert(k) = wert(k1) 
\wedge wert(k) = wert(k3) ) \\

\end{split}
\end{equation*} 

Thanks in advance.

EDIT: I fixed the new lines. However, now I got a new problem:

*Undefined control sequence.
<argument> ...t {wert}(k_{4}) \\ {}\land \nexists 
                                                  k \in h \setminus \{\,k_{1...
l.64 \end{split}*

Translated code snippet:

\documentclass{article}

\usepackage{amsmath}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}

\begin{document}

\subsection{b)}
\begin{equation*}
 \begin{split}
    h \in \mathit{TWO} - \mathit{PAIR} \iff \exists k_{1}, k_{2},
    k_{3}, k_{4} \in  h : (k_{1} \neq k_{2} \\
    {}\land k_{1} \neq k_{3} \land k_{3} \neq k_{4}
    \land \mathit{value}(k_{1}) = \mathit{value}(k_{2}) \\
    {}\land \mathit{value}(k_{3}) = \mathit{value}(k_{4}) \\
    {}\land \nexists k \in h \setminus \{\,k_{1}, k_{2}, k_{3}, k_{4},
    k_{5}\,\} : \mathit{value}(k) =
    \mathit{value}(k_{1})
    \land \mathit{value}(k) = \mathit{value}(k_{3}))
\end{split}
\end{equation*} 


\subsection
\end{document}
Au101
  • 10,278
  • Welcome to TeX. SE! try to remove empty lines in split environment. – Zarko Oct 29 '16 at 14:49
  • Follow up questions - if they're entirely new - should be asked separately as it increases visibility, and it helps keep Q & As on topic. Because we're a Q & A site not a forum, we don't exactly have a discussion here, but questions with their answers. Also somebody having the same problem as you will find it hard to find their answer in your question. Site dynamics aside, the command which is undefined is identified by where the line is broken in the error message. In other words, \nexists is undefined. This is because \nexists is provided by amssymb and you have not loaded the package – Au101 Oct 29 '16 at 16:00

1 Answers1

6

You have blank lines in your equation environment. These are not allowed, you must remove them.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}

\begin{equation*}
  \begin{split}
    h \in ZWEI-PAAR \iff \exists k1,k2,k3,k4 \in  h: (k1\neq k2 \\
    \wedge k1 \neq k3 \wedge k3 \neq k4
    \wedge wert(k1)= wert(k2) \\
    \wedge wert(k3) = wert(k4) \\
    \wedge \nexists k \in h \backslash \{k1,k2,k3,k4,k5\}: wert(k) =
    wert(k1)
    \wedge wert(k) = wert(k3) ) \\
  \end{split}
\end{equation*}

\end{document}

Or comment them out:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}

\begin{equation*}
  \begin{split}
 %
    h \in ZWEI-PAAR \iff \exists k1,k2,k3,k4 \in  h: (k1\neq k2 \\
    \wedge k1 \neq k3 \wedge k3 \neq k4
    \wedge wert(k1)= wert(k2) \\
    \wedge wert(k3) = wert(k4) \\
    \wedge \nexists k \in h \backslash \{k1,k2,k3,k4,k5\}: wert(k) =
    wert(k1)
    \wedge wert(k) = wert(k3) ) \\
%
  \end{split}
\end{equation*}

\end{document}

enter image description here

Below I've taken the liberty of suggesting a few general improvements.

  • I have enclosed ZWEI and PAAR in \mathit{}. I have no idea what these are, and whether they should be upright, but if you just use ZWEI LaTeX will treat them as variables being multiplied and you will get quite bad spacing

  • I've subscripted your numbers after k but you may not have wanted this.

  • I've elected to replace \wedge by \land (logical and) as I think this more appropriate here. In same cases you will see I have {}\land which will get you nice binary spacing after the symbol, which I think should be there.

  • I've replaced \backslash with \setminus

  • I've given wert the \mathit{} treatment as well, although perhaps this should be an operator?

  • I've added \, inside the { ... } for better spacing

I think it looks better this way, but I'm not actually familiar with what you're typesetting here so some of my guesses may be mistakes, but you might like to consider them.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}

\begin{equation*}
  \begin{split}
    h \in \mathit{ZWEI} - \mathit{PAAR} \iff \exists k_{1}, k_{2},
    k_{3}, k_{4} \in  h : (k_{1} \neq k_{2} \\
    {}\land k_{1} \neq k_{3} \land k_{3} \neq k_{4}
    \land \mathit{wert}(k_{1}) = \mathit{wert}(k_{2}) \\
    {}\land \mathit{wert}(k_{3}) = \mathit{wert}(k_{4}) \\
    {}\land \nexists k \in h \setminus \{\,k_{1}, k_{2}, k_{3}, k_{4},
    k_{5}\,\} : \mathit{wert}(k) =
    \mathit{wert}(k_{1})
    \land \mathit{wert}(k) = \mathit{wert}(k_{3})) \\
  \end{split}
\end{equation*}

\end{document}

enter image description here

Au101
  • 10,278
  • 1
    i suggest also removing the final \\ since otherwise the space below the display will be unnecessarily large. if a new paragraph begins below the display, then leave a blank line after \end{equation}. – barbara beeton Oct 29 '16 at 15:28
  • @barbarabeeton Well-spotted. Good advice :) By the way, did you know that if you use two backticks (before and after) you can get \\ without the trailing space :) – Au101 Oct 29 '16 at 15:30
  • i thought i'd tried the double backticks, but apparently not. (i have, many times, explored the 'sandbox" in the meta list to solve similar problems; maybe should go there to make sure that technique is covered. yes, the trailing space is annoying, but not nearly as annoying -- or confusing -- as a lost one.) – barbara beeton Oct 29 '16 at 15:35
  • @barbarabeeton That's true, I have endured much pain trying to get them as well ;) – Au101 Oct 29 '16 at 15:37