3

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
\newfontfamily\arabicfont[Script=Arabic, Scale=1.3]{Scheherazade}




\begin{document}

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

\end{document}
4

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}

enter image description here

  • I have to wait 4 minutes to accept your answer :D Thanks – Taha Magdy Jun 12 '18 at 22:43
  • @TahaMagdy You're welcome! – user36296 Jun 12 '18 at 22:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.