On 02/15/2015 09:52 PM, Guenter Milde wrote:
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
Hallo Günter,
thanks for all of your comments and additional input.

After going through lots of experimenting and teachings I can subscribe to all of your points but one: In Glosses the only way to get Greek parts is using the Transliteration Method. For all who are interested I recommend to read Chapter 7. "Using covington (glosses and examples) in a beamer presentation" of http://wiki.lyx.org/LyX/LinguistLyX It was edited and updated to the current version by Jürgen Spitzmüller as a respons to my so many nagging questions on the issue.

Jürgen emphasizes:
"So-called verbatim context (such as TeX mode, verbatim paragraphs, linguistic glosses or program listings) does not allow language changes and is currently hard-wired to latin1 encoding (the latter is a LyX limitation), so you cannot insert Greek (unicode) glyphs to verbatim context (if you do you get lots of LaTeX errors). *Therefore, you need to insert Greek to such context via Latin Transliteration.*"

Thanks to you and all who were interested and answered my questions. Only one is left unanswered:
How do I get a "roof" (triangle) in trees using the forest package?

Cheers, prost, heidewitzka! ;-)
Michael

Reply via email to