TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

\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

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.

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