# New to LaTeX, getting bunch of errors and not sure how to fix them

I started learning LaTeX just today. I'm trying to write some of my notes in TeX form, but when I try to build this I'm getting a bunch of errors. Can you take a look at it and see what's wrong? Thanks.

\documentclass{article}
\begin{document}
\title{Foundations of CS, Lecture 1}
\author{Ryan}
\date{January 23, 2014}
\maketitle

\textbf{Proposition} - a declarative statement that is either True or False.
\begin{itemize}
\item Atomic proposition - basic proposition
\item Compound proposition - complex proposition that is built upon smaller ones
\begin{itemize}
\item Negation - \lnot p
\item Conjunction - p \land q
\item Dis-junction - p \lor q
\item Implication - p \rightarrow q
\item Bi-conditional - p \longleftrightarrow q
\end{itemize}
\end{itemize}

For a statement p -> q, there are several related statements:
\begin{itemize}
\item Converse: q \rightarrow p
\item Contrapositive: \lnot q \rightarrow \lnot p
\item Inverse: \lnot p \rightarrow \lnot q
\end{itemize}

\textbf{Logical Equivalency} - Two propositions are logically equivalent
if they have the same truth table.
\begin{itemize}
\item \textbf{Example: }Is p \rightarrow q equivalent to \lnot q \rightarrow \lnot p?
Truth table goes here
\end{itemize}

\textbf{Precedence of Logical Operators}
Table goes here

\begin{itemize}
\item Tautology - proposition that is always True
\item Contradiction - proposition that is always False
\item Contingency - proposition that is neither True or False
\begin{itemize}
\item For example, p
\end{itemize}
\end{itemize}

\end{document}

• First thing: you need \begin{document} and \end{document}: they enclose all the things you hope to see printed on the page (roughly speaking). That is, (you could) put the first before the \maketitle line, and the second at the end of your .tex file (anything below \end{document} will be ignored by (La)TeX. I see that you have the \begin{document}, but without it's partner, \end{document}, you don't have a complete LaTeX file. – jon Jan 24 '14 at 5:37
• Second: many of your symbols are 'math' and therefore need to be enclosed in some sort of math environment (e.g., not \lnot, but $\lnot$). – jon Jan 24 '14 at 5:42
• – Peter Grill Jan 24 '14 at 5:48
• @Ryan: I see your notes are about logic. You might want to consider using \implies (you'll need to include \usepackage{amsmath} in your preamble for this one) and \iff instead of the arrows for implication and equivalence. That way your LaTeX will be easier to read :) – Snicksie Jan 24 '14 at 7:30
• You are using \textbf{} a few times, consider defining a new macro containing the meaning (why do you want this to be bold). \newcommand{\attention}[1]{\textbf{#1}}. This way, you can change the appearance of your document at a later point with just one change. – Johannes_B Jan 24 '14 at 9:04

Math content needs to be in math mode. Once I add a $ to begin math mode and a $ to end math mode I get:

## Notes:

• You were missing a \ in an \lnot as well. Other than that, the main problem was that you were not in math mode when you had math symbols.
• Although I used a $ to get into and out of math mode, the recommended approach is to use $$ to begin math mode, and a $$ to end math mode as per: Are $$and$$ preferable to dollar signs for math mode?. • For display math, which you will need fairly shortly, you should refer to Why is $...$ preferable to $$...$$?. • An excellent reference for math mode is Herbert Voss' comprehensive review of mathematics in (La)TeX. • As per Mico's suggestion I have replaced the - with the more typographically correct em-dash ---. See Dashes: - vs. – vs. — for more details on dashes. I personally would replace these with a : instead. ## Code: \documentclass{article} \begin{document} \title{Foundations of CS, Lecture 1} \author{Ryan} \date{January 23, 2014} \maketitle \textbf{Proposition} - a declarative statement that is either True or False. \begin{itemize} \item Atomic proposition - basic proposition \item Compound proposition - complex proposition that is built upon smaller ones \begin{itemize} \item Negation ---$\lnot p$\item Conjunction ---$p \land q$\item Dis-junction ---$p \lor q$\item Implication ---$p \rightarrow q$\item Bi-conditional ---$p \longleftrightarrow q$\end{itemize} \end{itemize} For a statement$p \to q$, there are several related statements: \begin{itemize} \item Converse:$q \rightarrow p$\item Contrapositive:$\lnot q \rightarrow \lnot p$\item Inverse:$\lnot p \rightarrow \lnot q$\end{itemize} \textbf{Logical Equivalency} - Two propositions are logically equivalent if they have the same truth table. \begin{itemize} \item \textbf{Example: }Is$p \rightarrow q$equivalent to$\lnot q \rightarrow \lnot p$? Truth table goes here \end{itemize} \textbf{Precedence of Logical Operators} Table goes here \begin{itemize} \item Tautology --- proposition that is always True \item Contradiction --- proposition that is always False \item Contingency --- proposition that is neither True or False \begin{itemize} \item For example,$p\$
\end{itemize}
\end{itemize}

\end{document}

• I would also replace the - (single-dash) symbols in the itemize lists with --- (triple dashes) in order to get the typographically more appropriate em-dash symbols. – Mico Jan 24 '14 at 7:19
• @Mico: Thanks for catching that. Have updated solution. – Peter Grill Jan 25 '14 at 0:14
• One more thing: You could replace three of the four \textbf{...} statements with \paragraph{...} statements. (This works because \paragraph, by default in the "standard" LaTeX document classes, creates bold run-in sectioning headers that aren't numbered.) Doing so would emphasize/clarify the logical structure of the text. – Mico Jan 25 '14 at 7:00