Como comentar ambientes programaticamente?

Como comentar ambientes programaticamente?

Eu escrevo exames de múltipla escolha usando a classe Exame e gostaria de poder imprimir o exame sem imprimir as opções de resposta. No momento, comento manualmente tudo de \begin{choices}até \end{choices}para cada uma das perguntas. Você pode sugerir uma maneira mais eficiente de fazer isso?

Aqui está um 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}

Responder1

Utilize o commentpacote:

\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}

Basta comentar a \excludecommentlinha para imprimir também as opções.

informação relacionada