11

A First Course in Complex Analysis by Matthias Beck, Gerald Marchesi, Dennis Pixton, and Lucas Sabalka Ch9.1

enter image description here

Circle: $C[z_0,R] = |z-z_0| = R$

Disc: $D[z_0,R] = |z-z_0| < R$

Closed Disc: $\overline{D}[z_0,R] = |z-z_0| \le R$

Punctured disc: $0 < |z-z_0| < R$

How do I do the dot inside the $D$ to denote a punctured disc?

sporc
  • 643
BCLC
  • 215
  • 2
  • 9
  • 17
    Among the worst notation I ever saw. – egreg Aug 16 '18 at 08:52
  • @egreg Thanks I guess XD – BCLC Aug 16 '18 at 08:53
  • 1
    If you want an alternative that has font support, there is always eth, ð / Ð. It's not just Unicode-supported, it's part of the shared space between Unicode and Windows-1252 that came from them both being built on Latin-1. – CR Drost Aug 16 '18 at 13:39
  • Unicode also has a small number of combining overlay accents, such as rings, although I don’t support using them as notation. They might, technically, work in unicode-math if you need something you can apply to any grapheme. – Davislor Aug 16 '18 at 21:34

2 Answers2

18

It's among the worst notation I have ever seen.

If you really want it, at least do it right, with the dot in the middle of the D.

\documentclass{article}
\usepackage{amsmath}
\usepackage{xparse}
\usepackage{mathpazo}

\NewDocumentCommand{\disk}{smm}{%
  \IfBooleanTF{#1}{\puncturedD}{D}[#2,#3]%
}

\makeatletter
\newcommand{\puncturedD}{{\vphantom{D}\mathpalette\punctured@D\relax}}
\newcommand{\punctured@D}[2]{%
  \sbox\z@{$\m@th#1D$}
  \ooalign{%
    $\m@th#1D$\cr
    \noalign{\punctured@adj{#1}}
    \hidewidth$\m@th#1\mkern1mu\cdot$\hidewidth\cr
  }%
}
\newcommand{\punctured@adj}[1]{%
  \kern\dimexpr\fontdimen22
  \ifx#1\displaystyle\textfont\else
  \ifx#1\textstyle\textfont\else
  \ifx#1\scriptstyle\scriptfont\else
  \scriptscriptfont\fi\fi\fi 2
  -\ht\z@/2\relax
}
\makeatother

\begin{document}

\begin{gather}
\disk*{z_0}{R}=
\{z\in\mathbb{C}:0<\lvert z-z_0\rvert<R\}=
\disk{z_0}{R}\setminus\{z_0\}
\\
\disk*{0}{1} \scriptstyle \disk*{0}{1} \scriptscriptstyle \disk*{0}{1}
\end{gather}

\end{document}

enter image description here

The only “manual” adjustment is \mkern1mu to shift the dot a bit to the right. The amount of shifting depends on the font and the shape of the D, so it cannot be made automatic.


A more complete version with syntax support also for the closed disk.

\documentclass{article}
\usepackage{amsmath}
\usepackage{xparse}
\usepackage{mathpazo}

\NewDocumentCommand{\disk}{st-mm}{%
  \IfBooleanTF{#1}{\puncturedD}{%
    \IfBooleanTF{#2}{\,\overline{\!D\!}\,}{D}%
  }%
  [#3,#4]%
}

\makeatletter
\newcommand{\puncturedD}{{\vphantom{D}\mathpalette\punctured@D\relax}}
\newcommand{\punctured@D}[2]{%
  \sbox\z@{$\m@th#1D$}
  \ooalign{%
    $\m@th#1D$\cr
    \noalign{\punctured@adj{#1}}
    \hidewidth$\m@th#1\mkern1mu\cdot$\hidewidth\cr
  }%
}
\newcommand{\punctured@adj}[1]{%
  \kern\dimexpr\fontdimen22
  \ifx#1\displaystyle\textfont\else
  \ifx#1\textstyle\textfont\else
  \ifx#1\scriptstyle\scriptfont\else
  \scriptscriptfont\fi\fi\fi 2
  -\ht\z@/2\relax
}
\makeatother

\begin{document}

\begin{gather}
\disk{z_0}{R}=
\{z\in\mathbb{C}:\lvert z-z_0\rvert<R\}
\\
\disk-{z_0}{R}=
\{z\in\mathbb{C}:\lvert z-z_0\rvert\le R\}
\\
\disk*{z_0}{R}=
\{z\in\mathbb{C}:0<\lvert z-z_0\rvert<R\}=
\disk{z_0}{R}\setminus\{z_0\}
\\
\disk*{0}{1} \scriptstyle \disk*{0}{1} \scriptscriptstyle \disk*{0}{1}
\end{gather}

\end{document}

enter image description here

The advantage of having a unified syntax is that if, for instance, you decide for \dot{D} instead of \puncturedD, you can just change the call in the definition of \disk.

egreg
  • 1,121,712
15

A simple \stackinset with a scalerel wrapper thrown around it will support the smaller math styles.

\documentclass{article}
\usepackage{stackengine,scalerel}
\newcommand\dotD{\ThisStyle{\ensurestackMath{%
  \stackinset{c}{.7\LMpt}{c}{-.2\LMpt}%
  {\SavedStyle\cdot}{\SavedStyle D}}}}
\begin{document}
\[
x\dotD\scriptstyle\dotD\scriptscriptstyle\dotD
\]
\end{document}

enter image description here

  • Nice solution, +1. Although 'simple' is not the first word that comes to mind looking at all the macros and arguments inside the \newcommand... – Marijn Aug 17 '18 at 13:09