我正在使用課堂寫作業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}