我想知道是否已经有一个包可以让我创建一个发现错误类似下面的测试:
最好在枚举环境中进行。
我尝试了一种tikz
方法,但没有成功。
\documentclass[10pt]{article}
\usepackage{tkz-base}
\usetkzobj{all}
\begin{document}
\begin{enumerate}
\item The principal \tikz [remember picture] \node (said) {}; that \tikz [remember picture] \node (weather) {}; the government \tikz [remember picture] \node (announces) {}; a holiday or not, his school \tikz [remember picture] \node (hold) {}; classes. \tikz [remember picture] \node (error) {};
\end{enumerate}
\begin{tikzpicture}[remember picture]
\def\abovebelow#1#2#3{
\node at (#1) {\underline{#2}};
\node [below=1pt of #1] {#3};
}
\abovebelow{said}{said}{A}
\abovebelow{weather}{weather}{B}
\abovebelow{announces}{announces}{C}
\abovebelow{hold}{will still hold}{D}
\abovebelow{error}{NO ERRROR}{E}
\end{tikzpicture}
\end{document}
以下是输出。
我正在寻找一个通用的解决方案,可以在列表环境中使用的东西。
答案1
我认为你这里不需要绘图包,我只是使用了tabular
:
\documentclass[10pt]{article}
\newcounter{qn}
\renewcommand\theqn{\Alph{qn}}
\newcommand\qn[1]{%
{\refstepcounter{qn}\begin{tabular}[t]{@{}l@{}}#1\\
\noalign{\vskip-.2ex}\hline\noalign{\vskip.2ex}\multicolumn{1}{c}{\theqn}\end{tabular}}}
\newcommand\qnx{{%
\par\qn{NO ERROR}\setcounter{qn}{0}}}
\begin{document}
\begin{enumerate}
\item The principal \qn{said} that \qn{weather} the government \qn{announces} a holiday or not, his school \qn{will still hold} classes. \qnx
\end{enumerate}
\end{document}