Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
share|improve this question
    
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. –  Ayman Elmasry 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. –  Yiannis Lazarides 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. –  Ayman Elmasry Jan 28 '12 at 16:47
add comment

3 Answers

up vote 4 down vote accepted

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}
share|improve this answer
1  
The option oldfontcommands incorporates old font commands in the memoir class. –  Yiannis Lazarides Jan 28 '12 at 12:07
    
@YiannisLazarides Thanks! –  egreg Jan 28 '12 at 12:08
    
@YiannisLazarides Great, Worked like a charm. –  Ayman Elmasry Jan 28 '12 at 17:39
add comment

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 بسم الله الرحمن الرحيم}
share|improve this answer
add comment

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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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