On Thu, Jan 02, 2025 at 01:49:44PM +0100, [email protected] wrote:
> On Thu, Jan 02, 2025 at 12:57:43AM +0000, Gavin Smith wrote:
> > If texi2any generates the images with a given DPI (dots per inch) setting
> > to dvips (-d argument) (say 200), then it seems that all Emacs would need
> > is a variable to specify the DPI of the Info images.  The image size
> > would then be scaled according to the size of the font used to display
> > the text in the Info buffer.  Suppose this is a nominal 10pt (10/72.27 in).
> 
> My point is that it is not possible to distinguish images coming from
> regular @image commands, and images coming from @math or @displaymath
> converted to images.  The scale relative to the image should only apply
> to the images coming from @math or @displaymath converted to images, but
> I can't see a way to separate those images from output of @image.
> 
> A general way to change the images size would still be relevant, but it
> is a different issue.

I'm coming back to this issue as it is one of the main features to be finished
before the next release.

I propose that we output an extra keyword in the image tag: instead of

   ^@^H[image src="test_info_math2img3.png" text="a + b"^@^H]

we do

   ^@^H[image src="test_info_math2img3.png" text="a + b" math^@^H]

Some future version of the Emacs Info mode could see this extra keyword
and scale those images differently.  (It could also ignore the image
file and generate an image itself based on the value of the "text"
attribute...)

I've tested this with Emacs 29.3 and it is required for the "math" keyword
to be at the end: the following doesn't work:

   ^@^H[image math src="test_info_math2img3.png" text="a + b"^@^H]

Another thing I noticed was that all the images are generated in
a subdirectory, e.g. test.info has images generated in test_info_images.
The images have to be copied to the same directory as test.info for the
images to be visible.

I've made some other adjustments:
* Reduce DPI setting for dvips to reduce size of image (from 600 to 180)
* Add extra LaTeX code to eliminate indent on displayed math environment

The results look ok with your test file, as you described below.  I've
attached a screen shot.  One problem is the alignment of the math images,
which appears to be inconsistent.  In the highlighted part in orange,
the top of the image is aligned with the top of the surrounding text,
while this is not the case for some of the other images.  Also it would
look worse for people with much different screen resolutions from me as
the images would either be too big or too small.

Date: Tue, 24 Dec 2024 14:36:22 +0100
From: Patrice Dumas <[email protected]>
To: [email protected], Rahguzar <[email protected]>
> One way to generate the example I setup as test, is to go to
> tp/tests, and run there:
> ./run_parser_all.sh -dir info_tex tex_math_info_math_images
> 
> All the resulting files will be in
> info_tex/raw_out_parser/tex_math_info_math_images/
> In particular, the generated tex_math_info_math2img.tex LaTeX file where
> the math is within the preview environment.
> 
> The test Texinfo is in tp/tests/info_tex/tex_math.texi.

This is all the same except tp/tests is now tta/tests.

By the way, does anybody know how to force a reload of an Info file in
Emacs?  (I am testing this by closing Emacs and opening it again every time
the test file changes.)



Reply via email to