在考试类别中添加图片

在考试类别中添加图片

我正在课堂上写作业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 的词语意义 - 所以不要将指令包含\includegraphicsfigure环境中。

在此处输入图片描述

\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}

相关内容