hyperref

repository·main·Indexed 41 days ago

https://github.com/latex3/hyperref

A core LaTeX package for managing cross-references and creating hyperlinks to URLs, internal document locations, or files in output formats such as PDF and HTML. The bundle includes the core hyperref package, backref for bibliography links, and nameref for referencing section names.

Tokens
959
Snippets
3
Records
5
Agent score
3%

What's inside hyperref

  1. Overview of the hyperref bundle

    main

    The hyperref bundle provides advanced cross-referencing capabilities in LaTeX by producing \special commands for various backends (including pdfTeX, dvipdfm, TeX4ht, and Acrobat Distiller).

    The bundle includes three primary components:

    1. hyperref: The core package for hyperlinking functionality.
    2. backref: Provides hypertext links from the bibliography back to the main text where the work was cited.
    3. nameref: Allows referencing the names of sections instead of their numbers.
  2. Manual installation of hyperref

    main

    If you are not using a package manager or a pre-sorted ZIP, follow these steps to install from source:

    1. Download and Unpack: Get the files from CTAN or the TUG server.
    2. Generate Files: Run tex hyperref.ins to generate the necessary package and driver files.
    3. Copy Package Files: Move *.sty, *.def, and *.cfg files to your TDS tree at tex/latex/hyperref/.
      • Note: bmhydoc.sty should be placed in source/latex/hyperref/ instead.
    4. Copy Documentation: Move documentation files (like hyperref-doc.pdf, README.md, etc.) to doc/latex/hyperref/.
    5. Update Database: Run your system's database update command (e.g., mktexlsr).
    # 1. Generate files
    tex hyperref.ins
    
    # 2. Install package files
    cp *.sty *.def *.cfg TDS:tex/latex/hyperref/
    
    # 3. Install documentation
    cp hyperref-doc.pdf README.md ChangeLog.txt slides.pdf paper.pdf hyperref.pdf backref.pdf nameref.pdf TDS:doc/latex/hyperref/
    
    # 4. Update database (TeXLive example)
    mktexlsr .../texmf
  3. Install hyperref using a TDS ZIP file

    main

    The fastest way to install the bundle manually is to use the pre-sorted TDS (TeX Directory Structure) ZIP file. Unpack this file directly into your TeX tree (e.g., texmf) and then refresh the filename database.

    Steps:

    1. Download hyperref.tds.zip from CTAN.
    2. Unzip the contents into your TDS tree.
    3. Run the filename database update command (e.g., mktexlsr for TeXLive).
    # Unpack into your TeX tree
    cd /...somewhere.../texmf
    unzip /...downloadpath.../hyperref.tds.zip
    
    # Refresh the filename database (example for TeXLive)
    mktexlsr /...somewhere.../texmf
  4. How to report a bug in hyperref

    main

    When reporting bugs via the GitHub issues tracker, please include the following to ensure a helpful response:

    • Problem Description: A comprehensive description including specific error or warning messages. To get more detailed error messages, add \errorcontextlines=\maxdimen to your TeX code.
    • Minimal Test File: A small, standalone .tex file that reproduces the issue without unnecessary packages or code.
    • Environment Details:
      • The drivers and programs being used.
      • Version information for packages and programs. Use the \listfiles command in your LaTeX document to print version information at the end of the run.
    • Note on Attachments: Do not attach .log, .dvi, .ps, or .pdf files unless specifically requested.
  5. Workaround for relative links in PDF generation

    main

    If you are generating PDFs and need to create a relative link without the file: prefix, you can use a group with \hypersetup to temporarily clear the linkfileprefix.

    Example:

    \begingroup
      \hypersetup{linkfileprefix={}}
      \href{../foo/bar.html}{bar.html}
    \endgroup