There is a problem when bidi & hyperref packages are used together and custom document style is used. For example:
\documentclass[unicode]{myreport}
\usepackage{xltxtra}
\author{Author}
\title{Title}
\usepackage[pagebackref=true, xetex, unicode]{hyperref}
\usepackage{bidi}
\begin{document}
\maketitle
Test
\end{document}
myreport
class is the exact copy of standard report
class (nothing is changed). Problem is in \maketitle
command. Result:
! TeX capacity exceeded, sorry [input stack size=5000].
\@ifnextchar #1#2#3->\let \reserved@d =#1
\def \reserved@a {#2}\def \reserved...
l.14
This error doesn't occur when:
hyperref
package isn't used, orstandard
report
class is uded, or\maketitle
command isn't used
I can't find any information about such behavior neither in bidi nor in hyperref documentation, nor in google.
I see that bidi
package uses command \@ifclassloaded
and plugs files like report-xetex-bidi.def
. Maybe such file should be created for custom docclass. But I saw this file and didn't find anything 'special' in it.
Bidi package is needed, since document will be multilingual with polyglossia and with some text in Arabic (and maybe other) language.
What can be done in this situation?
report-xetex-bidi.def
: some commands, in particular\maketitle
are redefined to cope with bidirectional input. A recommended practice is to\LoadClass{report}
and do the desired modifications after this, instead of writing a class from scratch.\maketitle
is redefined, but I don't see anything special in the redefined\maketitle
. I see, that, if I don't use RTL characters in title page, all should work without redefinition.\maketitle
which are important for allowing RTL in the title.