LaTeX forum ⇒ Graphics, Figures & TablesInserting 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

Postby megatunnage » Mon Mar 06, 2017 11:56 pm

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:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[addpoints, 12pt]{exam}
  2. \usepackage{amsmath}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{graphicx}
  5. \pagestyle{headandfoot}
  6.  
  7. \firstpageheader{Name:}{Quiz 8}{Tues 7-Mar-2017}
  8. \extrafootheight{-3in}
  9.  
  10. \begin{document}
  11.  
  12. \begin{center}
  13. \vspace{0.2in}
  14. \fbox{
  15. \parbox{6in}
  16. {\centering
  17. To receive full and partial credit, ALL work must be shown. }}
  18. \end{center}
  19.  
  20. \begin{questions}
  21. \question
  22. Determine and justify which differential equation matches the following direction field:
  23. \includegraphics{vfield1.pdf}
  24. \end{questions}
  25.  
  26. \end{document}


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

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass{article}
  2. \usepackage{amsmath}
  3. \usepackage{graphicx}
  4.  
  5. \begin{document}
  6.  
  7. \includegraphics{vfield1.pdf}
  8.  
  9. \end{document}


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

Thank you for your help

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 9444
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Tue Mar 07, 2017 7:52 am

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
Site admin


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 3 guests