Number sets such as natural numbers () or complex numbers () are not provided by default by LaTeX. It doesn’t mean that LaTeX doesn’t know those sets, or more importantly their symbols…

There are two packages which provide the same set of symbols. You can choose to load either of them:

\usepackage{amsfonts} % or \usepackage{amssymb}

Now, you have access to the different set symbols through this command **in math mode**:

$\mathbb{set}$

Examples:

for prime numbers using `\mathbb{P}`

,

for whole numbers using `\mathbb{W}`

,

for natural numbers using `\mathbb{N}`

,

for integers using `\mathbb{Z}`

,

for irrational numbers using `\mathbb{I}`

,

for rational numbers using `\mathbb{Q}`

,

for real numbers using `\mathbb{R}`

and

for complex numbers using `\mathbb{C}`

.

Positive and non-negative real numbers, and , can now be typeset using:

$\mathbb{R}_{>0}$ $\mathbb{R}_{\leq 0}$

Lasaro

In the last line, where “\leq0” should be replaced by “\geq 0”

Cesar

Thanks guy! That’s really help

the mad hatter

Yep, this helped me ! Thanks!

mathguy

Shouldn’t the integers be Z not I?

tom

You were right, thanks for the comment. I changed it.

Cheers,

Tom

Sean

Wow, awesome! Exactly what I needed: thanks!

Mr. Pi

This will really be helpful in writing my algebra and geometry blog, thanks.

Regards,

Mr. Pi

Enrique Argones Rúa

Why don’t you choose the more traditional notation \mathds{R}, \mathds{N}, etc.?

For using this you would have to include the package dsfont.

Cheers,

Enrique

Joe

THANK YOU! I’ve been digging around for an hour now looking for that. I can be picky about my fonts.

Joe

..I should have been more specific: thanks Enrique! The mathbb font is pretty well known, but the font for the more traditional number systems is hard to find.

kichabhai

What about binary numbers?

tom

Hi,

Not sure if a number set symbol is commonly used for binary numbers. But try the following with any letter:

Best, Tom.

one

Nice, thank you 🙂

Chewett

Thanks, very useful 🙂

Senthil

Thanks. Really its help to me.

Heni

Hi,how R^n write in Latex? THANK YOU ^^

tom

Hey Heni,

Thanks for your question. Is this what you were looking for?

Joan

Though a minor difference, $\mathbb{R}^n$ produces a BOLD n as the dimension of R. Is there any way to make this n slimmer?

Thanks a lot.

tom

Hi Joan,

How you perceive it might depend on the font used. In Computer Modern, the

ndoesn’t look bold in my opinion. Here’s what a boldnwould look like, as compared to the normal font style in math mode:Maybe you want to change the font size to make the letter

nslimmer, and smaller obviously?Also, I’d be curious to learn what configuration you used that made the letter thicker than what you would expect.

Cheers, Tom

Courtney

Hi! In the last line, the set of positive reals should be strictly R_>0, not R_≥0, which represents the nonnegative reals. The difference is subtle, but important 🙂

tom

Fixed! Thanks very much Courtney! Best, Tom.

m

Thanks! I found this very useful

tom

Great, glad to hear.

I like 4285127

There also is W for whole, right?

(Btw, thx this helped a lot!)

tom

Right, thanks for mentioning it! Tom

Charlie

Thank you very much

mielniczuk

Years later, your details provided just the solution I was looking for. Thanks.

tom

Great to hear, thanks!

Petra

This isn’t working. Can you help me? It sais “\mathbb allowed only in math mode”

tom

Hi Petra,

Thanks for the minimal working example. The command only works in math mode. So this should do the trick:

It wasn’t clear from the post and I’m going to change that. Thanks for bringing this up.

Best, Tom

NPandiya Rajan

Dear Friend, What is the symbol for composite numbers?

Send it to my mail_id

tom

Hi there,

I’m not aware of a symbol for composite numbers.

Best, Tom

Thomas Pierre Nicolas Jean Brouard

hi it does not work for me for P. What can be wrong? I use the two packages

tom

Hi Thomas,

Consider the example below. If this doesn’t help solving you problem, please provide a minimal working example to illustrate the issue.

Best,

Tom

Andrew

How do I define my own sets so that they do not collide with the conventional ones? eg. P for a set of particles (not to mean a set of Primes) in Latex.

tom

Hi Andrew,

I’m not sure I understand the question. Would you like to generate the same symbol with a different command or a similar, but different symbol?

Lisel

Hey Tom, thanks for your great work. I have an additional issue to solve. How can I represent this problem in a better way:

as the output of the power term looks like: mxn when it would be great to have some space in between the symbols to show that its m x n and not a term mxn.

Thank you in advance.

tom

Hi Lisel,

Thanks for your question. I’d use the

`\times`

macro instead of “x”, as regular text gets printed in italics in math mode. The macro has some extra space left and right. If you need more, use can use the math spacing commands (`\,`

or`\:`

or`\;`

— in increasing order).HTH, Tom