Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
2  
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
1  
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

1 Answer 1

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

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

will allow

\R is a nice program
share|improve this answer

Your Answer

 
discard

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.