Skip to content
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

Exporting citations as Latex source code doesn't escape ampersand characters #60

Open
bsdz opened this issue Jan 3, 2023 · 0 comments

Comments

@bsdz
Copy link
Contributor

bsdz commented Jan 3, 2023

This seemed to work for a while but then started causing issues. I've created a raw cell with latex raw nbconvert output and i can see new references appearing in this cell when I add a citation. When I try to run pdflatex on the generated tex source code I get errors like "Misplaced alignment tab character &. Foo, B. A., &". If I manually escape the ampersands then pdflatex compiles successfully. Not sure why it was working for a while then stopped.

Edit: Since I export my notebook to tex using a cell command with nbconvert, I've appended the following as a workaround:

!jupyter nbconvert notebook.ipynb --to latex --no-prompt
!sed -i -e '/\\bibitem/{n;s/\([&_]\)/\\\1/g}' notebook.tex 

Edit2: This also appears to affect underscores too. So I've updated my workaround snippet to reflect that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant