2

When I use \usepackage{hyperref} it doesn't complile the code.

\documentclass[a4paper,11pt]{report}
\usepackage{a4wide}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{url}
\usepackage{fixltx2e}
\usepackage{caption}
\usepackage{subcaption}
\oddsidemargin 0.0in
\textwidth 6.27in
\topmargin -0.5in
\textheight 9.69in
\footskip 0.5in
\urlstyle{sf}
\usepackage{fancyhdr}
\makeatletter
\newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral #1@}
\makeatother
\usepackage{epstopdf}
\usepackage{multirow}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{subfig}
\linespread{1.3}
\usepackage{float}
\usepackage{enumerate}
\usepackage{enumitem}
\usepackage{multirow}
\newtheorem{lemma}{Lemma}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}
\usepackage[linesnumbered,ruled,vlined]{algorithm2e}
\usepackage{hyperref}
\begin{document}
\chapter{xxx}
dfdsfdsfd
\end{document}
4

The incompatibility here is not with hyperref, but instead with loading two sub-float packages: subcaption and subfig. Since you're using caption already, I'd stick with subcaption rather than subfig.

Other suggestions include:

2
  • but I have sub figures and sub captions in my latex code – Harry Nov 21 '14 at 3:32
  • 4
    @Harry: That's fine, since both provide that functionality - they're not compatible though. So you have to make a decision between using the one or the other. Look at the subfig documentation and the subcaption documentation and make a decision in terms of the user interface you prefer. I'd go with the latter subcaption, since you're already using caption (by the same package author). – Werner Nov 21 '14 at 3:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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