2

This solution for inserting lowercase greek directly in mathmode works just fine for me.

However I have not yet been able to use the same trick for uppercase letters.

What went wrong?

Here is a working example

\documentclass[a4paper]{article}
\usepackage{fontspec}

\mathcode`ω=\omega
\mathcode`Ω=\Omega

\begin{document}

$$\omega=ω$$ %Just fine!

$$\Omega=Ω$$ %Will not work!

\end{document}

1 Answers1

1

Do the assignments at begin document:

\documentclass[a4paper]{article}
\usepackage{fontspec}

\AtBeginDocument{%
  \mathcode`ω=\omega
  \mathcode`Ω=\Omega
}

\begin{document}

\[\omega=ω,\quad \Omega=Ω\]

\end{document}

enter image description here

By the way, with unicode-math you need no special setup.

\documentclass[a4paper]{article}
\usepackage{unicode-math}

\begin{document}

\[\omega=ω,\quad \Omega=Ω\]

\end{document}
egreg
  • 1,121,712