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

  • The command \sf has been deprecated for more than 20 years. Use \mathsf{R}. – egreg Mar 21 at 22:11
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

4

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

4

Here is an option using \ooalign.

enter image description here

\documentclass{article}
\usepackage{graphicx}
\newcommand\RR{{\ooalign{\textsf{R}\kern.107em\cr\hfil.\cr}}}
\newcommand\DD{\reflectbox{\rotatebox[origin=c]{180}{\ooalign{\kern.04em\textsf{D}\cr.\hfil\cr}}}}

\begin{document}
\RR\DD\ {\Large\RR\DD} {\Huge\RR\DD}
\end{document}
  • Not sure what's the point about \ooalign. Anyway, you've better add a pair of braces around the code for \RR. – egreg Mar 21 at 21:34
  • Thanks for the reminder @egreg. Just putting another option out there. @Steven already did it a more intuitive way. Is there a reason to avoid \ooalign? Or just no compelling reason to use it in this case? – Sandy G Mar 21 at 21:42
4

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.