Which package has a similar looking fancy R or does anyone know how to make one? (Note: the line underneath the R is just the notebook paper... this is from a scanned set of notes).
My answer is by using tikz (but with simple lines and not fill
to add effect of width):
\documentclass{article}
\usepackage{amsmath,amsfonts}
\usepackage{tikz}
\usetikzlibrary{}
\newcommand{\fancyR}{\sbox1{\vbox{R}}\sbox2{\hbox{R}}\tikz[inner sep=0pt,outer sep=0pt]{\coordinate (A);\draw[-,black,line width=0.55pt,scale=0.75]([shift={({\the\wd2/2},0)}]A) to[out=180,in=0] ++(-{\the\wd2/2},{3*(\the\ht1+\the\dp1)/5)}) to[in=90,out=180]++({-\the\wd2/5},{-(\the\ht1+\the\dp1)/8})
to[in=270,out=270]++({\the\wd2/2},{7*(\the\ht1+\the\dp1)/12})
to[in=0,out=90]++(-{7*\the\wd2/20},{3*(\the\ht1+\the\dp1)/12})
to[in=90,out=180]++(-{13*\the\wd2/24},-{11*(\the\ht1+\the\dp1)/12})
to[in=180,out=270]++({3*\the\wd2/12},{-4*(\the\ht1+\the\dp1)/10})
to[in=270,out=0]++({11*\the\wd2/48},{(\the\ht1+\the\dp1)/3})
to[in=300,out=90]++(-{3*\the\wd2/13},{11*(\the\ht1+\the\dp1)/12})
to[in=40,out=120]++(-{6*\the\wd2/10},-{1*(\the\ht1+\the\dp1)/6});
}}
\begin{document}
$\mathbb{R}$R\fancyR{}$R$
\end{document}
Output:
-
1See what happens when you do
{\Huge $\mathbb{R}$R\fancyR{}$R$}
and then consider usingline width=0.06em
instead. BTW, you could drop all of the\sbox
,\wd
and\dp
stuff in favor of relative units, see tex.stackexchange.com/a/480818/121799. (And what is\usetikzlibrary{}
good for?) – user121799 Mar 25 at 23:08 -
Thanks @marmot... I have already read that post. My idea was the relative height and width too, but didn't thought to use
em
orex
because I tried to use the actual R's lengths (I know this is not exactly working!). The answer was posted somehow faster than should and I forgot to use line width too in relation with my measured sizes. Of course I could have save the lengths too instead of retyping. I will edit soon. Thanks. (\tikzlibrary{} just left there and loads features aboutnothing
:P ) – koleygr Mar 25 at 23:29
In the modern toolchain with unicode-math
, you can set any TrueType or OpenType font as your script alphabet (or calligraphic, or a new alphabet). For this example, I downloaded the OTF version of Odelette by Adi Marwah into a subdirectory of my project folder named fonts
.
\documentclass[varwidth]{standalone}
\usepackage{unicode-math}
\defaultfontfeatures{Scale = MatchUppercase}
\setmathfont{Latin Modern Math}
\setmathfont[Path = ./fonts/, range = scr]{Odelette.otf}
\begin{document}
\[ \mathscr{R} \subset \mathscr{T} \]
\end{document}
-
1Upvoted you. :-). In fact to have the similar R we must go out the "classic" font LaTeX using font .ttf or otf. – Sebastiano Mar 25 at 15:49
-
1@Sebastiano Thanks! The R from Stardust Adventure looks even more like the handwriting, but in my opinion Odelette looks pretty reasonable as a math alphabet. It comes down to personal taste. – Davislor Mar 25 at 21:09
-
I always vote positively efforts, what I'm trying to make understand to users of Physics.SE. If you are registered you will find a -5 :-) on my question. Rigid thinking makes me sad. – Sebastiano Mar 25 at 21:17
-
@Sebastiano I don’t believe I’m registered there, but I’ve been on SX communities where, if I tried to actually help a new user, I got flamed for making it harder to efficiently delete and remove “bad questions.” TeX.SX is much friendlier! – Davislor Mar 25 at 21:21
-
Here are two fancy R options:
You can consult Table 307: Math Alphabets on page 119 of the comprehensive list for other options.
-
1
-
@user2154420: I posted my answer before koleygr's comment. Your question did not indicate any knowledge of standard sources such as the comprehensive list. If you don't find this answer helpful, fine. But please refrain from insulting me (or other users on this site). We are only trying to be helpful. – Sandy G Mar 25 at 2:35
-
Your message came to me :-( Then I knew just afterwards. But then I read the previous comments that didn't refer to me. I'm not the type to insult or offend. My upvoted. – Sebastiano Mar 25 at 13:00
-
2In fact, none of the alphabets in table 307 of the comprehensive lists contains an "R" with this shape. The
mathpro2
curly font (as identified by @Sebastiano) is the closest that I know, but this font is commercial and must be paid for. (And that is the reason it's not in the comprehensive list.) The letter may also be in other commercial fonts that I'm not familiar with. The graphicdesign.stackexchange site might be helpful in this respect. – barbara beeton Mar 25 at 13:40 -
1
If you could obtain a higher-res image of it, or better still an image in vector format, then this approach would work for most situations. However, it is impervious to things like \textit
, \textcolor
, etc.
\documentclass{article}
\usepackage{scalerel}
\newcommand\fancyR{\scalerel*{\includegraphics{fancyR}}{R}}
\begin{document}
$ab\fancyR c \scriptscriptstyle ab\fancyR c$
$ y = x^{\fancyR}$
$ab\fancyR c \quad\scriptscriptstyle ab\fancyR c$
$x_{\fancyR} = 0$
\end{document}
-
-
@Sebastiano It is ugly because the original provided by the OP was low resolution. When provided in high resolution, or as a vector image, a much better result ensues: tex.stackexchange.com/questions/224357/… – Steven B. Segletes Mar 25 at 15:53
-
Yeah, I know. You don't have to justify yourself. I was just smiling as each of us tries to do everything possible to get the best for the user. I'm sorry he offended Sandy, however. – Sebastiano Mar 25 at 16:01
-
@Sebastiano No offense was taken. I thought I detected your tongue in your cheek, but wasn't 100% sure. You are right...as it stands, it is very ugly! – Steven B. Segletes Mar 25 at 16:20
-
1@Sebastiano Correct. I am not talking about vectorinzing a rastor image, but rather creating a vector master image, created with lines and arcs, rather than pixels. That or a hi-def rastor image to start with. – Steven B. Segletes Mar 25 at 16:39
I prefer this from (mt2pro
) (the image is taken from this link https://www.pctex.com/mtpro2.html):
\documentclass[12pt]{book}
\usepackage[mtpccal]{mtpro2}
\begin{document}
\[
\mathcal{R}
\]
\end{document}
If you prefer there is also this font TeX Gyre Pagella Math for the character bit curly R.
\documentclass{article}
\usepackage{unicode-math}
\newcommand{\nR}{\mathversion{Pagella} $\mathscr{R}$}
\setmathfont[version=Pagella]{TeX Gyre Pagella Math}
\begin{document}
\nR
\end{document}
-
Is there a way to define the first R locally? I like it, but I also use the usual mathcal{R} in this document. – user2154420 Mar 28 at 14:46
-
@user2154420 Unfortunately, the first R is a paid character, as the very good barbarian beeton has already written to you. There would be a chance and it works great but it's off-topic here. – Sebastiano Mar 28 at 16:08
Apart from the traditional \mathcal{R}
and \mathsrc{R}
mentioned in other answers (with appropriate packages, of course), consider using xelatex
with the font GL-Suetterlin:
Lauren Script
font, but requires usingfontspec
. – Bernard Mar 24 at 19:25