-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[FR] internationalization - Customize figure names to set label after number #1114
Comments
In the doc you linked to: https://bookdown.org/yihui/bookdown/internationalization.html it is explain with an example how to change a the figure label name, using the language and label key in the YAML What is not working for you with this ? |
Because the translation of Figure should go after the number, not before it (as I have written: " |
That is right, this is currently not possible to do that. Thanks for explaining. It will always be Out of curiosity, in which language do you label figure this way ? |
It's Hungarian. The reason why I hope for a possible new feature to support this is that the exact same thing is already working for chapter name! The cited doc even gives an example for this. The very same solution would be perfect for figure (and table) names. |
You mean the use of a function taking chapter number as argument ? Is that what you use for chapter name ? |
Yes,
A similar solution would be perfect for figure and table naming. |
That sounds like a reasonable feature request to me. |
@tamas-ferenci you may try #1120 remotes::install_github("rstudio/bookdown#1120") where this should work now language:
label:
fig: !expr function(i) paste(i, 'ábra')
ui:
chapter_name: !expr function(i) paste0(i, '. fejezet') |
Thank you very much @cderv and @yihui ! I checked it, and it indeed seems to work fine! I only see two (very minor) problems:
|
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
(Already posted in Stackoverflow here to no avail.)
Bookdown allows the customization of chapter names, which is handy when a Hungarian project is built, as
Chapter 1
is translated as1. fejezet
(i.e. the renaming ofChapter
is not enough).However, the very same is true for figure (and table) names as well, because
Figure 1.1
should be translated as1.1. ábra
, but I don't know how to achieve this (_bookdown.yml
doesn't seem to support something like "language/ui/figure_name
" just as it does withchapter_name
).There is no problem with the PDF (LaTeX) output, because including
\usepackage[magyar]{babel}
in thepreamble.tex
solves this problem, but I don't know what to do with the non-PDF formats, where my only idea was to use the_bookdown.yml
.The text was updated successfully, but these errors were encountered: