5

I'd like to use utf8 and arabtex packages under the memoir documentclass, but it seems unlikely to happen (previous discussion). What would be a good alternative, no transliteration and something that works with T1 encoding?

\documentclass[a4paper,oneside,12pt]{memoir}
\usepackage[T1]{fontenc}
\usepackage{arabtex}
\usepackage{utf8}


\begin{document}

بسم الله الرحمن الرحيم

\end{document}

This will produce an error:

("C:\Program Files\MiKTeX\tex\latex\arabtex\arabtex.sty"
("C:\Program Files\MiKTeX\tex\latex\arabtex\aconfig.sty")
("C:\Program Files\MiKTeX\tex\latex\arabtex\arabaux.sty")

! Class memoir Error: Font command \it is not supported.

See the memoir class documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.551 \settransfont {\rm \it }
                              % standard font for transliteration
5
  • Would you please show a minimal example of a document using arabtex that cannot be converted to memoir?
    – egreg
    Jan 28 '12 at 10:52
  • @egreg MWE done. Jan 28 '12 at 11:18
  • This doesn't produce Arabic output.
    – egreg
    Jan 28 '12 at 11:34
  • @AymanElmasry Arabtex is meant to be transliterated. I you don't want transliteration maybe you better check out XeTeX or XeLaTeX. Jan 28 '12 at 12:21
  • @YiannisLazarides Yes, so it seems. I'm not sure about switching to XeLaTeX, I've been switching to a lot of things lately, I suppose I'll take a look. Jan 28 '12 at 16:47
4

You can get back the functionality of the "old" font commands by writing, after \documentclass[<options>]{memoir},

\makeatletter
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\makeatother

However, as remarked by Yiannis,

\documentclass[<options>,oldfontcommands]{memoir}

does this without extra code. Here <options> stands for all the other options you want to pass to memoir, in your case call it as

\documentclass[a4paper,oneside,12pt,oldfontcommands]{memoir}
2
  • 1
    The option oldfontcommands incorporates old font commands in the memoir class. Jan 28 '12 at 12:07
  • @YiannisLazarides Great, Worked like a charm. Jan 28 '12 at 17:39
8

If you don't mind switching to another engine, the following should work with XeTeX (xelatex) and you get access to any Arabic OpenType font:

\documentclass[a4paper,oneside,12pt]{memoir}

\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{arabic}

\newfontfamily\arabicfont[Script=Arabic]{Amiri} % or any other font


\begin{document}

\textarabic{بسم الله الرحمن الرحيم}

\begin{Arabic}
بسم الله الرحمن الرحيم
\end{Arabic}

\end{document}
1

Khaled’s answer works fine for many things, but for me there’s always a conflict with one or more packages when I write Arabic. The solution I found in one TexShop template, if I don’t want to type the whole text in Arabic, is:

\newfontfamily{\A}{Geeza Pro} %or any other font
{\A بسم الله الرحمن الرحيم}

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.