LaTeX forum ⇒ Graphics, Figures & TablesInsert a jpg image onto LaTeX.

Information and discussion about graphics, figures & tables in LaTeX documents.
Philosophaie
Posts: 17
Joined: Sat Mar 21, 2015 8:59 pm

Insert a jpg image onto LaTeX.

Postby Philosophaie » Thu Sep 10, 2015 6:05 pm

I am trying to insert a jpg image onto LaTeX.

The error code says: "Undefined Control Sequence"

  1. \begin{center}
  2. \includegraphics[scale=0.8]{C:\Users\User\Documents\Conic_Section.jpg}
  3. \caption{Conic Section}
  4. \end{center}

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 3790
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Sep 10, 2015 6:34 pm

Use forward slashes. But better not to handle absolute paths. Put the images somewhere LaTeX can find them (or make LaTeX find them).
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Philosophaie
Posts: 17
Joined: Sat Mar 21, 2015 8:59 pm

Postby Philosophaie » Thu Sep 10, 2015 6:35 pm

Added:

  1. \usepackage{graphics}


but new error
! File ended while scanning use of \Gin@iii.

and it says it is missing a "}" when before I added "\usepackage{graphics}" it was working fine.

User avatar
Johannes_B
Site Moderator
Posts: 3790
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Sep 10, 2015 7:10 pm

You need to load package graphicx instead of graphics.

But this has nothing to do with the incompatible path and is a new problem.


Another issue: You cannot use \caption inside of center. It will raise another error.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Thu Sep 10, 2015 7:46 pm

This should work (untested as I neither have the graphic file nor a Windows OS):

  1. \documentclass{article}
  2. \usepackage{graphicx}
  3. \usepackage{caption} % for \captionof
  4. % or:
  5. % \usepackage{captionof}
  6. % or a KOMA-Script class...
  7. \begin{document}
  8.  
  9. \begin{center}
  10. \includegraphics[scale=0.8]{C:/Users/User/Documents/Conic_Section.jpg}
  11. \captionof{figure}{Conic Section}
  12. \end{center}
  13.  
  14. \end{document}


Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 6 guests