jupyter-book icon indicating copy to clipboard operation
jupyter-book copied to clipboard

Can't use {cite} role inside table/figure title

Open Jarartur opened this issue 3 years ago • 3 comments

Describe the problem

While creating a table, e.g. with ```{list-table} My title from {cite}`my-citation` :header-rows: 1 :name: "my-table"

    • Column1
    • Column 2
    • data 1
    • data 2

```

the {cite} role breaks the creation of the table resulting in:

table

Link to your repository or website

No response

Steps to reproduce

  1. Create a table with the {list-tabe} directive
  2. Add {cite} role in the title
  3. Build the book

The version of Python you're using

3.9.9

Your operating system

Windows 11

Versions of your packages

Jupyter Book : 0.12.0 External ToC : 0.2.3 MyST-Parser : 0.15.2 MyST-NB : 0.13.1 Sphinx Book Theme : 0.1.7 Jupyter-Cache : 0.4.3 NbClient : 0.5.8

Additional context

No response

Jarartur avatar Jan 03 '22 13:01 Jarartur

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar Jan 03 '22 13:01 welcome[bot]

In case anyone would want to do the same: I figured out a way to do this in figures. Based on this at least in figures case it's a problem with latex. I overcame this by directly adding a hyperlink in dollar notation with the \protect command ${[}\protect\hyperlink{cite.intro:id26}{1}{]}$. The drawback is you need to find the citation id manually in output.tex file.

Jarartur avatar Jan 06 '22 17:01 Jarartur

found the \protect work-around in https://github.com/mcmtroffaes/sphinxcontrib-bibtex/issues/276 :)

casperdcl avatar Oct 07 '23 21:10 casperdcl