In latex how to show different types of line, in symbol form as —- and other forms, in text line.
[Tex/LaTex] How to show line (symbol) in text
symbolstext;
Related Solutions
You could create your own symbol using ooalign
as demonstrated in
- What is the command for a sum symbol superimposed on an integral sign?
- \subseteq + \circ as a single symbol ("open subset") which contains a great tutorial on
ooalign
The subtle thing in the code below is that I've used a \phantom{sum}
in the displaystyle
version to make sure that limits of the sum
are displayed correctly. Without it, you loose the correct display of the upper limit.
If the circles aren't exactly where you want them, you can move them around by playing with the numbers in the code.
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
% a new command to draw the little circle
\newcommand{\smallcirc}[1]{\scalebox{#1}{$\circ$}}
\DeclareMathOperator*{\SumCircles}{%
\mathchoice%
{\ooalign{\phantom{$\displaystyle\sum$}\cr\hidewidth\raisebox{1.2\height}{$\mkern22mu\smallcirc{0.7}$}\hidewidth\cr%
\raisebox{-0.7\height}{$\mkern22mu\smallcirc{0.7}$}\cr
\hidewidth$\displaystyle\sum$}}
{\ooalign{$\textstyle\sum$\cr%
\hidewidth\raisebox{1.9\height}{$\mkern16mu\smallcirc{0.4}$}\hidewidth\cr
\hidewidth\raisebox{-.3\height}{$\mkern16mu\smallcirc{0.4}$}\hidewidth\cr}}
{\ooalign{\raisebox{0\height}{\scalebox{.6}{$\scriptstyle\sum$}}\cr%
\hidewidth\raisebox{1.6\height}{$\mkern7.5mu\smallcirc{0.2}$}\hidewidth\cr
\hidewidth\raisebox{-0.2\height}{$\mkern7.5mu\smallcirc{0.2}$}\hidewidth\cr}}
{\ooalign{\raisebox{.2\height}{\scalebox{.6}{$\scriptstyle\sum$}}\cr%
\hidewidth\raisebox{2.2\height}{$\mkern7.5mu\smallcirc{0.2}$}\hidewidth\cr
\hidewidth\raisebox{0.4\height}{$\mkern7.5mu\smallcirc{0.2}$}\hidewidth\cr}}
}
\begin{document}
$\SumCircles_{\SumCircles} \displaystyle\SumCircles$
\[
\SumCircles_{n=1}^\infty
\sum_{n=1}^\infty
\]
\end{document}
Similar to Christian's answer, but siunitx
will deal with the correct typesetting, be it text mode or math mode.
\documentclass{article}
\usepackage[
separate-uncertainty = true,
multi-part-units = repeat
]{siunitx}
\begin{document}
Math mode: $\SI{50 \pm 2}{\percent}$
Text mode: \SI{50 \pm 2}{\percent}
\end{document}
Best Answer
With TikZ you can define your own dash and dot patterns and embed the picture inline using
\tikz
. As none of the macros in TikZ is e-TeX protected you have to take care of that by yourself by using\protected\def
or in this case\DeclareRobustCommand
.