TeXShopStrange problem with tabular enviroment!

Information and discussion about TeXShop, an integrated LaTeX environment for Mac OS X
Post Reply
pan
Posts: 1
Joined: Sun May 23, 2010 9:19 pm

Strange problem with tabular enviroment!

Post by pan »

Hi all,

I have a rather strange problem with the tabular env. I am trying to make a table and I need some vertical lines around the table so I m using the | character. for example:

\begin{tabular}{|r|l|}
\hline
7C0 & hexadecimal \\
3700 & octal \\ \cline{2-2}
11111000000 & binary \\
\hline \hline
1984 & decimal \\
\hline
\end{tabular}

When I compile the .tex I receive a message saying

! Use of \@array doesn't match its definition.
\new@ifnextchar ...served@d = #1\def \reserved@a {
#2}\def \reserved@b {#3}\f...
l.92 \begin{tabular}{|r|l|} etc etc

So, I delete the | characters and everything works fine except that I don't have the vertical lines of course. I put them back and again the same problem.
I tried to use different languages in my keyboard but nothing really worked. I tried to copy and paste tables from the net but again the same problem. So, it seems to me that texshop for some strange reason doesn't recognize the |. I am using the TeX distribution and texshop. Everything is up to date. Any ideas why this happens? Do i need to add something in the preamble of the document?

Thanks in advance
Thanos

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Strange problem with tabular enviroment!

Post by Stefan Kottwitz »

Hi Thanos,

welcome to the board!
This code raises no error when I test it. Just show a complete minimal example that's producing the compiler error. A complete example looks like

Code: Select all

\documentclass[a4paper,10pt]{article}
\begin{document}
\begin{tabular}{|r|l|}
\hline
7C0 & hexadecimal \\
3700 & octal \\ \cline{2-2}
11111000000 & binary \\
\hline \hline
1984 & decimal \\
\hline
\end{tabular}
\end{document}
but this one doesn't show the error.

Stefan
LaTeX.org admin
ZZappaZZappa
Posts: 1
Joined: Sat Apr 02, 2011 12:26 am

Re: Strange problem with tabular enviroment!

Post by ZZappaZZappa »

Hi,
Just in case anyone is still looking for an answer, for me it was a conflict between the ltxdoc document style and the tabular environment. I switched to a4paper and it was fine.
Post Reply