45

I'm trying to replicate the dot that my professor uses in his notes for the dot product between vectors but I am having a hard time doing so. This is what it looks like:

enter image description here

I have tried a couple of things. \cdot is too thin

 asdf

and \bullet is too thick

enter image description here

and using \Large with \cdot gives an error. Moreover, after digging through the list of symbols I cannot find a nice medium between \cdot and \bullet.

How can I get a dot closest to the first picture?

  • I use \bullet for dot products. – k-l Mar 22 '17 at 0:13
41

May be you find a better name like \dotp or something like that.

\documentclass{scrartcl}
\usepackage{graphicx}

\makeatletter
\newcommand*\bigcdot{\mathpalette\bigcdot@{.5}}
\newcommand*\bigcdot@[2]{\mathbin{\vcenter{\hbox{\scalebox{#2}{$\m@th#1\bullet$}}}}}
\makeatother

\begin{document}
$a \bigcdot b$
\end{document}

enter image description here

  • 2
    @Manuel (or anyone who understands this), could you clarify a couple of points about your macros? 1. What are the two parameters to \mathpalette? (I only "see" one, unless "bigcdot@" and ".5" are separate in which case I don't understand why \mathpalette is called. 2. What ends up being the first parameter (#1) to bigcdot@, used right before \bullet? – dedded Feb 3 '16 at 13:22
  • 1
    That's how \mathpalette works, the #1 that is passed to \bigcdot@ is the current math style (\displaystyle, \textstyle, \scriptstyle, or \scriptscriptstyle depending on the case).Basically what mathpalette does is taking two arguments, and passing the currentstyle in first place and the second argument after it, so \mathpalete\foo{whatever} ends up being for instance \foo\displaystyle{whatever}, so you have to define \foo accordingly. – Manuel Feb 3 '16 at 14:06
  • @sardoj See The mysteries of \mathpalette – egreg Nov 28 '16 at 21:11
23

Here is a simple trick which needs the amsmath package.

\[
a  \boldsymbol{\cdot} b  =  0
\]

and the result is

enter image description here

  • Interesting solution; but \bf has been deprecated for 20+ years. Besides, align* serves no purpose here, where equation* would be the correct environment. – egreg Nov 28 '16 at 21:09
  • @egreg: Yeah! I am new to LaTex! Sorry for those! :) I changed the answer a little bit. Let me know if it is OK. :) – H. R. Nov 28 '16 at 21:11
  • This answer has a downside that the other one has not: if used within the scope of a \mathversion{bold} (or \boldmath, if you prefer) declaration, the dot cannot become any bolder. I agree, nonetheless, that it is an interesting solution. – GuM Nov 28 '16 at 21:58
8

The following example extends Manuel's answer in two ways:

  • The vertical position is fixed to center the symbol vertically around the math axis as \cdot and \bullet do.
  • The width of the symbol is not the scaled down width of the \bullet (with scaled down side bearings), but a little larger width of \cdot.

The scale and width factor can be configured by macros \bigcdot@scalefactor and \bigcdot@widthfactor.

\documentclass{scrartcl}
\usepackage{color}
\usepackage{graphicx}

\makeatletter
\newcommand*{\bigcdot}{}% Check if undefined
\DeclareRobustCommand*{\bigcdot}{%
  \mathbin{\mathpalette\bigcdot@{}}%
}
\newcommand*{\bigcdot@scalefactor}{.5}
\newcommand*{\bigcdot@widthfactor}{1.15}
\newcommand*{\bigcdot@}[2]{%
  % #1: math style
  % #2: unused
  \sbox0{$#1\vcenter{}$}% math axis
  \sbox2{$#1\cdot\m@th$}%
  \hbox to \bigcdot@widthfactor\wd2{%
    \hfil
    \raise\ht0\hbox{%
      \scalebox{\bigcdot@scalefactor}{%
        \lower\ht0\hbox{$#1\bullet\m@th$}%
      }%
    }%
    \hfil
  }%
}
\makeatother

\begin{document}
\[ a \bigcdot b \]
%
% Comparison with \cdot and \bullet
\[ a \cdot b \bigcdot c \bullet d \]
%
% Different math styles
\[ a \bigcdot b \quad
   \scriptstyle a \bigcdot b \quad
   \scriptscriptstyle a \bigcdot b
\]
%
% Visualization of the math axis
\[
  \sbox0{${-}{\cdot}{\bigcdot}{\bullet}{-}$}
  \rlap{\copy0}%
  \vcenter{%
    \hbox{%
      \textcolor{red}{%
        \vrule width\wd0 height .05pt depth .05pt\relax
      }%
    }%
  }
\]
\end{document}

Result

  • I love it! And some more words to exceed the character limit. – Simon Nov 13 '18 at 19:10

protected by Community Dec 6 '17 at 16:19

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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