|
From: | Jan-Åke Larsson |
Subject: | Re: [Dvipng] dvi origin issue |
Date: | Mon, 06 Oct 2008 19:49:23 +0200 |
User-agent: | Thunderbird 2.0.0.17 (X11/20080925) |
jw skrev:
Hello, In the dvipng manpage, It says: `-O x-offset,y-offset' Move the origin by x-offset,y-offset, a comma-separated pair of dimensions such as `.1in,-.3cm'. The origin of the page is shifted from the default position (of one inch down, one inch to the right from the upper left corner of the paper) by this amount. However, if I use dvipng without specifying -O, as in 'dvipng story.dvi', it does not have a 1in by 1in top,left margin. dvips, on the other hand, does when used the same way. Are the docs wrong, or is this a dvipng bug? I tested it in 1.11 and some earlier versions.
Neither :-) You just need to read more: `-T image_size'Set the image size to image_size which can be either of `bbox', `tight', or a comma-separated pair of dimensions hsize,vsize such as `.1in,.3cm'. The default is `bbox' which produces a PNG that includes all ink put on the page and in addition the DVI origin, located 1in from the top and 1in from the left edge of the paper. This usually gives whitespace above and to the left in the produced image. The value `tight' will make dvipng only include all ink put on the page, producing neat images.
I assume the behaviour you want is to include the top and left whitespace. To do this, you need to specify -T 1in,1in because that will make the topleft corner of the paper end up at the DVI origin, which is included on the paper. The default behaviour of including all ink will take care of the rest.
The reason for the behaviour of dvipng (including the dvi origin rather than the topleft corner of the paper) is that it is intended for producing equation images, in which case, the top and left whitespace is unwanted.
But point taken (mental note: add text about this in the -O docs in the next release).
/JÅ
[Prev in Thread] | Current Thread | [Next in Thread] |