Directory macros/luatex/latex/docref
LaTeX Package: DocRef v0.3.1 2026-11-30
Cross-references to external LaTeX package documentation.
Description
docref retrieves reference numbers, titles, and page numbers from locally available package manuals. It requires LuaLaTeX.
Usage
~latex documentclass{article} usepackage{docref} usepackage{hyperref} % optional begin{document} See Section~docref{babel}{selectors}, ~docnameref{babel}{selectors}'', on page~docpageref{babel}{selectors}. end{document}
All three commands take a package name and label. With hyperref, references link to the PDF manual; starred forms suppress links. Unresolved values produce ?? and a warning.
Common documentation source names are discovered automatically. To select a source or auxiliary file explicitly, use:
~latex DocRefSource{pkg}{build/manual.aux}build/manual.pdf ~
The first file may be .tex, .ltx, .dtx, or .aux; the optional final argument specifies a PDF file or URL. Auxiliary records support all label types, including figures, tables, equations, and custom counters. Titles require nameref or hyperref in the target manual; exact destinations require hyperref there. Without auxiliary records, lookup is limited to source headings and PDF information.
When no source label is available, \DocRefPDF{pkg}{manual.pdf}[URL] and \DocRefBookmark{pkg}{label}{Heading title} select a PDF bookmark by its exact, unique title. The local PDF supplies the reference data; a number is available only if it appears in the bookmark. Register the PDF first. Repeated titles are ambiguous even when they share a destination. Direct destinations without an identical named destination are displayed without a link. The optional URL selects the link target; query strings are preserved and any existing fragment is replaced by the destination. The online PDF must have the same named destinations as the local PDF. Bookmarks targeting an external document are not resolved.
Tests
The regression checks require LuaLaTeX, the TeX packages used by the test fixtures, pdftotext (Poppler), and Python 3 with pypdf. Run python3 test/check-pdf-bookmarks.py for PDF bookmarks. The complete suite can be run with python3 test/run-tests.py; generated files stay in temporary directories. Persian fixtures require the Amiri font.
Installation
Keep docref.sty and docref.lua together beside your document or in a TeX-searchable directory.
Documentation
See the main manual for lookup rules and examples.
License and maintainer
- License: LPPL 1.3c or later.
- Maintainer: Amer Amikhteh.
Download the contents of this package in one zip archive (68.0k).
DocRef – Cross-references to labels and PDF bookmarks in external LaTeX documentation
This package provides cross-references to labels in locally available LaTeX package documentation, retrieving reference numbers, titles, and page numbers from source files or auxiliary records.
When source labels or auxiliary records are unavailable, it can resolve references by the exact, unique title of a PDF bookmark. It extracts bookmark titles, section numbers, and printed page labels, and supports links to local or online PDF manuals via hyperref. Bookmark section numbers preserve Latin, Persian, and Arabic digits. The package requires LuaLaTeX.
| Package | DocRef |
| Bug tracker | |
| Repository | |
| Version | 0.3.1 2026-11-30 |
| Licenses | The LaTeX Project Public License 1.3c |
| Copyright | 2026 Amer Amikhteh |
| Maintainer | Amer Amikhteh |
| Contained in | TeX Live as docref MiKTeX as docref |
| Topics | LuaTeX Label and References |