2

In the code for a table below, there is an error indicated by the red marker in the line starting with "Not protest" after compilation, although the output seems pretty much okay. Can you pinpoint the mistake please?

\documentclass{article}
%\usepackage{showframe}% http://ctan.org/pkg/showframe
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\usepackage{array}% http://ctan.org/pkg/array
\usepackage{tabularx}% http://ctan.org/pkg/tabularx
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\usepackage{array}% http://ctan.org/pkg/array
\usepackage{tabularx}% http://ctan.org/pkg/tabularx
\usepackage{calc}
\usepackage{tabu}
\begin{document}

\begin{table}[h]

\centering

\begin{tabular}{|c|c|c|}

\hline
 & $N^{e}$ \textless $K_i$ & $N^{e} \geq T_i$\\
\hline
 Not protest & $ -\Delta U $ & $(1-\gamma) \cdot \Delta U}$ \\
\hline
Protest & $-(k/N^{e})-\Delta$ U& $\Delta U - (k/N^{e})$\\
\hline

\end{tabular}

\caption{Payoff matrix}

\end{table}

\end{document}
3
  • 1
    It's becuse you have a close bracket without the open pair after \Delta in line 22.
    – osjerick
    May 20, 2012 at 20:43
  • 1
    It'd be nice if the people who downvoted and voted to close left a quick explanatory note here .. (not saying I agree or disagree, just general polite policy)
    – doncherry
    May 20, 2012 at 21:38
  • @doncherry As also I voted to close. The closing reason below usually tells it: it's unlikely that the question would help any future visitors. Here, it's just a missing brace in some specific code. Addition for the OP: no additional answers (beside one comment and two answers, all telling the same) are needed, about that brace, so we close.
    – Stefan Kottwitz
    Aug 20, 2012 at 10:52

2 Answers 2

4

You have a bracket too much after the \Delta in the line you mentioned (the one starting with 'Not protest'.

\begin{table}[h]
\centering

\begin{tabular}{|c|c|c|}

\hline
 & $N^{e} < K_i$ & $N^e \geq T_i$\\
\hline
 Not protest & $ -\Delta U $ & $(1-\gamma) \cdot \Delta U$ \\
\hline
Protest & $-(k/N^{e})-\Delta U$ & $\Delta U - (k/N^e)$\\
\hline

\end{tabular}
\caption{Payoff matrix}
\end{table}
4
  • 1
    Andreas, you should correct the other mistakes in the code. I mean the over-usage of math mode / text mode. The correct first line is & $N^{e} < K_i$ & $N^{e} \geq T_i$\\ and the last line Protest & $-(k/N^{e})-\Delta U$ & $\Delta U - (k/N^{e})$\\
    – yo'
    May 20, 2012 at 20:52
  • And I don't agree on "forgot to open the bracket" -- he forgot to remove the bracket. Posting half-answers is not a good way to improve the LaTeX knowledge of its unexperienced users. As well, answers should be kept clean from sentences like "Next time you should ..." since these should be comments to the question.
    – yo'
    May 20, 2012 at 20:59
  • I was going over it again and changed that, thanks May 20, 2012 at 21:03
  • @Abhimanyu Arora: btw. since you are already using booktabs, you might want to try the table with the commands provided by it, it seems to me to be much more readable (using \toprule, etc. as mentioned in the booktabs documentation) May 20, 2012 at 21:13
3

an error?

TeX says

! Extra }, or forgotten $.
l.22 ... -\Delta U $ & $(1-\gamma) \cdot \Delta U}
                                                  $ \\
? h
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.

How much clearer do you want TeX to be? Learn to read the log file, please.

2
  • Thanks Martin, do you suggest a link where I could learn to read and understand errors, warnings etc in a log file? May 20, 2012 at 21:28
  • @AbhimanyuArora: Any reasonable introduction to LaTeX? The LaTeX manual by Lamport has a section on the error messages by LaTeX, but this one is produced by TeX directly. You could try the TeXbook, but I don't recommend that if you are mainly using high-level LaTeX. May 20, 2012 at 21:31

Not the answer you're looking for? Browse other questions tagged .