From 0c02841412f8c0efe871853f192252e58e23680d Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 28 Oct 2012 19:06:48 +0100 Subject: [PATCH] Closes #1010: Make pngmath images transparent by default; IE7+ should handle it. --- CHANGES | 2 ++ doc/ext/math.rst | 17 +++++------------ sphinx/ext/pngmath.py | 3 ++- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index 6152c6558..f82b9d250 100644 --- a/CHANGES +++ b/CHANGES @@ -34,6 +34,8 @@ Release 1.2 (in development) * #1012: Update Estonian translation. +* #1010: Make pngmath images transparent by default; IE7+ should handle it. + Release 1.1.3 (Mar 10, 2012) ============================ diff --git a/doc/ext/math.rst b/doc/ext/math.rst index 3652b55e8..91376d15d 100644 --- a/doc/ext/math.rst +++ b/doc/ext/math.rst @@ -148,19 +148,12 @@ built: .. confval:: pngmath_dvipng_args Additional arguments to give to dvipng, as a list. The default value is - ``['-gamma 1.5', '-D 110']`` which makes the image a bit darker and larger - then it is by default. + ``['-gamma', '1.5', '-D', '110', '-bg', 'Transparent']`` which makes the + image a bit darker and larger then it is by default, and produces PNGs with a + transparent background. - An arguments you might want to add here is e.g. ``'-bg Transparent'``, - which produces PNGs with a transparent background. This is not enabled by - default because some Internet Explorer versions don't like transparent PNGs. - - .. note:: - - When you "add" an argument, you need to reproduce the default arguments if - you want to keep them; that is, like this:: - - pngmath_dvipng_args = ['-gamma 1.5', '-D 110', '-bg Transparent'] + .. versionchanged:: 1.2 + Now includes ``-bg Transparent`` by default. .. confval:: pngmath_use_preview diff --git a/sphinx/ext/pngmath.py b/sphinx/ext/pngmath.py index 78c331a60..549dfb83a 100644 --- a/sphinx/ext/pngmath.py +++ b/sphinx/ext/pngmath.py @@ -237,7 +237,8 @@ def setup(app): app.add_config_value('pngmath_latex', 'latex', 'html') app.add_config_value('pngmath_use_preview', False, 'html') app.add_config_value('pngmath_dvipng_args', - ['-gamma 1.5', '-D 110'], 'html') + ['-gamma', '1.5', '-D', '110', '-bg', 'Transparent'], + 'html') app.add_config_value('pngmath_latex_args', [], 'html') app.add_config_value('pngmath_latex_preamble', '', 'html') app.add_config_value('pngmath_add_tooltips', True, 'html')