2

How to write this maths symbol below:

enter image description here

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

8
  • (It's \mathbb{R} you're looking for, included in e.g. the package amssymb)
    – steve
    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
    – steve
    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
5

like this ?

enter image description here

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

\end{document}
3

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 :.

enter image description here

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

\begin{document}

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

\end{document}
2
  • 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
    – steve
    May 26 '20 at 21:04
  • 2
    @steve see here for example.
    – Sandy G
    May 26 '20 at 21:07
1

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.