Skip to content

todolist directive generates wrong hyperlinks in LaTeX PDF output #12520

@jfbu

Description

@jfbu

Describe the bug

The LaTeX mark-up for todo directives uses a \label which can not work because there is no associated counter. As a result from the Todo List, the links go generally to the section title, not to the actual todo item.

Here is a screenshot where the target of the second item in the todo list is shown.
Capture d’écran 2024-07-08 à 22 09 46

How to Reproduce

index.rst

Welcome to FOO's documentation!
===============================

TEST
====

section 1
---------

.. todo::

   Implement TODOs!


Some text


Some more text

.. todo::

   Implement TODOs! Do it ! (2)


section 2
---------

.. todolist::

conf.py

project = 'FOO'
copyright = '2024, JFB'
author = 'JFB'
version = '0'
release = '0'
extensions = ['sphinx.ext.todo']
todo_include_todos = True
todo_link_only = True
language = 'en'
# master_doc = 'index'

Environment Information

Sphinx version: 7.4.0+/7eb77f237
Python version: 3.12.3 (CPython)
Docutils version: 0.21.2 
Pygments version: 2.18.0
Jinja2 version: 3.1.4

Sphinx extensions

['sphinx.ext.todo']

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions