Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anonymous links to sections create extra labels in LaTeX output #7701

Closed
cpitclaudel opened this issue May 21, 2020 · 0 comments
Closed

Anonymous links to sections create extra labels in LaTeX output #7701

cpitclaudel opened this issue May 21, 2020 · 0 comments

Comments

@cpitclaudel
Copy link
Contributor

Describe the bug

Using a target in an anonymous link causes sphinx to define the target twice:

This is a test:

- `xyz`__, this is an anonymous link

__ target_

Some text

.. _target:

Some more text

Output with Sphinx:

This is a test:
\begin{itemize}
\item {} 
{\hyperref[\detokenize{index:target}]{\sphinxcrossref{xyz}}}, this is an anonymous link

\end{itemize}
\phantomsection\label{\detokenize{index:target}}\phantomsection\label{\detokenize{index:id1}}
Some text

\phantomsection\label{\detokenize{index:target}}
Some more text

Output with rst2latex:

This is a test:

\begin{itemize}
\item \hyperref[target]{xyz}, this is an anonymous link
\end{itemize}

Some text

\phantomsection\label{target}
Some more text

The Sphinx one has Label `index:target' multiply defined

Expected behavior

Sphinx shouldn't define the label twice.

Environment info

  • OS: GNU/Linux
  • Python version: 3.6.9
  • Sphinx version: 2.3.1
  • Sphinx extensions: none
  • Extra tools: LaTeX

Btw, could there be a sphinx command to get all this info? Like sphinx-build --version could print the OS, python version, and sphinx version, and even installed extensions.

Thanks!

@tk0miya tk0miya added this to the 3.1.0 milestone May 21, 2020
tk0miya added a commit that referenced this issue May 29, 2020
Fix #7701: LaTeX: Anonymous indirect target causes duplicated labels
Zimmi48 pushed a commit to Zimmi48/coq that referenced this issue Jun 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants