I am making PDF with LaTeX. I have a few sections and subsections. I want to put a link towards the top of the document so that in the PDF someone can click on it and it'll go to that section/subsection. I know it's possible to have this with a linkable table of contents, but I don't want to make a table of contents, I need more control.
Include \usepackage{hyperref}
in the preamble of your document. Assign proper labels to your sections and reference these labels using \ref{}
. These references will then be turned into clickable links when creating PDFs with pdflatex.
The hyperref
package has extensive support for this sort of thing (as noted in an earlier answer).
Notes and advice: hyperref is a big package, and (by necessity) it plays some pretty dirty tricks with the guts of LaTeX. Load the hyperref package last, and if your document suddenly becomes weird, then comment that package out, get rid of the .out
and .aux
files from your directory, and try again to see if the problem disappears. If it does, then ... think of something.
The hypertex
package can do some of the same things, and is a little more lightweight. But my recollection is that it's a little fragile, and may not be much maintained any more.
You can do some of this stuff with PDF specials (see the pdftex manual), but that's getting a little hardcore, and requires you to know quite a bit about PDF.