4

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}
4

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{%
  \let\mathGamma\Gamma
  \let\mathDelta\Delta
  [...]
  \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

8
  • "However, the package defines \Alpha to be the same as \textAlpha" I am sorry but which package do you mean? – Diaa Dec 17 '20 at 18:34
  • Also, I am confused a bit, you used the command \textalpha which is a part of textalpha package (I think), however, you loaded alphabeta package instead. So, does alphabeta automatically load textalpha? Do you mean that alphabeta and texalpha are two faces of the same coin? I can't really distinguish between them. – Diaa Dec 17 '20 at 18:36
  • @Diaa No, \textalpha is not a property of the textalpha package. And alphabeta doesn't load the other package. They're two independent packages and I'd prefer textalpha. – egreg Dec 17 '20 at 18:45
  • My apologies, you said you prefer \text<letter> with textalpha package but I only see alphabeta loaded in your answer. (1) So, would you please show the approach you prefer with package textalpha? Also, (2) what package is the command \textAlpha in your answer part of? Thanks in advance! – Diaa Dec 17 '20 at 18:53
  • 1
    @Diaa Where did you get the idea that textcomp defines \textAlpha? It doesn't. – egreg Dec 17 '20 at 20:42

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.