# Conflict between multicol and arabtex

I need some arabic entries in a twocolumn index. The following document should work, I think:

\errorcontextlines999
\documentclass{book}

\usepackage{multicol}
\usepackage{arabtex}

\begin{document}

a

\begin{multicols}{2}
{\RL {al-khalIl}}
\end{multicols}

x

\end{document}


But it leads to the error:

! Package multicol Error: Document end inside multicols environment.

In my project it has only one visible consequence, namely the following \clearpage does not work any more. Instead of filling the page with blank space, LaTeX stretches the page to full height as with a \pagebreak[4].

I do not have the choice to use other packages since this is part of a large project. What I need is a fix... Any ideas?

(Previously, I used \twocolumn instead of \begin{multicols}{2}...\end{multicols}. This comes from the standard definition of theindex. But that does not balance the last columns.)

Edit (15:56): It seems that a patch for \a@Rinsert in apatch.sty is responsible for the problems. The original version in abidir.sty works fine for my purposes:

\def \a@Rinsert #1{% put a sequence of RL words into Ltext
\leavevmode % go to hmode if not there already
\ifinner \a@sequence {#1}% inside a \hbox: append
\else \a@Rsplit {#1}% splice into the current paragraph
\fi }


The only difference in apatch.sty is the use of \a@@Rsplit instead of \a@Rsplit. That replacement function \a@@Rsplit is much longer and seems to cover more stuff... I'll try to use the old stuff by

\let\a@@Rsplit\a@Rsplit


Maybe that helps even if I trade in some other bugs... Keep thumbs crossed that they do not affect me.

• When multicols throws the error \outputpenalty = -2^30. Just before the end{multicols} \outputpenalty = -10000. ??? – Michael Nüsken Jan 6 '15 at 13:11
• How did you solve your problem? – user146610 Oct 25 '17 at 21:01
• Sorry, but I do not remember details after more than two years. As far as I remember, the package creator provided an update that did most of the fix. – Michael Nüsken Oct 27 '17 at 7:42

It seem that your code work fine if we use arabtex environment for arabic paragraph . For small text (few arabic words) you can put them inside mbox like this:

\errorcontextlines999
\documentclass{book}

\usepackage{multicol}
\usepackage{arabtex}
\novocalize % no diacritics will be generated

\begin{document}
a
\begin{multicols}{2}
\mbox{\RL{al-xlyl}}
\end{multicols}
x
\end{document}


• Thanks for your answer. Unfortunately, my text is longer than a line. :( And it cannot be boxed, as there is other stuff on the first line. [I am using it with MikTeX, recently updated. And I definitely get the above error with the consequence that the a, the arabic and the x are as far away from each other as the page admits.] – Michael Nüsken Jan 11 '15 at 19:40