[Tex/LaTex] Why can’t the build produce certain Greek symbols

greekunicodexetex

I'm trying to use the β character in a LaTeX document, but the output PDF never shows it. I am building with xelatex. From the following code:

\documentclass{article}
\usepackage{fontspec,xltxtra,xunicode}
\usepackage{textgreek}

\title{Beta Test}
\begin{document}
\maketitle

% UTF-8 beta and \textbeta don't show in the output.
β    
\textbeta

% However, UTF-8 delta and \textDelta work fine.
Δ
\textDelta

\end{document}

My output will only show the two Δ characters. So UTF-8 and textgreek seem to be fine, except for beta?

Best Answer

The best solution is using a font that supports Greek. However, something can be done also in the case you don't have this support.

If the parts in Greek are very small and questions about hyphenation don't bother you, then no markup is necessary, which would be if longer parts are necessary; in this case using the features provided by polyglossia and defining \greekfont is sufficient, together with defining a font for Greek.

\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{greek}

\newfontfamily\greekfont{GFS Artemisia}[
  Scale=MatchUppercase
]

\title{Beta Test}
\begin{document}
\maketitle

Here is a \textgreek{β} beta.

\end{document}

If you just occasionally use Greek letters, a solution with ucharclasses is simpler:

\documentclass{article}
\usepackage{fontspec}
\usepackage[Latin,Greek]{ucharclasses}

\newfontfamily\greekfont{GFS Artemisia}[
  Scale=MatchUppercase
]
\setTransitionsForGreek{\begingroup\greekfont}{\endgroup}

\title{Beta Test}
\begin{document}
\maketitle

Here is a β beta.

\end{document}

enter image description here