Le 14/05/2024 à 17:05, Steevie a écrit :
On Mon, 13 May 2024 13:57:45 -0700 (PDT), Nhut Nguyen wrote:
Hi everyone,
I use Sphinx to generate PDFs for my book. If a *heading* contains a
*link*
like this illustration and I want it to appear in the footnote, some
will show "Page x," like below. It does not always happen. Just *some
headings* have.
*How can I prevent the "Page 5" in this footnote number from appearing?
I want only "2", not "Page 5, 2". * [image: sphinx.PNG]
It might be a bug. But any workaround is sufficient.
Can you share a minimum example that shows the behaviour?
Having said that, what about putting the link(s) not in the heading but
for example in an admonition or in some custom role (that you can
customise in latex) right below the title?
S.
Hi everyone,
Some minimal example would help indeed and also knowing if you use
`make latexpdf` to build the PDF output, or some other build
system which may not do as many pdflatex runs as necessary in all
circumstances (this was the case in the past with RTD, not sure
now).
Sphinx has some built-in mechanism to insert "Page N, " if the
footnote is not on same page, and in your example it looks as
if the footnote is on same page so the "Page N, " should not be there,
this is why I wondered if enough many runs are made.
Incorporating this to conf.py should fix your problem:
```
latex_elements = {
"preamble": r'\renewcommand\sphinxthefootnotemark[2]{#1}',
}
```
If you feel this is a bug, please try to produce a small example
and open a ticket at https://github.com/sphinx-doc/sphinx/
Something gets wrong in the "same page" detection mechanism.
At least with a ticket we can document is as a limitation in case
we decide we can't fix it.
JF B.
--
You received this message because you are subscribed to the Google Groups
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sphinx-users/v20434%24tor%241%40ciao.gmane.io.