# Writing error analysis test in TOEFL

I am new to latex. I am working as a lecturer of English as a Foreign Language. I am writing a test for TOEFL. I do not know how to write questions like in the following picture.

Is it possible to write in like

"{Early[A]} colonial {coffeehouses[B]} served as {meeting places[C]} where shipowners and merchants could exchange {informations[D]} and conduct business."

Note: I am using document class of "book" because I am actually writing a book.

Not like that, but almost:

\documentclass{book}

\makeatletter
\newcommand\?[1]{\test@key#1}
\def\test@key#1[#2]{%
\begin{tabular}[t]{@{}c@{}}
\underline{#1}\\#2
\end{tabular}%
}
\makeatother

\begin{document}

\begin{enumerate}

\item \?{Early[A]} colonial \?{coffeehouses[B]} served as
\?{meeting places[C]} where shipowners and merchants
could exchange \?{informations[D]} and conduct business.

\item \?{Sunlights[A]} cannot \?{reach[B]} far \?{beneath[C]}
the ocean's \?{surface[D]}

\end{enumerate}

\end{document}


If you want underlines at fixed height (cutting descenders), use

\documentclass{book}

\makeatletter
\newcommand\?[1]{\test@key#1}
\def\test@key#1[#2]{%
\begin{tabular}[t]{@{}c@{}}
\underline{\smash{#1}}\\#2 % <--- smash
\end{tabular}%
}
\makeatother

\begin{document}

\begin{enumerate}

\item \?{Early[A]} colonial \?{coffeehouses[B]} served as
\?{meeting places[C]} where shipowners and merchants
could exchange \?{informations[D]} and conduct business.

\item \?{Sunlights[A]} cannot \?{reach[B]} far \?{beneath[C]}
the ocean's \?{surface[D]}

\end{enumerate}

\end{document}


• These are wonderful. Thanks a million for your help @egreg. I prefer the one with fixed underline. It works like a charm. Mar 4 '16 at 17:29