-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Broken reference to label in included file (PDF output) #3432
Comments
You should use
and the
Is there some special reason why you use |
ah sorry I see HTML and LaTeX builder diverge here in behaviour. What I said is ok for LaTeX as the toctree inclusion is done by explicit file inclusion. For HTML it creates a local TOC which is not equivalent to what you try to achieve with |
Hi, thanks a lot for your quick response. The reason I'm using If |
if I understand correctly
but do not use |
Thanks a lot, the So if you consider that this is the way that appendices should be used and not with Thank you again for your help! |
Keeping this opened awaiting enlightenment by experts ;-)
Thanks for reporting ! |
It seems the included docs are processed twice. So you'd seen the "duplicate label" warnings.
Though the build process, Sphinx has been confused because the label has been appeared twice. Tips: you should use other extensions for included documents (cf .txt). |
+1 @tk0miya. So it seems the correct procedure in the context of
for a file But this |
It seems not a bug of Sphinx. So I close this now. |
Problem
Labels in files included using
.. include:: file.rst
cannot be referenced from the parent document, nor from other included files.The references are displayed as the name of the label in the PDF output instead of a clickable link with the name of the section. The problem is present with
:ref:
and:numref:
.The problem is not present in the HTML output where the references are correctly replaced by clickable links with the section name.
Procedure to reproduce the problem
See reproducible project section.
Error logs / results
make latexpdf
generates the following warning but this warning is also present when generating the HTML output which correctly works so it's probably not the cause of the bug.Expected results
The references should be replaced by clickable links with the name of the target section in the PDF output. Exactly like it is the case in the HTML output.
Reproducible project
Minimal project: include-ref-bug.tar.gz
Resulting PDF: include-ref-bug.pdf
Environment info
Thank you in advance for your help.
The text was updated successfully, but these errors were encountered: