
No exemplo a seguir, gostaria que a figura da fórmula do ohm circular fosse posicionada mais à direita e a parte inferior da figura alinhada com a opção D da pergunta 4. Não quero o espaço em branco entre as perguntas. Mover o \includegraphics
comando sem e dentro do ambiente de lista também causa coisas estranhas.
eu tentei
\newlength{\oldparindent} \setlength{\oldparindent}{\parindent}% Save \parindent
\setbox0=\hbox{\includegraphics[width=0.17\textwidth]{ohm_law}}% Original image
\noindent\begin{minipage}[t]{0.6\textwidth}
\end{minipage}\hfill
\begin{minipage}[t]{0.17\textwidth}
\raisebox{-\ht0}{\usebox0}% Insert image
\end{minipage}
que encontrei em algum lugar. Traz a figura para a direita, espaça as questões, deixando espaços em branco à esquerda. Acredito que a solução seja minipágina, mas como?
Aqui está o mwe:
\documentclass[12pt,letterpaper,addpoints]{exam}
\usepackage{geometry}
\usepackage{float}
%\usepackage[scaled=1.05,proportional,lightcondensed]{zlmtt}
\usepackage{graphicx} %needed to include pictures (png)
\usepackage{tabularx}%\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{inconsolata}
\renewcommand*\familydefault{\ttdefault} %% Only if the base font of the document is to be typewriter style
\extraheadheight[-1.25in]{-0.25in}
\extrafootheight{-1in}
\begin{document}
%\printanswers %uncomment and re-compile to print answer key
\pagestyle{headandfoot}
\runningheadrule
\lhead{}
\chead[]{Electrical Systems 20 Exam(continued)}
\rhead{}
\title{Electrical Systems 20 \\\textsc{Exam}}
\date{}
\maketitle
\textsc{NAME}\enspace\makebox[3in]{\hrulefill}
\textsc{DATE}\enspace\makebox[1.5in]{\hrulefill}
\fullwidth{}
\vspace{0.1in}
%\fullwidth{\large \textbf{1) Multiple Choices}}
\begin{center}
\fbox{\fbox{\parbox{5.5in}{\centering
\textsc {Choose the \emph{most correct} answer from the choices given.}}}}
\end{center}
\vspace{0.1in}
\begin{questions}
\boxedpoints
\pointsinrightmargin
\question[1]Automotive wiring diagrams include
\begin{choices}
\choice A series of colour coded diagrams
\choice Specific symbols to identify components
\choice Wire gauge sizes
\correctchoice All of the above
\end{choices}
\question[1]When soldering an electrical connection, use
\begin{choices}
\choice Acid core flux
\correctchoice Rosin core flux
\choice A or B
\choice Neither A or B
\end{choices}
\question[1]An electrical component that allows current to flow in one
direction only is called
\begin{choices}
\choice Watt
\choice Anode
\choice Cathode
\CorrectChoice Diode
\end{choices}
\question[1]Ohm's law states that
\includegraphics[width=2.0cm]{ohm_law} %started with this
\begin{choices}
\choice $1\ volt = 1\ amp \times 1 \Omega$
\choice $1\ amp = \frac{1\ volt}{1 \Omega}$
\choice $1 \Omega = \frac{1\ volt}{1\ amp}$
\CorrectChoice All of the above are true.
\end{choices}
\question[1] In a parallel circuit,
\begin{choices}
\choice the voltage is the same throughout the circuit, but the
current is divided.
\choice The total circuit resistance is always less than the smallest
resistor in the circuit.
\choice there is more than one path for current to flow.
\CorrectChoice All of the above are true.
\end{choices}
\question[1] An electronic device which acts like a high speed switch
is a
\begin{choices}
\choice triode
\choice diode
\choice monode
\correctchoice transistor
\end{choices}
\end{questions}
\end{document} here
Responder1
Você pode definir uma macro como:
\newcommand\myimage[2][width=2cm]{%
\hfill\makebox[0pt][r]{\raisebox{-\height}[0pt][0pt]{\includegraphics[#1]{#2}}}
}
e use-o como
\question[1]Ohm's law states that\myimage[width=3cm]{example-image}
\begin{choices}
\choice $1\ volt = 1\ amp \times 1 \Omega$
\choice $1\ amp = \frac{1\ volt}{1 \Omega}$
\choice $1 \Omega = \frac{1\ volt}{1\ amp}$
\CorrectChoice All of the above are true.
\end{choices}
Código completo:
\documentclass[12pt,letterpaper,addpoints]{exam}
\usepackage{geometry}
\usepackage{float}
%\usepackage[scaled=1.05,proportional,lightcondensed]{zlmtt}
\usepackage{graphicx} %needed to include pictures (png)
\usepackage{tabularx}%\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{inconsolata}
\renewcommand*\familydefault{\ttdefault} %% Only if the base font of the document is to be typewriter style
\extraheadheight[-1.25in]{-0.25in}
\extrafootheight{-1in}
\newcommand\myimage[2][width=2cm]{%
\hfill\makebox[0pt][r]{\raisebox{-\height}[0pt][0pt]{\includegraphics[#1]{#2}}}
}
\begin{document}
%\printanswers %uncomment and re-compile to print answer key
\pagestyle{headandfoot}
\runningheadrule
\lhead{}
\chead[]{Electrical Systems 20 Exam(continued)}
\rhead{}
\title{Electrical Systems 20 \\\textsc{Exam}}
\date{}
\maketitle
\textsc{NAME}\enspace\makebox[3in]{\hrulefill}
\textsc{DATE}\enspace\makebox[1.5in]{\hrulefill}
\fullwidth{}
\vspace{0.1in}
%\fullwidth{\large \textbf{1) Multiple Choices}}
\begin{center}
\fbox{\fbox{\parbox{5.5in}{\centering
\textsc {Choose the \emph{most correct} answer from the choices given.}}}}
\end{center}
\vspace{0.1in}
\begin{questions}
\boxedpoints
\pointsinrightmargin
\question[1]Automotive wiring diagrams include
\begin{choices}
\choice A series of colour coded diagrams
\choice Specific symbols to identify components
\choice Wire gauge sizes
\correctchoice All of the above
\end{choices}
\question[1]When soldering an electrical connection, use
\begin{choices}
\choice Acid core flux
\correctchoice Rosin core flux
\choice A or B
\choice Neither A or B
\end{choices}
\question[1]An electrical component that allows current to flow in one
direction only is called
\begin{choices}
\choice Watt
\choice Anode
\choice Cathode
\CorrectChoice Diode
\end{choices}
\question[1]Ohm's law states that\myimage[width=3cm]{example-image}
%\hfill\makebox[0pt][r]{\raisebox{-\height}[0pt][0pt]{\includegraphics[width=3.0cm]{example-image}}} %started with this}
\begin{choices}
\choice $1\ volt = 1\ amp \times 1 \Omega$
\choice $1\ amp = \frac{1\ volt}{1 \Omega}$
\choice $1 \Omega = \frac{1\ volt}{1\ amp}$
\CorrectChoice All of the above are true.
\end{choices}
\question[1] In a parallel circuit,
\begin{choices}
\choice the voltage is the same throughout the circuit, but the
current is divided.
\choice The total circuit resistance is always less than the smallest
resistor in the circuit.
\choice there is more than one path for current to flow.
\CorrectChoice All of the above are true.
\end{choices}
\question[1] An electronic device which acts like a high speed switch
is a
\begin{choices}
\choice triode
\choice diode
\choice monode
\correctchoice transistor
\end{choices}
\end{questions}
\end{document}
Como observação lateral, considere usar siunitx
o pacote para unidades de configuração de tipo. É fácil digitar unidades como \SI{1}{\ampere}
e o espaçamento está correto.