I'm trying to provide custom labels to figures and tables on bookdown but I haven't managed to do so.
I tried to change the language according to the book (Internationalization section) on the default book when opening a new project on Rstudio and selecting a bookdown project.
I only added the label sections below to the _bookdown.yml file present
However, the resulting cross reference text is " See Figure 3.1." and " Don’t miss Table 3.1." On the cross.html file rendered and not Figures 3.1 or Tables 3.1
I am misunderstanding something? Or this is a bug?
The cross reference syntax \@ref(label) will only be replaced by the number currently. So you see Figure or Table in front of the number because it should be in the text (like in the bookdown-demo).
The internationalization feature only works for Caption for now. You found the correct feature request for this.
Thanks, sorry but I find very difficult to find the documentation of the different options and combinations despite (or precisely due to) the high number of books and web pages with documentation.
So the function /expression is not used contrary to what it is documented? Is somewhere documented that this only works for captions? (I can send a PR to modify the internalization chapter of the "Authoring Books and Technical Documents with R Markdown")
Everything works, but I found the documentation unclear. I expected that the language option would add the expression also on cross-references. I didn't see any mention that the change only affects the caption labels.
I wish the documentation explained it:
If the language of your book is not English, you will need to translate certain English words and phrases into your language on the captions, such as the words “Figure” and “Table” when figures/tables are automatically numbered in the HTML output. Internationalization may not be an issue for LaTeX output, since some LaTeX packages can automatically translate these terms into the local language, such as the ctexcap package for Chinese.
I think it is not something which gets precised because there is no such things by default as reference caption or reference prepended label. It is not a feature that exists yet, so we did not mention in the doc that internationalization that it affect only caption.
We welcome any improvement to the doc so please yes do send a PR with improved wording so that this is clearer to you. Thanks !