Dear Michael,

On 2015-01-22, Michael Berger wrote:

> For other folks facing similar problems I would like to inform the 
> settings needed in accordance with Jürgen's recommendations.

> A) Replacing single English character(s) by its analog Greek character

> Settings in Documents > Language:
> Language: English / Quote Style "text"

Fine.

> Encoding: changed from 'Language Default' to Other: 'Unicode (utf8)'

Very good. I don't understand why lyx still defaults to a mix of
incompatible 8-bit encodings for mixed language documents!!!!!

> Language package: 'Custom:' the input field left empty

> At the end of the Preamble I added:
> \usepackage[greek,english]{babel}
> make sure that the main Language english comes second after greek!

This is not required. Instead, I recommend to leave the language at its
default (babel with 8-bit TeX, polyglossia with Xe/LuaTeX).

You can always set the language of parts of the document via

  Edit>text-style>custom>language 

(or similar, my LyX speaks German). This will also add the second (third,
...) language to the document preamble.

> Usage example:
> to replace the English character 'a' type:  \textgreek{a}  in an ERT box.

I recommend to input Greek Unicode characters. The Latin transcription has
the disadvantage of not working in PDF bookmarks and side-bar toc.

If you don't want this, write just a (or "logos" or whatever), mark it, and
set it to "language Greek". 
With 8-bit TeX (pdflatex, o.ä.), this will convert the text into Greek
script using the Latin transcription provided by the LGR font encoding.
(Side-effekt: you cannot easily have Latin words/characters inside Greek
text with 8-bit TeX! Wrap it in \textlatin or set the language accordingly
to German, French, Swedisch or whatever it is.)

(Actually, \textgreek is just doing this as well, but setting the language
is more "LyXisch" than ERT and also fixes hyphenation, spell-checking etc.)

(Also, LyX will wrap Greek Unicode characters in \textgreek for the
font/script change if required.)

> This works equally well for words (I have not tried sentences yet).

This works for sentences too. See the documentation of the greek-fontenc and
babel-greek packages.

> The extra tidbit of this great transliteration is that the Greek 
> characters are printed upright! and NOT slanted!

This is not due to the transliteration, but to the fact that you use text
fonts not math fonts. It is the same effect with Latin letters in text mode
vs. a math box.

This works also with the Greek Unicode input (even if you set the "latex
encoding" from utf8 to ASCII).

If you have difficulties with Unicode input, there is also the "textalpha"
and "alphabeta" package (both are part of greek-fontenc). With 

  \usepackage{textalpha}
  
you can input Greek symbols "by name", e.g. as \texalpha ... \textOmega
(in LyX as ERT).

With 

  \usepackage{alphabeta}
  
you can drop the "text" prefix: input Greek symbols as
\alpha ... \Omega (in LyX as ERT) and, according to their position in text
or an equation, the mathematical or text fonts will be used.

> B) as A) but in glosses
> In place of  'a'  type  \textgreek{a}  again but this time just like 
> ordinary standard text, e. i. NOT inside an ERT box (in fact, one cannot 
> add ERT boxes in a gloss and I had an evil grin in my face when doing as 
> told by Jürgen.)

You may try with Unicode characters here, but I am not sure whether the
glossary package is 8-bit save. Otherwise, I would use
"\textalpha" over "\textgreek{a}"

Günter

Reply via email to