4

I want to assign individual anchors to a series of paragraphs with \hypertarget, so that each paragraph can be linked to with \hyperlink:

\documentclass{article}
\usepackage{hyperref}

\begin{document}

\hypertarget{t000}{}000

\hypertarget{t001}{}001

\hypertarget{t002}{}002

...

\hypertarget{t100}{}100

\end{document}

But the page is overflowed:

enter image description here

How could I fix this, or what's the proper way to reference individual paragraphs? Thanks a lot!

wdscxsj
  • 628
  • 2
    Welcome to TeX.SX! Please help us to help you and 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}. –  Feb 08 '15 at 10:04

1 Answers1

5

Add \leavevmode before \hypertarget.

The command \hypertarget eventually issues \nobreak and, if it's found after a blank line, this produces a penalty in vertical mode that inhibits page breaking.

egreg
  • 1,121,712
  • Thank you very very much for the insight. I can dig a little deeper now... Maybe LaTeX requires too much insight. :) – wdscxsj Feb 08 '15 at 11:44