# How to write notation of "set of real numbers" in LaTex? [duplicate]

How to write this maths symbol below:

I search in enter link description here, but it said \R and $\R$ but is not working.

• (It's \mathbb{R} you're looking for, included in e.g. the package amssymb) May 26 '20 at 20:38
• @steve -- In this case, the suggestions in that question don't really lead one easily to the best answer. There may be a better one that deals particularly with alphabetic styles. I'll try to find one. May 26 '20 at 20:46
• @barbarabeeton Fair enough, I'll retract it. I'm sure this must've been asked before though May 26 '20 at 20:48
• It can be argued that \mathbb{R} is for handwritten maths (bb = blackboard bold) and that \mathbf{R} is for typeset maths. (Who argued that? Knuth? Halmos? I forgot.) See en.wikipedia.org/wiki/Blackboard_bold . Perhaps it was Serre.
– lhf
May 26 '20 at 21:28
• I remember that package; it's skmath. \documentclass[11pt]{article} \usepackage[commonsets]{skmath} \begin{document} $f: \R^{m+1}\rightarrow \R^{q}$ \end{document} will work.
– DJP
May 26 '20 at 21:42

like this ?

\documentclass[10pt]{standalone}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
$f:\mathbb{R}^{m+1}\rightarrow \mathbb{R}^{q}$

\end{document}


The standard way is to use the package amsfonts and then \mathbb{R} to produce the desired symbol. Many people who use the symbol frequently will make a macro, for example

\newcommand{\R}{\mathbb{R}}


Then the symbol can be produced in math mode using \R. Note also, the proper spacing for functions is achieved using \colon instead of :.

\documentclass{article}
\usepackage{amsfonts}
\newcommand{\R}{\mathbb{R}}

\begin{document}

$f\colon\R^{m+1}\to\R^q$

\end{document}

• Completely agree with defining your own macro; however, the spacing around \colon seems way to small to me. Now, I'm not sure if I've been conditioned by bad practice or what, but a quick explanation or further reading on why that's the correct spacing would be appreciated May 26 '20 at 21:04
• @steve see here for example. May 26 '20 at 21:07

Like the other answers say, \mathbb{R} is the code for this, and one of the many packages that define it is amssymb. However, that is not always the package you want.

In 2020, I would recommend that you use unicode-math, LuaLaTeX, and the modern toolchain when you can, and 8-bit legacy packages when you have to. It defines more symbols, with more consistency, than is even possible with any combination of legacy packages. Every OpenType math font contains its own version of \mathbb, or you can use any font you want. The list of symbols contains multiple font specimens.

If you do want to use PDFTeX and legacy packages, a good way to load math alphabets is the mathalpha package, which provides a consistent interface with scaling. The manual also has a comprehensive list of the available math typefaces. For other alphabets (such as sans-serif, Greek, bold italic and so on), isomath is an excellent way to load them.