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
Figure captions with citations fail in building PDF. Here is an example (note that :citet: is an alias of :cite:t:):
Input ipynb:
Output tex:
When compiling PDF from this tex, the following error shows up:
How to Reproduce
$ git clone -b sphinx-latex https://github.com/d2l-ai/d2l-en.git
$ cd d2l-en
$ vi static/post_latex/main.py # Comment out my hack https://github.com/d2l-ai/d2l-en/blob/sphinx-latex/static/post_latex/main.py#L141
$ pip install d2lbook
$ d2lbook build pdf # The output pdf should be at _build/pdf
Expected behavior
As a hack for this issue, I post-process this tex file. So the processed tex has a \protect and becomes:
Thanks for the detailed report, and apologies for the late reply - I've been on vacation. Using \protect is indeed the correct solution, and it would be possible to patch sphinxcontrib-bibtex so it always outputs \protect\hyperlink{...}. However I'm wary of any implications of using \protect everywhere for these hyperlinks - I don't understand enough about the robust/fragile system to know whether or not it will break something.
I'll close this as a duplicate of #276 - there you can find one idea for a solution (using the etoolbox package), but so far it doesn't work. Feel free to chime in there if you have further ideas.
Describe the bug
Figure captions with citations fail in building PDF. Here is an example (note that
:citet:
is an alias of:cite:t:
):Input ipynb:
Output tex:
When compiling PDF from this tex, the following error shows up:
How to Reproduce
Expected behavior
As a hack for this issue, I post-process this tex file. So the processed tex has a
\protect
and becomes:Then the output PDF is:
Your project
https://github.com/d2l-ai/d2l-en/ and https://github.com/d2l-ai/d2l-book
Screenshots
No response
OS
Linux
Python version
3.8
Sphinx version
5.1.1
The text was updated successfully, but these errors were encountered: