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

\oddsidemargin 0.0in
\textwidth 6.27in
\topmargin -0.5in
\textheight 9.69in
\footskip 0.5in
\newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral #1@}
\usepackage{amsmath, amsthm, amssymb}

1 Answer 1


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:

  • but I have sub figures and sub captions in my latex code
    – Harry
    Nov 21, 2014 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, 2014 at 3:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .