0

I asked a question relating to this but I did not have a working example. Here is the original post is-there-a-way-to-alternate-answer-choices-based-on-the-question-number-act-st . To summarize I want to make answer choices that have a different starting number depending if the question is even or odd. I think I need to make an environment and set up conditional statements that refer to the counter of the question, but I have not found similar examples.

Thank you for reading!

\documentclass[12pt,a4paper]{report}
\pagestyle{plain}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage[shortlabels]{enumitem}
\usepackage{multicol}

\makeatletter
\newcommand{\skipitems}[1]{%
  \addtocounter{\@enumctr}{#1}%
}
\makeatother

\begin{document}

\section{Passage I}
\begin{multicols}{2}
%-----------------------------------------------------------------------------------
%Intro paragraph
Intro paragraph place holder before starting questions
%-----------------------------------------------------------------------------------

\vspace{1cm}

\begin{enumerate}
    \item Question 1
    \begin{enumerate}[A.]
        \item Choice A
        \item Choice B
        \item Choice C
        \item Choice D
    \end{enumerate}
    \item Question 2
    \begin{enumerate}[A., start = 6]
        \item Choice F
        \item Choice G
        \item Choice H
        \skipitems{1}
        \item Choice J
    \end{enumerate}
        \item Question 3
    \begin{enumerate}[A.]
        \item Choice A
        \item Choice B
        \item Choice C
        \item Choice D
    \end{enumerate}
    \item Question 4
    \begin{enumerate}[A., start = 6]
        \item Choice F
        \item Choice G
        \item Choice H
        \skipitems{1}
        \item Choice J
    \end{enumerate}

\end{enumerate}


\end{multicols}
\end{document}
  • you could have edited the existing question. If this post is essentially an extended duplicate of that, could you delete the earlier question to get it off the list of unanswered questions, thanks. – David Carlisle Sep 17 '19 at 6:49
  • Okay thank you for the clarification. I did not want to complete redo the original post, because it could make the comments invalid. I will delete the original question. – David Lord Sep 17 '19 at 19:40
0

If I understand the question correctly, something like:

\documentclass[12pt,a4paper]{report}
\pagestyle{plain}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage[shortlabels]{enumitem}
\usepackage{multicol}

\makeatletter
\newcommand{\skipitems}[1]{%
  \addtocounter{\@enumctr}{#1}%
}
\newcommand\startval{\ifodd\value{enumi} 1 \else 6 \fi}
\makeatother

\begin{document}

\section{Passage I}
\begin{multicols}{2}
%-----------------------------------------------------------------------------------
%Intro paragraph
Intro paragraph place holder before starting questions
%-----------------------------------------------------------------------------------

\vspace{1cm}

\begin{enumerate}
    \item Question 1
    \begin{enumerate}[A., start=\startval]
        \item Choice A
        \item Choice B
        \item Choice C
        \item Choice D
    \end{enumerate}
    \item Question 2
    \begin{enumerate}[A., start=\startval]
        \item Choice F
        \item Choice G
        \item Choice H
        \skipitems{1}
        \item Choice J
    \end{enumerate}
        \item Question 3
    \begin{enumerate}[A., start=\startval]
        \item Choice A
        \item Choice B
        \item Choice C
        \item Choice D
    \end{enumerate}
    \item Question 4
    \begin{enumerate}[A., start=\startval]
        \item Choice F
        \item Choice G
        \item Choice H
        \skipitems{1}
        \item Choice J
    \end{enumerate}

\end{enumerate}


\end{multicols}
\end{document}
  • David, thank you for your response. My startval command does not alternate answer choices, so I think there is an issue with using the enumctr. My hypothesis is that enumctr is 0, since it is the beginning of the enumerate. Would it be possible to edit your command, to have it based on the first level enumerator? Something like \newcommand\startval{\ifodd\value\@enumi 1 \else 6 \fi} I tried this, but it results in undefined control sequence error. – David Lord Sep 17 '19 at 20:36
  • @DavidLord the example document as posted in this answer alternates doesn't it? – David Carlisle Sep 17 '19 at 20:40
  • Yay! I got it! I changed it to \newcommand\startval{\ifodd\value{enumi} 1 \else 6 \fi} and that works as I hope it would. Thank you! – David Lord Sep 17 '19 at 20:41
  • To answer your question, it did not alternate in my document. It made the Choices all start with F whether the question number was even or odd. – David Lord Sep 17 '19 at 20:44
  • @DavidLord sorry last minute change broke it, I fixed the post to match your comment above. – David Carlisle Sep 17 '19 at 21:02

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.