答案1
\bigcirc
您可以使用和的放大版本\ooalign
:
\documentclass{article}
\usepackage{amsmath,graphicx}
\makeatletter
\newcommand{\makecircled}[2][\mathord]{#1{\mathpalette\make@circled{#2}}}
\newcommand{\make@circled}[2]{%
\begingroup\m@th
\vphantom{\biggercirc{#1}}%
\ooalign{$#1\biggercirc{#1}$\cr\hidewidth$#1#2$\hidewidth\cr}%
\endgroup
}
\newcommand{\biggercirc}[1]{%
\vcenter{\hbox{\scalebox{1.4}{$\m@th#1\bigcirc$}}}%
}
\makeatother
\newcommand{\disjointsharp}{\makecircled[\mathbin]{\#}}
\begin{document}
$A\disjointsharp B_{A\disjointsharp B}$
\end{document}
我用过\mathbin
但这可能\mathrel
取决于含义。
看https://tex.stackexchange.com/a/22375/4427快速课程\ooalign
。
用较小的圆圈
\documentclass{article}
\usepackage{amsmath,graphicx}
\makeatletter
\newcommand{\makecircled}[2][\mathord]{#1{\mathpalette\make@circled{#2}}}
\newcommand{\make@circled}[2]{%
\begingroup\m@th
\vphantom{\bigcirc}%
\ooalign{$#1\bigcirc$\cr\hidewidth$#1\make@smaller{#1}{#2}$\hidewidth\cr}%
\endgroup
}
\newcommand{\make@smaller}[2]{%
\vcenter{\hbox{\scalebox{0.7}{$\m@th#1#2$}}}%
}
\makeatother
\newcommand{\disjointsharp}{\makecircled[\mathbin]{\#}}
\begin{document}
$A\disjointsharp B_{A\disjointsharp B}$
\end{document}
当符号“更大”时,它们通常相对于公式轴居中。
另一种可能性:
\documentclass{article}
\usepackage{amsmath,graphicx}
\makeatletter
\newcommand{\makecircled}[2][\mathord]{#1{\mathpalette\make@circled{#2}}}
\newcommand{\make@circled}[2]{%
\begingroup\m@th
\sbox\z@{$#1A$}%
\sbox\tw@{%
\raisebox{\depth}{%
\vphantom{$#1A$}%
\ooalign{%
\hidewidth$#1\make@smaller{#1}{#2}$\hidewidth\cr
$#1\bigcirc$\cr
}%
}%
}%
\resizebox{!}{\ht\z@}{\box\tw@}%
\endgroup
}
\newcommand{\make@smaller}[2]{%
\vcenter{\hbox{\scalebox{0.7}{$\m@th#1#2$}}}%
}
\makeatother
\newcommand{\disjointsharp}{\makecircled[\mathbin]{\#}}
\begin{document}
$A\disjointsharp B_{A\disjointsharp B}$
\end{document}
答案2
您可以使用 TikZ 绘制一个#
内部有的圆形节点。使用\DeclareMathOperator
fromamsmath
可以改善间距。字符应该比当前字体小一点,您可以使用包\smaller
中的字体relsize
来确保它在不同的字体大小下都能正常工作。
梅威瑟:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{relsize}
\DeclareMathOperator{\chash}{\tikz{\node[circle,draw,inner sep=0,outer sep=0]{\smaller[3]\#}}}
\begin{document}
$A\chash B$
\Huge$A\chash B$
\end{document}
结果:
答案3
stackengine
这是一种使用和\bigovoid
符号的可能性mathabx
(不用 mathabx 字体替换默认的数学字体):
\documentclass{article}
\usepackage{amsmath}
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{%
<-6> mathx5
<6-7> mathx6
<7-8> mathx7
<8-9> mathx8
<9-10> mathx9
<10-12> mathx10
<12-> mathx12
}{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareMathSymbol{\bigovoid}{\mathop}{mathx}{"EC}
\usepackage{stackengine}
\newcommand{\Otag}{\mathbin{\stackMath\stackinset{c}{}{c}{}{\#}{\bigovoid}}}
\begin{document}
\[A \Otag B = C \]
\end{document}