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 am using the tufte-handout class in LaTeX and I want to refer to R using the "correct" sans-serif font. I am currently using

\newcommand{\R}{ {\bf \sffamily R } }

used as ...

... function in the \verb|spatstat| \R package ...

What LaTeX "command" / incantation would you use?

share|improve this question

migrated from stackoverflow.com Sep 28 '12 at 9:59

This question came from our site for professional and enthusiast programmers.

Rather than flagging to close just because it's easy to do, why not flag for moderator attention to migrate, even though it takes a little more effort?? – Brent.Longborough Sep 28 '12 at 9:32
This is surely a duplicate; anyway, the answer is \newcommand{\R}{\textbf{\textsf{R}}}. Never use the two letter commands \bf, \sf or \it, they are obsolete. – egreg Sep 28 '12 at 10:02
@egreg: I agree, I just thought the attitude of the folks @ SO a bit less than constructive – Brent.Longborough Sep 28 '12 at 11:31
Related (but here it appears that the "R" is not desired in sans serif font): tex.stackexchange.com/questions/73089/… Indeed in the R manual the "R" is just in the roman font (possibly bold in a bold context). So \newcommand{\R}{\textup{R}} might be better. – egreg Sep 28 '12 at 11:37
@egreg Thanks for the link. Opinion seems mixed, the Springer books (including MASS4) use sans. – Sean Sep 28 '12 at 11:47
up vote 3 down vote accepted

If you want to ensure a sans serif upright bold font, just define

\newcommand{\R}{\textnormal{\sffamily\bfseries R}}}

If you want to avoid typing \R{} is a nice program, then

\newcommand{\R}{\textnormal{\sffamily\bfseries R}}\xspace}

will allow

\R is a nice program
share|improve this answer

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.