0

Consider the following code:

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

When I execute this code by clicking "QuickBuild" in TeX editor I get the following errors:

  1. ! Undefined control sequence.
  2. ! Missing number treated as zero.
  3. ! Illegal unit of measure (pt inserted).

A rough sketch of my entire code is given for reference:

\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}
2
  • 2
    Try adding \usepackage{graphicx} to your preamble. The command \includegraphics is part of the graphicx package.
    – Christian
    Sep 25, 2016 at 10:56
  • @Christian thank you so much! It worked. Please write this as an answer so that I can accept it.
    – Student
    Sep 25, 2016 at 11:02

1 Answer 1

6

The problem in your code is that your are using the \includegraphics command without loading a package where it is defined. This is what the error message

Undefined control sequence.
<argument> \includegraphics 
                            [trim=2 0 0 0,width=\textwidth ]{algorithm.jpg}
l.39 ...=2 0 0 0,width=\textwidth]{algorithm.jpg}}

means. The solution is to load the package graphicx which contains a definition of \includegraphics. You do this by adding \usepackage{graphicx} to the preamble of your document.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .