paleolimbot / rbbt

R Interface to the Better BiBTex Zotero Connector
142 stars 25 forks source link

'Update bibliography for the current document' does not work with cites in captions #40

Open LuisLauM opened 1 year ago

LuisLauM commented 1 year ago

I got a caption like this:

\```{r fig_1, fig.cap='A caption  with a cite @AnAuthor2021'}
plot(1, 1)
\```

Then I try to update the bibliography using the addin, but reference of @AnAuthor2021 is never added.

PS: omit the \ before the ` (is just to avoid the Rmd interpreter of Github).

LuisLauM commented 1 year ago

Dear @paleolimbot

In order to move on in this point, I have made the next commit in my fork https://github.com/LuisLauM/rbbt/commit/bfafeb22f22cb48f49fa5d5439525f1f59df2106

There, I include a new argument (include.chunks = TRUE). Now it works great for me but of course I do not know if you feel that it is a good solution.

Let me know it, please. Regards.

dmi3kno commented 1 year ago

This should be taken care of together with references in Quarto #| tbl-caption: ... and #| fig-caption: ... etc (including sub-captions if any. Also include chunks is confusing because you are talking about chunk options.

Also, if you (optionally) include chunk options, why not the rest of the carved-out instances, i.e. in-line code? I think the interface should be consistent.

References in chunks would refer to, for example, table output.

LuisLauM commented 1 year ago

This should be taken care of together with references in Quarto #| tbl-caption: ... and #| fig-caption: ... etc (including sub-captions if any. Also include chunks is confusing because you are talking about chunk options.

Also, if you (optionally) include chunk options, why not the rest of the carved-out instances, i.e. in-line code? I think the interface should be consistent.

References in chunks would refer to, for example, table output.

Yes, that solution was made quickly and then I realized that it is not the good one at all. I have written some lines that extract @refs from 1) header of chunks and, 2) within the chunks, only from those lines that starts with #| tbl-caption: ... and #| fig-caption:. However, I have not submitted yet because I was planing to test it well before and right now I have been busy with another activities in my project.