Text FormattingError When Creating Table

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
kassycoan
Posts: 2
Joined: Mon Jan 02, 2012 11:23 pm

Error When Creating Table

Post by kassycoan »

I am creating a True False table.

Here is a picture of what I have so far:
tablesofar.png
tablesofar.png (7.22 KiB) Viewed 1487 times
I did that using

Code: Select all

p & q \\
in the heading.

For the heading in that 3rd column, I want to write "not p" with the negation symbol.

However,

Code: Select all

p & q & \neg p \\
gives me the error:

! Missing $ inserted.[/b]

Any ideas of what I am doing wrong?


Here is everything I have written for the table:

Code: Select all

\begin{table}[ht]
\centering  % used for centering table
\begin{tabular}{c c c c c c c} % centered columns (4 columns)
\hline\hline                        %inserts double horizontal lines
%p & q & \neg p & p \to q & \neg p \to (p \to q) & p \wedge q & p \wedge q \to (p \to q) \\ [0.5ex] % inserts table 
p & q & \neg p \\
%heading
\hline                  % inserts single horizontal line
T & T & F & T & T & T & T \\ % inserting body of the table
T & F & F & F & T & F & T \\
F & T & T  & T & T & F & T \\
F & F & T & T & T & F & T \\
[1ex]      % [1ex] adds vertical space
\hline %inserts single line
\end{tabular}
\end{table}
Last edited by localghost on Tue Jan 24, 2012 8:12 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Error When Creating Table

Post by Stefan Kottwitz »

Hi kassycoan,

welcome to the board!

For \neg math mode is required:

Code: Select all

p & q & $\neg$ p \\
I would write p and q in math mode too.

Stefan
LaTeX.org admin
kassycoan
Posts: 2
Joined: Mon Jan 02, 2012 11:23 pm

Perfect!

Post by kassycoan »

Thank you! That was the problem.
Post Reply