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 using Mixtex 2.9 in Windows XP and I'm trying to make my article's table of contents clickable. I tried to add the package hyperref like this:

\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}

but it throws the following error:

Runaway argument?
\sf@counterlist \relax \def \sf@temp {\@nil }\ifx \sf@temp \@nnil \else \ETC.
! Paragraph ended before \sf@setref was complete.
<to be read again> 
                   \par 
l.15 

What is going on? If I try this in a new article it does work, so how comes it doesn't work on mine?

My article is defined as:

\documentclass[10pt]{article}

I'm importing these packages;

\usepackage[utf8]{inputenc}                    
\usepackage[spanish]{babel}                   
\usepackage{graphicx}                               
\usepackage[usenames,dvipsnames]{color}          
\usepackage{wallpaper}                         
\usepackage{fancyhdr}                          
\usepackage[hmargin=3cm,vmargin=3.5cm]{geometry} 
\usepackage{marvosym}                           
\usepackage{caption}
\usepackage{subcaption}
\usepackage{subfig}
\usepackage{chapterfolder}
share|improve this question

migrated from stackoverflow.com Dec 15 '12 at 16:07

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

    
There seems to be an incompatibility between the subfig package and hyperref. –  cyberSingularity Dec 15 '12 at 16:23
5  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. In any case you shouldn't load both subfig and subcaption as they're incompatible. –  cgnieder Dec 15 '12 at 16:37
3  
Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Dec 15 '12 at 22:01

1 Answer 1

The subcaption package is incompatible with subfig (or with the obsolete subfigure); anyways, you only need either subfig or subcaption (not both, and preferably the latter since you are using caption), so simply use

\documentclass{article}
\usepackage[utf8]{inputenc}                    
\usepackage[spanish]{babel}                   
\usepackage{graphicx}                               
\usepackage[usenames,dvipsnames]{color}          
\usepackage{wallpaper}                         
\usepackage{fancyhdr}                          
\usepackage[hmargin=3cm,vmargin=3.5cm]{geometry} 
\usepackage{marvosym}                           
\usepackage{caption}
\usepackage{subcaption}
\usepackage{chapterfolder}
\usepackage{hyperref}
\hypersetup{
   colorlinks,
   citecolor=black,
   filecolor=black,
   linkcolor=black,
   urlcolor=black
}

\begin{document}

\tableofcontents
\section{Test} 

\end{document}

and build you sub-floats with the syntax provided by subcation. You could also use subfig instead of subcaption:

\documentclass{article}
\usepackage[utf8]{inputenc}                    
\usepackage[spanish]{babel}                   
\usepackage{graphicx}                               
\usepackage[usenames,dvipsnames]{color}          
\usepackage{wallpaper}                         
\usepackage{fancyhdr}                          
\usepackage[hmargin=3cm,vmargin=3.5cm]{geometry} 
\usepackage{marvosym}                           
\usepackage{caption}
\usepackage{subfig}
\usepackage{chapterfolder}
\usepackage{hyperref}
\hypersetup{
   colorlinks,
   citecolor=black,
   filecolor=black,
   linkcolor=black,
   urlcolor=black
}

\begin{document}

\tableofcontents
\section{Test} 

\end{document}

(and this time use the syntax provided by subfig).

share|improve this answer

Your Answer

 
discard

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