# Error when including \usepackage{hyperref}

I'm new to LaTeX and trying to use hyperref, and having trouble with \usepackage{hyperref}.

As recommended in posts, I included \usepackage{hyperref} as the last \usepackage{} instruction. No other problem when I comment out \usepackage{hyperref}.

I've successfully compiled the testams.tex document that came with the hyperref download from TUG and uses

\usepackage[%
verbose,
naturalnames=true,
]{hyperref}


I am receiving this error:

!Latex Error: \RequirePackage or \LoadClass in Options Section


This is my preamble and document structure:

\documentclass[11pt,reqno]{report}
\usepackage{geometry}
\geometry{letterpaper}                   % ... or a4paper or a5paper or ...
%\geometry{landscape}                 % Activate for for rotated page geometry

\usepackage[parfill]{parskip}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath, amsthm}
\usepackage{epstopdf}
\usepackage[onehalfspacing]{setspace}
\usepackage[comma,authoryear]{natbib}
\usepackage{titling}
\usepackage{url}
\usepackage{caption}    % Activate to format captions
\captionsetup[table]{font=bf}   % Make table captions bold
%\usepackage[format=hang,font={small,bf}]{caption}  %Makes all captions bold

\usepackage{hyperref}

\title{Title}
\subtitle{Subtitle}
\author{New Author}
\date{\today}

\begin{document}

\maketitle

\tableofcontents

\chapter{Begin}

\section{Continue}

\begin{table}[htbp]
\begin{center}
\caption{Caption}
\begin{tabular}{ccc}
%table
\end{tabular}
\label{tab:first}
\end{center}
\end{table}

\newpage
\appendix
\chapter{App 1}
\section{App 1.1}
Lots of tables.

\pagebreak

\begin{singlespace}

\bibliographystyle{plainnat}

\bibliography{bibliography}

\end{singlespace}
\end{document}

-

## migrated from stackoverflow.comJul 8 '13 at 16:07

This question came from our site for professional and enthusiast programmers.

Where do you get your \subtitle command from? Not that I think that's the problem, it's just that your example will get stuck there for me. –  Ulrich Schwarz Jul 8 '13 at 16:17
If you want to use the command \subtitle you have to use a KOMA-Script document class, where it is defined. For example, substitute report with scrreprt: \documentclass[11pt,reqno]{scrreprt} –  karlkoeller Jul 8 '13 at 16:25
BTW: Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  karlkoeller Jul 8 '13 at 16:29
Please update your example to show the real error message and not ! Undefined control sequence in line 22. Also post the full error message (e.g. from the .log file including the line number). If \listfiles is added at the begin of the TeX file, then LaTeX will print a version list at the end of the .log file (try pressing q for batch mode on the first error message to get a chance to reach \end{document}. If you are using older software, try updating your TeX distribution. –  Heiko Oberdiek Jul 8 '13 at 18:17
I'm sure there are some packages on CTAN that you haven't included yet. Please create a minimal example that demonstrates your problem. And please include only those packages in your document that you know you need. –  Martin Schröder Jul 8 '13 at 19:47

Your code doesn't give any errors, except the \subtitle command. Commenting it out will solve the problem.