Thanks, JF B. *The \renewcommand\sphinxthefootnotemark[2]{#1} really helps.🙏*
Here is the code that produced the issue: ------------------- # Container With Most Water % Medium ## [Problem statement]( https://leetcode.com/problems/container-with-most-water/) You are given an integer array `height` of length `n`. There are `n` vertical lines drawn such that the two endpoints of the `i-th` line are `(i, 0)` and `(i, height[i])`. ------------------------- After running "sphinx -T -b latex", I ran "latexmk -r latexmkrc -pdf -f -dvi- -ps- " only once to build the pdf. (I do not know how to build *many runs *this way. It seems I have to delete the pdf folder to rebuild for many runs.) I might prepare a small example to open a bug. Best regards /Nhut On Tue, May 14, 2024 at 6:39 PM jfbu <j...@free.fr> wrote: > 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 a topic in the > Google Groups "sphinx-users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sphinx-users/HctkGQYk6sI/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > sphinx-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sphinx-users/v20434%24tor%241%40ciao.gmane.io > . > -- 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 sphinx-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/CAGzBvyXTdXtsQo6go2VhU0_D7uuDKgZarArzvMGgqwEHdq4sxg%40mail.gmail.com.