11

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?

4
  • 2
    welcome to tex.se! $\bigostar$ from MnSymbol? Commented Sep 20, 2018 at 20:58
  • Oh amazing. I did look through some documentations but did not find that. Thanks! Commented Sep 20, 2018 at 21:04
  • i found this symbol in The Comprehensive LATEX Symbol List , page 45. it my sill be on CTAN. try with google ... Commented Sep 20, 2018 at 21:06
  • 1
    If you load 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... Commented Sep 20, 2018 at 22:02

3 Answers 3

13

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}

enter image description here

2
  • 1
    Some explanation of how this works would be helpful. Commented May 9, 2022 at 6:32
  • @PaulWintz It's a standard application of \ooalign and of \mathpalette Commented May 9, 2022 at 8:22
7

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} 

enter image description here

6

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:

enter image description here

7
  • You can decrease more the size by removing the \vphantom{WAH1g} command Commented Sep 20, 2018 at 21:10
  • 1
    And you can remove the calc library, I guess. Commented Sep 20, 2018 at 21:35
  • Are you confusing the calc library and package? TikZ can do all sorts of calculations without the calc library, such as width("X") which has an analogon (I think it is widthof) in the calc package. Commented Sep 20, 2018 at 21:38
  • @marmot, I usually use \tikzlibrary calc 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) Commented Sep 20, 2018 at 21:55
  • 1
    Well, 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. Commented Sep 20, 2018 at 23:14

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.