1

Since two or three days I can't write Greek with LuaTeX using \textgreek and \begin{otherlanguage}{greek}. I have absolutely no idea why this is so -- it did work until now.

% -*- mode: latex; TeX-engine: luatex; coding: utf-8; -*-
\documentclass{scrartcl}
\PreventPackageFromLoading{fixltx2e}
\PassOptionsToPackage{no-math}{fontspec}
\PreventPackageFromLoading{MnSymbol}
\usepackage[main=ngerman,greek,english,french]{babel}
\languageattribute{greek}{ancient}
\usepackage{luatextra}
\defaultfontfeatures[\rmfamily,\sffamily]{Ligatures={TeX,Common}}
\setmainfont{TeX Gyre Pagella X}
\newfontfamily\greekfont{GFS Porson}[Ligatures=TeX,%
                                     ItalicFont = GFSPorson-Regular,%
                                     SmallCapsFont = GFSPorson-Regular]
\begin{document}
\emph{emphblabla}\textgreek{Ζεύς}{\greektext Ζεύς}\textit{textitbla}

{\itshape itshapebla Ζεύς}

\begin{otherlanguage}{greek}
  Ζεύς οτηερλανγυαγε
\end{otherlanguage}

{\selectlanguage{greek}\selectfont Ζεύς σελεψτλανγυαγε}
{\setmainfont{GFSPorson} Ζεύς} %only this works
\end{document}
  • As far as I can see, the problem is twofold: on the one hand babel-greek seems to have issues with LuaLaTeX, on the other hand TeX Gyre Pagella has limited support for Greek (no ύ, for instance). – egreg Nov 2 '17 at 21:31
  • On the second point: That's why I use -- or used until now -- GFS Porson. It lacks the digamma, which is not at issue here. – Alexander Wittmann Nov 2 '17 at 21:42
  • 1
    With polyglossia everything seems to be fine in XeLaTeX (except greektext)... with babel I have problem and I confirm that the problem is not just LuaLatex specific. (I tried with english and greek languages only and with TeX Gyre Pagella as main font)... It seems to be a babel problem. Also, may be related is that babel needs xltxtra to recognize \setmainfont command. I would suggest you to work with pollyglossia if it is available in LuaLatex and contains all your used languages. – koleygr Nov 2 '17 at 22:35
5

I won't claim that your code never worked. A number of things relevant changed in the format (the font encoding), babel and fontspec.

But in a current system it is not meant to work. \textgreek is according to the documentation only defined when pdflatex and LGR encoding is used. So if you want it, you will have to define it yourself, similar for \greektext.

Imho you don't really need luatextra nowadays (it is from 2010).

\documentclass{scrartcl}

\usepackage[no-math]{fontspec}

\usepackage[main=ngerman,greek,english,french]{babel}
\languageattribute{greek}{ancient}


\setmainfont{TeX Gyre Pagella X}

\newfontfamily\greekfont{GFS Porson}[Ligatures=TeX,%
                                     ItalicFont = GFSPorson-Regular,%
                                     SmallCapsFont = GFSPorson-Regular]

\addto\extrasgreek{\greekfont}

\newcommand\textgreek[1]{\foreignlanguage{greek}{#1}}


\begin{document}
blblb {\itshape itshapebla Ζεύς}

\textgreek{Ζεύς}{\greekfont Ζεύς}\textit{textitbla}


\begin{otherlanguage}{greek}
  Ζεύς οτηερλανγυαγε
\end{otherlanguage}

{\selectlanguage{greek}Ζεύς σελεψτλανγυαγε}   

blblbl blblb 


\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.