希望在 LaTeX (Overleaf) 中圈出一组数字。以下是我目前所做的:
\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{graphicx}
\newtheorem*{theorem}{Theorem}
\newtheorem*{corollary}{Corollary}
\newtheorem*{exercise}{Exercise}
\newtheorem*{problem}{Problem}
\newtheorem*{question}{Question}
\newenvironment{solution}
{\renewcommand\qedsymbol{$\blacksquare$}\begin{proof}[Solution]}
{\end{proof}}
\begin{document}
\begin{problem}[4.50]
\normalfont Repeat the above exercise, but this time use $\mathbb{Z}_{12}$ instead of $\mathbb{Z}_{18}$.
\end{problem}
\begin{solution}
\begin{enumerate}
\item The generators of $\mathbb{Z}_{12}$ are $\langle 1\rangle, \langle 5\rangle, \langle 7\rangle$, and $\langle 11\rangle$.
\item The divisors of 12 are $1,2,3,4,6$, and $12$.
\item Order of 1: $\langle 0\rangle=\{0\}$
\item Order of 2: $\langle 6\rangle=\{0,6\}$
\item Order of 3: $\langle 4\rangle=\{0,4,8\}$
\item Order of 4: $\langle 3\rangle=\{0,3,6,9\}$
\item Order of 6: $\langle 2\rangle=\{0,2,4,6,8,10\}$
\item Order of 12: $\mathbb{Z}_12=\{0,1,2,3,4,5,6,7,8,9,10,11\}$
\end{enumerate}
\end{solution}
\end{document}
我想圈出上述集合中的某些数字,但不知道该怎么做。如能提供任何帮助,不胜感激!
答案1
这是 TikZ 解决方案。您需要将其添加\usepackage{tikz}
到序言中。
定义一个宏\cir
,将要圈出的数字作为参数:
\newcommand{\cir}[1]{\tikz[baseline]{%
\node[anchor=base, draw, circle, inner sep=0, minimum width=1.2em]{#1};}}
这minimum width
确保所有圆圈的大小相同。注意:如果您尝试圈出一个三位数,圆圈会变大。您可以根据需要扩大最小宽度。
代码
Order of 12: $\mathbb{Z}_{12}=\{0,\cir{1},2,3,4,\cir{5},6,\cir{7},8,9,10,\cir{11}\}$