# [XeTeX] aemph redefined: arabxetex and polyglossia

Zdenek Wagner zdenek.wagner at gmail.com
Wed Mar 28 12:59:34 CEST 2012

2012/3/28 Juan Acevedo <juan.acevedo at gmx.net>:
> Dear all,
>
> Presumably the countless replies to the post below mean that there is (a lot of sunny weather outside or) no solution at the moment other than creating a modified version of one of the sty files, with the "\aemph" command definition commented out. This is done and working.
>
> Thinking that polyglossia, being larger and more general, has here seniority over arabxetex, I modified the latter. Is this right thinking? Or should polyglossia be the one to modify here?
>
> Perhaps, Vafa, if possible, could we have something like a "no-aemph" package loading option to prevent this polyglossia clash in the future? Does this sound as the way to go? Forgive me if I'm being too simplistic here, and please enlighten me!
>
IMHO macros should be defined in a package where they logically
depend. If there is a good reason to have a macro defined if only one
of the packages is loaded, I would suggest to define them via
\ProvideCommand.

I encountered similar problem in Urdu a few month ago but since I do
not need Urdu every month and I occasionally typeset just a few words,
I did not diagnose the problem.

> Cheers,
> Juan
>> Message: 1
>> Date: Mon, 26 Mar 2012 13:14:33 +0100
>> From: Juan Acevedo <juan.acevedo.juan at gmail.com>
>> To: <xetex at tug.org>
>> Subject: [XeTeX] aemph redefined: arabxetex and polyglossia
>> Message-ID: <AA979EE5-F3E4-4C43-A525-892BA236B3FD at gmail.com>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> Hello everyone,
>>
>> When running the following minimal test file:
>> -------------------------------
>> %!TEX TS-program = xelatex
>> %!TEX encoding = UTF-8 Unicode
>> \documentclass{book}
>> \usepackage{xltxtra}
>>
>> \usepackage{polyglossia}
>> \usepackage{arabxetex}
>>
>> \begin{document}test run\end{document}
>> -------------------------------
>>
>> compiling stops with this message:
>> ! LaTeX Error: Command \aemph already defined.
>>               Or name \end... illegal, see p.192 of the manual.
>>
>> Now, back in 2010 this problem came up here, when Gareth Hughes offered the solution:
>>
>> "If you remove \setotherlanguage{arabic}, polyglossia won't define \aemph."
>>
>> but this does not seem to work.
>>
>> I am using MacTeX2011, everything up to date.
>>
>> I wonder, is there any solution around for this, other than fiddling with the package itself and saving a copy in my local texmf?
>>
>> Here is the command definition in polyglossia.sty:
>>
>> \AtEndPreamble{\@ifpackageloaded{bidi}{\newcommand*{\aemph}[1]{$\overline{\hboxR{#1}}$}}{}}
>>
>> And the arabxetex.sty version:
>>
>> \newcommand{\aemph}[1]{%
>>  \edef\@tempb{\expandafter\noexpand\csname text\ax at lang\endcsname}%
>>  $\overline{\text{\@tempb{#1}}}$}
>>
>> Maybe I can do a little trick in my preamble to prevent the "already defined" warning?
>>
>> Gracias mil,
>> Juan
>
>
>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex

--
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz