2

I'm trying to format a basic circuit question, where a circuit diagram is placed to the right of the choices in a multiple choice question.

Currently, it looks like

incorrectly formatted multiple-choice question

I'm after something that looks like, e.g.

correctly formatted multiple-choice question

Unfortunately, I'm having trouble figuring out how to do this with the wrapfigure and enumerate environments. The circuit diagram is getting placed below the choices, rather than to their right. Any help would be much appreciated!

\documentclass{exam}

\usepackage{circuitikz} % for drawing circuit diagrams \usepackage{wrapfig} % for wrapfigure environment \usepackage{enumitem} % more options for enumerate command

% define enumerate command for new multiple choice question \newlist{mcquestion}{enumerate}{1} \setlist[mcquestion,1]{label={\bfseries\arabic{mcquestioni}.}, leftmargin=*, resume=mcquestion} \def\remembered[#1]{\typeout{Call #1:\arabic{mcquestioni}}}

% define enumerate command for possible choices \newlist{mchoices}{enumerate}{1} \setlist[mchoices,1]{label={\bfseries\alph.}, wide=1cm, leftmargin=}

\begin{document}

\begin{mcquestion} \item In the circuit drawn in the figure, the ammeter has no resistance, and the battery has an e.m.f.~$\varepsilon$ and an internal resistance~$r$. Which of the following is correct? \end{mcquestion}

\begin{mchoices} \item The current flowing through the ammeter is zero. \item The p.d. across the ammeter is zero. \item The potential drop \textbf{inside} the battery is zero. \item The energy dissipated in the whole circuit is zero. \end{mchoices}

\begin{wrapfigure}{R}{0.5\linewidth} \begin{circuitikz}[scale=2] \draw (0,1) to[battery, l={$\varepsilon$, r}] (1,1) (1,1) -- (1,0) (1,0) to[rmeter, t=A] (0,0) (0,0) -- (0,1) ; \end{circuitikz} \end{wrapfigure}

\end{document}

1 Answers1

1

As I commented, wrapfig and list environments do not work well together, as noted by the manual (first page):

enter image description here

Although you can help it work, I think that in this case, explicitly using a minipage is better (I changed problem, which is undefined, to mquestion):

\documentclass{exam}

\usepackage{circuitikz} % for drawing circuit diagrams \usepackage{wrapfig} % for wrapfigure environment \usepackage{enumitem} % more options for enumerate command

% define enumerate command for new multiple choice question \newlist{mquestion}{enumerate}{1} \setlist[mquestion,1]{label={\bfseries\arabic{mquestioni}.}, leftmargin=*, resume=mquestion} \def\remembered[#1]{\typeout{Call #1:\arabic{mquestioni}}}

% define enumerate command for possible choices \newlist{mchoices}{enumerate}{1} \setlist[mchoices,1]{label={\bfseries\alph.}, wide=1cm, leftmargin=}

\begin{document}

\begin{mquestion} \item In the circuit drawn in the figure, the ammeter has no resistance, and the battery has an e.m.f.~$\varepsilon$ and an internal resistance~$r$. Which of the following is correct? \end{mquestion}

\begin{minipage}[t]{0.65\linewidth} \begin{mchoices} \item The current flowing through the ammeter is zero. \item The p.d. across the ammeter is zero. \item The potential drop \textbf{inside} the battery is zero. \item The energy dissipated in the whole circuit is zero. \end{mchoices} \end{minipage}\begin{minipage}[t]{0.3\linewidth} \begin{circuitikz}[scale=2, baseline=(A.center)] \draw (0,1) to[battery, l={$\varepsilon$, r}, name=A] (1,1) (1,1) -- (1,0) (1,0) to[rmeter, t=A] (0,0) (0,0) -- (0,1) ; \end{circuitikz} \end{minipage} \end{document}

enter image description here

Notice how I fine-tuned the vertical position of the circuit with the baseline option (this is from TikZ).

Rmano
  • 40,848
  • 3
  • 64
  • 125
  • 1
    Many thanks! I've slightly adjusted the formatting for aesthetic reasons, which others may find helpful, adding \vspace{-1em} before \begin{minipage}{0.65\linewidth}\begin{mchoices} and \centering the circuit diagram. – nullgeodesic Jun 27 '23 at 04:18