Is there a nice way to produce a medium-sized dot to use in a formula like this:
$x_{i\cdot} = \sum_{j} x_{ij}$
The \cdot
is not very visible.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityOne way would be to use \scalebox
from the graphicx
package. Here is a comparrison of before and after:
\documentclass{article}
\usepackage{graphicx}
\newcommand*{\LargerCdot}{\raisebox{-0.25ex}{\scalebox{1.2}{$\cdot$}}}
\begin{document}
$x_{i\cdot} = \sum_{j} x_{ij}$
$x_{i\LargerCdot} = \sum_{j} x_{ij}$
\end{document}
The following example defines \Cdot
to generate a larger dot. It takes an optional argument with a scaling factor. The default is 1.25
.
The centered dot remains centered after scaling by moving the dot to the baseline
before scaling. The depth that is caused by scaling is removed. Exceeded height is truncated to the height of \bullet
.
The width is more difficult. The exact values of the side bearings are unknown. For small scaling factors, the original width might be a good choice. That is implemented in the example below. For larger scaling factors the width might be increased by a smaller scaling factor. At any case, the horizontal and vertical scaling factors of the glyph must be the same, otherwise the glyph looses the circle shape.
The example file:
\documentclass{article}
\usepackage{graphicx}
\usepackage{amstext}
\newcommand*{\Cdot}[1][1.25]{%
\mathpalette{\CdotAux{#1}}\cdot%
}
\newdimen\CdotAxis
\newcommand*{\CdotAux}[3]{%
{%
\settoheight\CdotAxis{$#2\vcenter{}$}%
\sbox0{%
\raisebox\CdotAxis{%
\scalebox{#1}{%
\raisebox{-\CdotAxis}{%
$\mathsurround=0pt #2#3$%
}%
}%
}%
}%
% Remove depth that arises from scaling.
\dp0=0pt %
% Decrease scaled height.
\sbox2{$#2\bullet$}%
\ifdim\ht2<\ht0 %
\ht0=\ht2 %
\fi
% Use the same width as the original \cdot.
\sbox2{$\mathsurround=0pt #2#3$}%
\hbox to \wd2{\hss\usebox{0}\hss}%
}%
}
\newcommand*{\test}[1]{%
\text{%
\setlength{\fboxsep}{0pt}%
\setlength{\fboxrule}{.1pt}%
\fbox{$#1$}%
}%
}
\begin{document}
$x_{i\cdot} = x_{i\test{\cdot}} = \sum_{j} x_{ij}$
$x_{i\Cdot} = x_{i\test{\Cdot}} = \sum_{j} x_{ij}$
$x_{i\Cdot[1.5]} = x_{i\test{\Cdot[1.5]}} = \sum_{j} x_{ij}$
$x_{i\Cdot[1.75]} = x_{i\test{\Cdot[1.75]}} = \sum_{j} x_{ij}$
$x_{i\Cdot[2]} = x_{i\test{\Cdot[2]}} = \sum_{j} x_{ij}$
\end{document}
\ht
, \dp
, \wd
; LaTeX manuals for \raisebox
and \settoheight
; grfguide for \scalebox
.
Nov 7, 2012 at 3:38
\bullet
for such occasions but it's a matter of taste ;)