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 LaTeX writing my bachelor thesis and I have some issues with the hyperref package.

I use a LaTeX document provided by my university that has a lot of stuff regarding citation styles, listings, numbering etc. already predefined according to university's guidelines. Trying to use hyperref, I ran into a problem with captions in float environments like tables and figures. Error message is:

! Argument of \reserved@a has an extra }.

I tried to make a minimal example reproducing the error, spend a few hours on google and here on stackexchange and the problem seems to be the redefinition of \contentsline and \numberline provided by my university:

\let\jbcontentsline\contentsline
\renewcommand{\contentsline}[3]{\jbcontentsline{##1}{##2}{##3}\vspace{0.25\baselineskip}}
\let\jbnumberline=\numberline%
\renewcommand{\numberline}[2]{\jbnumberline{Abbildung ##1:}{##2}}

So, as far as I understood, this redefinitions do not work because hyperref also redefined those commands. Is there a way to adapt the code to make it work with hyperref?

share|improve this question
3  
Welcome to TeX.sx! Can you please name the used style or give a link to it? Without knowing your used document class it is hard to help you. A minimal working example (MWE) would be helpful. –  Kurt Dec 31 '12 at 3:29
    
The document class is scrreprt. But I don't think the style is available on the internet somewhere. –  Tobias Dec 31 '12 at 16:46
    
With no MWE, this is I'm afraid unclear. –  Joseph Wright Aug 4 '13 at 19:33
    
Unfortunately this question has been closed, while at least some issues can be solved. Therefore I give my answer as comment: 1. First load hyperref, then change \contentsline and \numberline. 2. Hyperref uses \numberline with four (4) parameters, not with only three (3)! 3. There is a spurious "=" in your code. 4. Better: (to be continued) –  Stephen Nov 17 '13 at 15:29
    
(continuation) \RequirePackage{letltxmacro}[2010/09/02]\relax \GlobalLetLtxMacro{\jbcontentsline}{\contentsline}\relax \renewcommand{\contentsline}[4]{\jbcontentsline{##1}{##2}{##3}{##4}\vspace{0.25\‌​baselineskip}}\relax \GlobalLetLtxMacro{\jbnumberline}{\numberline}\relax \renewcommand{\numberline}[2]{\jbnumberline{Abbildung ##1:}{##2}}\relax. (Instead of \relax a new line should be used, which is not possible in comments.) That should fix at least some error(message)s. –  Stephen Nov 17 '13 at 15:30
add comment

closed as unclear what you're asking by Joseph Wright Aug 4 '13 at 19:33

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.