Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm completely at a loss with how to get LuaLaTeX to output Greek text. I have tested the following MWE with PDFLaTeX and LuaLaTeX on both TeXlive 2009 (Linux) and TeXlive 2011 (Win32) and in both cases PDFLaTeX produces the expected output while LuaLaTeX seems to gobble up the Greek text and then do nothing with it.

\documentclass{minimal}
% Use LGRx if installed else LGR. 
% Forcing one or the other makes no difference either.
\IfFileExists{lgrxenc.def}{%
    \usepackage[LGRx,T1]{fontenc}}{%
    \usepackage[LGR,T1]{fontenc}}
%\fi
\usepackage{lmodern,trace,ifluatex}
\usepackage[greek,british]{babel}
\unless\ifluatex
  \usepackage[utf8]{inputenc}
\fi
\begin{document}
% pdflatex: OK. 
%lualatex:  "τρίγωνον" is missing from the output, 
%           and the sum total of output from \traceon is this: 
%             {into \tracingonline=1}
%             {the character τ}
%             {end-group character }}
Triangle: \textgreek{\traceon τρίγωνον}.
\end{document}
share|improve this question
add comment

3 Answers 3

up vote 5 down vote accepted

If you want to use the original CB fonts for Greek, there is a way out, but you need to have lgrenc.dfu, so I'll assume it's available along with its sibling lgrxenc.def:

\documentclass{minimal}
\usepackage[LGRx,T1]{fontenc}
\usepackage{lmodern,ifluatex}
\usepackage[greek,british]{babel}
\ifluatex
  \let\LtxDeclareUnicodeCharacter\DeclareUnicodeCharacter
  \def\DeclareUnicodeCharacter#1{%
    \catcode\string"#1=\active
    \begingroup
    \lccode`~=\string"#1\relax
    \lowercase{\endgroup
      \protected\def~}}
  \input{lgrenc.dfu}
  \let\DeclareUnicodeCharacter\LtxDeclareUnicodeCharacter
\else
  \usepackage[utf8]{inputenc}
\fi
\begin{document}
Triangle: \textgreek{τρίγωνον}.
\end{document}

With LuaLaTeX I use lgrenc.dfu for a different purpose, that is for activating the Greek characters and defining them to the required meaning.

However I don't see the advantages of using LuaLaTeX, in this case.

share|improve this answer
add comment

I am not 100% sure I understand all the packages you are loading, but I would think this is the LuaTeX way:

\documentclass{minimal}

\usepackage[greek,british]{babel}

\usepackage{fontspec}
\setmainfont{TeX Gyre Pagella}

\begin{document}

Triangle: τρίγωνον.

\end{document}

triangle output image

You need to use a compatible font, you can find TeX Gyre Pagella and other fonts at fontsquirrel, but it should come with your TeX.

share|improve this answer
    
That is what I would do if using fontspec was an option. But this has to work on TeXlive 2009 as shipped by Debian (and Debian-derived distributions), and before TeXlive 2010, it shipped with fontspec that started (after the usual boilerplate) with the lines \RequirePackage{ifxetex}\RequireXeTeX (it used a lot of XeTeX-specific features) –  kahen Nov 12 '11 at 8:25
    
@Andy: Obviously TeX Gyre Pagella is not compatible since it misses the “ί.” –  Philipp Nov 12 '11 at 14:54
    
@kahen: If you are stuck with using LuaTeX with TL2009 you have my sympathies; I strongly advise to upgrade your LuaTeX. –  Martin Schröder Nov 12 '11 at 16:02
    
@Philipp, I even had Greek in school and did not notice :( –  Andy Nov 12 '11 at 18:00
add comment

When you are using pdflatex and inputenc each greek input is a small command which is mapped by the definitions in lgrenc.dfu (or lgrxenc.dfu) to an internal command. Then this internal command is mapped by the definitions in lgrenc.def or lgrxenc.de to the correct position in the correct font.

With lualatex the greek chars are simply chars and they are mapped to the position in the font which match their unicode value (e.g. hex 03B1 for a small alpha) – and this position is empty in your font.

You can try \usepackage[utf8]{luainputenc} (I don't know if it exists in texlive 2009). This will convert the greek chars in commands like inputenc is doing it with pdflatex.

But imho it is not very sensible to make a document for lualatex for such old systems. If fontspec is not working the luatex itself will be old and buggy. Tell this users to compile only with pdflatex and use fontspec.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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