2

Is it possible to compile the following example using pdfLaTeX showing the correct font for greek text, and not the default CMR?

\documentclass[a4paper]{article}

\usepackage[english,greek]{babel}
\usepackage[iso-8859-7]{inputenc}
\usepackage{tgheros}
\usepackage[T1]{fontenc}

\begin{document}

\section{Εισαγωγή}

Αυτό είναι ελληνικό κείμενο.
\selectlanguage{english} this is latin text.
\selectlanguage{greek} και αυτό είναι ελληνικό κείμενο.

\[
a = b + \gamma
\]

\end{document}
15
  • Yes, but if the fonts haven't been setup up yet for pdflatex it would take some time and some skills. May 25, 2014 at 13:08
  • 1
    @Sverre: pdflatex can include otf and ttf-fonts (but not subset them). May 25, 2014 at 13:13
  • 1
    @cfr: Try it out: Add to a hello-world document which loads cmr10.pfb the line \pdfmapline{=cmr10 CMR10 <<lmroman10-regular.otf}. May 25, 2014 at 13:44
  • 1
    Uh, no? The kerkis package is not a Unicode font. Your question was how to use a Unicode font with pdflatex. If that in fact was not your question, you should have asked what you actually wanted to accomplish (which seems to be "how to write Greek with pdflatex"). So please ask what you actually want to accomplish, otherwise the question will be closed.
    – Sverre
    May 25, 2014 at 13:50
  • 1
    Both kerkis and tgheros are LaTeX fonts, not Unicode fonts. I don't understand what you're getting at now. Please edit your question and ask what you actually want to ask. Otherwise, as said, the question will be closed as it's not clear what you're asking.
    – Sverre
    May 25, 2014 at 14:06

3 Answers 3

3

TeX Gyre Heros does not support Greek. You can see this in the opentype version of the fonts:

otfinfo -s fonts/opentype/public/tex-gyre/texgyreheros-regular.otf 
DFLT            Default
cyrl            Cyrillic
latn            Latin
latn.AZE        Latin/Azeri
latn.CRT        Latin/Crimean Tatar
latn.MOL        Latin/Moldavian
latn.NLD        Latin/Dutch
latn.PLK        Latin/Polish
latn.ROM        Latin/Romanian
latn.TRK        Latin/Turkish

Similarly, the LaTeX fonts include support for no suitable encoding.

The fonts do include Greek characters which may be used in, for example, typesetting mathematics. But there is no support for typesetting Greek text.

1

First, there's no reason to use \usepackage[iso-8859-7]{inputenc}. Use \usepackage[utf8]{inputenc}. The font TeX-Gyre-Heros is a sans-serif font, so it'll be used only if the text is set to be sans-serif.

\documentclass{article}
\usepackage[english, greek]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\renewcommand*{\familydefault}{\sfdefault}
\usepackage{tgheros}
\begin{document}

\section{Εισαγωγή}

Αυτό είναι ελληνικό κείμενο.
\selectlanguage{english}this is latin text.
\selectlanguage{greek}και αυτό είναι ελληνικό κείμενο.

\[a = b + \gamma\]

\end{document}

enter image description here

7
  • "the correct font for greek text, and not the default CMR" means that the produced greek text is not in tgheros font! Can't you see it in your attached figure?
    – TeXFun
    May 25, 2014 at 14:47
  • @TeXFun - Maybe should reconsider carefully your preference for using pdflatex instead of either xelatex or lualatex.
    – Mico
    May 25, 2014 at 14:54
  • +1 for pointing out that the option iso-8859-7 would seem to be out of place.
    – Mico
    May 25, 2014 at 14:55
  • @Mico The focus of my question was on the font of greek text, and not how to use inputenc package.
    – TeXFun
    May 25, 2014 at 15:17
  • Right. I don't know how the Greek font face in Computer Modern looks. I'll update my answer.
    – Sverre
    May 25, 2014 at 15:20
1

tex-gyre-heros does not support Greek under pdfLaTeX. Under Xe/LuaTeX, only the base letters are present, accented letters and other symbols are missing.

The simplest solution would be to switch to a sans-serif font that supports the Greek "LGR" font encoding like https://www.ctan.org/pkg/gfsneohellenic or https://www.ctan.org/pkg/gofonts.

Another option is to set up a substitute just for Greek with the \DeclareFontfamilySubstitution command added to the LaTeX kernel in the 2020 release, see ltnews31.

The third option would be to use LuaTeX with a Helvetica variant that supports Greek or with language-specific fonts set up via Babel or Polyglossia.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .