
답변1
원은 TikZ에서도 그릴 수 있습니다. 다음 옵션 plot
도 허용됩니다 .mark
\documentclass{article}
\usepackage{tikz}
\newcommand*{\RedCircle}{}
\DeclareRobustCommand*{\RedCircle}{%
\tikz\path plot[
mark=*,
mark size=3,
mark options={solid, fill=red},
] coordinates {(0, 0)};%
}
\begin{document}
Circle: \RedCircle
\end{document}
수학 축을 중심으로 수직 중심 맞추기
중앙에 있는 기호는 괄호 안에 더 잘 들어맞습니다.
\documentclass{article}
\usepackage{tikz}
\newcommand*{\RedCircle}{}
\DeclareRobustCommand*{\RedCircle}{%
\ensuremath{\vcenter{\hbox{%
\tikz\path plot[
mark=*,
mark size=3,
mark options={solid, fill=red},
] coordinates {(0, 0)};%
}}}%
}
\begin{document}
Circle (\RedCircle)
\end{document}
경계 상자 수정
TikZ는 경계 상자에 대해 마크의 선 너비를 고려하는 것을 잊어버린 것 같습니다. 다음 코드는 이를 보완하기 위해 작은 프레임을 추가합니다.
\documentclass{article}
\usepackage{tikz}
\newcommand*{\RedCircle}{}
\DeclareRobustCommand*{\RedCircle}{%
\ensuremath{\vcenter{\hbox{%
\setlength{\fboxsep}{.21pt}%
% 0.2pt (half line width)
% + 0.01pt to get some rounding tolerance
\setlength{\fboxrule}{0pt}%
\fbox{%
\tikz\path plot[
mark=*,
mark size=3,
mark options={solid, fill=red, draw=black},
] coordinates {(0, 0)};%
}%
}}}%
}
\begin{document}
% Show bounding box:
\setlength{\fboxsep}{0pt}
\setlength{\fboxrule}{.1pt}
(\textcolor{cyan}{\fbox{\RedCircle}})
\end{document}
TikZ 내부에 여백 추가(외부화로 인해 이미지가 잘릴 수도 있음):
\documentclass{article}
\usepackage{tikz}
\newcommand*{\RedCircle}{}
\DeclareRobustCommand*{\RedCircle}{%
\ensuremath{\vcenter{\hbox{%
\def\BoundingBoxCorrection{.55\pgflinewidth}%
% .5\pgflinewidth: half the line width, forgotten by TikZ
% .05\pgflinewidth: some tolerance for rounding errors
\tikz\path plot[
mark=*,
mark size=3,
mark options={solid, fill=red, draw=black},
] coordinates {(0, 0)}
(current bounding box.south west)
++(-\BoundingBoxCorrection, -\BoundingBoxCorrection)
(current bounding box.north east)
++(\BoundingBoxCorrection, \BoundingBoxCorrection)
;%
}}}%
}
\begin{document}
% Show bounding box:
\setlength{\fboxsep}{0pt}
\setlength{\fboxrule}{.1pt}
(\textcolor{cyan}{\fbox{\RedCircle}})
\end{document}