Graphics, Figures & TablesPackage graphic{s,x}

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
dieinfolk
Posts: 12
Joined: Sun Sep 30, 2012 11:26 pm

Package graphic{s,x}

Post by dieinfolk »

Hello,

I want to insert a picture in my article.

Packages used:
(no dvips)

Code: Select all

\usepackage{latexsym}
\usepackage[empty]{fullpage}
\usepackage[usenames,dvipsnames]{color}
\usepackage{verbatim}
\usepackage{lmodern}
\usepackage{fontenc}
\usepackage{textcomp}
\usepackage{listings}
\usepackage{color}
\usepackage[usenames]{color}
\usepackage{enumitem}
\usepackage{amsfonts}
\usepackage{setspace}
\usepackage[pdftex]{hyperref}
\usepackage{epstopdf}
\usepackage[pdftex]{graphicx}
\usepackage{graphicx}
and including my picture:

Code: Select all

\begin{figure}h
\includegraphics[width=1cm]{images/picture.eps}
\end{figure}
Detailed errors in logs:
- Package epstopdf Warning: No graphics package `graphic{s,x}' loaded.
- ! LaTeX Error: Unknown graphics extension: .eps.

Using this directory: /usr/local/texlive/

I've tried with .png, but i got an error as well.

Is there any incompatibility? is there any wrong package? is there something missing?

Thanks a lot in advance,
dieinfolk

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Package graphic{s,x}

Post by cgnieder »

There are a few points you should consider:
  • it's probably better not to specify the driver for graphicx and hyperref. They're doing quite a good job detecting it themselves.
  • unless you need to do otherwise you should load hyperref as late as possible. It is best to load it as the last package unless you know of some conflict where the order should be reversed.
  • you're loading graphicx twice. There is no need to.
  • epstopdf probably needs to be loaded after graphicx. This is probably the cause for your problems.

Code: Select all

\usepackage{graphicx}
\usepackage{epstopdf}
...
\usepackage{hyperref}
Regards
site moderator & package author
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

Package graphic{s,x}

Post by nlct »

Code: Select all

\includegraphics[width=1cm]{images/picture.eps}
I think you also may need to omit the file extension:

Code: Select all

\includegraphics[width=1cm]{images/picture}
Regards
Nicola Talbot
dieinfolk
Posts: 12
Joined: Sun Sep 30, 2012 11:26 pm

Re: Package graphic{s,x}

Post by dieinfolk »

@cgnieder: you were totally right, with the order :)
@nlct: for me it's working both, with and without the extension

Thank you so much!
Post Reply