用tikz画的带圈数字,用在上下标时如何自动缩小尺寸?

2020-03-18 22:46发布

![](/static/images/ext/zip.gif)带圈数字.zip

![](/static/images/ext/zip.gif)带圈数字.zip
2条回答
用文本的上下标模式试试,不要用公式的数学模式。 ``` tex \documentclass{ctexart} \setmainfont{Times New Roman} \setsansfont{Arial} \usepackage{tikz} \usepackage{xparse} \NewDocumentCommand{\qqr}{ s O{black} m } {\begin{tikzpicture}[x=2.4ex,y=2.4ex,line width=0.1ex] \IfBooleanTF {#1} {\draw(0,0) circle (0.32) node [inner sep=0pt] {\resizebox{1.1ex}{1.1ex}{\rmfamily#3}};} {\filldraw[#2](0,0) circle (0.32) node [white,inner sep=0pt] {\resizebox{1.1ex}{1.1ex}{\rmfamily #3}};} \end{tikzpicture}} \NewDocumentCommand{\qqs}{ s O{black} m } {\begin{tikzpicture}[x=2.4ex,y=2.4ex,line width=0.1ex] \IfBooleanTF {#1} {\draw(0,0) circle (0.32) node [inner sep=0pt] {\resizebox{1.1ex}{1.1ex}{\sffamily #3}};} {\filldraw[#2](0,0) circle (0.32) node [white,inner sep=0pt] {\resizebox{1.1ex}{1.1ex}{\sffamily #3}};} \end{tikzpicture}} \begin{document} 文字\qqr*{3}文字\textsuperscript{\qqr{3}} 文字\qqs*{3}文字\textsuperscript{\qqs{3}} \end{document} ```

一周热门 更多>