# Incompability of kpfonts and hyperref?

I use hyperref with the optional argument breaklinks=true. I later wanted to inlcude kpfonts via:

\usepackage{kpfonts}
\usepackage[T1]{fontenc}

What I got after compiling was the following error message:

! pdfTeX error (ext4): \pdfendlink ended up in different nesting level than \pd fstartlink. \AtBegShi@Output ...ipout \box \AtBeginShipoutBox

\fi \fi

l.278

! ==> Fatal error occurred, no output PDF file produced! Transcript written on pirates.log. texify: pdflatex failed for some reason (see log file).

When I put all the existing references in my .tex-file into a box (for example by framing them in a \fbox{} then the compiler did his job, but (of course) without breaking the links.

Has anybody an idea what the problem might be? (I hope the part of the error-code I posted is sufficient...)

• 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}. — The usual rule (with its exceptions) is: Load hyperref last. From what you say in your question, it seems you load it before other packages. This has often created issues in the past. A MWE would surely help to sorten that out. May 14, 2013 at 21:07
• Avoid the link that is broken across pages. May 14, 2013 at 21:21
• I refrained from the MWE at first, because I set my references (which apparently cause the problems) via macros and felt like asking about general incompabilities at first (I didn't find any posts - what I found couldn't fix my problem). However, I was about to create a MWE for you now and I incidentally found out that the draft-mode (given as optional argument in \documentclass[]{scrbook}) caused the compiling failure. With draft "turned off" everything goes just fine... @HeikoOberdiek: Thought about that too. Is there a general way to prevent that links are broken across pages? May 14, 2013 at 21:21
• (Out of characters...) Plus, any idea why draft is the problem? May 14, 2013 at 21:28
• 1) draft disables hyperref's links. 2) There is not a general way to prevent links that are broken across pages. May 14, 2013 at 21:34