latexpdfpages

Undefined control sequence when using \includepdf


I'm new to LaTeX. I am trying to include a PDF file using Overleaf and I don't know why I got several errors: "undefined control sequence", "PDF not found". I think I have uploaded the PDF file right, I don't know what might be the problem.

I don't know how to copy the exact text of the error so I have attached some images.

I have read some posts about updating something in MiKTeX. I don't know what MiKTeX is and I don't know if I am using it.

This is the structure of my document:

\documentclass{article}
% General document formatting
\usepackage[margin=0.7in]{geometry}
\usepackage[parfill]{parskip}
\usepackage[utf8]{inputenc}
\usepackage[final]{pdfpages}

% Related to math
\usepackage{amsmath,amssymb,amsfonts,amsthm}

\begin{document}

Name, date, Exercise X

\section*{Part a}

\section*{Part b}

\includepdf[pages=1-2]{ProblemasPNG.pdf}

\end{document}

My code

Some errors

Some more errors


Solution

  • So as hinted by @samcarter_is_at_topanswers.xyz in the comment, you named the file wrong. Though you may use \includepdf[pages=1-2]{filename.pdf}, I think its best practice to use \includepdf[pages={1-2}]{filename.pdf}. This will also allow you to skip certain pages using \includepdf[pages={1-2,5}]{filename.pdf}, thus skipping pages 3 and 4.