
다음 mwe에서는 원형 옴 공식 수치를 오른쪽에 더 배치하고 그림의 하단을 질문 4의 선택 D와 정렬하고 싶습니다. 질문 사이에 공백이 있는 것을 원하지 않습니다. 목록 환경 없이 또는 목록 환경 내에서 명령 을 이동하면 \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}
내가 어딘가에서 발견한 것. 그림을 오른쪽으로 가져오고 질문 사이에 간격을 두고 왼쪽에 공백을 남겨 둡니다. 나는 해결책이 미니페이지라고 생각하는데, 어떻게?
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
답변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}
간격도 모두 정확합니다.