[Tex/LaTex] Import pdf image into LaTeX file

graphicsimportpdf

I am trying to insert some ready image-pdf files to my LaTeX code but failed.
My code is

\documentclass[a4paper,12pt]{book}
\usepackage{graphicx}
\graphicspath{{/Cathay/Desktop/build/Cathay1/}{C:\Users}}
\begin{figure}
\centering
\includegraphics[height=5cm]{Cathay1.pdf}
\caption{text}
\end{figure}
\end{document}

The pic didn't show up after I put this code. Instead, the text follows this code just disappeared.
Could anyone tell me the right code for inserting this pdf?

Best Answer

  • In command \graphicspath{}, you must use slash (/) instead of backslash (\) to list directories. In your case, \graphicspath{{/Cathay/Desktop/build/Cathay1/}{C:/Users/}} is right.
  • You forget the \begin{document} command.
  • We need to know the ERROR you have just got, in order to understand what happened on your system more clearly.