On Wed, Nov 05, 2025 at 10:48:06PM +0200, Eli Zaretskii wrote:
> > From: Gavin Smith <[email protected]>
> > Date: Wed, 5 Nov 2025 20:08:35 +0000
> > 
> > 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.
> 
> I'm guessing this depends on the image.  You could also experiment
> with the various attributes of the image, described in "Image
> Descriptors" node of the ELisp Reference manual.  For example,
> :ascent, :margin, and :height sound relevant.

The image is inserted into the buffer by Info mode.  I have practically
no knowledge of Emacs Lisp and would assume it is up to whoever works
on Info mode to set the code to set these properties appropriately.  I
don't know how to inspect the attributes of the image anyway: I got
as far as trying to run "M-x eval-expression RET (get-display-property) RET"
before giving up.

I expect it is unlikely that these images could always be perfectly aligned
with surrounding text.  I found on a page online that this information
isn't part of the format:

> Several other chunks were proposed but never approved as official
> extensions, mainly due to the perceived lack of need for them. The
> alignment chunk (aLIG, had it been approved) would have provided
> centering and baseline information about an image so that it could be
> aligned more cleanly with surrounding text; this would have been most
> useful for images with transparent edges. The fingerprint chunk (fING)
> would have provided a 16-byte MD5 fingerprint of the raw image data,
> a type of cryptographic signature that could be used to test whether two
> images were identical. Neither aLIG nor fING was ever put up for a vote,
> and both proposals have long since expired.

PNG: The Definitive Guide (Greg Roelofs) "Chapter 11. PNG Options and 
Extensions"
https://www.libpng.org/pub/png/book/chapter11.html

It's possible that AUCTeX and preview-latex have had or solved this problem
before.

> > 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.
> 
> Maybe try using the :scale attribute with the value 'auto'.

Reply via email to