1

The following LaTeX code was saved in ~/Test.tex.

\documentclass{beamer-rl} \usepackage[bidi=basic]{babel} \babelprovide[main, import]{hebrew} \babelfont{rm}{FreeSerif} \babelfont{sf}{FreeSans} \babelfont{tt}{FreeMono} \begin{document} \begin{frame} \begin{definition} D \end{definition} \begin{theorem} T \end{theorem} \begin{corollary} C \end{corollary} \begin{proof} P \end{proof} \end{frame} \end{document} 

The code creates a Hebrew presentation with a single slide containing four mathematical blocks.

Then the following commands were executed in the Terminal.

> cd ~ > lualatex Test 

Consequently, the file ~/Test.pdf was generated. When opened in a PDF viewer, the file displayed as follows.

A Hebrew presentation with math blocks

Bear in mind that Hebrew is a right-to-left language, and so the text's right-justification is expected and correct, and does not constitute a problem.

Note that in three of the mathematical blocks: definition, theorem, and corollary, the block's title is written in English, whereas in the fourth block, proof, the title was automatically generated in Hebrew.

I'd like all the mathematical blocks to behave like the proof block in having automatically generated Hebrew titles. How can these environments be localized to Hebrew, when the presentation's language is Hebrew? Where do these environments get their titles from?

6
  • Please include the translations for definition, theorem and corollary in your question Commented Dec 7, 2022 at 9:10
  • @samcarter_is_at_topanswers.xyz What does it matter? You can use DEFINITION, THEOREM, COROLLARY, in capital English letters. Commented Dec 7, 2022 at 9:12
  • 1
    beamer uses in most places (proof is an exception of the rule) the translator package to translate strings. You can add a translation eg. with \deftranslation[to=hebrew]{Theorem}{xxxxx}. Commented Dec 7, 2022 at 9:23
  • @UlrikeFischer Thanks. Where can I see an example of a complete localization for beamer? Are there files, similar to .lbx for biblatex, where all the localization strings for a given language are concentrated? Commented Dec 7, 2022 at 9:28
  • 1
    Well if you do what @samcarter_is_at_topanswers.xyz asked you she can probably provide something. She maintains beamer. Commented Dec 7, 2022 at 10:00

1 Answer 1

3

Beamer uses the translator package to get translation for these strings. For most commonly used languages it comes with .dict files which already have all the translations, but for hebrew they don't yet exist.

You can create a new .dict file for hebrew like this:

% !TeX TS-program = lualatex \PassOptionsToPackage{bidi=basic,main=hebrew}{babel} \documentclass{beamer-rl} \babelfont{rm}{FreeSerif} \babelfont{sf}{FreeSans} \babelfont{tt}{FreeMono} \begin{filecontents*}[overwrite]{translator-theorem-dictionary-Hebrew.dict} \providetranslation{Definition}{הגדרה} \providetranslation{Theorem}{משפט} \providetranslation{Corollary}{מסקנה} \end{filecontents*} \uselanguage{hebrew} \begin{document} \begin{frame} \begin{definition} D \end{definition} \begin{theorem} T \end{theorem} \begin{corollary} C \end{corollary} \begin{proof} P \end{proof} \end{frame} \end{document} 

enter image description here

(please consider opening a PR at https://github.com/josephwright/translator/ to add hebrew dict files so other users can use them, too!)

15
  • Why is the command \uselanguage{hebrew} required? Shouldn't the Hebrew strings be retrieved automatically from the dictionary file when the document's main language is Hebrew, as set by babel? Commented Dec 8, 2022 at 15:45
  • Also: why is it \uselanguage{hebrew} with a lowercase h rather than Hebrew with a capital H? According to the translator manual "The names used by the translator package are the English names commonly used for these languages. Thus, the name for the English language is English, the name for German is German." (Section 1.2.2 Language Names, on p. 3 of the current version, 2021-05-31) Commented Dec 8, 2022 at 15:53
  • @EvanAad If the language is set on the document level and not only for the babel package, you don't need to manually set \uselanguage, see e.g. pastebin.com/u8Qw2jEe (no idea how one would do this with hebrew, bidi freaks out when I tried this...) Commented Dec 8, 2022 at 16:03
  • 1
    @EvanAad Hebrew can be passed as a class option, just not with babel. I was chatting with a hebrew polyglossia user last night and the class option worked just fine. Commented Dec 10, 2022 at 11:28
  • 1
    @EvanAad Update: As of texlive 2025, \documentclass[hebrew] works for me, in LuaLaTeX, with or without a provide=* package option to Babel (which the manual says should no longer be used). This no longer attempts to load an obsolete 8-bit font. Commented Oct 29 at 19:12

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.