Hi, Uwe!

All of the problems you're describing are because you haven't performed the one-time setup required for Arabtex, see http://permalink.gmane.org/gmane.editors.lyx.devel/88100 for details. Note that most or all of the things I'm saying that you should add to the preferences file could also be added from within the preferences in the GUI.

I'll elaborate below.

Uwe Stöhr wrote:
Dov Feldstern schrieb:

one-time setup for ArabTeX) were not taking effect. It looks like the language switch commands are currently used only if babel is activated.

I cannot reproduce this - works fine here or I do need a better recipe to reproduce.

Try the attached file.

First, I cannot process your file because the command \R is not known. It therefore only works when I add \usepackage{arabtex} to the preamble.

add the following line to your preferences file:
\language_package "\usepackage{arabtex,cp1256} \setcode{cp1256}"

This is bug 2928 that I originally tried to fix when I started the discussions about Arabic, see also my last request in the bug report to add this preamble command automatically. Attached is a patch that does this, OK?

The patch is not working for me. I think it's because the document language is not (and shouldn't be) arabtex --- it should be English, as in the example file I provided; in which case the patch won't kick in.

Secondly, I agree with JMarc about the hardcoding of language info --- I'm not sure that it really belongs in the source code. I don't think it's so terrible to require a little setup from the user, and if it is --- the installer could do this one-time setup.


 > With the current situation (latest svn) I get the
 > output in arabtex2-bad.dvi. Adding arabtex (or anything, it doesn't
 > matter what, it could say 'dummy') to lib/languages as in my patch fixes
 > it, and I get the output as portrayed in arabtex2-good.lyx.

Not for me: when I use e.g. the word "arabtex" as dummy language for babel I get LaTeX-errors, because then your file reads in LaTeX:

\selectlanguage{english}
\inputencoding{latin9}English and \inputencoding{cp1256}\R{عربي}

\selectlanguage{arabtex}
عربي وال-\inputencoding{latin9}\L{English}

\selectlanguage calls babel and therefore needs a valid language name. When you use "arabic" you always get arabi and not arabtex.


Right, that's why you need to add the following two lines to the preferences file, so that you *don't* use babel's \selectlanguage:

\language_command_begin "\begin{arabtext}"
\language_command_end "\end{arabtext}"

With current SVN where no babel ame is given, the file reads:

\selectlanguage{english}
\inputencoding{latin9}English and \inputencoding{cp1256}\R{عربي

 عربي وال-\inputencoding{latin9}\L{English}

Then you get LaTeX errors because the characters are unknown in the encoding. To fix this \inputencoding must be replace by \setcode as described in the arabtex manual or omitted. So this one compiles:

This is taken care of by the line added above (the language_package preference).


\selectlanguage{english}
\inputencoding{latin9}English and \setcode{cp1256}\R{عربي

 عربي وال-\inputencoding{latin9}\L{English}

But the output is as ugly as in your dvi-file. What was the LaTeX-code when you get the nice output?
I'm not able to get this at the moment.

I'm attaching the latex file as it should look, produced directly from LyX without any manual tweaking (except for the one-time setup that I did last week).

Uwe, before trying to patch the code, please try to perform the setup I described for ArabTeX --- use a separate user directory and start from scratch. I think you'll find that it solves all the problems you're having, and if not --- ask me, I'll try to help (and don't forget to add back arabtex or whatever into the lib/languages!). But you should be able to reach the stage where you are able to generate correct latex and dvi, without having to touch the latex file.

Once you're at that stage, then we can see about maybe solving the issue so that the user won't have to perform the manual setup. Although as I've already said, I'm not sure that hardcoding is the correct way to go about this.


regards Uwe


Good luck!
Dov

Attachment: arabtex2.tex
Description: TeX document

Reply via email to