## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Inserting a PDF file into Exam class

Information and discussion about graphics, figures & tables in LaTeX documents.
megatunnage
Posts: 1
Joined: Mon Mar 06, 2017 11:45 pm

### Inserting a PDF file into Exam class

Hi, I'm writing a quiz using the Exam class, and I want to insert a pdf of a vector field. The file is called 'vfield1' and it's located in the same directory as my tex file. I'm using WinEdt 8.1 and compiling with the 'PDFTexify' button.

However, I keep getting the error message, "Package pdftex.def Error: File 'vfield1.pdf' not found." Here's the code that I have:

\documentclass[addpoints, 12pt]{exam}\usepackage{amsmath}\usepackage[utf8]{inputenc}\usepackage{graphicx}\pagestyle{headandfoot} \firstpageheader{Name:}{Quiz 8}{Tues 7-Mar-2017}\extrafootheight{-3in} \begin{document} \begin{center}\vspace{0.2in}\fbox{\parbox{6in}{\centering    To receive full and partial credit, ALL work must be shown. }}\end{center} \begin{questions}\question Determine and justify which differential equation matches the following direction field: \includegraphics{vfield1.pdf}\end{questions} \end{document}

What's interesting is that if I use the Article class, I don't get any errors and it compiles fine:

\documentclass{article}\usepackage{amsmath}\usepackage{graphicx} \begin{document} \includegraphics{vfield1.pdf} \end{document}

Any ideas what's causing the problem in the Exam class code?

Tags:

Stefan Kottwitz
Posts: 9568
Joined: Mon Mar 10, 2008 9:44 pm
Welcome to the forum!

That's actually strange, because it writes pdfTeX is used but cannot read PDF. Are you really sure that the main document is in the same folder as the pdf image? I sometimes think I'm working in a folder but the document I'm working on was saved to another place. Perhaps explicitly save again to that folder with another name.

Please post the .log file of the compiler run here, as attachment.

Stefan