latex3 / latex3/hyperref

Incompatibility between thmtools and hyperref packages in Tex Live 2024 and 2025

Open
#396 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
205
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Packages involved:
TL-2024 {thmtools}[2023/05/04 v0.76], {hyperref}[2024-11-05 v7.01l]
TL-2025 {thmtools}[2023/05/04 v0.76], {hyperref}[2025-07-12 v7.01o]

Links to theorem-like environments defined by thmtools, that are produced by hyperrref-packages [2024-11-05 v7.01l] in TeXLive-2024 and [2025-07-12 v7.01o] in TeXLive-2025, do not work correctly.

Here is an `almost' minimal working example:


% !TEX TS-program = pdflatex

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}
\declaretheoremstyle[%
headfont=\color{blue}\normalfont\bfseries,
bodyfont=\color{black}\normalfont\itshape,
]{coloredtm}
\declaretheorem[%
style=coloredtm,
name=Theorem,
numberwithin=section
]{tm}
\declaretheoremstyle[%
headfont=\color{blue}\normalfont\bfseries,
bodyfont=\color{black}\normalfont,
]{coloreddef}
\declaretheorem[%
style=coloreddef,
name=Example,
sibling=tm
]{exa}
\declaretheorem[%
style=coloreddef,
name=Definition,
sibling=tm
]{dfn}

\usepackage[colorlinks]{hyperref}

\begin{document}

\section{Section 1}
\begin{exa} \label{IntroExa1}
This is Example 1.1, \emph{not} 2.1,!
\end{exa}

\subsection{}
\begin{dfn}\label{def:1.1}
This is Definition 1.2.
\end{dfn}
\begin{exa}\label{ExaLMS}
This is Example 1.3.
\end{exa}

\subsection{}
\begin{exa}\label{rate}
This is Example 1.4, \emph{not} 2.4,!
\end{exa}

\subsection{}
\begin{exa}
This is Example 1.5.
\end{exa}
\begin{exa}[Yet another example] \label{Elaine}
This is Example 1.6.
\end{exa}

%%%%%%%%%%%%%%%%%%%%%%%

\section{Section 2}
\begin{exa}\label{ExaLip1}
This is Example 2.1.
\end{exa}

\subsection{}
\begin{exa}\label{ExaLip2}
This is indeed Example 2.2.
\end{exa}
\begin{exa}\label{ExaLip3}
This is Example 2.3
\end{exa}
\begin{exa}\label{ExaLip4}
This is Example 2.4
\end{exa}

See Examples~\ref{ExaLip1}, \ref{ExaLip2}, and~\ref{ExaLip4}.

\end{document}


Until TeXLive-2023, including
TL-2023 {thmtools}[2023/05/04 v0.76], {hyperref}[2023-11-26 v7.01g]
all the way down to TL-2015, these links work as they should.

Same with "numberwithin=chapter" in case of \documentclass{book}.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by compiling the provided minimal working example with TeX Live 2024 and 2025, then compare its theorem links with TeX Live 2023. The work is done when links created for thmtools theorem-like environments resolve correctly in the affected versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex, tex
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.