On 11/22/2010 01:43 PM, Guenter Milde wrote:
On 2010-11-22, Nikos Chantziaras wrote:
(This is probably grave-digging :P)
I left LyX (and TeX) alone since that thread. Recently I was asked to
create a paper in LaTeX and therefore looked at the LyX site again. I
saw that LyX 2.0 beta supports "XeTeX", which presumably does exactly
what I described in this thread!
So after all, thanks LyX devs! I just tried it out and indeed it works
like a charm after enabling XeTeX in the Document Settings. I can write
Latin and Greek characters at the same time without being driven insane
by constantly selecting text and switching language. :-)
Good news.
Beware, however that you must not use the "Babel" package with XeTeX
for Greek documents, as this would select a "traditional LaTeX" font
with Greek characters at the place of Latin ones.
Currently, this can be solved by changing \usepackage{babel} with
\usepackage{polyglossia} in Tools>Preferences>Language.
You then need to set the document language in the LaTeX-preamble via e.g.
\setmainlanguage{greek}. (See the documentation polyglossia.pdf for
details.)
Thanks for the hints, but there's a problem. That way, the command:
\usepackage{polyglossia}
comes too late (after the user defined preamble commands) in the
generated .tex file resulting in \setmainlanguage not being defined yet.
One has to put the above line in the preamble, not in the LyX
settings. Also, this is needed to in the preamble:
\let\textgre...@undefined
otherwise xelatex can't process the file:
! LaTeX Error: Command \textgreek already defined.
(That one took me quite a bit of Googling to find out how to solve.)
Another thing that became apparent after reading the pdf was that in
"Language settings" it might be a good idea to change the default
"Command start" and "Command end" fields to:
\begin{$$lang}
\end{$$lang}
respectively. It would be nice if the config dialog would have a
checkbox or another form of selection where one could enable XeTeX
globally and LyX would reconfigure itself automatically for XeTeX use
(and also change the default document settings for new documents to use
XeTeX so that manually adding stuff to the preamble shouldn't be necessary.)
I must say that with XeTeX, LyX is very nice to work with! I hope XeTeX
support will become better in time, since to me it seems XeTeX is the
future of TeX in general, especially since it can use normal fonts (that
alone is a killer feature.)