TransWikia.com

Typesetting Greek letters in text mode: differences between alphabeta and textalpha

TeX - LaTeX Asked on July 20, 2021

This is a two-part question. First part is about the differences between alphabeta, and textalpha. Each package documentation says it typesets Greek letters in text mode.

So, are there any actual difference or pros/cons of using any one of them?


The second part is how to make the following MWE correctly produce all the commands set by both packages textalpha and alphabeta?

enter image description here

documentclass{article}
usepackage[no-math]{fontspec}
setmainfont[Ligatures={NoCommon, NoRare}]{Latin Modern Roman}
usepackage{mathtools}
usepackage[bold-style=TeX]{unicode-math}
setmathfont[math-style=ISO]{Latin Modern Math}
usepackage{alphabeta}
begin{document}
    section*{alphabeta} 
    subsection*{small}
    alpha  beta  gamma 
    subsection*{capital}
    Alpha Beta Gamma
    section*{textalpha} 
    subsection*{small}
    textalpha textbeta textgamma
    subsection*{capital}
    textAlpha textBeta textGamma
end{document}

One Answer

In order to work with XeLaTeX or LuaLaTeX, you need a main font with full coverage of Greek, which Latin Modern hasn't.

However, the package alphabeta has a few shortcomings. Here's a short excerpt:

AtBeginDocument{%
  letmathGammaGamma
  letmathDeltaDelta
  [...]
  providecommand*{Alpha}{textAlpha}
  providecommand*{Beta}{textBeta}
  [...]
}

What's the problem? The package does providecommand and since at the point the instruction is executed, Alpha has already been defined by unicode-math, so providecommand does nothing.

You should really use text<letter> or, of course, the actual letters.

My preference would go to textalpha, though.

documentclass{article}
usepackage[no-math]{fontspec}
usepackage{mathtools}
usepackage[bold-style=TeX]{unicode-math}
setmathfont[math-style=ISO]{Latin Modern Math}

usepackage{newcomputermodern} % this has Greek

usepackage{alphabeta}

begin{document}

αβγ

textalpha  textbeta  textgamma 

ΑΒΓ

textAlpha textBeta textGamma

end{document}

enter image description here

Correct answer by egreg on July 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP