>On 04/19/2012 12:34 PM, Joel Forsberg wrote:
>> Hello!
>> I've just upgraded both operating system (Fedora 17) and Xwiki to 4.0 RC-1 
>> and got an issue with the formula macro. Whenever I use it, the resulting 
>> image created is 1020x1320 pixels big, mostly empty except for the 
>> (correctly sized) formula placed in the bottom left corner of the .png image.

>Thu Apr 19 17:49:52 UTC 2012 Sergiu Dumitriu wrote:
>It works fine for me, so let's try and see where the problem occurs. 
>Start by putting this into a tex file called a.tex:

>http://pastebin.com/8Tx92S5L

>The renderer uses a three-step process, tex->dvi, dvi->ps, ps->png. 
>Let's try them out in order:

>latex --interaction=nonstopmode a.tex

>This should produce a.dvi, which should be a very big page with only the 
>formula in the center, no other text. Check if there are any errors displayed 
>there. Try without --interaction to make latex stop at errors.

>dvips -E a.dvi -o a.ps

>This should produce a.ps, which should be tightly cropped around the 
>formula. If it isn't then there's a problem, maybe dvips doesn't support 
>the -E parameter.

>convert -density 120 a.ps a.png

>This should produce a.png, having the same size as the ps.

>For reference, here's what I have locally (texlive installation):

>$ latex --version
>pdfTeX 3.1415926-2.3-1.40.12 (TeX Live 2011)
>kpathsea version 6.0.1

>$ dvips --version
>This is dvips(k) 5.991 Copyright 2011 Radical Eye Software



Thanks for the quick reply. 
My texlive seem to produce a PostScript file that displays okay, but somehow 
the convert step sets the canvas size to 1020x1320
Adding a -trim parameter to will work around the problem, such as:
convert -trim -density 120 a.ps a.png

I'll look for a mention of this behavior for Imagemagick shortly (need food)
(Sorry for messing up the thread, I guess..)

-----
For reference:

The files I produced: 
http://www.mediafire.com/file/6qv8tty0pn1nyz0/formula_test2.tar.bz
debug output of convert-step: http://pastebin.com/FdJPEYwr  

convert -version
Version: ImageMagick 6.7.5-6 2012-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP

latex --version
pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6)
kpathsea version 3.5.6
Compiled with libpng 1.5.8; using libpng 1.5.10
Compiled with zlib 1.2.5; using zlib 1.2.5
Compiled with libpoppler

dvips --version
dvips(k) 5.96.1
kpathsea version 3.5.6
-----
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to