Topic: Determining size of graphics file for Latex (1 of 3), Read 16 times, 1 File Attachment
Conf: VEDIT Macro Library
From: Fritz Heberlein
Date: Saturday, November 01, 2003 03:29 PM

I have put together a little macro to determine the bounding box of a graphics file as expected by the LaTeX "graphicx" bundle.


The graphics size info is supplied by the well known freeware viewer Irfanview (www.irfanview.com) and then inserted into the bounding box section of the command \includegraphics[bb]{file_name}.

The file selector code is stolen from compare.vdm (thanks to whoever it has written!).

Fritz

 
GRAPHSIZE.VDM (1KB)

 


Topic: Determining size of graphics file for Latex (2 of 3), Read 13 times
Conf: VEDIT Macro Library
From: Pauli Lindgren
Date: Monday, November 03, 2003 12:24 PM

On 11/1/2003 3:29:53 PM, Fritz Heberlein wrote:
>
>The graphics size info is supplied by the well known
>freeware viewer Irfanview

If I understand correctly, you are reading the image dimensions (in pixels)?

This can be done with Vedit, without using external programs. An example of this can be found in the macro HTML_img.vdm in the HTML tools section of my web site:
http://koti.mbnet.fi/pkl/vedit/html.htm#img

HTML_img.vdm reads dimensions from JPG, GIF and PNG files.

--
Pauli

 


Topic: Determining size of graphics file for Latex (3 of 3), Read 9 times, 1 File Attachment
Conf: VEDIT Macro Library
From: Fritz Heberlein
Date: Sunday, March 07, 2004 11:30 AM

Here is another version, which checks for file extension first. If the graphics file is EPS, it does nothing but insert the appropriate \include... command. Any other graphics file is checked for its bounding box and the value is filled in after the include command. For this i use ebb.exe, which is part of the dvipdfm bundle, which in turn is part of every standard TeX distribution. So, no external program is needed any more.

Fritz

 
GRAPHEBB.VDM (2KB)