3

I want to include a graphics called quadratic.pdf in my LaTeX document, which only contains the image show below.

While compiling, I get the following errors:

Line 1: Fatal Error No output file produced 

Line 5: !LaTeX error. File: 'quadratic.pdf.sty' not found. 

Where am I going wrong?

Quadratic.pdf

\documentclass[oneside]{book}

\usepackage{graphicx}
\usepackage{quadratic.pdf}

\begin{document}

\chapter*{Basic Graphics}

\begin{figure}[h]
\centering
\includegraphics[width=0.5\linewidth]{quadratic}
\caption{The graphics file named \texttt{quadratic}.}
\end{figure}

\end{document}
jub0bs
  • 58,916
  • 1
    Remove \usepackage{quadratic.pdf} (\usepackage is a macro for loading LaTeX packages, not for inserting images) and make sure quadratic.pdf is the same folder as your tex file. – jub0bs Feb 21 '14 at 11:38
  • Thank you @jubobs it works.. Yayyy !! :) Daleif the pdf was on desktop and .tex in another folder. I didn't knew. Thanks Anyways :) – meowthecat Feb 21 '14 at 11:44
  • @Abi Cool. To keep things tidy, you may also want to store your graphics in some subfolder (e.g. ./graphics/) of the folder containing your tex file. Look up \graphicspath for that. – jub0bs Feb 21 '14 at 11:46

1 Answers1

3

Too long as a comment.

\documentclass[oneside]{book}

\usepackage{graphicx}
%\graphicspath{{./}{./SubdirOne/}{./SubdirTwo/}<... more items here ...>{./SubdirOne/SubsubdirOne/}}
\graphicspath{{./}{./SubdirOne/}{./SubdirTwo/}}

\begin{document}

\chapter*{Basic Graphics}

\begin{figure}[h]
\centering
\includegraphics[width=0.5\linewidth]{quadratic}
\caption{The graphics file named \texttt{quadratic}.}
\end{figure}

\end{document}
jub0bs
  • 58,916