Take the 2-minute tour ×
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.

I'm getting this error message in a document, which contains three tables.

Error: Missing } inserted. \end{center} (followed by: )

I have no idea why, I reviewed it like ten times, but might overvlook something. Have a look at my code:

\documentclass[a4paper]{article}

\usepackage[german]{babel}
\usepackage[utf8]{inputenc}
\usepackage[margin={2cm,2cm}]{geometry}
\usepackage{color, colortbl}

\title{Addendum \\ Beispieldatenbanken}
\author{}
\date{}

\definecolor{Gray}{gray}{0.9}

\begin{document}

\setlength{\parindent}{0pt}
\maketitle

\section{Kunden}
    \begin{center}
        \tiny
        \bgroup
        \def\arraystretch{1.5}
        \begin{tabular}{|l|l|l|l|l|}
            \hline
            \rowcolor{Gray}
            KNr & Name & Stadt & Saldo & Rabatt \\ 
            \hline
            1 & Legrand & Genf & -1080,00 & 0.10 \\
            \hline
            2 & Mart & Basel & -800,00 & 0.20 \\
            \hline
            3 & Frei & Basel & 0,00 & 0.10 \\
            \hline
            4 & Janvier & Genf & 0,00 & 0.10 \\
            \hline
            5 & Rosi & Lugano & 0,00 & 0.05 \\
            \hline
            6 & Meier & Z"urich & -3800,00 & 0.05 \\
            \hline
        \end{tabular}
    \end{center}

\section{Produkte}

    \begin{center}
        \tiny
        \bgroup
        \def\arraystretch{1.5}
        \begin{tabular}{|l|l|l|l|l|l|}
            \hline
            \rowcolor{Gray}
            Pnr & Bez & Gewicht & Preis & Lagerort & Vorrat \\ 
            \hline
            1 & Papier & 2000 & 20.00 & Basel & 10000 \\
            \hline
            2 & Platte & 1000 & 2500.00 & Z"urich & 400 \\
            \hline
            3 & Drucker & 5000 & 2000.00 & Genf & 200 \\
            \hline
            4 & Bildschirm & 5000 & 3000.00 & Genf & 80 \\
            \hline
            5 & CDs & 0.500 & 20.00 & Basel & 5000 \\
            \hline
            6 & Maus & 0.250 & 100.00 & Basel & 200 \\
            \hline
            7 & Speicher & 0.100 & 200.00 & Bern & 2000 \\
            \hline
        \end{tabular}
    \end{center}

        (...) % two other tables of the same form

    \end{document}

This error message appears at every \end{center} line. How can I fix this?

share|improve this question
    
If you have such problems it is often usefull to comment out the code line by line. This way it is quite easy to find out that the \bgroup is the problem. –  Dave Jan 10 '13 at 14:16

1 Answer 1

up vote 5 down vote accepted

Remove the spurious \bgroup at the beginning of the table. It translates into { which has then no counterpart.

As well, I have to say a note about \tiny: modifying font size to fit a table in a given space is a very bad idea. I recommend you to look at the rotating package.

share|improve this answer
    
That worked, thank you. May I ask what \bgroup actually is? I saw this in an example in relation to change the color of a row in a table. Further I don't use to fit the table, I actually want to shrink the fontsize in the table. –  Valentino Ru Jan 10 '13 at 14:11
2  
\bgroup changes itself into { at the place when the code is executed, not when it is read. Therefore definitions like \newenvironment{myenv}{\vbox\bgroup}{\egroup} are valid. If you tried \newenvironment{myenv}{\vbox{}{}} it would (obviously) not work as expected (\newenvironment would see 2 arguments myenv and \vbox{}{}, not 3 as desired). –  tohecz Jan 10 '13 at 14:14
1  
@ValentinoRu \bgroup is in many cases like a { (not in all cases, though; see tex.stackexchange.com/questions/27972/bgroup-and-egroup, for instance. –  egreg Jan 10 '13 at 14:15

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.