Diferentes símbolos de itens em uma única lista

Diferentes símbolos de itens em uma única lista

Quero esta lista enumerada para as seguintes coisas:

  1. Apenas as questões são rotuladas por (a), (b), (c). As respostas não devem ser rotuladas.
  2. Estas seis linhas devem aparecer uma por uma. A princípio, apenas a primeira pergunta é mostrada, seguida de sua resposta após pressionar a próxima página. Depois a segunda pergunta, depois a segunda resposta,...

    \documentclass[]{beamer}
    
    \begin{document}
    
    \begin{frame}
    \frametitle{Example}
    \begin{enumerate}[(a)]
    \item<1-> Q: what is the answer to the first question?
    \item<2-> A: The answer is A.
    \item<3-> Q: what is the answer to the second question?
    \item<4-> A: The answer is B.
    \item<5-> Q: what is the answer to the second question?
    \item<6-> A: The answer is C.
    \end{enumerate}
    \end{frame}
    
    \end{document}
    

insira a descrição da imagem aqui

Responder1

Uma possibilidade é criar um itemcomando vazio personalizado:

\documentclass[]{beamer}

\newcommand{\answer}{\item[]} %new code
\begin{document} 

\begin{frame}
\frametitle{Example}
 \begin{enumerate}[<+->][(a)]    %new code          
  \item Q: what is the answer to the first question?
  \answer A: The answer is A.
  \item Q: what is the answer to the second question?
  \answer A: The answer is B.
  \item Q: what is the answer to the second question?
  \answer A: The answer is C.
\end{enumerate}
\end{frame}

\end{document}

Também removi as especificações de sobreposição individuais e adicionei um +-operador que afeta toda a lista.

insira a descrição da imagem aqui


Conforme observado nos comentários de @moewe, o código pode se tornar mais compacto adicionando os elementos reutilizados às definições dos itens personalizados:

\documentclass[]{beamer}

\newcommand{\answer}[1]{\item[] A: The answer is #1.}  %new code
\newcommand{\question}{\item Q:}   %new code
\begin{document}

\begin{frame}
\frametitle{Example}
 \begin{enumerate}[<+->][(a)]               
  \question what is the answer to the first question?
  \answer{A}
  \question what is the answer to the second question?
  \answer{B}
  \question what is the answer to the second question?
  \answer{C}
\end{enumerate}
\end{frame}

\end{document}

O resultado é o mesmo de antes. Não estou fazendo o mesmo com as partes "qual é a resposta para ..." porque suspeito que elas estejam lá apenas por causa do MWE

Responder2

Basta usar []para especificar rótulos de itens vazios. Definitivamente, você também pode definir suas próprias macros para itens como este.

\documentclass[]{beamer}

\begin{document}

\begin{frame}
\frametitle{Example}
 \begin{enumerate}[(a)]
  \item<1-> Q: what is the answer to the first question?
  \item[]<2-> A: The answer is A.
  \item<3-> Q: what is the answer to the second question?
  \item[]<4-> A: The answer is B.
  \item<5-> Q: what is the answer to the second question?
  \item[]<6-> A: The answer is C.
\end{enumerate}
\end{frame}

\end{document}

informação relacionada