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


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


! ==> 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...)

  • 2
    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
  • 2
    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?
    – user30727
    May 14, 2013 at 21:21
  • (Out of characters...) Plus, any idea why draft is the problem?
    – user30727
    May 14, 2013 at 21:28
  • 1
    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

2 Answers 2


It's important that draft-mode is set false in \documentclass[draft=false]{<class>} (it is by default, in fact), then kpfonts will load.


At first it seemed that broken links (...hyperref) cause an error. However, it turned out that for some reason draft-mode needs to be turned off when using MikTex. I started to use TeX Live recently and kpfonts works just fine (with draft mode, broken links and so forth...)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.