# Redefining contentsline using hyperref

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?

-
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