我想画\star
一个圆圈,这样我就可以把它用在我的论文上。我找不到合适的方法。有没有(简单的)方法来做这样的自定义符号?
答案1
缩放\bigcirc
似乎产生了不错的结果:
\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}
答案2
答案3
如果你已经在使用tikz
包,或者你需要其他字母、符号或数字圈出来,或者你想改变符号的样式或大小,你可以使用我的解决方案这里。
代码:
\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}
输出: