LaTeX forum ⇒ GeneralUnable to compile

LaTeX specific issues not fitting into one of the other forums of this category.
DarkCarb
Posts: 1
Joined: Thu Sep 26, 2019 9:21 am

Unable to compile

Postby DarkCarb » Thu Sep 26, 2019 9:29 am

Hello, I just downloaded LaTeX and know almost nothing about the language. I am trying to get a document created for something school related. I downloaded LaTeX and did some googling for what I was trying to do but I cant get my code to compile. Basically, I am trying to output a Truth table for an implication statement. Here is what I have so far. Any explanations of how to fix what I have wrong and tips on the formatting of LaTeX would be much appreciated.
\documentclass{article}
\begin{document}
\begin{table}
\begin{tabular}{•}
\begin{array}{|c |c|c|}
p & q & p \implies q\\
\hline
T & T & T
T & F & F
F & T & T
F & F & T
\end{array}


\end{tabular}


\end{document}

This results in the following error:
! LaTeX Error: Illegal character in array arg.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.4 \begin{tabular}{•}

?

User avatar
Ijon Tichy
Posts: 163
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Thu Sep 26, 2019 10:17 am

There are several issues with your code (which is unfortunately also not marked as code using either the Code button in the toolbar or the "Select code" feature):
  • * is not a valid column declaration for tabular but a multiplier that expects two arguments.
  • array needs the math mode
  • \implies is undefined without package, that defines it
  • The array row ends are missing.
  • \begin{table} without \end{table}
Here one possible suggestion to fix all these issues:
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass{article}
  2. \usepackage{mathtools}
  3. \begin{document}
  4. \[
  5. \begin{array}{|c|c|c|}
  6. p & q & p \implies q\\
  7. \hline
  8. T & T & T \\
  9. T & F & F \\
  10. F & T & T \\
  11. F & F & T \\
  12. \end{array}
  13. \]
  14. \end{document}

I've removed the table environment, because table without \caption mostly does not make sense.

Please read an introduction to LaTeX. You won't become happy with LaTeX without reading at least a short introduction but I would suggest to read a detailed one.

BTW: Vertical rules/lines in tabulars/tables are awful. See the manual of package booktabs for information how to make nice tabulars/tables.


Return to “General”

Who is online

Users browsing this forum: No registered users and 7 guests