# greek encodings under lyx

In my newly installed linux machine (Fedora 19), editing a formerly working document under lyx, I get:

Package fontenc Error: Encoding file 'lgrenc.def' not found


and in fact I see that the dir /usr/share/texlive/texmf-dist/tex/latex/greek-fontenc/ is empty

But installing it by yum install yum install texlive-greek-fontenc.noarch, (and calling texhash, and doing reconfigure&exit&restart in lyx), although I now have the lgrenc.def file, the error becomes:

        LaTeX error: this NFSS system isnt set up properly
\begin{document}
For encoding scheme LGR the defaults cmr/m/n do not form a valid font shape
The system maintainer forgot to specify a suitable substitution font shape usin
g the DeclareErrorFont command


followed by many

corrupted NFSS tables


any hint?

• I doubt you needed to run texhash. I'd expect yum install to set everything necessary up. Try reinstalling the package?
– cfr
Feb 3, 2014 at 23:10
• I just deleted&reinstalled all of texlive-* and lyx-* packages, and always the lgrenc.def error appears (in any article using greek letters, by the way) Feb 4, 2014 at 9:52
• Not sure but this could be a bug in Fedora's packaging.
– cfr
Feb 4, 2014 at 17:10
• I just discovered that the problem is very narrow, i.e. confined at the "insert symbol" level, that calls the command \textgreek{} : inserting a greek letter as $\mu$ doesnt give any problem Feb 5, 2014 at 13:37
• That's because $\mu$ doesn't use Greek text. It uses Greek symbols from the maths fonts. Great to typeset mathematics but not suitable for typesetting text.
– cfr
Feb 5, 2014 at 14:00

I had the same error in Ubuntu. A previously working document with greek letters gave the two errors below:

! Package fontenc Error: Encoding file lgrenc.def' not found
(fontenc) You might have misspelt the name of the encoding.

l.99 \ProcessOptions*
Necessary code for this encoding was not loaded.
Thus calling the encoding later on will produce further error messages.

! LaTeX Error: This NFSS system isn't set up properly.

l.261 \begin{document}
For encoding scheme LGR the defaults cmr/m/n do not form a valid font shape


The package greek-fontenc was missing. I installed the package "TexLive: Greek" from the Ubuntu repository and after that the document compiled properly.

"TexLive: Greek" is the debian package texlive-lang-greek. It contains greek-fontenc but also a bunch of other TeX packages. Perhaps you're missing one of them (e.g. cbfonts, "a complete set of Greek fonts"). See its debian page for the list of TeX packages included.

• The question was about LyX and greek encodings. Your answer does not mention LyX at all. Could you clearify whether you use Lyx. Nevertheless, the proposed solution could be helpful to the OP.
– user31729
Apr 17, 2014 at 14:47
• @ChristianHupfer For this specific case I don't think it matters. The error mentioned by the OP is not generated by LyX, but the underlying LaTeX system, and likely has the same cause. Apr 17, 2014 at 15:50
• I must say it did, indeed, matter! In particular, I did not have exactly the cbfonts package: installing it did the trick - good shot!!! Apr 18, 2014 at 13:14
• and for Mac OS X with MacPorts: port install texlive-lang-greek
– user75410
Apr 1, 2015 at 11:43

If anyone encounters this problem under Arch Linux, the equivalent package to install is texlive-langgreek.

For anybody who encounters this problem while using tlmgr instead of the distro package managers, you can solve this problem by installing the following packages:

• greek-fontenc
• babel-greek
• cbfonts
• thanks a lot !! Was missing cbfonts and only had NFSS corrupted error logs. Mar 26, 2018 at 11:40

In my case, it was caused by a Greek symbol pasted directly into body text instead of inside an inline equation.

My Lyx file was working fine until I did something and this error showed up, pointing at an equation that had been showing up just fine previously. I discovered that the problem was in fact that I had typed a Greek symbol in standard text (not inside an inline math environment), like so: π. While it showed up fine in Lyx, it apparently has trouble rendering as part of body text in the final document unless the correct Greek encoding is specified. I simply put my π inside an inline equation, and the error was removed.

Yes, I also was facing this problem on Ubuntu 14 and Mint 17.3. Running

sudo apt-get install texlive-lang-greek


solved the error

Package fontenc Error: Encoding file 'lgrenc.def' not found.


Now is LyX working fine. To install latest the latest versions of LyX and TeX Live on Linux Mint or Ubuntu do this:

Installing LyX 2.1.4 and TeX Live on Linux Mint 17.3 or Ubuntu 14 onwards:

sudo add-apt-repository ppa:lyx-devel/release
sudo apt-get update
sudo apt-get install lyx
sudo apt-get install texlive-latex-recommended
sudo apt-get install texlive-science
sudo apt-get install latex-xcolor
sudo apt-get install texlive-latex-extra
sudo apt-get install texlive-fonts-recommended
sudo apt-get install preview-latex-style dvipng imagemagick
sudo apt-get install psutils latex-xft-fonts gv
sudo apt-get install chktex dvipost texlive-latex-extra
sudo apt-get install texlive-lang-greek
texhash
`

Start LyX. Reconfigure. Restart.