# Match text and math Greek fonts with XCharter in pdflatex

I'd like to use the XCharter font with pdflatex and get the Greek font in text to match the Greek font in math. I found this, but can't find the right font to use with it. Maybe there's another approach.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{XCharter}
\usepackage[charter,scaled=1.07]{newtxmath}
\usepackage[T1]{fontenc}
\usepackage[greek, english]{babel}

% From: https://tex.stackexchange.com/questions/106790/
\usepackage{xpatch}
\xpatchcmd{\greektext}
{\selectfont}
{\fontfamily{artemisia}\selectfont}% Maybe change this?
{}{}

\begin{document}
Make this \textit{\textgreek{αβγδ}} the same font
as this $\alpha\beta\gamma\delta$.
\end{document}


You can redefine the association of the Greek letters with fonts.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[greek, english]{babel}

% fix a bad bug in XCharter
\let\LGRtextnu\textnu
\usepackage{XCharter}
% fix a bad bug in XCharter
\let\textnu\LGRtextnu
\usepackage[charter,scaled=1.07]{newtxmath}
\usepackage{substitutefont}
\substitutefont{LGR}{\rmdefault}{artemisia}

\DeclareSymbolFont{greekletters}{LGR}{artemisia}{m}{it}
\SetSymbolFont{greekletters}{bold}{LGR}{artemisia}{b}{it}
\DeclareSymbolFont{ucgreekletters}{LGR}{artemisia}{m}{n}
\SetSymbolFont{ucgreekletters}{bold}{LGR}{artemisia}{b}{n}
\DeclareMathSymbol{\alpha}{\mathord}{greekletters}{a}
\DeclareMathSymbol{\beta}{\mathord}{greekletters}{b}
\DeclareMathSymbol{\gamma}{\mathord}{greekletters}{g}
\DeclareMathSymbol{\delta}{\mathord}{greekletters}{d}
\DeclareMathSymbol{\epsilon}{\mathord}{greekletters}{e}
\DeclareMathSymbol{\zeta}{\mathord}{greekletters}{z}
\DeclareMathSymbol{\eta}{\mathord}{greekletters}{h}
\DeclareMathSymbol{\theta}{\mathord}{greekletters}{j}
\DeclareMathSymbol{\iota}{\mathord}{greekletters}{i}
\DeclareMathSymbol{\kappa}{\mathord}{greekletters}{k}
\DeclareMathSymbol{\lambda}{\mathord}{greekletters}{l}
\DeclareMathSymbol{\mu}{\mathord}{greekletters}{m}
\DeclareMathSymbol{\nu}{\mathord}{greekletters}{n}
\DeclareMathSymbol{\omicron}{\mathord}{greekletters}{o}
\DeclareMathSymbol{\xi}{\mathord}{greekletters}{x}
\DeclareMathSymbol{\pi}{\mathord}{greekletters}{p}
\DeclareMathSymbol{\rho}{\mathord}{greekletters}{r}
\DeclareMathSymbol{\sigma}{\mathord}{greekletters}{s}
\DeclareMathSymbol{\tau}{\mathord}{greekletters}{t}
\DeclareMathSymbol{\upsilon}{\mathord}{greekletters}{u}
\DeclareMathSymbol{\phi}{\mathord}{greekletters}{f}
\DeclareMathSymbol{\chi}{\mathord}{greekletters}{q}
\DeclareMathSymbol{\psi}{\mathord}{greekletters}{y}
\DeclareMathSymbol{\omega}{\mathord}{greekletters}{w}
\DeclareMathSymbol{\varepsilon}{\mathord}{greekletters}{e}
\DeclareMathSymbol{\vartheta}{\mathord}{greekletters}{j}
\DeclareMathSymbol{\varpi}{\mathord}{greekletters}{p}
\DeclareMathSymbol{\varrho}{\mathord}{greekletters}{r}
\DeclareMathSymbol{\varsigma}{\mathord}{greekletters}{v}
\DeclareMathSymbol{\varphi}{\mathord}{greekletters}{f}
\DeclareMathSymbol{\Alpha}{\mathord}{ucgreekletters}{A}
\DeclareMathSymbol{\Beta}{\mathord}{ucgreekletters}{B}
\DeclareMathSymbol{\Gamma}{\mathord}{ucgreekletters}{G}
\DeclareMathSymbol{\Delta}{\mathord}{ucgreekletters}{D}
\DeclareMathSymbol{\Epsilon}{\mathord}{ucgreekletters}{E}
\DeclareMathSymbol{\Zeta}{\mathord}{ucgreekletters}{Z}
\DeclareMathSymbol{\Eta}{\mathord}{ucgreekletters}{H}
\DeclareMathSymbol{\Theta}{\mathord}{ucgreekletters}{J}
\DeclareMathSymbol{\Iota}{\mathord}{ucgreekletters}{I}
\DeclareMathSymbol{\Kappa}{\mathord}{ucgreekletters}{K}
\DeclareMathSymbol{\Lambda}{\mathord}{ucgreekletters}{L}
\DeclareMathSymbol{\Mu}{\mathord}{ucgreekletters}{M}
\DeclareMathSymbol{\Nu}{\mathord}{ucgreekletters}{N}
\DeclareMathSymbol{\Xi}{\mathord}{ucgreekletters}{X}
\DeclareMathSymbol{\Omicron}{\mathord}{ucgreekletters}{O}
\DeclareMathSymbol{\Pi}{\mathord}{ucgreekletters}{P}
\DeclareMathSymbol{\Rho}{\mathord}{ucgreekletters}{R}
\DeclareMathSymbol{\Sigma}{\mathord}{ucgreekletters}{S}
\DeclareMathSymbol{\Tau}{\mathord}{ucgreekletters}{T}
\DeclareMathSymbol{\Upsilon}{\mathord}{ucgreekletters}{U}
\DeclareMathSymbol{\Phi}{\mathord}{ucgreekletters}{F}
\DeclareMathSymbol{\Chi}{\mathord}{ucgreekletters}{Q}
\DeclareMathSymbol{\Psi}{\mathord}{ucgreekletters}{Y}
\DeclareMathSymbol{\Omega}{\mathord}{ucgreekletters}{W}

\begin{document}

Make this \textit{\textgreek{αβγδ}} the same font
as this $\alpha\beta\gamma\delta$.

\textit{\textgreek{αβγδεζηθικλμνξοπρστυφχψω}}

$\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda \mu\nu\xi\omicron\pi\rho\sigma\tau\upsilon\phi\chi\psi\omega$

\textgreek{ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ}

$\Alpha\Beta\Gamma\Delta\Epsilon\Zeta\Eta\Theta\Iota\Kappa\Lambda \Mu\Nu\Xi\Omicron\Pi\Rho\Sigma\Tau\Upsilon\Phi\Chi\Psi\Omega$

\end{document}


The “fix for the bad bug in XCharter” is necessary, because the package redefines \textnu, so breaking Greek support.

• This is great, and I feel like you worked too hard because I was unclear. But I was hoping to go the other direction, that is, use the newtxmath Greek font in text (not artemisia in math). I want to quote one Greek work in a document that's all English and math, and hoped for a consistent font. But I don't know what to substitute for "artemisia" in the patch command. – dedded Aug 8 '17 at 14:16
• @dedded There is no Greek font in newtxmath, only support for the math Greek symbols. – egreg Aug 8 '17 at 14:25
• I'm not sure what you mean. When I use $\alpha$ I get a Greek letter alpha. It must be in some font (and it doesn't appear to be cmr). (Perhaps I'm using the word "font" incorrectly. I'd like to put \textgreek{...} in text and get the same Greek glyphs that I get with newtxmath.) – dedded Aug 8 '17 at 14:40
• @dedded What I meant is that there is not a full fledged font: only italic lowercase, for example. – egreg Aug 8 '17 at 14:53
• Got it. So I'd have to substitute what's used in math mode. – dedded Aug 8 '17 at 15:02