4

Because of this question, I'm using the following code to typeset my XeLaTeX document. The problem is, there does not seem to be any support for Greek. The Greek text in the following comes out as question marks:

\documentclass{memoir}

\usepackage{fontspec}
\usepackage[T1]{fontenc}
\usepackage[oldstylenums]{kpfonts}

\usepackage{polyglossia}

\begin{document}

Some nice Greek text in the middle of an English document: μυϱίᾳ εἰμὶ διὰ τὴν τοῦ ϑεοῦ λατϱείαν.

\end{document}

I looked into this question, too, and hence tried to add the line

\newfontfamily\greekfont[Script=Greek]{Linux Libertine O}

to the preamble, but it changed nothing.

  • kpfonts have no support for Greek. – egreg Jul 17 '14 at 19:37
  • Can you give more information about your document? Is its main language Greek, or you have just small parts in Greek? – egreg Jul 17 '14 at 19:55
  • Only small parts are Greek, the main language is in fact Danish. – Gaussler Jul 17 '14 at 19:56
  • But I tried changing to Linux Libertine O completely, and it worked. Guess I'll manage with that. – Gaussler Jul 17 '14 at 20:06
  • Don't use T1 as text encoding with xelatex. – Ulrike Fischer Jul 17 '14 at 20:09
5

If you want to use the kpfonts for text, then XeLaTeX is out of the question: they don't have support for OpenType or TrueType and so they aren't suitable for usage with XeLaTeX (although some dirty tricks might work).

Here's a version for pdflatex with babel, where for Greek I use GFS Artemisia that's not so distant from the Kpfonts.

\documentclass[a4paper]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[greek,danish]{babel}

\usepackage{amsmath}
\usepackage{kpfonts} % for math
\usepackage{substitutefont}
\substitutefont{LGR}{\rmdefault}{artemisia}
\usepackage{siunitx}

\begin{document}

København er Danmarks hovedstad og er med \num{1246611} indbyggere (2014) 
landets største byområde omfattende 18 kommuner eller dele heraf. Centrum
for byområdet udgøres af Københavns Kommune, der inkl. enklaven
Frederiksberg Kommune tæller \num{661464} indbyggere (2013) og er Danmarks 
mest folkerige kommune. I hele byregionen, den \SI{2778}{km^2} store 
Hovedstadsregionen, bor \num{1950430} mennesker (2013), der også
sammenfalder med Københavns lokaltrafikområde. Den danske hovedstad er
desuden centrum for Øresundsregionen, som er Nordens største metropolregion. 
\[
\int_{-\infty}^\infty e^{-x^2}\,dx=\sqrt{\pi}
\]
\textgreek{μυρίᾳ εἰμὶ διὰ τὴν τοῦ θεοῦ λατρείαν}.

\end{document}

enter image description here

For XeLaTeX, probably the best match is Palatino or a clone thereof (TeX Gyre Pagella, here) again with GFS Artemisia for Greek.

\documentclass[a4paper]{memoir}

\usepackage{amsmath}
\usepackage{unicode-math}
\usepackage{polyglossia}
\usepackage{siunitx}

\setmainfont{TeX Gyre Pagella}
\setmathfont{TeX Gyre Pagella Math}
\setmainlanguage{danish}
\setotherlanguage{greek}
\newfontfamily{\greekfont}{GFS Artemisia}

\begin{document}

København er Danmarks hovedstad og er med \num{1246611} indbyggere (2014) 
landets største byområde omfattende 18 kommuner eller dele heraf. Centrum
for byområdet udgøres af Københavns Kommune, der inkl. enklaven
Frederiksberg Kommune tæller \num{661464} indbyggere (2013) og er Danmarks 
mest folkerige kommune. I hele byregionen, den \SI{2778}{km^2} store 
Hovedstadsregionen, bor \num{1950430} mennesker (2013), der også
sammenfalder med Københavns lokaltrafikområde. Den danske hovedstad er
desuden centrum for Øresundsregionen, som er Nordens største metropolregion. 
\[
\int_{-\infty}^\infty e^{-x^2}\,dx=\sqrt{\pi}
\]
\textgreek{μυρίᾳ εἰμὶ διὰ τὴν τοῦ θεοῦ λατρείαν}.

\end{document}

enter image description here

3

Here if you want to use greek from another font. Your selection Linux Libertine O has all glyphs mentioned.

\documentclass{memoir}
\usepackage{polyglossia}
\setmainlanguage[spelling=new]{german}
\setotherlanguage[variant=polytonic]{greek}
\setotherlanguage{english}
\usepackage{fontspec}
\usepackage[T1]{fontenc}
\usepackage[oldstylenums]{kpfonts}
\newfontfamily{\greekfont}[Ligatures=TeX]{Linux Libertine O}

\begin{document}

Some nice Greek text in the middle of an English document: \textgreek{μυϱίᾳ εἰμὶ διὰ   τὴν τοῦ ϑεοῦ λατϱείαν}. Yes in the middle.

\end{document}

Example using LinLibertineO greek

Note: If you don't want to always type \textgreek you could define every symbol like in the code below e.g.: \newunicodechar{α}{\textgreek{α}}

If you say: well I only use the standard greek symbols, no special, you can use the few shipped with kpfonts:

\documentclass{memoir}
\usepackage{fontspec}
\usepackage[T1]{fontenc}
\usepackage[oldstylenums]{kpfonts}
\usepackage{polyglossia}

\usepackage{newunicodechar}

\newunicodechar{α}{$\alphaup$}
\newunicodechar{β}{$\betaup$}
\newunicodechar{γ}{$\gammaup$}
\newunicodechar{δ}{$\deltaup$}
\newunicodechar{ε}{$\varepsilonup$} %\epsilonup your choice
\newunicodechar{ζ}{$\zetaup$}
\newunicodechar{η}{$\etaup$}
\newunicodechar{ϑ}{$\thetaup$}
\newunicodechar{ι}{$\iotaup$}
\newunicodechar{κ}{$\kappaup$}
\newunicodechar{λ}{$\lambdaup$}
\newunicodechar{μ}{$\muup$}
\newunicodechar{ν}{$\nuup$}
\newunicodechar{ξ}{$\xiup$}
\newunicodechar{ℴ}{o}
\newunicodechar{π}{$\piup$}
\newunicodechar{ν}{$\rhoup$}
\newunicodechar{σ}{$\sigmaup$}
\newunicodechar{τ}{$\tauup$}
\newunicodechar{φ}{$\varphiup$} %\phiup your choice
\newunicodechar{χ}{$\chiup$}
\newunicodechar{ψ}{$\psiup$}
\newunicodechar{ω}{$\omegaup$}
\newunicodechar{τ}{$\tauup$}

\begin{document}
Some nice reduced Greek text in the middle of an English document: αβγδεζη...
\end{document}

Example using kpfonts own upright greek

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.