0

In the Hungarian language the definite article depends on the word that comes after the article (it can be either a or az). To account for this, the Hungarian - magyar - Babel (magyar.ldf) introduces the aref (and some related commands) in lieu of the usual ref. E.g. \aref{fig:1}. ábra compiles to az 1. ábra, but \aref{fig:2}. ábra becomes a 2. ábra. (See the LaTeX Companion as well.)

Is it possible to achieve this with bookdown? Unfortunately - but unsurprisingly - no \@aref() seems to exist there.

Tamas Ferenci
  • 424
  • 2
  • 10
  • Have you tried `\aref` without the `@`? Generally in Markdown pure LaTex is passed through. Of course, if you are targetting HTML output, this wouldn't work. – user2554330 Jan 13 '19 at 00:17
  • @user2554330 Thanks for the idea, it works (but changing to `aref` is not enough, of course you also have to replace `()` with `{}`) but unfortunately I also need non-LaTeX output. (That's why `\@ref()` is nice because it works for both.) – Tamas Ferenci Jan 13 '19 at 08:34
  • @user2554330 Thank you very much! The LaTeX seems to work perfectly, but the HTML doesn't: it outputs `a 1.1.` instead of `az 1.1.`. The reason seems to be that `magyar_article` checks whether the number's length is divisible with 3, if it begins with 1. That makes perfect sense for numbers, but not for labels, because `1.1` is pronounced the same as `1`, i.e. everything that comes after the first period is irrelevant from the pronunciation aspect (and thus from the article aspect). Also there is another thing, but that is surely just a typo: `ar` should be `az`. Thank you again! – Tamas Ferenci Jan 17 '19 at 12:44
  • @user2554330 Sure! I just did it, thank you again. (It'd be nice, if this would be eventually included in `bookdown`...!) – Tamas Ferenci Jan 18 '19 at 05:34

0 Answers0