[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: math as image in Info INFO_MATH_IMAGES
From: |
Gavin Smith |
Subject: |
Re: math as image in Info INFO_MATH_IMAGES |
Date: |
Tue, 24 Dec 2024 18:24:31 +0000 |
On Tue, Dec 24, 2024 at 02:36:22PM +0100, Patrice Dumas wrote:
> I tried to read a bit AUCTeX code to understand how it is done there but
> couldn't really understand.
>
> In short, I generate a LaTeX file where the math is within the preview
> environment. I run latex on it. Then I run
> dvipng -T tight -D 600 dvi_file
Methinks a smaller argument to -D will produce a smaller image - it's
documented as the "dots per inch". The units for the dvi are in length
and for the png are in pixels and this converts between the two.
This change produces formulae which are about the right size for me,
except for @displaymath which is still partially off the edge of the
screen:
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -4732,7 +4732,7 @@ sub convert_math_to_images($$$;$)
$math2img_dvi_basefile))
unless (-f $encoded_math2img_dvi_basefile);
- my @to_images_options = ('-T', 'tight', '-D', '600');
+ my @to_images_options = ('-T', 'tight', '-D', '200');
my @to_images_args = (@to_images_options, $encoded_math2img_dvi_basefile);
my $to_image_exec = 'dvipng';
The problem with using a value that is too small is that detail will
be lost for someone reading the Info file on a high-resolution display.
So we should provide a size that is slightly too large, but looks ok
without scaling, and leave it up to the Emacs developers to implement
enlarging or reducing images in Info to match the text.
For @displaymath, could we avoid centring the output in the image
to make it less likely it is pushed off the right side of the screen?