Fuente árabe para documentclass {exam}
Mi código
\documentclass{exam}
\pagestyle{headandfoot}
\firstpageheader{\bfseries\large رياضيات\\مأمون }{\includegraphics{example-image}}{\bfseries\large الإمتحان الأول }
\begin{document}
مرحبا كيف حالكم, جزاكم الله كل خير
\begin{table}
\begin{tabular}{lllll}
الوحدة & فصول الوحدة & عدد الحصص & الفترة الزمنية & الوسائل المقترحة\\
\end{tabular}
\end{table}
\end{document}
Todos estos códigos no funcionaron.
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.1,AutoFakeSlant=-0.03]{Amiri}
\setsansfont[Script=Arabic,Scale=1.1]{Amiri}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{arabic}
\newfontfamily\arabicfont[Script = Arabic]{Simplified Arabic}
\usepackage{sexam} % wexam & sexam package
%\setdefaultlanguage[calendar=gregorian,,locale=algeria]{arabic} % on sexam.sty
%\newfontfamily\arabicfont[Script=Arabic,Scale=1.1]{Amiri}% on sexam.sty
%\newfontfamily\arabicfontsf[Script=Arabic,Scale=1.2]{Aljazeera}% on sexam.sty
%\newfontfamily\arabicfonttt[Script=Arabic,Scale=1.1]{Simplified Arabic} % on sexam.sty
Respuestas
LuaLaTeX requiere que el renderizador HarfBuzz muestre scripts complejos con combinación de caracteres, pero selecciona el renderizador antiguo por defecto. Esto pareció funcionar para mí (aunque no sé árabe y me disculpo si el texto es incorrecto)
\documentclass{exam}
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont{Amiri}[
Script=Arabic,
Scale=MatchLowercase,
AutoFakeSlant=-0.03, % Are you sure?
Renderer=HarfBuzz ]
\pagestyle{headandfoot}
\firstpageheader{\bfseries\large رياضيات\\مأمون }{}{\bfseries\large الإمتحان الأول }
\begin{document}
مرحبا كيف حالكم, جزاكم الله كل خير
\end{document}
También sería posible utilizar babel. Este MWE carga las fuentes Libertinus de Khaled Hosny, incluida Libertinus Math, como compañeras para su fuente Amiri.
\documentclass{exam}
\usepackage[bidi=basic,layout=sectioning.tabular,english]{babel}
\usepackage{unicode-math}
\babelprovide[import,main]{arabic} % You might select a variant here.
\defaultfontfeatures{ Scale=MatchLowercase, Ligatures=TeX, Renderer=Harfbuzz }
\babelfont{rm}
[Scale=1.0, Ligatures={Common,Discretionary}]{Libertinus Serif}
\babelfont[arabic]{rm}
{Amiri} % Might want to load a stylistic set or activate font features.
\babelfont{sf}
[Ligatures={Common,Discretionary}]{Libertinus Sans}
% Load a sans-serif Arabic font here if needed, for example Noto Sans Arabic.
\babelfont{tt}
{Libertinus Mono}
\babelfont[arabic]{tt}
{ALM Fixed}
\setmathfont{Libertinus Math}
\babeltags{Arabic=arabic} % Enable \Arabic, \textArabic, etc.
\babeltags{english=english}
\pagestyle{headandfoot}
\firstpageheader{\bfseries\large رياضيات\\مأمون }{}{\bfseries\large الإمتحان الأول }
\begin{document}
\begin{tabular}{lllll}
الوحدة & فصول الوحدة & عدد الحصص & الفترة الزمنية & الوسائل المقترحة
\end{tabular}
\end{document}
Si solo usa inglés para frases cortas dentro de un documento árabe, puede eliminar la englishopción de babely agregar \babelprovide[onchar=ids fonts]{english}para detectar automáticamente el idioma que se está usando y cambiar las fuentes automáticamente.
Una forma de hacerlo sería usar fontspec y polyglossia como lo hizo en algunos de sus fragmentos de código. (Como ya los probó, supongo que está creando el documento con LuaLaTeX, no con pdfLaTeX).
Si quieres saber en detalle cómo puedes usar la poliglosia para activar varios idiomas y cambiar entre ellos, te recomiendo que eches un vistazo al manual de poliglosia. Aquí hay un ejemplo (acabo de usar Amiri como fuente árabe porque ya la tenía instalada):
\documentclass{exam}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{arabic}
\newfontfamily\arabicfont{Amiri}
\usepackage{graphicx}
\pagestyle{headandfoot}
\firstpageheader{\bfseries\large \textarabic{رياضيات\\مأمون}}{\includegraphics{example-image}}{\bfseries\large \textarabic{الإمتحان الأول}}
\begin{document}
\textarabic{مرحبا كيف حالكم, جزاكم الله كل خير }
\end{document}
Lo que da esta salida:
Si desea utilizar principalmente árabe en su documento, probablemente debería utilizar \setdefaultlanguage{arabic}. Entonces no es necesario poner \textarabic{...}todos los textos en árabe.