2

MnSymbol has a \udotdot command (search for \udotdot in the comprehensive latex symbol list document), but I don't want to import MnSymbol because of all the side-effects (for instance, it creates \vec definitions that clash with other \vec definitions, and its meant to be used with Adobe Minion Pro in particular).

How can I create my own \udotdot symbol, for use with Computer Modern or Concrete Math?

bzm3r
  • 3,196

2 Answers2

4

The following example uses the normal dot to generate the symbol:

  • \mathpalette adds support for the different math styles.
  • It is assumed, that the dot is on the base line with a correct character bounding box including symmetrical side bearings. The dot itself has the same width and height.
  • The two dots of \udotdot lie on opposite corners of a square, which is centered around the math axis.
  • The centers of the dots lie on the upper and lower borders of the equals sign.

Implementation with example:

\documentclass{article}
%\usepackage{MnSymbol}

\makeatletter
\providecommand*{\udotdot}{%
  \mathbin{\mathpalette\@udotdot{}}%
}
\providecommand*{\@udotdot}[2]{%
  % #1: math style
  % #2: unused
  % Box 0: dot
  \sbox0{$#1.\m@th$}%
  % Remove side bearings
  \setbox2=\hbox to \ht0{\hss\copy0\hss}
  % Side bearing
  \dimen2=.5\dimexpr\wd0-\wd2\relax
  % Box 2: equal sign
  \sbox4{$#1=\m@th$}%
  % Box 4: math axis
  \sbox6{$#1\vcenter{}$}%
  \dimen@=\dimexpr(\ht4-\ht6)*2 + \ht0\relax
  \kern\dimen2 % side bearing
  \vcenter to \dimen@{%
    \hbox to \dimen@{\hfill\copy2}%
    \nointerlineskip
    \vfill
    \hbox to \dimen@{\copy2\hfill}%
  }%
  \kern\dimen2 % side bearing
}
\makeatother

\begin{document}
\[ a \udotdot b \]
\[={\udotdot}\scriptstyle{\udotdot}\scriptscriptstyle{\udotdot}=\]
\end{document}

Result

Heiko Oberdiek
  • 271,626
  • Thanks very much for this generous answer. In order to be able to make my own operator symbols in the future (i.e. fully understand what you just did), are there a resources you'd recommend I familiarze myself with? – bzm3r Feb 12 '15 at 04:39
  • @user89 Further readings: The TeXbook by Donald E. Knuth or TeX by Topic by Victor Eijkhout. – Heiko Oberdiek Feb 12 '15 at 04:44
3

You can either import the single MnSymbol symbol, or create one that roughly matches it:

enter image description here

\documentclass{article}
\usepackage{graphicx,amsmath}
\newcommand{\udotdot}{\mathbin{\text{\rotatebox[origin=c]{45}{${\cdot}{\cdot}$}}}}
\begin{document}

$a \cdots e \cdot a \mathbin{\cdot\cdot} e \mathbin{{\cdot}{\cdot}} a \udotdot e$

$a \udotdot e_{a \udotdot e_{a \udotdot e}}$

\end{document}​
Werner
  • 603,163