[Tex/LaTex] Script-r Symbol

charactersfonts

The near-ubiquitous undergraduate reference on electrodynamics, "Introduction to Electrodynamics" by David Griffiths make extensive use of a script-r symbol, defined to be \vector{\scriptr} \equiv \vector{r} - \vector{r}^{\prime} and looks like:

Script r

Although the question of how to produce such a symbol in LaTeX is quite a common one I am yet to find a satisfactory solution. The closest I've found is from the physymb package and uses the Calligra fonts:

enter image description here

Sadly, there is not a bold variant of this character and it is far more cursive than I would like. I am hence wondering if there are any better facsimiles.

Best Answer

I'd like to expand on the answer by Mateen. First of all, it is possible to limit the selection of calligra to only the lowercase r and second, bold face can be achieved using PDF literals. All of this is done using virtual fonts. So first, we create the virtual fonts, which is just a stripped down and tuned version of the output of tftopl `kpsewhich callig15.tfm`. In particular, the bounding boxes of the glyphs were enlarged and the glyph shifted a little bit to the left. On top of that we add some SPECIAL statements to unslant the character a little, because the Calligra font is more cursive than Griffiths' one.

The normal font variant: griffm.vpl

(FAMILY GRIFF)
(CODINGSCHEME FONTSPECIFIC)
(DESIGNSIZE R 10.0)
(MAPFONT D 0 (FONTNAME callig15))
(FONTDIMEN
   (SLANT R 0.0)
   (SPACE R 0.332987)
   (STRETCH R 0.165994)
   (SHRINK R 0.109996)
   (XHEIGHT R 0.195992)
   (QUAD R 0.798967)
   )
(CHARACTER C r
   (CHARWD R 0.23)
   (CHARHT R 0.23)
   (CHARDP R 0.0095)
   (MAP
      (SPECIAL pdf: q 1 0 -.5 1 0 0 cm)
      (PUSH)
      (MOVELEFT R 0.02)
      (SELECTFONT D 0)
      (SETCHAR C r)
      (POP)
      (SPECIAL pdf: Q)
      )
   )

In the bold font variant we add extra SPECIAL instructions around the character to embolden it by thickening the outline strokes: griffb.vpl

(FAMILY GRIFF)
(CODINGSCHEME FONTSPECIFIC)
(DESIGNSIZE R 10.0)
(MAPFONT D 0 (FONTNAME callig15))
(FONTDIMEN
   (SLANT R 0.0)
   (SPACE R 0.332987)
   (STRETCH R 0.165994)
   (SHRINK R 0.109996)
   (XHEIGHT R 0.195992)
   (QUAD R 0.798967)
   )
(CHARACTER C r
   (CHARWD R 0.23)
   (CHARHT R 0.23)
   (CHARDP R 0.0095)
   (MAP
      (SPECIAL pdf: q 1 0 -.5 1 0 0 cm 2 Tr 0.4 w)
      (PUSH)
      (MOVELEFT R 0.02)
      (SELECTFONT D 0)
      (SETCHAR C r)
      (POP)
      (SPECIAL pdf: 0 Tr 0 w Q)
      )
   )

The two virtual fonts are assembled using

vptovf griffm.vpl
vptovf griffb.vpl

Then they are ready to be used in the LaTeX file. We only need to put in the correct NFSS instructions. For easy access to the bold face variant I make use of the bm package and define the shortcut \brcurs (like Griffiths).

\documentclass{article}

\usepackage{bm}
\DeclareFontFamily{U}{griff}{}
\DeclareFontShape{U}{griff}{m}{n}{<-> s*[2.2] griffm}{}
\DeclareFontShape{U}{griff}{b}{n}{<-> s*[2.2] griffb}{}
\DeclareSymbolFont{griff}{U}{griff}{m}{n}
\SetSymbolFont{griff}{bold}{U}{griff}{b}{n}
\DeclareMathSymbol{\rcurs}{\mathalpha}{griff}{"72}
\DeclareBoldMathCommand{\brcurs}{\rcurs}
\newcommand*\hrcurs{\hat{\brcurs}}

\begin{document}

\[
  \mathbf{E}(\mathbf{r}) = \frac{1}{4 \pi \epsilon_0} \int\limits_{\mathcal{V}} \frac{\rho(\mathbf{r}')}{\rcurs^2} \hrcurs d \tau'
\]

\end{document}

enter image description here

References