5

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.

aan
  • 2,663
  • 1
    (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. – barbara beeton 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 https://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
  • @Werner -- Actually, finding that this is blackboard bold/\mathbb isn't all that easy to find in that question. Detexify only offers dsfonts; the Comprehensive Symbols List shows only "ABC" from amsfonts. Those references are great for real symbols, but not for various alphabet styles. A better source is needed for math alphabets. (Although this is a duplicate, having been asked many times before, if one doesn't know that this is "blackboard bold", a good dup is hard to find. – barbara beeton May 27 '20 at 01:56
  • @barbarabeeton: I connected with Scott in August 2019 to add to his Comprehensive LaTeX Symbol List but could only provide a list of raw font tables. He's been busy, stating "I haven't had time recently to work on the Comprehensive LaTeX Symbol List, but I think a mapping from package name to font table, even if just for the math alphabets, could prove quite useful." Perhaps we can do that and post it in the duplicate link to benefit linkage to that FAQ. – Werner May 27 '20 at 16:14
  • @Werner -- Yes, Scott told me about the raw font tables, and that's a fantastic resource! For alphabets, it's most useful if one already knows what the different styles are, so the suggested mapping would indeed be helpful. Get in touch with me in email, please. I've got a few ideas. – barbara beeton May 27 '20 at 17:51

3 Answers3

6

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}
JeT
  • 3,020
4

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}
Sandy G
  • 42,558
  • 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
2

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.

Davislor
  • 44,045