¿Cómo comentar entornos mediante programación?

¿Cómo comentar entornos mediante programación?

Escribo exámenes de opción múltiple usando la clase Examen y me gustaría poder imprimir el examen sin imprimir las opciones de respuesta. Por el momento, comento manualmente todo, desde \begin{choices}hasta, \end{choices}para cada una de las preguntas. ¿Puede sugerir una forma más eficiente de hacer esto?

Aquí hay un MWE:

\documentclass[letterpaper,12pt,addpoints]{exam}
\title{MWE}
\begin{document}
\maketitle

\begin{questions}
\question What is your favorite color?
\begin{choices}
\CorrectChoice Green
\choice Yellow
\choice Red
\end{choices}
\end{questions}
\end{document}

Respuesta1

Utilice el commentpaquete:

\documentclass[letterpaper,12pt,addpoints]{exam}

\usepackage{comment}
\excludecomment{choices}

\title{MWE}
\begin{document}
\maketitle

\begin{questions}
\question What is your favorite color?
\begin{choices}
\CorrectChoice Green
\choice Yellow
\choice Red
\end{choices}
\end{questions}
\end{document}

Sólo necesita comentar la \excludecommentlínea para imprimir también las opciones.

información relacionada