I am trying to reproduce part of the results from this question, but I get the following error ! LaTeX cmd Error: Command '\arabicfont' already defined!. I already downloaded the fonts and they are in my system.
\documentclass{article}
\usepackage[novoc]{arabluatex}
\linespread{1.25}
\newcommand{\sample}{\arb{الأفكار الخضراء عديمة اللون تنام بغضب}}% http://www.omniglot.com/language/phrases/colorlessgreenideas.htm
\begin{document}
Amiri: \sample% arabluatex defaults to Amiri
\newfontfamily\arabicfont[Script=Arabic]{Reem Kufi}
Reem Kufi: \sample% https://github.com/khaledhosny/reem-kufi
\end{document}
How can I fix it?
\arabicfontwith\renewfontfamily\arabicfont[Script=Arabic]{Reem Kufi}. Better still: "Font setup Any Arabic font can be defined to be used with arabluatex. For example, assuming that fontspec is loaded, this line may be inserted in the preamble, just above the line that loads arabluatex:\newfontfamily\arabicfont{<fontname>}[Script=Arabic]wheretexdoc arabluatex, s 2.1)arabluatexassumes only one font is being used (\arabicfont) and that it has been set by the user, otherwise it tries to load Amiri font; the package checks for this at the beginning of the document:\AtBeginDocument{\ifdefined\arabicfont\relax\else.... I see from the linked question that you have asked the package maintainer. – Cicada Oct 09 '21 at 14:41\renewfontfamilyinstead of\newfontfamily. You can do this as many times as you want. See here for more information on commands used to select fonts. Also, for utf Arabic, you should rather use\txarbinstead of\arb. – Robert Alessi Oct 10 '21 at 07:07