Talk:LaTeX/Importing Graphics

Graphics storage
should be under Windows (XP) with a double dot to work properly: --Escalator (discuss • contribs) 15:57, 5 March 2012 (UTC)


 * I do not use Windows so I can't check, but aren't you working with an 'images' folder located in the parent folder, hence the double points? --Ambrevar (discuss • contribs) 12:41, 13 January 2013 (UTC)

Sam2p - a better graphics file converter than ImageMagic
I have struggled for some time with ImageMagic to get correct bounding-boxes in .eps graphics files (converted from .jpg, .png, .pdf format).

Generally speaking I found it unsatisfactory, so I searched for an alternative and finally found Sam2p (see http://www.inf.bme.hu/~pts/sam2p/). After using it for some months I was so impressed by its quality that I have come to use it exclusively instead of ImageMagic.

Like ImageMagic, Sam2P is a commandline program and Open Source. It is more recent than ImageMagic however and seems to boast a number of improvements over ImageMagic (other than finding bounding boxes) which are listed on its website. Highly recommended.


 * Link and recommendations added by someone. --Ambrevar (discuss • contribs) 12:41, 13 January 2013 (UTC)

Bug in file extension in graphicx package
Adding a figure with in this format : [filename.eps] produces an error : "Unknown graphics extension .eps".

However removing the extension from the parameter solves the problem.

So, the correct format : [filename].


 * Yes, seems to be a bug for .eps files, but I'm not sure. Anyway, it works flawlessly without extension. This detail has been added to the chapter. --Ambrevar (discuss • contribs) 12:41, 13 January 2013 (UTC)

eps - what about using pdflatex
indeed, ".eps" extension is not needed in modern implementations of (la)tex, at least not in tetex. An extra advantage is that if you also have a pdf-version of the picture, then it will automatically be picked up, instead of eps-version, when you run pdflatex

In the list of software producing EPS graphics, it is worth mentioning IDL, Matlab and Mathematica, used by many scientists.

At least since version 2010.20288-1, pdflatex natively handles EPS files by converting them to pdf.

-- Karper (discuss • contribs) 20:38, 27 January 2011 (UTC)


 * I updated the part about EPS support for pdflatex. I do not know enough about IDL, Matlab not Mathematica, but feel free to contribute! --Ambrevar (discuss • contribs) 12:41, 13 January 2013 (UTC)

Creating vector graphics natively in LaTeX
LaTeX has some primitive line drawing functions in the picture environment that can be used to create graphics. Although it's quite simple and probably not so useful anymore, an extension of it called Portable Graphics Format (PGF) and TikZ is really useful and amazingly extensible. I think it should be placed after Inkscape. (I just saw that there is an entire page called Creating Graphics, so this should definitely go into that page) --Cengique (talk) 18:37, 10 March 2009 (UTC)
 * The whole section of creating graphics should be moved to the chapter about this subject. I'm no native English speaker so I prefer someone else doing it.--Sanderd17 (talk) 14:09, 23 January 2010 (UTC)


 * I moved the TikZ stuff to its dedicated chapter. I've put some references to the 'Creating Graphics' part. --Ambrevar (discuss • contribs) 12:41, 13 January 2013 (UTC)

Examples do not work
Examples on this page do not work. LaTex keeps complaining Cannot determine size of graohic, or, no bounding box.

None of the given examples actually do something usefull. This page is a waste of time.
 * You do have to place the pictures with the exact same name (LaTeX is capital sensitive) in a directory where LaTeX searches (in jou directory where the .tex file is is a good option). Also be sure you have a good format. You may have renamed a .gif image to a .jpg but that doesn't make it readable for LaTeX.--Sanderd17 (talk) 14:06, 23 January 2010 (UTC)

Draft document option
LaTeX/Importing_Graphics In this subsection there is said that the default is draft. But when you compile your doc without draft, the figures are included and with draft only the name is shown. Am I wrong if I say the default isn't draft but final?--Sanderd17 (talk) 16:19, 20 January 2010 (UTC)


 * Fixed by someone. --Ambrevar (discuss • contribs) 12:41, 13 January 2013 (UTC)

Images as Figures
The images as figures section sounded like two guys having an editting war. I think that both people had a point; images are not figures, definately, but the figures page (http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions#Figures) jumps straight into more complex figure usage. I thought that a bare-minimum example was needed, so provided two; one that's almost completely useless, and a slightly longer one which provides a basic 'all you need' example for using figures and images. I think this is a much better way to present the concept than pushing people towards a more advanced topic, as most people who come looking for how to insert images are most likely looking for a figure & image example to copy/paste into their documents. The above comment was added by 130.209.6.40 at 19:13:23 2010-07-08
 * Yeah, this book needs more cross-referencing, and as is evident on the main page, many chapters are far from finished. Anyway, good edit, if you find any similar problems in other chapters feel free to correct them. Tomato86 (talk) 20:54, 8 July 2010 (UTC)


 * I worked out duplicates and cross-referencing for this chapter (as well as for lots of chapters actually). I removed the wrapfig example, replacing it by a link to the Figure chapter. --Ambrevar (discuss • contribs) 12:41, 13 January 2013 (UTC)

Process LaTeX article that use png or jpg image files to eps ones ...
I have created with some days of effort this script in order to convert a LaTeX using jpg files to one using eps. All is done automatic. The new source folder is ready to be compiled using latex instead of pdflatex. I did this for my self use in order to save many effort, specially looking for the included images through a complex images folder tree and calculating for each one its final dimension in "cm" in order to be converted to eps and able to be used for proffesional publication or by editors.

Process latex article%20JPG%202%20EPS%20Automatic

It is released with GPL licence.

If this is not the better place to this free tool, please tell me where to publish it in case it is usefull.

Regards. --Gengiskanhg (discuss • contribs) 21:01, 10 May 2011 (UTC)

Error in "trim" documentation
The article describes syntax for the trim option to \includegraphics as "trim=t l b r". I believe it should be "trim=l b r t". I am using pdflatex v. 3.1415926-1.40.11 (TeX Live 2010). --144.02.110.145 (discuss) 03:36, 11 May 2012‎ (UTC)
 * Hi, I just checked the grfguide.pdf from CTAN and it seems you are right. This has been changed yesterday by an anonymous user, it originally was as you say. I undid this change. Thanks. -- XonqNopp Tk 05:54, 11 May 2012 (UTC)
 * (Please remember to sign your posts on talk pages with ~ Thanks.)


 * After the rewrite, the trim option is no longer mentioned at all... Pipping (discuss • contribs) 11:14, 17 April 2017 (UTC)

Rewrite needed
As many other pages/chapters in this wikibook, much of the information is old and partially obsolete. A user of todays LaTeX doesn; t have to think about most of the stuff that is said as relevant. Starting a rewrite now. --Johannes Bo (discuss • contribs) 10:13, 16 October 2016 (UTC)


 * One thing that should be changed when someone re-writes this: There's a contradiction about preferred formats. Up near the top (sxn entitled "Raster graphics vs. vector graphics") it says, "you should always prefer PDF or EPS to PNG or JPG."  Further down (sxn entitled "Compiling with pdflatex"), it says that JPG is "the best choice if you want to insert photos", and PNG is "the best choice for diagrams", while PDF is "not recommended" for some types of images.  I suspect also that some readers will be confused by the distinction in the discussion of "Supported image formats" between "latex" and "pdflatex", especially since on some installations they may be the same program.  (On our Linux installation of TeXLive 2016, both 'latex' and 'pdflatex' are symbolic links to 'pdftex'.)  Finally, xe(la)tex and other "*tex"s should probably be mentioned--I thought XeLaTeX had some limitations, although I can't find anything to that effect now.  BTW, I would write some of this, but I don't consider myself knowledgeable enough. Mcswell (discuss • contribs) 20:08, 4 February 2017 (UTC)


 * True,  and   run the very same program, but in different modes. So there is a cear distiction (altough the user doesn't notice it with pdflatex and a modern setup as all eps file are converted in the backround). In  -mode, you cannot have jpg or png or pdf, it really just supports eps files. XeLaTeX works a bit different at the low level, so it supports (almost?) all formats.


 * Same is true for the image format. If you take a picture and it is saved as jpg, there is no point to convert it in any other format. Creating a diagram/scheme with paint or any other software, i would choose png over jpg any time, but i would much more appreciate if the thing i have done would be saved in a vector format, so it is scalable. --Johannes Bo (discuss • contribs) 07:32, 5 February 2017 (UTC)

trim
you forgot "trim=l b r t". it is important.