latex3 / babel

The babel system for LaTeX, LuaLaTeX and XeLaTeX
LaTeX Project Public License v1.3c
124 stars 34 forks source link

Typo in the Babel documentation. Test for non-supported language attributes? #219

Closed gmilde closed 1 year ago

gmilde commented 1 year ago

The documentation "babel.pdf" has a typo in the Example for "main" on page 30. The language attribute for polytonic Greek in the contributed Babel-Greek package is "polutoniko", not "polutonic".

This may explain why some accents in Greek are not shown correctly after specifying this option.

To prevent such problems, how could I add code to warn users when a non-supported modifier is used?

jbezos commented 1 year ago

The modifiers mechanism was devised as a way to pass options to the ldf file to modify its behavior at the loading time, but without a very precise semantics, so there is not a general way to know if they are supported.

I was considering the possibility to add a helper macro, but it should be more or less simple. For example:

  \ifx\BabelModifiers\relax\else
    \bbl@foreach\BabelModifiers{%
      \@expandtwoargs\in@{,#1,}{,no-LGR-fixes,polytonic,}% Add here further options
      \ifin@\else
        \bbl@error
          {Unknown modifier '#1' in '\CurrentOption'}%
          {See the language manual for valid keys}%
      \fi}%
  \fi

So, I think it’s best managed by the ldf file according to its needs.