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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.