![在考试类别中添加图片](https://linux22.com/image/316177/%E5%9C%A8%E8%80%83%E8%AF%95%E7%B1%BB%E5%88%AB%E4%B8%AD%E6%B7%BB%E5%8A%A0%E5%9B%BE%E7%89%87.png)
我正在课堂上写作业exam
。我在添加图片时遇到了困难。有人能帮我吗?以下是我的作业。作为测试,我附上了下面的图片。
\documentclass[english, 11pt, hidelinks]{exam}
\usepackage[affil-it]{authblk}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{bigints}
\usepackage{float}
\usepackage{hyperref}
\usepackage[stable]{footmisc}
\usepackage{ulem}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{enumerate}
\usepackage{multirow}
\usepackage[round]{natbib}
\usepackage[table]{xcolor}
\definecolor{blue}{rgb}{0,0,1}
\definecolor{red}{rgb}{1,0,0}
\definecolor{light-gray}{gray}{0.5}
\printanswers
\unframedsolutions
\SolutionEmphasis{\color{blue}}
\begin{document}
\begin{questions}
\question
some text
\begin{parts}
\part Plot some graph
\begin{solution}
\begin{figure}[h]
\includegraphics[sclae=0.8]{test}
\end{figure}
\end{solution}
\end{parts}
\end{questions}
\end{document}
答案1
由于您看起来不需要(或希望)图表“浮动” - 按照 LaTeX 的词语意义 - 所以不要将指令包含\includegraphics
在figure
环境中。
\documentclass[english, 11pt, hidelinks]{exam}
\usepackage[affil-it]{authblk}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[demo]{graphicx} % remove "demo" option in real document
\usepackage{bigints}
\usepackage{float}
\usepackage[stable]{footmisc}
\usepackage{ulem}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{enumerate}
\usepackage{multirow}
\usepackage[round]{natbib}
\usepackage[table]{xcolor}
\definecolor{blue}{rgb}{0,0,1}
\definecolor{red}{rgb}{1,0,0}
\definecolor{light-gray}{gray}{0.5}
\printanswers
\unframedsolutions
\SolutionEmphasis{\color{blue}}
\usepackage{hyperref} % good idea to load this package last
\begin{document}
\begin{questions}
\question
Some text
\begin{parts}
\part Plot a graph
\begin{solution}
%\begin{figure}[h] %Don't enclose graph in a "figure" env.
\includegraphics[scale=0.8]{test}
%\end{figure}
\end{solution}
\end{parts}
\end{questions}
\end{document}