TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I really like using UTF-8 greek letters in my latex code source and I use utf8x to convert them into \textalpha commands and then I define the \textalpha commands in a separate file where I write this, for each greek letter:


And can even afford the luxury to use \varepsilon and \varphi.

This is actually the least intrusive and the most compatible way I found of doing this. (Well actually a little sed-parser was a lot more versatile and efficient because I knew what was going on but that's a very intrusive method)

Sadly this ... does not work with beamer because it seems to already have defined \textbeta and \textmu. Yes, only them. I don't know why.

Here is how to reproduce this. (This compiles. If you uncomment anything it won't compile)

  % $β$
  % $μ$

Does somebody know why? And also, how to overcome this? If I use \renewcommand it works in beamer files but it won't work in non-beamer files. Maybe there is a \forcerenewcommand that I don't know about?

share|improve this question
maybe you want to use \providecommand which does nothing, if the command already exist and does a \newcommand otherwise. – Peter Breitfeld May 16 '12 at 13:30
@PeterBreitfeld thank you I will definitely use this as a workaround (with renewcommand). – jmad May 16 '12 at 13:58

I have no idea why beamer has a \textbeta. Maybe someone else can give that answer.

There of course are ways to overwrite an existing macro.

For example you can use \def to overwrite any existing macro definition. This lacks \newcommand's syntax, though. So you could instead define a new command that checks if the command already exists and depending on the ckeck either invokes \newcommand or \renewcommand.


% check if csname is defined
% define in any case
    \GenericWarning{}{Warning: redefining \string#1}{}%

% this works, of course:
% as will the new definition command:

% for demonstration purposes only:

share|improve this answer
Thank you. Is using \checkfor any better than doing \providecommand{\textbeta}{DEBUG-providecommand} \renewcommand{\textbeta}{\beta}? (Apart from the warning) – jmad May 22 '12 at 13:44
@jmad I woudn't think so. Except less typing for you maybe if you don't have to define each command twice... – clemens May 22 '12 at 14:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.