
В следующем mwe я хотел бы, чтобы круговая формула Ома располагалась правее, а нижняя часть рисунка была выровнена с вариантом D вопроса 4. Я не хочу, чтобы между вопросами было пустое пространство. Перемещение команды \includegraphics
вне и внутри среды списка тоже приводит к странным вещам.
я пробовал
\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}
который я где-то нашел. Он переносит рисунок вправо, разносит вопросы, оставляя пробел слева. Я думаю, что решение — это мини-страница, но как?
Вот как это выглядит:
\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
решение1
Вы можете определить макрос следующим образом:
\newcommand\myimage[2][width=2cm]{%
\hfill\makebox[0pt][r]{\raisebox{-\height}[0pt][0pt]{\includegraphics[#1]{#2}}}
}
и используйте его как
\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}
Полный код:
\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}
В качестве примечания, пожалуйста, рассмотрите использование siunitx
пакета для единиц набора текста. Там легко набирать единицы, как \SI{1}{\ampere}
и интервалы, все правильно.