Graphics, Figures & Tables%\usepackage[pdftex]{graphicx}

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
diskhub
Posts: 11
Joined: Mon May 10, 2010 3:22 pm

%\usepackage[pdftex]{graphicx}

Post by diskhub »

\documentclass[a4paper,11pt]{article}
\usepackage{multicol}
\usepackage{iasted}
\usepackage{url}
%\usepackage[pdftex]{graphicx}
\usepackage{graphicx}
\input epsf
\setlength{\textheight}{25.4cm}
\setlength{\textwidth}{7in}
\setlength{\topmargin}{-0.2cm}
\setlength{\columnsep}{0.5in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\parindent}{1pc}
\setlength{\oddsidemargin}{-0.33in}


hi all i have used the above package... in the beginning, i was using pdflatex to insert graphics like the following code.
\includegraphics[scale=0.48]{diagram1-1.png}

but i was told that i have to compile in 'latex' command on linux which prompts me error.
! Package pdftex.def Error: PDF mode expected, but DVI mode detected!....

that's why i commented the package for pdftex but another error comes out.
! LaTeX Error: Cannot determine size of graphic in diagram1-1.png (no BoundingB


in fact, my problem right now is that i need to use latex command in linux but i do not have that os on my machine. Hence, i downloaded milktex which is not a standard on linux.

Can someone guide me on how i can format my code to insert graphics on a normal linux machine assuming i can only use latex command

Thanks alot

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

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

%\usepackage[pdftex]{graphicx}

Post by josephwright »

First, you should leave graphicx to determine the type of output for itself:

Code: Select all

\usepackage{graphicx}
Second, you should not include the extension for graphics files

Code: Select all

\includegraphics[scale=0.48]{diagram1-1}
as the extension will be different for DVI and PDF output. You don't say which Linux or TeX distribution you use, but modern systems all include pdfTeX, so you can use either "latex" or "pdflatex". As your graphic is in PNG format, why are you not sticking to pdflatex?
Joseph Wright
Post Reply