Is there a package or simple method to generate Greek characters from their Roman counterparts?

Like, for instance:

\greek{a} would generate \alpha

\greek{b} would generate \beta

\greek{B} would generate \Beta,

And so on... I'm aware that such correspondence would not be a one-one map, but could be close enough.

My need for this is related to a set of commands that I have in my Ph.D. document to ensure a compatible (always equal) use of determined symbols in some categories. For instance, I have some commands such as:


Thus, if I ever need to define a set S, I can use \setname{S} and the set is ensured to be an uppercase letter with math formatting (italic like). If for some reason, later on, I need to change the formating of sets to use lowercase, I will just need to change the \setname command's definition.

Now I need a new command for a specific non-empty kind of set: an alphabet. I want to use uppercase greek characters to define the name of an alphabet. So I would like to create a command such as:


Then for defining a Σ alphabet I could write:

\alphabetname{s} and get Σ.

  • Is it for maths formulæ? – Bernard Aug 11 '19 at 20:41
  • Yes, it is. I will probably use within a command that will have a ensuremath, just to be safe. – Isma Aug 11 '19 at 20:44
  • 2
    I think it's more a problem of the editor. WinEdt has a package which allows for typing the letter α, say, from the letter a + a prefix, yet saves as \alpha. – Bernard Aug 11 '19 at 20:57
  • I'll try to improve the question to be more clear in my needs :) – Isma Aug 11 '19 at 21:20
  • 1
    You don't want to use \ensuremath throughout. Maybe using \setname{S} in text mode can be deemed easier, but it's wrong from a semantic point of view. You don't type something like the value of x is obtained… where x should be a math letter, do you? For the same reason, The set $\setname{S}$ is interesting should be the correct input. – egreg Aug 12 '19 at 9:35

Here's the encoding that's standard in LaTeX for inputting Greek with Latin characters.


  \str_case:nn { #1 }
  \str_case:nn { #1 }



The alphabet $\alphabetname{S}$ is important.


One way is just to choose the character you want based on the code of the corresponding Roman character like the following (the code is incomplete, only first four letters are implemented, also, you might want to use another correspondence, \gamma for g for example):


    \mathrm A\or \mathrm B\or\Gamma\or\Delta



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.