-
Notifications
You must be signed in to change notification settings - Fork 45
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
Latex issue when is included a citation in the caption of a table or figure #276
Comments
This is a documented issue: https://sphinxcontrib-bibtex.readthedocs.io/en/latest/usage.html#latex-backend-fails-with-citations-in-figure-captions Does the workaround documented there still work? |
No it does not work. It still given the same error, on the captions with a cite. |
Ah, good to know. Something must have changed in sphinx. Looking at the error, I'm not sufficiently skilled in TeX wizardry to see a simple immediate solution. If there would be a way to adjust something in the preamble to make it work, similar to the old solution, that would be fantastic. Ideas welcome. |
I have been looking this and it seems that if is added the term \protect before the \hyperlink{} citation method inside a the tables or figures captions \sphinxcaption{} the list of tables is generated correctly without errors The following give error in LATEX, when generated by SPHINX with sphinxcontrib-bibtex, The following does not give error, The same for figures cases, the following does not give error, with the \protect term before \hyperlink, However, I do not know how to add this term \protect in runtime while the sphinx LATEX generation. |
Many thanks for doing some research on this. Glad to see there's a solution in principle. Adding |
Haven't tested yet but I wonder if something like this could work in
|
In latex files where the issue has been check it does not harm adding \protect before every \hyperlink
Adding the solution to the preamble is less general, and does not work in my case. For the figures, code-blocks and tables might work if are generated with the standard latex labels. But for example in my case the tables are generated using \sphinxcaption and in this cases does not work. |
Thanks for the feedback, I've been thinking about this, will eventually try to come up with some solution (I'm just super busy for a few weeks). |
Just checking if there was an estimation when the protect would be added to attempt to fix this. Just came across this issue today when updating my sphinx environment and troubleshooting it to find that it was already written up :) |
I'm wary of adding a blanket
but apparently this doesn't work, and I don't know why. Some advice would be deeply appreciated. |
FWIW this fix does work for me perfectly with a |
Thanks for letting me know. I'm amazed this random untested code actually worked! Unfortunately, I still couldn't make it work on pdflatex. |
When is included a cite in the caption of a table or figure.
The generation in latex of the list of figures or tables is failing.
Are the citation labels added with the \protected label?
\protect\citeA[
[4] (structuraloptimizationgenerativedesign.lot Runaway argument? {\numberline {3.1.1}{\ignorespaces Summary of optimization objectives\ETC. ! Paragraph ended before \contentsline was complete. <to be read again> \par l.5 ...erved@a \relax \let \reserved@d =[\def \par }}{6}{table.3.1.0.0.0.1}% ? r
The text was updated successfully, but these errors were encountered: