Graphics, Figures & TablesUsing »graphicx« package with MiKTeX

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
theneedtoknow
Posts: 1
Joined: Wed Feb 23, 2011 2:47 am

Using »graphicx« package with MiKTeX

Post by theneedtoknow »

I want to use »graphicx« with MiKTeX (v2.8). I guess I am supposed to "install" the package in some way, but I can't seem to find where to get it / how to install it. Any recommendations? (I am a total beginner to Latex...so far I've used an online compiler which already had the »graphicx« package so I was able to use it for graphics in my paper, but now I am trying to compile with TeXworks, and when I try to call it with \usepackage{graphicx} , I get an error
"! LaTeX Error: LaTeX2e command \usepackage in LaTeX 2.09 document.


l.4 \usepackage
{graphicx}
?
"
and the compiler fails.
How do I get »graphicx« to work?

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

Using »graphicx« package with MiKTeX

Post by Montag »

If you use TeXworks, you should be able to use MikTeX's auto-installation feature without any problem.
Please click here and see under "TeXnicCenter compatibility":
Remedy: start MiKTeX Options and choose either Yes or No (but not "Ask me first") for the option "Install missing packages on-the-fly".
If this doesn't help, please post a MWE.
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Using »graphicx« package with MiKTeX

Post by localghost »

theneedtoknow wrote:[…] I get an error

Code: Select all

"! LaTeX Error: LaTeX2e command \usepackage in LaTeX 2.09 document.
        
                                
l.4 \usepackage
               {graphicx}
?
"
and the compiler fails. […]
The compiler runs in LaTeX2.09 compatibility mode since your document presumably begins as follows.

Code: Select all

\documentstyle[…]{article}
This mode does not allow to include package as you tried since packages where given as class options. Your LaTeX2e document should look at least like the below short example.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}

\begin{document}
  Hello World!
\end{document}
I recommend to do some basic reading [1]. This way you will learn how to set up a proper document for use with LaTeX2e.

[1] View topic: LaTeX Resources for Beginners

Beat regards and welcome to the board
Thorsten
Post Reply