0

How to insert some arabic words in a beamer presentation using the babel package and xelatex? I have tried the following code but the arab words are not displayed!

\documentclass{beamer}
\usepackage{fontspec}
\usepackage[main=english]{babel}

\babelprovide[import]{arabic}
\babelfont[arabic]{rm}{Amiri}

\title{My Beamer Presentation with somme arabic words}

\begin{document}

\begin{frame}
  \titlepage
\end{frame}

\begin{frame}
  \frametitle{First Frame}
  Some arabic words:
  \foreignlanguage{arabic}{كلمات باللغة
  العربية
  } 
that  aren't displayed!
\end{frame}

\end{document}

1 Answer 1

2

The default family in beamer is sf, not rm. Here is the MWE with some additional changes (which apply to this MWE):

  • Don’t use main. Rely on the default behaviour: the last language in \usepackage is the main one.
  • No need to load fontspec explicitly.
  • Set the bidi mode. I’ve chosen bidi=default, which for a few words is usually better than bidi=bidi, which loads a huge machinery with a lot of unnecessary changes for simple cases like this.
  • Loading arabic with \selectlanguage for short texts isn’t necessary.
  • And, of course, define the sf font instead of rm.
\documentclass{beamer}

\usepackage[bidi=default, english]{babel}
\babelfont[arabic]{sf}{Amiri}

\title{My Beamer Presentation with somme arabic words}

\begin{document}

\begin{frame}
  \titlepage
\end{frame}

\begin{frame}
  \frametitle{First Frame}
  Some arabic words:
  \foreignlanguage{arabic}{كلمات باللغة العربية} 
  that are displayed!
\end{frame}

\end{document}

enter image description here

1

You must log in to answer this question.

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