I want to create a symbol "\bulletplus" which is basically a plus symbol with a bullet in middle. The symbol should have the same width and height as an usual plus.
How do I create this using only latex commands? (maybe with the help of tikz)
I want to create a symbol "\bulletplus" which is basically a plus symbol with a bullet in middle. The symbol should have the same width and height as an usual plus.
How do I create this using only latex commands? (maybe with the help of tikz)
The following example
centers the bullet on the plus sign,
respects the current math style, and
uses a scaled down version of the bullet, which can be configured by setting macro \bulletplusscale
.
The symbol behaves as math binary operator as the plus sign.
Full example:
\documentclass{article}
\usepackage{graphicx}
\makeatletter
\newcommand*{\bulletplus}{%
\mathbin{%
\mathpalette\@bulletplus{}%
}%
}
\newcommand*{\@bulletplus}[2]{%
% #1: math style
% #2: unused (empty)
\sbox0{$#1+\m@th$}%
\sbox2{$#1\vcenter{}$}% math axis
\rlap{%
\hbox to \wd0{% centers the bullet in the space of the plus sign.
\hfil
% The bullet is moved to the base line, scaled, and
% moved back.
\raise\ht2\hbox{%
\scalebox{\bulletplusscale}{%
\lower\ht2\hbox{$#1\bullet\m@th$}%
}%
}%
\hfil
}%
}%
+%
}
\newcommand*{\bulletplusscale}{.6}
\makeatother
\begin{document}
\[ A \bulletplus B_{A \bulletplus B_{A \bulletplus B}}\]
\end{document}
\bullet
in original size\documentclass{article}
\makeatletter
\newcommand*{\bulletplus}{%
\mathbin{%
\mathpalette\@bulletplus{}%
}%
}
\newcommand*{\@bulletplus}[2]{%
% #1: math style
% #2: unused (empty)
\sbox0{$#1+\m@th$}%
\rlap{%
\hbox to \wd0{\hfil$#1\bullet\m@th$\hfil}%
}%
+%
}
\makeatother
\begin{document}
\[ A \bulletplus B_{A \bulletplus B_{A \bulletplus B}}\]
\end{document}
You can overprint the characters and force the result to be a \mathbin
, like +
\documentclass{article}
\usepackage{mathtools}
\begin{document}
$\mathbin{+\mathllap{\bullet\mkern2.5mu}}$
\end{document}
A solution with stackengine
:
\documentclass[border = 2pt]{standalone}
\usepackage{stackengine} %
\newcommand\bullplus{\stackMath\mathbin{\stackinset{c}{0.01ex}{c}{-0.07ex}{\bullet}{+}}}
\begin{document}
$ x \bullplus y$
\end{document}
I suggest the following code:
\documentclass{article}
\newcommand{\bulletplus}{%
\ooalign{$\bullet$\cr\hidewidth$+$\hidewidth}}
\begin{document}
\bulletplus
\end{document}
You might want to fine-tune it regarding the bullet's size.