Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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,
  colorlinks=true,
  naturalnames=true,
  linkcolor=blue,
]{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}  
share|improve this question

migrated from stackoverflow.com Jul 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
1  
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
1  
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
1  
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
show 1 more comment

1 Answer

up vote 1 down vote accepted

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

CHeers!

share|improve this answer
    
Exactly correct for the code I gave. My document had other code to format tables, etc. including a \newcommand{subtitle}(removed that cause using scrrprt). I discovered \DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse} to be the conflict with \usepackage{hyperref}. Took it out, and all looks good now. Thank you for the help, and I hope my comment is useful for others. –  user32097 Jul 8 '13 at 19:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.