4

In a paper I'm writing, there are words using the alphabet ${{\sf D,R}}$. It will be very convenient to add ornated versions as in the picture below, but I have no idea how to create something that is scalable and can be used in text (as opposed to being an included image); hence, no included code.

The little circles can be bullets, and are about flush with the top/bottom of their respective letters, and could be larger than shown. enter image description here

1
  • The command \sf has been deprecated for more than 20 years. Use \mathsf{R}.
    – egreg
    Mar 21, 2019 at 22:11

3 Answers 3

5
\documentclass{article}
\usepackage{stackengine}
\newcommand\dotR{\stackinset{r}{-.11em}{b}{}{.}{\textsf{R}}\kern0.075em}
\newcommand\dotD{\kern.06em\stackinset{l}{-0.06em}{t}{}{.}{\textsf{D}}}
\begin{document}
\dotR\dotD {\Large\dotR\dotD}
\end{document}

enter image description here

I added kerning to account for the extra width. However, if you prefer the original kerning of R and D,

\documentclass{article}
\usepackage{stackengine}
\newcommand\dotR{\stackinset{r}{-.11em}{b}{}{.}{\textsf{R}}}
\newcommand\dotD{\stackinset{l}{-0.06em}{t}{}{.}{\textsf{D}}}
\begin{document}
\dotR\dotD {\Large\dotR\dotD}

\sffamily RD{\Large RD}
\end{document}

enter image description here

3

You can always patch things together.

\documentclass{article}
\newcommand{\OrnatedD}{\raisebox{1.35ex}{.}\hspace*{-0.22em}\textsf{D}}
\newcommand{\OrnatedR}{\textsf{R}\hspace*{-0.15em}.}
\begin{document}
\OrnatedD~\OrnatedR {\Large \OrnatedD~\OrnatedR}
\end{document}

enter image description here

3

I prefer letting TeX doing the calculations. ;-) Just the kerning needs optical adjustment.

\documentclass{article}
\usepackage{graphicx}

% a general purpose macro
\newcommand{\xmathpalette}[2]{\mathchoice
  {#1\displaystyle\textfont{#2}}%
  {#1\textstyle\textfont{#2}}%
  {#1\scriptstyle\scriptfont{#2}}%
  {#1\scriptscriptstyle\scriptscriptfont{#2}}%
}
\makeatletter
\newcommand{\Ro}{\mathsf{R}\mkern-1.7mu{\xmathpalette\R@o\relax}}
\newcommand{\Do}{\mathsf{\xmathpalette\D@o\relax\mkern-2.7mu D}}

\newcommand{\R@o}[3]{%
  \scalebox{0.3}{%
    \raisebox{\dimexpr\height-2\fontdimen22#22}{%
      $\m@th#1\bullet$%
    }%
  }%
}
\newcommand{\D@o}[3]{%
  \raisebox{\fontcharht#2\fam`D}{%
    \scalebox{0.3}{%
      \raisebox{-\height}{$\m@th#1\bullet$}%
    }%
  }%
}
\makeatother

\begin{document}

$\Ro+\Do_{\Ro+\Do}$

{\Large $\Ro$ $\Do$}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .