考虑以下代码:
\begin{figure}[hbtp]
\centering
\fbox{\includegraphics[trim=2 0 0 0,width=\textwidth]{"Main Picture".jpg}}
\caption{Geometric Setup used for the proof of Theorem 1}
\end{figure}
当我通过单击 TeX 编辑器中的“QuickBuild”执行此代码时,出现以下错误:
- ! 未定义的控制序列。
- !缺失数字视为零。
- ! 非法计量单位(插入 pt)。
我给出了整个代码的草图,供参考:
\documentclass[10 pt,a4paper,twoside,reqno]{amsart}
\usepackage{amsfonts,amssymb,amscd,amsmath,enumerate,verbatim,calc}
\renewcommand{\baselinestretch}{1.2}
\textwidth = 12.5 cm
\textheight = 20 cm
\topmargin = 0.5 cm
\oddsidemargin = 1 cm
\evensidemargin = 1 cm
\pagestyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{definition}{Definition}
\begin{document}
\begin{titlepage}
\vfill
\centering
{\Huge On the Reflection Property of a Pararbolid}\\[1cm]
{\Large Shrey Aryan}\\[0.6cm]
XYZ University, ABC Country
Email:[email protected]
\vfill
\end{titlepage}
\section{abstract}
Some Text....
\section{Introduction}
Some Text.....
\section{Preliminary}
Some Text.....
\begin{figure}[hbtp]
\centering
\fbox{\includegraphics[trim=2 0 0 0,width=\textwidth]{"Main Picture".jpg}}
\caption{Geometric Setup used for the proof of Theorem 1}
\end{figure}
\section{Main Result}
Some Text....
section{References}
Some Text....
\end{document}
答案1
代码中的问题在于,你使用该\includegraphics
命令时没有加载定义该命令的包。以下是错误消息
Undefined control sequence.
<argument> \includegraphics
[trim=2 0 0 0,width=\textwidth ]{algorithm.jpg}
l.39 ...=2 0 0 0,width=\textwidth]{algorithm.jpg}}
意思是。解决方案是加载graphicx
包含 定义的包。您可以通过将其添加到文档的序言中\includegraphics
来实现这一点。\usepackage{graphicx}