LaTeX filter and true color

59 views
Skip to first unread message

Michel Krämer

unread,
Jul 16, 2011, 5:26:33 AM7/16/11
to asciidoc
Hi!

I recently used the LaTeX filter to embed math formulae into my PDF
output. I'm using the DocBook->FOP chain which works quite well.
However, I was wondering why the LaTeX filter does not use the --
truecolor option of dvipng. FOP 1.0 does not support greyscale images
and apart from that true color images include half transparent pixels
which seem to make the output smoother and more eye pleasing.

What do you think about that? Is there any reason for using --
truecolor?

Thanks,
Michel

Stuart Rackham

unread,
Aug 8, 2011, 2:20:05 AM8/8/11
to asci...@googlegroups.com

No reason I know of, put it down to my ignorance, if you have a patch for
filters/latex/latex2png.py please submit it.

Cheers, Stuart


>
> Thanks,
> Michel
>

Michel Krämer

unread,
Aug 11, 2011, 12:53:20 PM8/11/11
to asciidoc
Stuart,

thanks for your answer. Please find the patch below. It should apply
against the current trunk.

Bye,
Michel


diff -r 4d7c8779a6b4 filters/latex/latex2png.py
--- a/filters/latex/latex2png.py Thu Aug 11 11:57:29 2011 +1200
+++ b/filters/latex/latex2png.py Thu Aug 11 06:54:00 2011 +0200
@@ -142,7 +142,7 @@
cmd = 'dvipng'
if dpi:
cmd += ' -D %s' % dpi
- cmd += ' -T tight -x 1000 -z 9 -bg Transparent -o "%s" "%s"'
\
+ cmd += ' -T tight -x 1000 -z 9 -bg Transparent --truecolor -o
"%s" "%s ' \
% (outfile,dvifile)
run(cmd)
finally:

Stuart Rackham

unread,
Aug 11, 2011, 5:55:49 PM8/11/11
to asci...@googlegroups.com
Thanks Michel, I've applied your patch to the trunk:

http://code.google.com/p/asciidoc/source/detail?r=92913c6ec78bef4e7f73883b7e8947964b4aedf1


Cheers, Stuart

Simon Ruderich

unread,
Aug 12, 2011, 6:49:16 AM8/12/11
to asci...@googlegroups.com
On Fri, Aug 12, 2011 at 09:55:49AM +1200, Stuart Rackham wrote:
> Thanks Michel, I've applied your patch to the trunk:
>
> http://code.google.com/p/asciidoc/source/detail?r=92913c6ec78bef4e7f73883b7e8947964b4aedf1
>
> Cheers, Stuart

Hi,

The patch is missing a quote. The attached patch fixes it.

Regards,
Simon
---
filters/latex/latex2png.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/filters/latex/latex2png.py b/filters/latex/latex2png.py
index 843266c..bbafdd2 100755
--- a/filters/latex/latex2png.py
+++ b/filters/latex/latex2png.py
@@ -142,7 +142,7 @@ def latex2png(infile, outfile, dpi, modified):


cmd = 'dvipng'
if dpi:
cmd += ' -D %s' % dpi

- cmd += ' -T tight -x 1000 -z 9 -bg Transparent --truecolor -o "%s" "%s ' \


+ cmd += ' -T tight -x 1000 -z 9 -bg Transparent --truecolor -o "%s" "%s" ' \
% (outfile,dvifile)
run(cmd)
finally:

--
1.7.6

--
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

Michel Krämer

unread,
Aug 11, 2011, 12:56:35 AM8/11/11
to asci...@googlegroups.com
Stuart,

thanks for your answer. Please find the patch below. It should apply
against the current trunk.

Bye,
Michel


diff -r 4d7c8779a6b4 filters/latex/latex2png.py
--- a/filters/latex/latex2png.py Thu Aug 11 11:57:29 2011 +1200
+++ b/filters/latex/latex2png.py Thu Aug 11 06:54:00 2011 +0200
@@ -142,7 +142,7 @@

cmd = 'dvipng'
if dpi:
cmd += ' -D %s' % dpi

- cmd += ' -T tight -x 1000 -z 9 -bg Transparent -o "%s" "%s"' \


+ cmd += ' -T tight -x 1000 -z 9 -bg Transparent --truecolor -o
"%s" "%s ' \
% (outfile,dvifile)
run(cmd)
finally:

Stuart Rackham

unread,
Aug 12, 2011, 7:40:46 PM8/12/11
to asci...@googlegroups.com
On 12/08/11 22:49, Simon Ruderich wrote:
> On Fri, Aug 12, 2011 at 09:55:49AM +1200, Stuart Rackham wrote:
>> Thanks Michel, I've applied your patch to the trunk:
>>
>> http://code.google.com/p/asciidoc/source/detail?r=92913c6ec78bef4e7f73883b7e8947964b4aedf1
>>
>> Cheers, Stuart
>
> Hi,
>
> The patch is missing a quote. The attached patch fixes it.

Thanks for spotting that Simon, fixed in trunk:

http://code.google.com/p/asciidoc/source/detail?r=9191d6a8a4d9179334579d967433c01ca6384eaa

Cheers, Stuart

Michel Krämer

unread,
Aug 13, 2011, 7:37:23 AM8/13/11
to asciidoc
Weird. Must be a problem with the mailing list...

Bye,
Michel

On 13 Aug., 01:40, Stuart Rackham <srack...@gmail.com> wrote:
> On 12/08/11 22:49, Simon Ruderich wrote:
>
> > On Fri, Aug 12, 2011 at 09:55:49AM +1200, Stuart Rackham wrote:
> >> Thanks Michel, I've applied your patch to the trunk:
>
> >>http://code.google.com/p/asciidoc/source/detail?r=92913c6ec78bef4e7f7...
>
> >> Cheers, Stuart
>
> > Hi,
>
> > The patch is missing a quote. The attached patch fixes it.
>
> Thanks for spotting that Simon, fixed in trunk:
>
> http://code.google.com/p/asciidoc/source/detail?r=9191d6a8a4d91793345...
Reply all
Reply to author
Forward
0 new messages