I am trying to put \star in a circle so I can use it on my paper. I could not find a proper way to do so. Is there a (simple) way of doing such a custom symbol?
3 Answers
Scaling \bigcirc seems to yield a decent result:
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\makeatletter
\newcommand{\ostar}{\mathbin{\mathpalette\make@circled\star}}
\newcommand{\make@circled}[2]{%
\ooalign{$\m@th#1\smallbigcirc{#1}$\cr\hidewidth$\m@th#1#2$\hidewidth\cr}%
}
\newcommand{\smallbigcirc}[1]{%
\vcenter{\hbox{\scalebox{0.77778}{$\m@th#1\bigcirc$}}}%
}
\makeatother
\begin{document}
$x\ostar y$
$x\oplus y$
$\oplus\ostar$
\end{document}
-
1Some explanation of how this works would be helpful.Paul Wintz– Paul Wintz2022-05-09 06:32:10 +00:00Commented May 9, 2022 at 6:32
-
@PaulWintz It's a standard application of
\ooalignand of\mathpaletteegreg– egreg2022-05-09 08:22:13 +00:00Commented May 9, 2022 at 8:22
You can use the \stackinset command from stackengine:
\documentclass{article}
\usepackage{stackengine}
\newcommand\oast{\stackMath\mathbin{\stackinset{c}{0ex}{c}{0ex}{\ast}{\bigcirc}}}
\begin{document}
$ x \oast y$
\end{document}
If you already are using tikz package or if you need other letters, symbols or numbers circled, or even if you want to change style or size in your symbol you can use my solution from here.
Code:
\documentclass{article}
\makeatletter
\usepackage{tikz}
% #1 is a multiplier of fontsize for the minimum diameter of the circle
% #2 is the symbol to be circled.
\newcommand*\circled[2][1.6]{\tikz[baseline=(char.base)]{
\node[shape=circle, draw, inner sep=1pt,
minimum height={\f@size*#1},] (char) {\vphantom{WAH1g}#2};}}
\makeatother
\begin{document}
This is a \circled{*} and a \circled{$\star$} and a \circled{$\ast$}.
This is a \circled[1.2]{*} and a \circled[1.2]{$\star$} and a \circled[1.2]{$\ast$}
This is a \circled[0.8]{*} and a \circled[0.8]{$\star$} and a \circled[0.8]{$\ast$}
\end{document}
Output:
-
You can decrease more the size by removing the
\vphantom{WAH1g}commandkoleygr– koleygr2018-09-20 21:10:29 +00:00Commented Sep 20, 2018 at 21:10 -
1And you can remove the calc library, I guess.user121799– user1217992018-09-20 21:35:20 +00:00Commented Sep 20, 2018 at 21:35
-
Are you confusing the
calclibrary and package? TikZ can do all sorts of calculations without thecalclibrary, such aswidth("X")which has an analogon (I think it iswidthof) in thecalcpackage.user121799– user1217992018-09-20 21:38:45 +00:00Commented Sep 20, 2018 at 21:38 -
@marmot, I usually use
\tikzlibrarycalc in coordinate calculations for distances... I have heard for the\widthof{}but never used it before. The calculations here was simple for tikz but I read your message and thought that you mean it is not needed for the other cases I added. (I didn't used that calculation there)koleygr– koleygr2018-09-20 21:55:05 +00:00Commented Sep 20, 2018 at 21:55 -
1Well, in the other answer, calc is not needed, too. Nor the complicated implementation of
minimum size. So perhaps you want to clean up. And no, I am not going to write an answer here.user121799– user1217992018-09-20 23:14:55 +00:00Commented Sep 20, 2018 at 23:14



$\bigostar$fromMnSymbol?The Comprehensive LATEX Symbol List, page 45. it my sill be on CTAN. try with google ...amsmath, which is one of the most standard libraries, you could simply do\textcircled{$\star$}or\textcircled{$*$}. I hope this option will be appended to one of the answers...