3

set_of_real_numbers

Does anyone know how to make a symbol of real numers like in the picture? I mean the same symbol.It's like R but empty inside.

kuba16
  • 31
  • Welcome to TeX.SE! It appears you're looking for either the Fraktur "R", traditionally used for real numbers, or for a blackboard bold "R". Consider looking through the Comprehensive LaTeX Symbol List before posting here, or even running it through Detexify. Ultimately, though, I think this is a duplicate or https://tex.stackexchange.com/questions/14/how-to-look-up-a-symbol-or-identify-a-math-symbol-or-character – dgoodmaniii Dec 10 '19 at 18:45
  • Came after this was closed, but it genuinely has an answer separate from the duplicate. With unicode-math, you can load the TrueType or OpenType font of your choice as \mathbb using \setmathfont[range=bb, Scale=MatchUppercase]{Some Font}. – Davislor Dec 11 '19 at 02:25

2 Answers2

6

Works only in pdflatex, because it uses pdf literals.

\documentclass{article}
\usepackage{xcolor}
\input pdf-trans
\newbox\qbox
\def\usecolor#1{\csname\string\color@#1\endcsname\space}
\newcommand\bordercolor[1]{\colsplit{1}{#1}}
\newcommand\fillcolor[1]{\colsplit{0}{#1}}
\newcommand\outline[1]{\leavevmode%
  \def\maltext{#1}%
  \setbox\qbox=\hbox{\maltext}%
  \boxgs{Q q 2 Tr \thickness\space w \fillcol\space \bordercol\space}{}%
  \copy\qbox%
}
\newcommand\colsplit[2]{\colorlet{tmpcolor}{#2}\edef\tmp{\usecolor{tmpcolor}}%
  \def\tmpB{}\expandafter\colsplithelp\tmp\relax%
  \ifnum0=#1\relax\edef\fillcol{\tmpB}\else\edef\bordercol{\tmpC}\fi}
\def\colsplithelp#1#2 #3\relax{%
  \edef\tmpB{\tmpB#1#2 }%
  \ifnum `#1>`9\relax\def\tmpC{#3}\else\colsplithelp#3\relax\fi
}
\newcommand\shadowfy[1]{\begingroup%
  \ooalign{\kern.2pt\raisebox{-.1pt}{\outline{$#1$}}\cr\outline{$#1$}}\endgroup}
\begin{document}
\bordercolor{black}
\fillcolor{white}
\def\thickness{.25}
$f\colon\shadowfy{\textsf{R}} \rightarrow 0; \shadowfy{\alpha\textsf{Z}}$ 
\end{document}

enter image description here

  • 1
    @Mico Oops. Thanks! Fixed. – Steven B. Segletes Dec 10 '19 at 21:04
  • 1
    For xelatex, the dvi driver it uses, xdvipdfmx, accepts a \special command, to pass pdf literals to the pdf step e.g.: \newcommand\doxdvi[1]{% \begingroup% \special{pdf:literal direct q 2 Tr \thickness\space w 1 1 1 rg 0 0 0 RG}% #1% \special{pdf:literal direct Q}% \endgroup}, where \thickness is .25 – Cicada Dec 11 '19 at 12:06
  • @Cicada Thank you for that useful comment! – Steven B. Segletes Dec 11 '19 at 12:19
4

Welcome! In case you do not find this symbol in some catalogue, you can always use contour and tikz to transform any character or text to this style. For your convenience I stored the parameters in keys.

\documentclass{article}
\usepackage{tikz}
\usepackage{contour}
\tikzset{outlined/.cd,contour length/.initial=0.1pt,
shadow xshift/.initial=0.16ex,
shadow yshift/.initial=-0.08ex,
shadow color/.initial=black,
contour color/.initial=black,
font/.initial=\sffamily}
\newcommand\OutlinedWithShadow[2][]{\tikz[baseline={(X.base)},outlined/.cd,#1]{%
\contourlength{\pgfkeysvalueof{/tikz/outlined/contour length}}%
\path (\pgfkeysvalueof{/tikz/outlined/shadow xshift},%
\pgfkeysvalueof{/tikz/outlined/shadow yshift}) 
node[text=\pgfkeysvalueof{/tikz/outlined/shadow color},font=\pgfkeysvalueof{/tikz/outlined/font}]{#2}
(0,0) node[font=\pgfkeysvalueof{/tikz/outlined/font}] (X) {\contour{\pgfkeysvalueof{/tikz/outlined/contour color}}{\textcolor{white}{#2}}};}}
\begin{document}
\OutlinedWithShadow{R}

\end{document}

enter image description here

Let me add that this works with arbitrary characters, and give you one example for how the keys work.

\documentclass{article}
\usepackage{amsmath}

\usepackage{tikz}
\usepackage{contour}
\tikzset{outlined/.cd,contour length/.initial=0.2pt,
shadow xshift/.initial=0.16ex,
shadow yshift/.initial=-0.08ex,
shadow color/.initial=black,
contour color/.initial=black,
font/.initial=\sffamily}
\newcommand\OutlinedWithShadow[2][]{\tikz[baseline={(X.base)},outlined/.cd,#1]{%
\contourlength{\pgfkeysvalueof{/tikz/outlined/contour length}}%
\path (\pgfkeysvalueof{/tikz/outlined/shadow xshift},%
\pgfkeysvalueof{/tikz/outlined/shadow yshift}) 
node[text=\pgfkeysvalueof{/tikz/outlined/shadow color},font=\pgfkeysvalueof{/tikz/outlined/font}]{#2}
(0,0) node[font=\pgfkeysvalueof{/tikz/outlined/font}] (X) {\contour{\pgfkeysvalueof{/tikz/outlined/contour color}}{\textcolor{white}{#2}}};}}
\begin{document}
$f:\OutlinedWithShadow{R}\ni x\mapsto \lfloor x\rfloor\in \OutlinedWithShadow{Z}$
or \OutlinedWithShadow{$\alpha\,\beta\,\gamma$}

\OutlinedWithShadow[shadow xshift=0.1ex,shadow yshift=0.08ex]{R}
\end{document}

enter image description here