You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Captioned code-blocks in distinct sections which are numbered the same confuse the internal links inside pdf output.
To Reproduce
Steps to reproduce the behavior:
Use sphinx-quickstart to create fresh project then use following index.rst file
Welcome to FOO's documentation!
===============================
Section One
-----------
This link: :ref:`last` fails to jump to last code-block in pdf output
(if ``numfig`` not set).
.. code-block:: none :caption: first a
.. code-block:: none :caption: second :name: II b
.. code-block:: none :caption: third c
Section Two
-----------
.. code-block:: none :caption: last one :name: last d.. See also :numref:`II`.
The pdf link :ref:`last` brings us back to first code-block in first section.
Execute make latexpdf and open pdf output in some viewer. The internal hyperlinks are wrong. Also the latex log file contains following warnings:
Chapter 2.
pdfTeX warning (ext4): destination with the same identifier (name{literalblock.
1}) has been already used, duplicate ignored
Expected behavior
Internal links in pdf work.
Environment info
Python version: 3.6.8 (CPython)
Sphinx version: tested with v2.0.0 as well as current 3.x
Extra tools: TeXLive 2020
Additional context
With numfig = True in conf.py, the issue does not show.
The text was updated successfully, but these errors were encountered:
It is hard to provide a unit test, because the problem only raises a
LaTeX warning and show only as broken internal links in pdf output.
As the fix moves some LaTeX code to the end of preamble, user or
extension code may have to be moved to. However, a large part of it
already was delayed. I checked that sphinxmessages.tex does not
introduce code in preamble which would be broken from missing macros due
to this change.
jfbu
added a commit
to jfbu/sphinx
that referenced
this issue
Jan 23, 2021
It is hard to provide a unit test, because the problem only raises a
LaTeX warning and shows as broken internal links in pdf output.
As the fix moves some LaTeX code to the end of preamble, user or
extension code may have to be moved there too. However, a large part of
it already was delayed. I checked that sphinxmessages.tex does not
introduce preamble code which would be broken from missing macros due
to this change.
Describe the bug
Captioned code-blocks in distinct sections which are numbered the same confuse the internal links inside pdf output.
To Reproduce
Steps to reproduce the behavior:
Use
sphinx-quickstart
to create fresh project then use followingindex.rst
fileExecute
make latexpdf
and open pdf output in some viewer. The internal hyperlinks are wrong. Also the latex log file contains following warnings:Expected behavior
Internal links in pdf work.
Environment info
Additional context
With
numfig = True
inconf.py
, the issue does not show.The text was updated successfully, but these errors were encountered: