\documentclass[titlepage]{article}
\author{foobar}
\title{foofoofoo}
\usepackage{syntonly}
\usepackage{verbatim}
\usepackage{lipsum}
\usepackage{listings}
\begin{document}
\maketitle
\newpage
\tableofcontents
\newpage
\lstset{basicstyle=\texttt} %THIS LINE
\section{Source Code}
I will admit that this code is {\it messy}.
\subsection{foo.c}
\lstinputlisting{foo.c}
\end{document}
I don't understand why that line makes pdflatex
not compile; when I remove it, everything works fine.
It gives me this:
! Incomplete \ifmmode; all text was ignored after line
\texttt
by\ttfamily
and\it
should be either\itshape messy
or\textit{messy}