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 have a custom command defined as


The argument that I pass to the command can sometimes be normal text and thus is formatted using \texttt{text} and sometimes I want to pass a math symbol such as \tau or \alpha or a combination of these.

Is there a way how I can reason on the argument being passed, such as introduce an if then else depending on the type of the parameter?

share|improve this question
up vote 5 down vote accepted

Use \mathtt instead.


You can use \textstyle before #1 if you want lager text.

share|improve this answer
Maybe you should explain, that you've used \ensuremath instead of $$ to make \transition work not only in text but also inside of math. – Schweinebacke Dec 9 '11 at 8:41
works great! thanks – aseychell Dec 9 '11 at 9:54

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.