PDF Metadata and Publishing
Use hyperref to set the PDF title, author, subject, and keywords, and to make contents entries, references, and URLs clickable. Before publishing, inspect the final PDF as a reader, not merely as a source file that compiles.
EasyLaTeX compiler setting: pdfLaTeX; load hyperref. Thesis submissions, journals, and archives may require PDF/A, embedded fonts, or specific filenames. Follow the delivery specification and validate the final file with suitable tools.
Loading hyperref
hyperref creates links for contents entries, cross-references, and URLs. Load it after most other packages:
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue,citecolor=blue]{hyperref}
colorlinks=true colors the link text. For monochrome printing, hidelinks removes colored borders and link colors. Check template compatibility before combining multiple packages that manage links.
PDF Metadata
Set document properties with \hypersetup:
\hypersetup{
pdftitle={Experiment Report},
pdfauthor={Alex Taylor},
pdfsubject={Materials Testing},
pdfkeywords={LaTeX, Experiment Report, Materials Testing}
}
These appear in the PDF reader's properties panel and may be used in search results. Keep the title, author, and keywords consistent with the cover, attribution, and actual content.
Bookmarks and Links
Section headings normally generate PDF bookmarks. Use these options to open them to a chosen depth:
\hypersetup{bookmarksopen=true,bookmarksopenlevel=1}
Use \tableofcontents for contents and \url{...} or \href{URL}{link text} for external links. Make link text describe its destination rather than relying only on “click here.”
Special Content in Headings
Headings are also written to contents files and PDF bookmarks. Complex formulas, footnotes, or formatting commands can cause bookmark warnings. Supply a shorter contents version:
\section[Model Comparison]{Model $A/B$ : Comparison and Discussion}
When needed, use \texorpdfstring{typeset content}{plain bookmark text} to provide appropriate text for the page and the bookmark separately.
Before Publishing
-
Rebuild the entire document and resolve undefined references, overflows, and font warnings.
-
Check contents, bookmarks, internal references, and external URLs in a PDF reader.
-
Inspect the title, author, subject, and keywords in PDF properties.
-
Check paper size, page numbers, headers, footers, image resolution, and grayscale output using the actual delivery method.
-
Verify filenames, licensing, accessibility, PDF/A, and embedded fonts where required.
Do not “fix” a final PDF simply by deleting auxiliary files or ignoring warnings. Identify the cause, then rebuild completely.
Common Problems
Garbled or Incomplete Bookmarks
Save the source as UTF-8 and simplify unsupported heading content with short titles or \texorpdfstring. For multilingual documents, use LuaLaTeX or XeLaTeX with an appropriate language and font setup.
Unwanted Colored Link Borders
Use colorlinks=true for colored text or hidelinks for unobtrusive links. Avoid combining border and text colors unless the delivery specification requires it.
Metadata Still Shows Old Values
Check that \hypersetup is in the main file's preamble and that changes have saved. Compile on the platform, wait for success, and inspect the latest preview or download the PDF again. If compilation fails, an older PDF's properties do not reflect the current changes.
Complete Example
\documentclass[a4paper,12pt]{article}
\usepackage[
colorlinks=true,
linkcolor=blue,
urlcolor=blue
]{hyperref}
\hypersetup{
pdftitle={Experiment Report},
pdfauthor={Alex Taylor},
pdfsubject={Materials Testing},
pdfkeywords={LaTeX, Experiment Report}
}
\begin{document}
\tableofcontents
\section{Method}\label{sec:method}
For the method, see \autoref{sec:method}.
Project website: \href{https://www.latex-project.org/}{LaTeX Project}.
\end{document}