我想做点类似的事情
\documentclass{article}
\usepackage{amsmath,amssymb,enumerate}
\newcounter{num}
\newcommand{\exam}[1]
{\bigskip\bigskip\noindent\refstepcounter{num}\textbf{Example \arabic{num})} #1\par\noindent}
\begin{document}
%
\exam{Read the following sentences and write 'O' or 'X' in each bracket}
\begin{enumerate}[(1)]
\item
If \(x\) is real, then \(\sqrt{(x-1)^2}=|x-1|\).
\(\quad\cdots\cdots\cdots\cdots\cdots\cdots\cdots\quad\)[\qquad]
\item
If \(y\) is real, then \(\sqrt{y^2}=y\).
\(\quad\cdots\cdots\cdots\cdots\cdots\cdots\cdots\cdots\cdots\cdots\quad\)[\qquad]
\item
If \(t\le0\), then \(\sqrt t^2\neq t\).
\(\quad\cdots\cdots\cdots\cdots\cdots\cdots\cdots\cdots\cdots\cdots\cdots\cdots\quad\)[\qquad]
\end{enumerate}
\end{document}
我手动输入了类似的命令,但我更愿意自动执行此操作,以便生成括号并将其对齐到包中\(\cdots\)
每个括号的最右侧item
enumerate
答案1
使用\dotfill
。
\documentclass{article}
\usepackage{amsmath,amssymb,enumerate}
\newcounter{num}
\newcommand{\exam}[1]
{\bigskip\bigskip\noindent\refstepcounter{num}\textbf{Example \arabic{num})} #1\par\noindent}
\begin{document}
%
\exam{Read the following sentences and write 'O' or 'X' in each bracket}
\begin{enumerate}[(1)]
\item
If \(x\) is real, then \(\sqrt{(x-1)^2}=|x-1|\).
\dotfill[\qquad]
\item
If \(y\) is real, then \(\sqrt{y^2}=y\).
\dotfill[\qquad]
\item
If \(t\le0\), then \(\sqrt t^2\neq t\).
\dotfill[\qquad]
\end{enumerate}
\end{document}
或者用\cdot
s。(非常感谢 @Fractal 给我发送 ping 消息!)
\documentclass{article}
\usepackage{amsmath,amssymb,enumerate}
\newcounter{num}
\newcommand{\exam}[1]
{\bigskip\bigskip\noindent\refstepcounter{num}\textbf{Example \arabic{num})} #1\par\noindent}
\begin{document}
%
\exam{Read the following sentences and write 'O' or 'X' in each bracket}
\begin{enumerate}[(1)]
\item
If \(x\) is real, then \(\sqrt{(x-1)^2}=|x-1|\).
{\leaders\hbox{$\,\cdot$}\hfill}[\qquad]
\item
If \(y\) is real, then \(\sqrt{y^2}=y\).
{\leaders\hbox{$\,\cdot$}\hfill}[\qquad]
\item
If \(t\le0\), then \(\sqrt t^2\neq t\).
{\leaders\hbox{$\,\cdot$}\hfill}[\qquad]
\end{enumerate}
\end{document}
或者
\documentclass{article}
\usepackage{amsmath,amssymb,enumerate}
\newcounter{num}
\newcommand{\exam}[1]
{\bigskip\bigskip\noindent\refstepcounter{num}\textbf{Example \arabic{num})} #1\par\noindent}
\newcommand{\Cdotfill}{\leaders\hbox{$\,\cdot$}\hfill}
\begin{document}
%
\exam{Read the following sentences and write 'O' or 'X' in each bracket}
\begin{enumerate}[(1)]
\item
If \(x\) is real, then \(\sqrt{(x-1)^2}=|x-1|\).
\Cdotfill[\qquad]
\item
If \(y\) is real, then \(\sqrt{y^2}=y\).
\Cdotfill[\qquad]
\item
If \(t\le0\), then \(\sqrt t^2\neq t\).
\Cdotfill[\qquad]
\end{enumerate}
\end{document}