2

I'm trying to set hebrew as a secondary language with polyglossia. I wish that the title, author and date would be in hebrew and the rest would be defaulted to english. This is how my document is set-up currently:

\documentclass[]{article}

\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{Arial}

\begin{hebrew}
\title{כותרת}
\author{מחבר}
\end{hebrew}

\begin{document}
\maketitle

\begin{abstract}

\end{abstract}

\section{test}

\end{document}

And this is what is showing up: enter image description here I've tried to look on how to begin writing in a secondary language using polyglossia and I've found someone using \begin{language} and \end{language} blocks so I've wrapped my title and author commands with it, but as you can see nothing is showing up.

Any ideas?
Thanks in advance.

2 Answers 2

2

Your code has two main problems:

  1. It does not use a Hebrew supporting script - you should change from Arial to David CLM
  2. The otherlanguage environment is used to typeset several paragraphs in Hebrew and is not intended to be used outside the body of the document. Meaning it should be used after \begin {document}

If you remove that environment and wrap the maketitle with it, then it works.

\documentclass[]{article}

\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{David CLMl}

\title{כותרת}
\author{מחבר}

\begin{document}

\begin{hebrew}
\maketitle
\end{hebrew}

\begin{abstract}

\end{abstract}

\section{test}

\end{document}

Remember to use XeLaTeX.

Notice that once \maketitle is in a Hebrew environment then all the title is in Hebrew including the date. If you wish ONLY the title and author to be in Hebrew you can use \texthebrew{} as @Davisior stated:

\documentclass[]{article}

\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{David CLMl}

\title{\texthebrew{כותרת}}
\author{\texthebrew{מחבר}}

\begin{document}

\maketitle

\begin{abstract}

\end{abstract}

\section{test}

\end{document}
2
  • \title{\texthebrew{כותרת}} should also work.
    – Davislor
    Commented Oct 25, 2020 at 3:10
  • Thanks, I've fixed the answer accordingly.
    – Elad Den
    Commented Oct 25, 2020 at 7:30
4

You can do this just fine in LuaLaTeX with babel (using version 7.00 of Arial, not the one from the ’90s available for Linux).

\documentclass{article}
\tracinglostchars=2
\usepackage[english,bidi=basic,layout=sectioning]{babel}
\babelprovide[import, onchar=ids fonts]{hebrew}

\babelfont{rm}
          [Ligatures={Common,Discretionary,TeX}]{Arial}

\title{כותרת}
\author{מחבר}

\begin{document}
\maketitle

\begin{abstract}

\end{abstract}

\section{test}

\end{document}

Arial sample

You could add \babelfont[hebrew]{rm}[Scale=MatchUppercase]{Mitiam CLM} or your font of choice, and babel will switch to it whenever you type in Hebrew. With this version, babel will switch to Script=Hebrew and Language=Hebrew whenever it sees Hebrew.

You can also add \babeltags{english=english} and \babeltags{hebrew=hebrew} to be able to overwrite the auto-detection and use \texthebrew or \begin{english}. This will not properly format full paragraphs in Hebrew as right-to-left unless you turn off auto-detection and use language tagging all the time, however.

7
  • Could you explain why I should use babel over polyglossia as I'm not sure I understand
    – Jorayen
    Commented Oct 26, 2020 at 22:02
  • @Jorayen It’s not so much that you should as that you can: someone else already posted a solution with polyglossia, so I followed up with the alternative approach.
    – Davislor
    Commented Oct 26, 2020 at 23:03
  • @Jorayen However, there are at least two things you can only do with babel: auto-detect the language you’re typing in, with no tagging in the source, and supporting PDFTeX.
    – Davislor
    Commented Oct 26, 2020 at 23:05
  • I see, well that sound convenience. But why did you said using version 7.00 of Arial, not the one from the ’90s available for Linux ?
    – Jorayen
    Commented Oct 27, 2020 at 21:00
  • @Jorayen I don't believe the older version of the font supports Hebrew.
    – Davislor
    Commented Oct 27, 2020 at 21:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .