5

I am using the beamer package and I am writing a lot of questions. I am answering each question and each question is enumerated, so when I add another question, I need to put the number manually. Each question has its answer and at some point in the future it has to have its medium-sized comment. Bear in mind that I want to add any question without worrying about the order of the questions and without changing the number, just like when I add a equation anywhere in my document and latex enumerates it without problem. I don't know if it is worth using the enumerate package (there are many questions) o if there is a trick (maybe a counter). How do I solve this?

Edit: My code is:

\documentclass[]{beamer}

\mode<presentation>{
\usetheme{Madrid}
\setbeamertemplate{navigation symbols}{} 
}

\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
\usepackage[utf8]{inputenc}
\title[]{Actividad de la novena}
\date{Diciembre 22 de 2014} % Date, can be changed to a custom date

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}
    \begin{block}{}
    1. Por primera vez en la historia de la humanidad, un módulo de aterrizaje aterriza     en un cometa para estudiarlo. ¿Cuándo ocurrió este hecho?
    \end{block}

    \begin{enumerate}[a)]
        \item El 5 de noviembre.
        \item El 12 de noviembre.
        \item El 29 de octubre.
        \item El 25 de octubre
    \end{enumerate}
\end{frame}

\begin{frame}
\begin{block}{}
2. Dicho módulo de aterrizaje no iba solo, él se desprendió de una sonda espacial     que lo acompañaba. ¿Cuáles son los nombres del módulo y de la sonda?
\end{block}

\begin{enumerate}[a)]
    \item Philae y Orión. 
    \item Orión y Rosetta.
    \item Philae y Rosetta.
    \item Orión y Lutecia.
\end{enumerate}

 \end{frame}

\begin{frame}
\begin{block}{}
3. ¿Cuándo ocurrió la segunda vuelta presidencial?
\end{block}
\end{frame}

\begin{frame}
\begin{block}{}
4. Si solo tomamos en cuenta listas abiertas, ¿cuál fue el segundo senador con más     votos en el país?
\end{block}

\begin{enumerate}[a)]
    \item Musa Besaile. 
    \item Horacio Serpa.
    \item Jorge Enrique Robledo.
    \item Bernando Elías.
\end{enumerate}
\end{frame}

\end{document}
  • It would be really great if you could show us an example of your setup. This way we can see what you use for a question and an answer. It will aid in providing you with a better solution to your current situation. – Werner Dec 21 '14 at 7:06
  • It's not clear to me what you want to achieve with regard to the questions' numbers. Would you like to questions to be numbered automatically and consecutively? – Mico Dec 21 '14 at 8:18
7

Here is a simple solution using a new question counter.

\documentclass{beamer}
\newcounter{question}
\newcommand\question[1]{\stepcounter{question}Q.~\arabic{question} -- #1}

\begin{document}
\begin{frame}
  \frametitle{Frame one}
  \question{Where is my first question?}

  \question{What is my second question?}
\end{frame}

\begin{frame}
  \frametitle{Frame two}

  \question{Who is my third question?}

  \question{When is my fourth question?}
\end{frame}
\end{document}

If your document requires labeled questions (and cross-referenced via \ref), you may use \refstepcounter instead of \stepcounter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.