2

My goal is to use Unicode to type Greek letters in LaTeX. Some letters (i.e. α) work fine, but others (i.e. o) give the error LaTeX Error: Command \textomicron unavailable in encoding OT1.

What is so special about omicron?

An example that compiles fine:

% !TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[greek,english]{babel}
\usepackage{lgreek}
\usepackage{textgreek}

\begin{document}

Certain letters work, i.e. alpha: α

\end{document}

and one that gives the error:

% !TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[greek,english]{babel}
\usepackage{lgreek}
\usepackage{textgreek}

\begin{document}

Certain letters work, i.e. alpha: α
\\
But, with other letters, I get an error, i.e, omicron ο

\end{document}

P.S. If you want to know why I have the line % !TEX encoding=UTF-8 Unicode at the very beginning, see the answer given by @egreg.

My log:

enter image description here

3

A name conflict: textgreek defines \textomikron, but the LGR encoding has omicron.

You can define aliases.

% !TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[greek,english]{babel}
\usepackage{textgreek}

\let\textOmicron\textOmikron
\let\textomicron\textomikron

\begin{document}

Certain letters work, i.e. alpha: α

Also omicron ο works

\end{document}

enter image description here

Notes.

  1. lgreek is not needed and I'd say it's obsolete.
  2. The magic line at the beginning is to ensure TeXShop will pick up the right encoding for the file, independently on the set preference.
3
  • I am amazed that you know this! Wow. Excellent answer, it fixed things immediately.
    – Sam Y.
    Dec 8 '21 at 0:07
  • @SamY. I learned it a few minutes ago: looking for \textomicron in textgreek.sty I just found \textomikron.
    – egreg
    Dec 8 '21 at 0:12
  • Omicron? I Remember something 😃😃😃😃😃
    – Sebastiano
    Dec 8 '21 at 7:06

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.