I want to insert an in-line equation with the symbol of Real Number as the code below:

Let $X$ be a continuous random variable with CDF $F(x) = log_{c}(x)$
where $x \in [1,c]$ and $c \in \R_{++}$.

LaTex gives me this error "Undefined control sequence ..." when inserting \R.

Don't know why this happens. Maybe it's related to the amsmathpackage.

This my preamble:

\documentclass[12pt, a4wide]{article}







\skip\footins=4ex plus 1ex

\lhead{University Name}
\rhead{Course Name}
%\lfoot{Student Name}
%\rfoot{Student ID}

I know there are lots of packages. Maybe there some problems among them.

  • Did you mean \Re?
    – JPi
    Sep 3, 2016 at 21:18

1 Answer 1


\R is not a predefined command, you need to define it yourself if you want to use it as a shortcut.






Let $X$ be a continuous random variable with CDF $F(x) = \log_{c}(x)$
where $x \in [1,c]$ and $c \in \R_{++}$.


enter image description here

Note \log for log.

  • @FrancescoBianchi note that a lot of folks here would call such shortcuts silly. Best (IMO) to redefine an existing command like \Re. Sep 3, 2016 at 23:19
  • 4
    @SeanAllred I'm not a fan of one-letter shortcuts like this myself (even though the consensus I've seen is that the fact that they are one-letter is not the problem per se), but I think it'd be a shame to override \Re, which has a distinct and separate office (used for the real part of a complex number, rather than the set of real numbers). If I were selecting a name for a command, I'd probably use \reals (assuming it's undefined) but it becomes questionable whether that really saves you much time, especially if you're using an editor/IDE which can input the \mathbb{} part for you
    – Au101
    Sep 3, 2016 at 23:28
  • Still, the whole logical structure approach, defining commands for objects and structures does then come into play
    – Au101
    Sep 3, 2016 at 23:29
  • 3
    @Au101 well I guess that's what I get for not taking complex analysis ;) And honestly, \Reals would be better than \mathbb all over the place – at least the former has semantic meaning :) Sep 3, 2016 at 23:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .