# Arabic words in a beamer document, polyglossia problem

I making a presentation which contains some Arabic words, I use polyglossia, but the following code gives me that error Package polyglossia Error: The current roman font does not contain the Arabic script!(polyglossia) define \arabicfont with \newfontfamily.

In my search I figured out that it is a bug in polyglossia. How to get around this?!

\documentclass[10pt]{beamer}

\usetheme[progressbar=frametitle]{metropolis}
\usepackage{appendixnumberbeamer}
\usepackage{booktabs}
\usepackage[scale=2]{ccicons}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}
\usepackage{xspace}
\newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}

% For Arabic
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{arabic}
% Defining the font family

\begin{document}

% First Slide :(
\begin{frame}[fragile]{A Section!}
Hello  \textarabic{مرحبا}
\end{frame}

\end{document}


I don't think this is a bug, beamer just uses sans serif fonts, so you have to define \arabicfontsf and not only \arabicfont.

I don't have your special font, so I replaced it in the following MWE. You'll have to check if your desired font also has a sans serif version.

% !TeX TS-program = xelatex

\documentclass[10pt]{beamer}

\usetheme[progressbar=frametitle]{metropolis}
\usepackage{appendixnumberbeamer}
\usepackage{booktabs}
\usepackage[scale=2]{ccicons}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}
\usepackage{xspace}
\newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}

% For Arabic
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{arabic}
% Defining the font family
\newfontfamily\arabicfont[Script=Arabic,Scale=1]{Times New Roman}%
\newfontfamily\arabicfontsf[Script=Arabic,Scale=1]{Times New Roman}%

\begin{document}

% First Slide :(
\begin{frame}[fragile]{A Section!}
Hello  \textarabic{مرحبا}
\end{frame}

\end{document}


• I have to wait 4 minutes to accept your answer :D Thanks Jun 12, 2018 at 22:43
• @TahaMagdy You're welcome! Jun 12, 2018 at 22:46